diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/AbstractClass1.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/AbstractClass1.java new file mode 100644 index 00000000000..f76b828fe7c --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/AbstractClass1.java @@ -0,0 +1,5 @@ +package org.jboss.weld.tests.resolution.weld1075; + + +public abstract class AbstractClass1 implements Interface2 { +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/AbstractClass2.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/AbstractClass2.java new file mode 100644 index 00000000000..263501b58d2 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/AbstractClass2.java @@ -0,0 +1,5 @@ +package org.jboss.weld.tests.resolution.weld1075; + + +public abstract class AbstractClass2 extends AbstractClass1 { +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass1.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass1.java new file mode 100644 index 00000000000..783fa160490 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass1.java @@ -0,0 +1,8 @@ +package org.jboss.weld.tests.resolution.weld1075; + + +import java.util.UUID; + + +public class ConcreteClass1 extends AbstractClass2 { +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass2.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass2.java new file mode 100644 index 00000000000..4c6ac725cdb --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass2.java @@ -0,0 +1,5 @@ +package org.jboss.weld.tests.resolution.weld1075; + + +public class ConcreteClass2 extends AbstractClass2 { +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass3.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass3.java new file mode 100644 index 00000000000..0711d752713 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ConcreteClass3.java @@ -0,0 +1,8 @@ +package org.jboss.weld.tests.resolution.weld1075; + + +import java.util.UUID; + + +public class ConcreteClass3 implements Interface1 { +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Holder.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Holder.java new file mode 100644 index 00000000000..e8032cf6cc8 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Holder.java @@ -0,0 +1,29 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2012, Red Hat, Inc., and individual contributors + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * Licensed 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.jboss.weld.tests.resolution.weld1075; + +import javax.inject.Inject; +import java.util.UUID; + +/** + * @author Ales Justin + */ +public class Holder { + @Inject + Interface1 dependency; +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Interface1.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Interface1.java new file mode 100644 index 00000000000..1dcce432e87 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Interface1.java @@ -0,0 +1,5 @@ +package org.jboss.weld.tests.resolution.weld1075; + + +public interface Interface1 { +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Interface2.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Interface2.java new file mode 100644 index 00000000000..741a83a71ef --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/Interface2.java @@ -0,0 +1,5 @@ +package org.jboss.weld.tests.resolution.weld1075; + + +public interface Interface2 extends Interface1 { +} diff --git a/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ResolutionTest.java b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ResolutionTest.java new file mode 100644 index 00000000000..071218558b3 --- /dev/null +++ b/tests-arquillian/src/test/java/org/jboss/weld/tests/resolution/weld1075/ResolutionTest.java @@ -0,0 +1,47 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2012, Red Hat, Inc., and individual contributors + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * Licensed 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.jboss.weld.tests.resolution.weld1075; + + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.BeanArchive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.assertNotNull; + +/** + * @author Sebastian Graca + * @author Ales Justin + */ +@RunWith(Arquillian.class) +public class ResolutionTest { + @Deployment + public static Archive createDeployment() { + return ShrinkWrap.create(BeanArchive.class).addPackage(ResolutionTest.class.getPackage()); + } + + @Test + public void shouldResolveDependency(Holder holder) { + assertNotNull(holder); + assertNotNull(holder.dependency); + } +}