For what is worth: this is tested in TCK already (RestrictedManagedBeanTest I think) in an user facing way - i e CDI exception, not our internal OWB one which does not have to be stable. Don't know if we need to duplicate it - guess this one is fine cause fast but thought I should mention it.
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://rmannibucau.metawerx.net/> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <https://www.packtpub.com/application-development/java-ee-8-high-performance> ---------- Forwarded message --------- De : <[email protected]> Date: jeu. 4 juin 2020 à 22:57 Subject: [openwebbeans] branch master updated: adding a test for testing the Typed annotation with wrong value To: [email protected] <[email protected]> This is an automated email from the ASF dual-hosted git repository. gerdogdu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openwebbeans.git The following commit(s) were added to refs/heads/master by this push: new 6de6f20 adding a test for testing the Typed annotation with wrong value 6de6f20 is described below commit 6de6f200f0817fc8028017800e5fdcf490496a9a Author: Gurkan Erdogdu <[email protected]> AuthorDate: Thu Jun 4 23:57:26 2020 +0300 adding a test for testing the Typed annotation with wrong value --- .../webbeans/test/injection/typed/NotInTyped.java | 26 +++++++++++++++++ .../test/injection/typed/NotInTypedTest.java | 34 ++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/typed/NotInTyped.java b/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/typed/NotInTyped.java new file mode 100644 index 0000000..d5d265e --- /dev/null +++ b/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/typed/NotInTyped.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.webbeans.test.injection.typed; + +import javax.enterprise.inject.Typed; + +@Typed(Raven.class) +public class NotInTyped implements Bird{ + +} diff --git a/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/typed/NotInTypedTest.java b/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/typed/NotInTypedTest.java new file mode 100644 index 0000000..97cbdb3 --- /dev/null +++ b/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/typed/NotInTypedTest.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.webbeans.test.injection.typed; + +import org.apache.webbeans.exception.WebBeansConfigurationException; +import org.apache.webbeans.test.AbstractUnitTest; +import org.junit.Test; + +public class NotInTypedTest extends AbstractUnitTest +{ + + @Test(expected = WebBeansConfigurationException.class) + public void testNotInTypedMustThrowException() + { + startContainer(Bird.class, Raven.class, NotInTyped.class); + } + +}
