Author: scabanovich
Date: 2012-08-13 17:27:11 -0400 (Mon, 13 Aug 2012)
New Revision: 43005
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/.settings/org.eclipse.jdt.core.prefs
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/DefaultBeanTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/MessageLoggerTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/UnwrapsTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/VetoTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/BeanNamingTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/DefaultBeanTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/ExactTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/GenericBeanTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/MessageLoggerTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/ServiceHandlerTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/UnwrapsTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/VetoTest.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in local variables in tests wherever it is possible.
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/.settings/org.eclipse.jdt.core.prefs 2012-08-13
21:27:11 UTC (rev 43005)
@@ -0,0 +1,8 @@
+#Fri Nov 04 10:56:09 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/BeanNamingTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
@@ -37,7 +37,7 @@
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
//1. package @Named; class not annotated
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/named/Dog.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/named/Dog.java"));
assertFalse(bs.isEmpty());
IBean b = findBeanByMemberName(bs, "Dog");
assertNotNull(b);
@@ -54,7 +54,7 @@
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
//1. package @FullyQualified and @Named; class not annotated
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/fullyqualified/Cat.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/fullyqualified/Cat.java"));
assertFalse(bs.isEmpty());
IBean b = bs.iterator().next();
assertEquals("org.jboss.fullyqualified.cat", b.getName());
@@ -76,7 +76,7 @@
public void testFullyQualifiedProducers() {
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
//1. package @FullyQualified
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/fullyqualified/Elephant.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/fullyqualified/Elephant.java"));
//1.1 producer method @Named
IBean b = findBeanByMemberName(bs, "getTail");
@@ -122,7 +122,7 @@
assertEquals("org.jboss.fullyqualified.black-eye", b.getName());
}
- private IBean findBeanByMemberName(Set<IBean> bs, String memberName) {
+ private IBean findBeanByMemberName(Collection<IBean> bs, String memberName) {
for (IBean b: bs) {
if(b instanceof IClassBean) {
if(memberName.equals(((IClassBean)b).getBeanClass().getElementName())) {
@@ -144,7 +144,7 @@
// Package @FullyQualified and @Named
// 1. Class @Named("bird-of-prey")
- Set<IBean> bs = cdi.getBeans("org.jboss.birds.bird-of-prey", false);
+ Collection<IBean> bs = cdi.getBeans("org.jboss.birds.bird-of-prey",
false);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/DefaultBeanTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core.test;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@@ -49,7 +50,7 @@
public void testLegalTypesOfDefaultProducerBeanWithoutDefaultBeanAnnotation() throws
CoreException {
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
IInjectionPointField injection = getInjectionPointField(cdi,
"src/org/jboss/defaultbean/producer/Test1.java", "a");
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerField);
@@ -91,7 +92,7 @@
// default class bean with qualifier @Small
IInjectionPointField injection = getInjectionPointField(cdi, javaPath,
"small");
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ExactTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
@@ -35,7 +35,7 @@
public void testExact() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/exact/FishFactory.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/exact/FishFactory.java"));
assertEquals(2, bs.size());
IClassBean cls = null;
IProducerMethod mtd = null;
@@ -48,10 +48,10 @@
}
assertNotNull(cls);
assertNotNull(mtd);
- Set<IInjectionPoint> points = cls.getInjectionPoints();
+ Collection<IInjectionPoint> points = cls.getInjectionPoints();
int count = 0;
for (IInjectionPoint p: points) {
- Set<IBean> injected = cdi.getBeans(false, p);
+ Collection<IBean> injected = cdi.getBeans(false, p);
IMember member = p.getSourceMember();
if(member.getElementName().equals("peacefulFish")) {
assertEquals(1, injected.size());
@@ -77,7 +77,7 @@
public void testExactInDependentProject() throws CoreException, IOException {
ICDIProject cdi = getDependentCDIProject();
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/exact/FishFactory.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest/src/org/jboss/exact/FishFactory.java"));
assertEquals(2, bs.size());
}
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -10,9 +10,9 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core.test;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -50,7 +50,7 @@
*/
IInjectionPointField injection = getInjectionPointField(cdi,
"src/org/jboss/generic/MyBeanInjections.java", "first1");
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerMethod);
@@ -121,10 +121,10 @@
* each has that injection point;
* in all cases bean is produced by MyGenericBean.createMyFirstBean()
*/
- Set<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic/MyGenericBean2.java", "c");
+ Collection<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic/MyGenericBean2.java", "c");
assertEquals(5, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerMethod);
@@ -143,10 +143,10 @@
* each has that injection point;
* in all cases we insert a dummy bean of type org.jboss.generic.MyGenericType
*/
- Set<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic/MyGenericBean2.java", "type");
+ Collection<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic/MyGenericBean2.java", "type");
assertEquals(5, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
@@ -156,10 +156,10 @@
}
//TODO - more tests
- protected Set<IInjectionPointField> getGenericInjectionPointField(ICDIProject cdi,
String beanClassFilePath, String fieldName) {
- Set<IInjectionPointField> result = new HashSet<IInjectionPointField>();
+ protected Collection<IInjectionPointField>
getGenericInjectionPointField(ICDIProject cdi, String beanClassFilePath, String fieldName)
{
+ Collection<IInjectionPointField> result = new
HashSet<IInjectionPointField>();
IFile file = cdi.getNature().getProject().getFile(beanClassFilePath);
- Set<IBean> beans = cdi.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdi.getBeans(file.getFullPath());
Iterator<IBean> it = beans.iterator();
while(it.hasNext()) {
IBean b = it.next();
@@ -167,7 +167,7 @@
}
for (IBean b: beans) {
- Set<IInjectionPoint> injections = b.getInjectionPoints();
+ Collection<IInjectionPoint> injections = b.getInjectionPoints();
for (IInjectionPoint injectionPoint : injections) {
if(injectionPoint instanceof IInjectionPointField) {
IInjectionPointField field = (IInjectionPointField)injectionPoint;
@@ -191,10 +191,10 @@
* in all cases bean is produced by MyGenericBean.createMyFirstBean()
*/
IClassBean beanToBeVetoed = null;
- Set<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic2/MessageManager.java", "queue");
+ Collection<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic2/MessageManager.java", "queue");
assertEquals(3, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertTrue(bs.size() >= 1);
for (IBean b: bs) {
assertTrue(b instanceof GenericBeanProducerMethod);
@@ -219,7 +219,7 @@
injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic2/MessageManager.java", "queue");
assertEquals(2, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof GenericBeanProducerMethod);
@@ -243,7 +243,7 @@
injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic2/MessageManager.java", "queue");
assertEquals(3, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertTrue(bs.size() >= 1);
for (IBean b: bs) {
assertTrue(b instanceof GenericBeanProducerMethod);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/MessageLoggerTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/MessageLoggerTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/MessageLoggerTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
@@ -34,7 +34,7 @@
IInjectionPointField logger = getInjectionPointField(cdi,
"src/org/jboss/logger/LogAccess.java", "logger");
- Set<IBean> bs = cdi.getBeans(false, logger);
+ Collection<IBean> bs = cdi.getBeans(false, logger);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
@@ -50,7 +50,7 @@
IInjectionPointField bundle = getInjectionPointField(cdi,
"src/org/jboss/logger/LogAccess.java", "bundle");
- Set<IBean> bs = cdi.getBeans(false, bundle);
+ Collection<IBean> bs = cdi.getBeans(false, bundle);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/ServiceHandlerTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
@@ -34,7 +34,7 @@
IInjectionPointField logger = getInjectionPointField(cdi,
"src/org/jboss/service/UserListManager.java", "userQuery");
- Set<IBean> bs = cdi.getBeans(false, logger);
+ Collection<IBean> bs = cdi.getBeans(false, logger);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/UnwrapsTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/UnwrapsTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/UnwrapsTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDICorePlugin;
@@ -35,7 +35,7 @@
IInjectionPointField logger = getInjectionPointField(cdi,
"src/org/jboss/unwraps/Unwrapped.java", "permission");
- Set<IBean> bs = cdi.getBeans(false, logger);
+ Collection<IBean> bs = cdi.getBeans(false, logger);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/VetoTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/VetoTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/VetoTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDIConstants;
@@ -40,7 +40,7 @@
assertNotNull(a);
Object name = a.getMemberValue(null);
assertEquals("tiger", name); //...and it is annotated with
@Named("tiger")
- Set<IBean> bs = cdi.getBeans("tiger", false);
+ Collection<IBean> bs = cdi.getBeans("tiger", false);
assertTrue(bs.isEmpty()); //...CDI model does not have a bean named
"tiger"
bs = cdi.getBeans(d.getResource().getFullPath());
assertTrue(bs.isEmpty()); //...and does not loaded any beans form its resource
@@ -68,7 +68,7 @@
assertNotNull(a);
Object name = a.getMemberValue(null);
assertEquals("bear", name); //...and it is annotated with
@Named("bear")
- Set<IBean> bs = cdi.getBeans("bear", false);
+ Collection<IBean> bs = cdi.getBeans("bear", false);
assertTrue(bs.isEmpty()); //...CDI model does not have a bean named
"bear"
bs = cdi.getBeans(d.getResource().getFullPath());
assertTrue(bs.isEmpty()); //...and does not loaded any beans form its resource
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/BeanNamingTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/BeanNamingTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/BeanNamingTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test.v30;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
@@ -37,7 +37,7 @@
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
//1. package @Named; class not annotated
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/named/Dog.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/named/Dog.java"));
assertFalse(bs.isEmpty());
IBean b = findBeanByMemberName(bs, "Dog");
assertNotNull(b);
@@ -54,7 +54,7 @@
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
//1. package @FullyQualified and @Named; class not annotated
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/fullyqualified/Cat.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/fullyqualified/Cat.java"));
assertFalse(bs.isEmpty());
IBean b = bs.iterator().next();
assertEquals("org.jboss.fullyqualified.cat", b.getName());
@@ -76,7 +76,7 @@
public void testFullyQualifiedProducers() {
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
//1. package @FullyQualified
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/fullyqualified/Elephant.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/fullyqualified/Elephant.java"));
//1.1 producer method @Named
IBean b = findBeanByMemberName(bs, "getTail");
@@ -122,7 +122,7 @@
assertEquals("org.jboss.fullyqualified.black-eye", b.getName());
}
- private IBean findBeanByMemberName(Set<IBean> bs, String memberName) {
+ private IBean findBeanByMemberName(Collection<IBean> bs, String memberName) {
for (IBean b: bs) {
if(b instanceof IClassBean) {
if(memberName.equals(((IClassBean)b).getBeanClass().getElementName())) {
@@ -143,7 +143,7 @@
// Package @FullyQualified and @Named
// 1. Class @Named("bird-of-prey")
- Set<IBean> bs = cdi.getBeans("org.jboss.birds.bird-of-prey", false);
+ Collection<IBean> bs = cdi.getBeans("org.jboss.birds.bird-of-prey",
false);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/DefaultBeanTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/DefaultBeanTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/DefaultBeanTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core.test.v30;
+import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
@@ -58,7 +59,7 @@
// default class bean with qualifier @Small
IInjectionPointField injection = getInjectionPointField(cdi, javaPath,
"small");
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/ExactTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/ExactTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/ExactTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test.v30;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
@@ -35,7 +35,7 @@
public void testExact() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(getTestProject(), true);
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/exact/FishFactory.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/exact/FishFactory.java"));
assertEquals(2, bs.size());
IClassBean cls = null;
IProducerMethod mtd = null;
@@ -48,10 +48,10 @@
}
assertNotNull(cls);
assertNotNull(mtd);
- Set<IInjectionPoint> points = cls.getInjectionPoints();
+ Collection<IInjectionPoint> points = cls.getInjectionPoints();
int count = 0;
for (IInjectionPoint p: points) {
- Set<IBean> injected = cdi.getBeans(false, p);
+ Collection<IBean> injected = cdi.getBeans(false, p);
IMember member = p.getSourceMember();
if(member.getElementName().equals("peacefulFish")) {
assertEquals(1, injected.size());
@@ -77,7 +77,7 @@
public void testExactInDependentProject() throws CoreException, IOException {
ICDIProject cdi = getDependentCDIProject();
- Set<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/exact/FishFactory.java"));
+ Collection<IBean> bs = cdi.getBeans(new
Path("/CDISolderTest30/src/org/jboss/exact/FishFactory.java"));
assertEquals(2, bs.size());
}
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/GenericBeanTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/GenericBeanTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/GenericBeanTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -10,9 +10,9 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.solder.core.test.v30;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -50,7 +50,7 @@
*/
IInjectionPointField injection = getInjectionPointField(cdi,
"src/org/jboss/generic/MyBeanInjections.java", "first1");
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerMethod);
@@ -121,10 +121,10 @@
* each has that injection point;
* in all cases bean is produced by MyGenericBean.createMyFirstBean()
*/
- Set<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic/MyGenericBean2.java", "c");
+ Collection<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic/MyGenericBean2.java", "c");
assertEquals(5, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerMethod);
@@ -143,10 +143,10 @@
* each has that injection point;
* in all cases we insert a dummy bean of type org.jboss.generic.MyGenericType
*/
- Set<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic/MyGenericBean2.java", "type");
+ Collection<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic/MyGenericBean2.java", "type");
assertEquals(5, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
@@ -156,10 +156,10 @@
}
//TODO - more tests
- protected Set<IInjectionPointField> getGenericInjectionPointField(ICDIProject cdi,
String beanClassFilePath, String fieldName) {
- Set<IInjectionPointField> result = new HashSet<IInjectionPointField>();
+ protected Collection<IInjectionPointField>
getGenericInjectionPointField(ICDIProject cdi, String beanClassFilePath, String fieldName)
{
+ Collection<IInjectionPointField> result = new
HashSet<IInjectionPointField>();
IFile file = cdi.getNature().getProject().getFile(beanClassFilePath);
- Set<IBean> beans = cdi.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdi.getBeans(file.getFullPath());
Iterator<IBean> it = beans.iterator();
while(it.hasNext()) {
IBean b = it.next();
@@ -167,7 +167,7 @@
}
for (IBean b: beans) {
- Set<IInjectionPoint> injections = b.getInjectionPoints();
+ Collection<IInjectionPoint> injections = b.getInjectionPoints();
for (IInjectionPoint injectionPoint : injections) {
if(injectionPoint instanceof IInjectionPointField) {
IInjectionPointField field = (IInjectionPointField)injectionPoint;
@@ -191,10 +191,10 @@
* in all cases bean is produced by MyGenericBean.createMyFirstBean()
*/
IClassBean beanToBeVetoed = null;
- Set<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic2/MessageManager.java", "queue");
+ Collection<IInjectionPointField> injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic2/MessageManager.java", "queue");
assertEquals(3, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertTrue(bs.size() >= 1);
for (IBean b: bs) {
assertTrue(b instanceof GenericBeanProducerMethod);
@@ -219,7 +219,7 @@
injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic2/MessageManager.java", "queue");
assertEquals(2, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof GenericBeanProducerMethod);
@@ -243,7 +243,7 @@
injections = getGenericInjectionPointField(cdi,
"src/org/jboss/generic2/MessageManager.java", "queue");
assertEquals(3, injections.size());
for (IInjectionPointField injection: injections) {
- Set<IBean> bs = cdi.getBeans(false, injection);
+ Collection<IBean> bs = cdi.getBeans(false, injection);
assertTrue(bs.size() >= 1);
for (IBean b: bs) {
assertTrue(b instanceof GenericBeanProducerMethod);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/MessageLoggerTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/MessageLoggerTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/MessageLoggerTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test.v30;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
@@ -34,7 +34,7 @@
IInjectionPointField logger = getInjectionPointField(cdi,
"src/org/jboss/logger/LogAccess.java", "logger");
- Set<IBean> bs = cdi.getBeans(false, logger);
+ Collection<IBean> bs = cdi.getBeans(false, logger);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
@@ -50,7 +50,7 @@
IInjectionPointField bundle = getInjectionPointField(cdi,
"src/org/jboss/logger/LogAccess.java", "bundle");
- Set<IBean> bs = cdi.getBeans(false, bundle);
+ Collection<IBean> bs = cdi.getBeans(false, bundle);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/ServiceHandlerTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/ServiceHandlerTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/ServiceHandlerTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test.v30;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
@@ -34,7 +34,7 @@
IInjectionPointField logger = getInjectionPointField(cdi,
"src/org/jboss/service/UserListManager.java", "userQuery");
- Set<IBean> bs = cdi.getBeans(false, logger);
+ Collection<IBean> bs = cdi.getBeans(false, logger);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/UnwrapsTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/UnwrapsTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/UnwrapsTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test.v30;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDICorePlugin;
@@ -19,7 +19,6 @@
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IInjectionPointField;
import org.jboss.tools.cdi.core.IProducerMethod;
-import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants;
import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants30;
/**
@@ -36,7 +35,7 @@
IInjectionPointField logger = getInjectionPointField(cdi,
"src/org/jboss/unwraps/Unwrapped.java", "permission");
- Set<IBean> bs = cdi.getBeans(false, logger);
+ Collection<IBean> bs = cdi.getBeans(false, logger);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/VetoTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/VetoTest.java 2012-08-13
19:09:17 UTC (rev 43004)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/v30/VetoTest.java 2012-08-13
21:27:11 UTC (rev 43005)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.seam.solder.core.test.v30;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDIConstants;
@@ -40,7 +40,7 @@
assertNotNull(a);
Object name = a.getMemberValue(null);
assertEquals("tiger", name); //...and it is annotated with
@Named("tiger")
- Set<IBean> bs = cdi.getBeans("tiger", false);
+ Collection<IBean> bs = cdi.getBeans("tiger", false);
assertTrue(bs.isEmpty()); //...CDI model does not have a bean named
"tiger"
bs = cdi.getBeans(d.getResource().getFullPath());
assertTrue(bs.isEmpty()); //...and does not loaded any beans form its resource
@@ -68,7 +68,7 @@
assertNotNull(a);
Object name = a.getMemberValue(null);
assertEquals("bear", name); //...and it is annotated with
@Named("bear")
- Set<IBean> bs = cdi.getBeans("bear", false);
+ Collection<IBean> bs = cdi.getBeans("bear", false);
assertTrue(bs.isEmpty()); //...CDI model does not have a bean named
"bear"
bs = cdi.getBeans(d.getResource().getFullPath());
assertTrue(bs.isEmpty()); //...and does not loaded any beans form its resource