Author: scabanovich
Date: 2011-04-08 15:02:43 -0400 (Fri, 08 Apr 2011)
New Revision: 30441
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/lib/cdi-solder-birds.jar
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java
Log:
JBIDE-8199
https://issues.jboss.org/browse/JBIDE-8199
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/.classpath
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/.classpath 2011-04-08
17:17:45 UTC (rev 30440)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/.classpath 2011-04-08
19:02:43 UTC (rev 30441)
@@ -5,5 +5,6 @@
<classpathentry kind="lib" path="lib/cdi-api.jar"/>
<classpathentry kind="lib" path="lib/javax.inject.jar"/>
<classpathentry kind="lib" path="lib/seam-solder.jar"/>
+ <classpathentry kind="lib" path="lib/cdi-solder-birds.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/lib/cdi-solder-birds.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/projects/CDISolderTest/lib/cdi-solder-birds.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java 2011-04-08
17:17:45 UTC (rev 30440)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java 2011-04-08
19:02:43 UTC (rev 30441)
@@ -10,11 +10,14 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IBeanMember;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IProducerMethod;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
@@ -140,6 +143,40 @@
return null;
}
+ public void testAnnotatedPackagesInJars() {
+ ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
+
+ // Package @FullyQualified and @Named
+
+ // 1. Class @Named("bird-of-prey")
+ Set<IBean> bs = cdi.getBeans("org.jboss.birds.bird-of-prey", false);
+ assertEquals(1, bs.size());
+ IBean b = bs.iterator().next();
+ assertTrue(b instanceof IClassBean);
+ IClassBean cb = (IClassBean)b;
+ IType t = cb.getBeanClass();
+ assertEquals("org.jboss.birds.Eagle", t.getFullyQualifiedName());
+
+ // 2. Class not annotated
+ bs = cdi.getBeans("org.jboss.birds.nightingale", false);
+ assertEquals(1, bs.size());
+ b = bs.iterator().next();
+ assertTrue(b instanceof IClassBean);
+ cb = (IClassBean)b;
+ t = cb.getBeanClass();
+ assertEquals("org.jboss.birds.Nightingale", t.getFullyQualifiedName());
+
+ // 3. Producer method @Named
+ bs = cdi.getBeans("org.jboss.birds.song", false);
+ assertEquals(1, bs.size());
+ b = bs.iterator().next();
+ assertTrue(b instanceof IProducerMethod);
+ IProducerMethod mb = (IProducerMethod)b;
+ IMember m = mb.getSourceMember();
+ assertEquals("getSong", m.getElementName());
+
+ }
+
public void tearDown() throws Exception {
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
JobUtils.waitForIdle();