JBoss Tools SVN: r43019 - trunk/esb/tests/org.jboss.tools.esb.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ldimaggio
Date: 2012-08-13 22:15:58 -0400 (Mon, 13 Aug 2012)
New Revision: 43019
Modified:
trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/pom.xml
Log:
Updated ESB tests' pom.xml
Modified: trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/pom.xml
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/pom.xml 2012-08-14 01:18:16 UTC (rev 43018)
+++ trunk/esb/tests/org.jboss.tools.esb.ui.bot.test/pom.xml 2012-08-14 02:15:58 UTC (rev 43019)
@@ -13,10 +13,10 @@
<packaging>eclipse-test-plugin</packaging>
<properties>
<jbosstools.test.jbossesb.home>${requirementsDirectory}/jbossesb-4.11</jbosstools.test.jbossesb.home>
- <jbosstools.test.jbosssoa.home>${requirementsDirectory}/jboss-soa-p-5.3/jboss-soa-p-5/jboss-as</jbosstools.test.jbosssoa.home>
+ <jbosstools.test.jbosssoa.home>${requirementsDirectory}/jboss-soa-p-5/jboss-as</jbosstools.test.jbosssoa.home>
<swtbot.test.properties.file>./org.jboss.tools.esb.ui.bot.test.properties</swtbot.test.properties.file>
- <systemProperties>-Djbosstools.test.jbossesb.home=${jbosstools.test.jbossesb.home} -Djbosstools.test.jbosssoa.home=${jbosstools.test.jbosssoa.home} -Dswtbot.test.properties.file=${swtbot.test.properties.file}</systemProperties>
- <surefire.timeout>7200</surefire.timeout>
+ <systemProperties>-Djbosstools.test.jbossesb.home=${jbosstools.test.jbossesb.home} -Djbosstools.test.jbosssoa.home=${jbosstools.test.jbosssoa.home} -Dswtbot.test.properties.file=${swtbot.test.properties.file}
+ </systemProperties>
</properties>
<build>
@@ -32,8 +32,8 @@
<goal>wget</goal>
</goals>
<configuration>
- <url>http://jawa05.englab.brq.redhat.com/candidate/soa-5.3.0.ER2/soa-p-5.3.0.E...</url>
- <md5>1f70c15b26a0d812ba2a39a96c6a8c57</md5>
+ <url>http://jawa05.englab.brq.redhat.com/candidate/soa-5.3.0.ER5/soa-p-5.3.0.E...</url>
+ <md5>1c2e329498396762b8dad2c1621308bf</md5>
<unpack>true</unpack>
</configuration>
</execution>
@@ -59,6 +59,7 @@
<skip>${swtbot.test.skip}</skip>
<testSuite>org.jboss.tools.esb.ui.bot.test</testSuite>
<testClass>org.jboss.tools.esb.ui.bot.tests.ESBAllBotTests</testClass>
+ <forkedProcessTimeoutInSeconds>7200</forkedProcessTimeoutInSeconds>
</configuration>
</plugin>
</plugins>
13 years, 8 months
JBoss Tools SVN: r43018 - trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-13 21:18:16 -0400 (Mon, 13 Aug 2012)
New Revision: 43018
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java 2012-08-14 01:06:06 UTC (rev 43017)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java 2012-08-14 01:18:16 UTC (rev 43018)
@@ -102,6 +102,10 @@
// Does nothing
}
+ public void removeAllMessages() {
+ messages.clear();
+ }
+
public void setCanceled(boolean set) {
this.fIsCanceled = set;
}
@@ -440,11 +444,11 @@
new IRegion[] {
new Region(fStartRegionToProcess, fEndRegionToProcess - fStartRegionToProcess)
}),
- fHelper, fReporter);
+ fHelper, fReporter);
}
+ fReporter.removeAllMessages();
}
-
-
+
private boolean isJavaElementValidationRequired() {
ICompilationUnit unit = fReporter.getCompilationUnit();
if (unit == null)
13 years, 8 months
JBoss Tools SVN: r43017 - in trunk: common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-13 21:06:06 -0400 (Mon, 13 Aug 2012)
New Revision: 43017
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-08-13 23:45:06 UTC (rev 43016)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-08-14 01:06:06 UTC (rev 43017)
@@ -498,6 +498,7 @@
setAsYouTypeValidation(true);
this.document = validationContext.getDocument();
rootCdiProject = new CDIProjectAsYouType(rootCdiProject, file);
+ validateResource(file);
disableProblemAnnotations(new ITextSourceReference() {
@Override
public int getStartPosition() {
@@ -513,8 +514,7 @@
public int getLength() {
return document.getLength();
}
- });
- validateResource(file);
+ }, reporter);
}
/**
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java 2012-08-13 23:45:06 UTC (rev 43016)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java 2012-08-14 01:06:06 UTC (rev 43017)
@@ -14,6 +14,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -53,6 +54,8 @@
protected boolean asYouTypeValidation;
protected int messageCounter;
+ private static final IMessage[] EMPTY_MESSAGE_ARRAY = new IMessage[0];
+
protected abstract String getMessageBundleName();
/*
@@ -218,7 +221,42 @@
return message;
}
- protected void disableProblemAnnotations(final ITextSourceReference reference) {
+ private static class SimpleReference implements ITextSourceReference {
+ int start;
+ int length;
+ IResource resource;
+
+ public SimpleReference(int start, int length, IResource resource) {
+ this.start = start;
+ this.length = length;
+ this.resource = resource;
+ }
+
+ @Override
+ public int getStartPosition() {
+ return start;
+ }
+
+ @Override
+ public int getLength() {
+ return length;
+ }
+
+ @Override
+ public IResource getResource() {
+ return resource;
+ }
+ };
+
+ protected void disableProblemAnnotations(ITextSourceReference region, IReporter reporter) {
+ List messages = reporter.getMessages();
+ IMessage[] msgs = EMPTY_MESSAGE_ARRAY;
+ if(messages!=null) {
+ msgs = (IMessage[])messages.toArray(new IMessage[messages.size()]);
+ }
+ final ITextSourceReference reference = new SimpleReference(region.getStartPosition(), region.getLength(), region.getResource());
+
+ final IMessage[] messageArray = msgs;
UIJob job = new UIJob("As-you-type JBT validation. Disabling the marker annotations.") {
public IStatus runInUIThread(IProgressMonitor monitor) {
if(EclipseUIUtil.isActiveEditorDirty()) {
@@ -241,11 +279,23 @@
try {
String type = marker.getType();
if(getMarkerType().equals(type)) {
- Annotation newAnnotation = new DisabledAnnotation(annotation.getType(), false, annotation.getText(), marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING) == IMarker.SEVERITY_WARNING);
int offset = marker.getAttribute(IMarker.CHAR_START, 0);
- int length = 0; // marker.getAttribute(IMarker.CHAR_END, 0) - offset;
- Position p = new Position(offset, length);
- newAnnotations.put(newAnnotation, p);
+ int originalMarkerEnd = marker.getAttribute(IMarker.CHAR_END, -1);
+ String markerMessage = marker.getAttribute(IMarker.MESSAGE, "");
+ boolean removedProblem = true;
+ for (Object object : messageArray) {
+ IMessage message = (IMessage)object;
+ if(message.getOffset() == offset && message.getLength() == originalMarkerEnd - offset && markerMessage.equals(message.getText())) {
+ removedProblem = false;
+ break;
+ }
+ }
+ if(removedProblem) {
+ Annotation newAnnotation = new DisabledAnnotation(annotation.getType(), false, annotation.getText(), marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING) == IMarker.SEVERITY_WARNING);
+ int length = 0; // marker.getAttribute(IMarker.CHAR_END, 0) - offset;
+ Position p = new Position(offset, length);
+ newAnnotations.put(newAnnotation, p);
+ }
annotationsToRemove.add(annotation);
} else if("org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor".equals(e.getClass().getName()) && "org.eclipse.jst.jsf.facelet.ui.FaceletValidationMarker".equals(type)) {
// Remove WTP's annotations for JBT JSP/XHTML editors.
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java 2012-08-13 23:45:06 UTC (rev 43016)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/java/JavaDirtyRegionProcessor.java 2012-08-14 01:06:06 UTC (rev 43017)
@@ -42,7 +42,6 @@
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
-import org.jboss.tools.common.validation.java.xpl.DirtyRegionProcessor;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
@@ -53,6 +52,7 @@
import org.jboss.tools.common.validation.CommonValidationPlugin;
import org.jboss.tools.common.validation.TempMarkerManager;
import org.jboss.tools.common.validation.ValidationMessage;
+import org.jboss.tools.common.validation.java.xpl.DirtyRegionProcessor;
/**
* As-You-Type validation Java files
@@ -67,7 +67,7 @@
private ITextEditor fEditor;
private IDocument fDocument;
private IValidationContext fHelper;
- private JavaELProblemReporter fReporter;
+ private JavaProblemReporter fReporter;
private AsYouTypeValidatorManager fValidatorManager;
private boolean fDocumentJustSetup = false;
@@ -80,7 +80,8 @@
private int fStartRegionToProcess = -1;
private int fEndRegionToProcess = -1;
- public final class JavaELProblemReporter implements IReporter {
+ public final class JavaProblemReporter implements IReporter {
+ private List<IMessage> messages = new ArrayList<IMessage>();
private IFile fFile;
private ICompilationUnit fCompilationUnit;
private IAnnotationModel fAnnotationModel;
@@ -113,7 +114,7 @@
@SuppressWarnings("rawtypes")
@Override
public List getMessages() {
- return null;
+ return messages;
}
@Override
@@ -227,6 +228,7 @@
@Override
public void addMessage(IValidator origin, IMessage message) {
+ messages.add(message);
if (isCancelled()) {
return;
}
@@ -280,8 +282,8 @@
};
}
- private JavaELProblemReporter createProblemReporter() {
- JavaELProblemReporter reporter = new JavaELProblemReporter();
+ private JavaProblemReporter createProblemReporter() {
+ JavaProblemReporter reporter = new JavaProblemReporter();
reporter.update();
return reporter;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-08-13 23:45:06 UTC (rev 43016)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-08-14 01:06:06 UTC (rev 43017)
@@ -296,8 +296,6 @@
displaySubtask(ELValidationMessages.VALIDATING_EL_FILE, new String[]{el.getResource().getProject().getName(), el.getResource().getName()});
if(!asYouType) {
el.deleteMarkers();
- } else {
- disableProblemAnnotations(el);
}
if(context!=null && !el.getSyntaxErrors().isEmpty() && !isDollarExpressionInXML(el)) {
@@ -322,6 +320,9 @@
for (ELExpression expresion : el.getEl()) {
validateELExpression(el, expresion, asYouType, context);
}
+ if(asYouType) {
+ disableProblemAnnotations(el, reporter);
+ }
}
}
13 years, 8 months
JBoss Tools SVN: r43016 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-13 19:45:06 -0400 (Mon, 13 Aug 2012)
New Revision: 43016
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-08-13 23:04:40 UTC (rev 43015)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-08-13 23:45:06 UTC (rev 43016)
@@ -2113,24 +2113,26 @@
* 6.6.4 Validation of passivation capable beans and dependencies
* - If a managed bean which declares a passivating scope is not passivation capable, then the container automatically detects the problem and treats it as a deployment problem.
*/
- IScope scope = bean.getScope();
- if(scope!=null && scope.isNorlmalScope()) {
- IAnnotationDeclaration normalScopeDeclaration = scope.getAnnotationDeclaration(CDIConstants.NORMAL_SCOPE_ANNOTATION_TYPE_NAME);
- if(normalScopeDeclaration != null) {
- boolean passivatingScope = "true".equalsIgnoreCase("" + normalScopeDeclaration.getMemberValue("passivating"));
- if(passivatingScope) {
- boolean passivatingCapable = false;
- Set<IParametedType> supers = bean.getAllTypes();
- for (IParametedType type : supers) {
- if("java.io.Serializable".equals(type.getType().getFullyQualifiedName())) {
- passivatingCapable = true;
- break;
+ if(bean.getScopeDeclarations().size()<2) { // Ignore broken beans with multiple scope declarations.
+ IScope scope = bean.getScope();
+ if(scope!=null && scope.isNorlmalScope()) {
+ IAnnotationDeclaration normalScopeDeclaration = scope.getAnnotationDeclaration(CDIConstants.NORMAL_SCOPE_ANNOTATION_TYPE_NAME);
+ if(normalScopeDeclaration != null) {
+ boolean passivatingScope = "true".equalsIgnoreCase("" + normalScopeDeclaration.getMemberValue("passivating"));
+ if(passivatingScope) {
+ boolean passivatingCapable = false;
+ Set<IParametedType> supers = bean.getAllTypes();
+ for (IParametedType type : supers) {
+ if("java.io.Serializable".equals(type.getType().getFullyQualifiedName())) {
+ passivatingCapable = true;
+ break;
+ }
}
+ if(!passivatingCapable) {
+ ITextSourceReference reference = CDIUtil.convertToSourceReference(bean.getBeanClass().getNameRange(), bean.getResource(), bean.getBeanClass());
+ addProblem(MessageFormat.format(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, bean.getElementName(), scope.getSourceType().getElementName()), CDIPreferences.NOT_PASSIVATION_CAPABLE_BEAN, reference, bean.getResource(), NOT_PASSIVATION_CAPABLE_BEAN_ID);
+ }
}
- if(!passivatingCapable) {
- ITextSourceReference reference = CDIUtil.convertToSourceReference(bean.getBeanClass().getNameRange(), bean.getResource(), bean.getBeanClass());
- addProblem(MessageFormat.format(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, bean.getElementName(), scope.getSourceType().getElementName()), CDIPreferences.NOT_PASSIVATION_CAPABLE_BEAN, reference, bean.getResource(), NOT_PASSIVATION_CAPABLE_BEAN_ID);
- }
}
}
}
13 years, 8 months
JBoss Tools SVN: r43015 - in trunk: cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-08-13 19:04:40 -0400 (Mon, 13 Aug 2012)
New Revision: 43015
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDefenitionErrorsValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CDIAnnotationTest.java
trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/IAnnotationTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
trunk/common/tests/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF
trunk/tests/plugins/org.jboss.tools.tests/.classpath
trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-08-13 22:32:45 UTC (rev 43014)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -54,6 +54,7 @@
import org.jboss.tools.cdi.core.test.tck.lookup.ResolutionByNameTest;
import org.jboss.tools.cdi.core.test.tck.lookup.ResolutionByTypeTest;
import org.jboss.tools.cdi.core.test.tck.lookup.UnsatisfiedDependencyTest;
+import org.jboss.tools.cdi.core.test.tck.validation.AYTDefenitionErrorsValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.AnnotationsValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.BeansXmlValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.BuilderOrderValidationTest;
@@ -121,7 +122,7 @@
suite.addTestSuite(CoreTest.class);
suite.addTestSuite(ResourceExclusionTest.class);
- // Validation tests
+ // Marker validation tests
suite.addTestSuite(DefenitionErrorsValidationTest.class);
suite.addTestSuite(DeploymentProblemsValidationTests.class);
suite.addTestSuite(BeansXmlValidationTest.class);
@@ -130,7 +131,10 @@
suite.addTestSuite(ELValidationTest.class);
suite.addTestSuite(SuppressWarningsTests.class);
suite.addTestSuite(IncrementalValidationTest.class);
-
+
+ // As-you-type validation tests
+ suite.addTestSuite(AYTDefenitionErrorsValidationTest.class);
+
// Refactoring test
suite.addTestSuite(NamedBeanRefactoringTest.class);
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDefenitionErrorsValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDefenitionErrorsValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDefenitionErrorsValidationTest.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.tests.IAnnotationTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class AYTDefenitionErrorsValidationTest extends DefenitionErrorsValidationTest {
+
+ private CDIAnnotationTest annotationTest = new CDIAnnotationTest();
+
+ protected IAnnotationTest getAnnotationTest() {
+ return annotationTest;
+ }
+
+ @Override
+ public void testBeanDoesNotHaveSomeTypeOfSpecializedBean() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/MissingTypeBeanBroken.java");
+ annotationTest.assertAnnotationsEqualToMarkers(file);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTDefenitionErrorsValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CDIAnnotationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CDIAnnotationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CDIAnnotationTest.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+import org.jboss.tools.common.base.test.validation.AbstractAnnotationTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CDIAnnotationTest extends AbstractAnnotationTest {
+
+ @Override
+ protected String getMarkerType() {
+ return CDICoreValidator.PROBLEM_TYPE;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/CDIAnnotationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2012-08-13 22:32:45 UTC (rev 43014)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -18,12 +18,19 @@
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
+import org.jboss.tools.tests.IAnnotationTest;
/**
* @author Alexey Kazakov
*/
public class DefenitionErrorsValidationTest extends ValidationTest {
+ private IAnnotationTest annotationTest = new AbstractResourceMarkerTest();
+
+ protected IAnnotationTest getAnnotationTest() {
+ return annotationTest;
+ }
+
/**
* 2.2.2. Restricting the bean types of a bean
* - bean class or producer method or field specifies a @Typed annotation,
@@ -34,7 +41,7 @@
*/
public void testLegalTypesInTyped() throws Exception {
IFile petShopFile = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 25);
+ getAnnotationTest().assertAnnotationIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 25);
}
/**
@@ -45,7 +52,7 @@
*/
public void testInterceptorWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 8);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 8);
}
/**
@@ -56,7 +63,7 @@
*/
public void testDecoratorWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR, 7);
}
/**
@@ -67,7 +74,7 @@
*/
public void testMultipleBeanScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/BeanWithTooManyScopeTypes_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS, 22, 23);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS, 22, 23);
}
/**
@@ -79,7 +86,7 @@
*/
public void testBeanWithMultipleScopedStereotypes() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/scopeConflict/Scallop_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, 24, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, 24, 25);
}
/**
@@ -90,9 +97,9 @@
*/
public void testNamedInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 9);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedStereotypedInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
}
/**
@@ -103,9 +110,9 @@
*/
public void testNamedDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedStereotypedDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
}
/**
@@ -116,7 +123,7 @@
*/
public void testAlternativeInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, 7);
}
/**
@@ -127,7 +134,7 @@
*/
public void testAlternativeDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, 7);
}
/**
@@ -138,7 +145,7 @@
*/
public void testStereotypeScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/tooManyScopes/StereotypeWithTooManyScopeTypes_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, 32, 33);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, 32, 33);
}
/**
@@ -149,7 +156,7 @@
*/
public void testNonEmptyNamedForStereotype() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/nonEmptyNamed/StereotypeWithNonEmptyNamed_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, 31);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, 31);
}
/**
@@ -160,7 +167,7 @@
*/
public void testAnnotatedStereotype() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithBindingTypes_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, 30);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, 30);
}
/**
@@ -171,7 +178,7 @@
*/
public void testTypedStereotype() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithTyped_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
}
/**
@@ -182,7 +189,7 @@
*/
public void testInterceptorCanNotAlsoBeDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorCanNotBeDecorator/InterceptingDecorator.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, 24, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, 24, 25);
}
/**
@@ -193,7 +200,7 @@
*/
public void testNonDependentScopedBeanCanNotHavePublicField() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/dependentWithPublicField/Leopard_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, 25);
}
/**
@@ -204,7 +211,7 @@
*/
public void testNonDependentGenericManagedBeanNotOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/bean/genericbroken/FooBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, 21);
}
/**
@@ -216,7 +223,7 @@
*/
public void testSpecializingClassExtendsNonSimpleBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
}
/**
@@ -228,7 +235,7 @@
*/
public void testSpecializingClassDirectlyExtendsNothing() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
}
/**
@@ -240,7 +247,7 @@
*/
public void testSpecializingClassDirectlyExtendsEnterpriseBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
}
/**
@@ -252,7 +259,7 @@
*/
public void testSpecializingClassImplementsInterfaceAndExtendsNothing() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
}
/**
@@ -264,7 +271,7 @@
*/
public void testStatelessWithRequestScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -276,7 +283,7 @@
*/
public void testStatelessWithApplicationScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -288,7 +295,7 @@
*/
public void testStatelessWithConversationScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -300,7 +307,7 @@
*/
public void testStatelessWithSessionScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
@@ -313,7 +320,7 @@
*/
public void testSingletonWithConversationScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 24);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 24);
}
/**
@@ -325,7 +332,7 @@
*/
public void testSingletonWithSessionScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 25);
}
/**
@@ -337,7 +344,7 @@
*/
public void testSingletonWithRequestScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 23);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 23);
}
/**
@@ -348,7 +355,7 @@
*/
public void testSessionBeanAnnotatedInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, 8, 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, 8, 9);
}
/**
@@ -359,7 +366,7 @@
*/
public void testSessionBeanAnnotatedDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, 6, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, 6, 7);
}
/**
@@ -370,7 +377,7 @@
*/
public void testNonDependentGenericSessionBeanNotOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/FooBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, 6);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, 6);
}
/**
@@ -381,7 +388,7 @@
*/
public void testSpecializingClassDirectlyExtendsSimpleBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsSimpleBean/Tractor_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
}
/**
@@ -392,7 +399,7 @@
*/
public void testSpecializingEnterpriseClassImplementsInterfaceAndExtendsNothing() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/implementInterfaceAndExtendsNothing/Donkey_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
}
/**
@@ -403,7 +410,7 @@
*/
public void testSpecializingEnterpriseClassDirectlyExtendsNothing() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsNothing/Cow_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
}
/**
@@ -417,7 +424,7 @@
*/
public void testParameterizedReturnTypeWithWildcard() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/SpiderProducer.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
}
/**
@@ -431,9 +438,9 @@
*/
public void testParameterizedType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/TProducer.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
}
/**
@@ -444,10 +451,10 @@
*/
public void testParameterizedReturnTypeWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 29, 43);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 35);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 39);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 29, 43);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 35);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 39);
}
/**
@@ -457,8 +464,8 @@
*/
public void testParameterizedReturnTypeWithoutTypeVariableOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 52);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 57);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 52);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 57);
}
/**
@@ -469,7 +476,7 @@
*/
public void testInitializerMethodAnnotatedProduces() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/Pheasant_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 25);
}
/**
@@ -480,7 +487,7 @@
*/
public void testProducerMethodWithParameterAnnotatedDisposes() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 25, 26);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 25, 26);
}
/**
@@ -491,7 +498,7 @@
*/
public void testProducerMethodWithParameterAnnotatedObserves() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 26);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 26);
}
/**
@@ -503,7 +510,7 @@
public void testProducerMethodOnSessionBeanMustBeBusinessMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/enterprise/nonbusiness/FooProducer.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, new String[]{"createFoo", "FooProducer"});
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, bindedErrorMessage, 25);
}
/**
@@ -516,7 +523,7 @@
public void testProducerMethodOnSessionBeanMustBeBusinessMethodWithoutLocalInterface() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, new String[]{"retrieveEntityManager", "WidgetRepositoryProducerOk"});
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 14);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, bindedErrorMessage, 14);
}
/**
@@ -529,7 +536,7 @@
public void testProducerMethodOnLocalBeanMustBeBusinessMethodBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/NotBusinessMethod_Broken.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, new String[]{"retrieveEntityManager", "NotBusinessMethod_Broken"});
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 13);
+ getAnnotationTest().assertAnnotationIsCreated(file, bindedErrorMessage, 13);
}
/**
@@ -543,7 +550,7 @@
public void testProducerMethodOnLocalBeanMustBeBusinessMethodOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/DisposerOk.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_PRODUCER_METHOD_IN_SESSION_BEAN, new String[]{"retrieveEntityManager", "DisposerOk"});
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 15);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, bindedErrorMessage, 15);
}
/**
@@ -554,7 +561,7 @@
*/
public void testDecoratorMustNotHaveProducerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 10);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 10);
}
/**
@@ -565,7 +572,7 @@
*/
public void testInterceptorMustNotHaveProducerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 17);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 17);
}
/**
@@ -576,7 +583,7 @@
*/
public void testSpecializedStaticMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializesStaticMethod/FurnitureShop_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, 24);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, 24);
}
/**
@@ -587,7 +594,7 @@
*/
public void testSpecializedMethodIndirectlyOverridesAnotherProducerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/indirectOverride/ShoeShop_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, 24);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, 24);
}
/**
@@ -598,7 +605,7 @@
*/
public void testMultipleDisposeParameters() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, 30, 30);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, 30, 30);
}
/**
@@ -609,7 +616,7 @@
*/
public void testProducesUnallowed() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 30, 31);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 30, 31);
}
/**
@@ -620,7 +627,7 @@
*/
public void testObserverParameterUnallowed() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 32, 32);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 32, 32);
}
/**
@@ -631,7 +638,7 @@
*/
public void testInitializerUnallowed() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 32, 33);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 32, 33);
}
/**
@@ -643,10 +650,10 @@
public void testDisposalMethodNotBusinessOrStatic() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/methodOnSessionBean/AppleTree.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, new String[]{"recycle", "AppleTree"});
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 31);
+ getAnnotationTest().assertAnnotationIsCreated(file, bindedErrorMessage, 31);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/Fox.java");
bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, new String[]{"disposeLitter", "Fox"});
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 73);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, bindedErrorMessage, 73);
}
/**
@@ -659,7 +666,7 @@
public void testDisposalMethodNotBusinessOrStaticWithoutLocalInterface() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/WidgetRepositoryProducerOk.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, new String[]{"disposeEntityManager", "WidgetRepositoryProducerOk"});
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 18);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, bindedErrorMessage, 18);
}
/**
@@ -672,7 +679,7 @@
public void testDisposalMethodOnLocalBeanMustBeBusinessMethodBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/NotBusinessMethod_Broken.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, new String[]{"disposeEntityManager", "NotBusinessMethod_Broken"});
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 18);
+ getAnnotationTest().assertAnnotationIsCreated(file, bindedErrorMessage, 18);
}
/**
@@ -686,7 +693,7 @@
public void testDisposalMethodOnLocalBeanMustBeBusinessMethodOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/DisposerOk.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, new String[]{"disposeEntityManager", "DisposerOk"});
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 20);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, bindedErrorMessage, 20);
}
/**
@@ -697,7 +704,7 @@
*/
public void testDecoratorDeclaresDisposer() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6, 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6, 9);
}
/**
@@ -708,7 +715,7 @@
*/
public void testInterceptorDeclaresDisposer() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FordInterceptor.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8, 16);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8, 16);
}
/**
@@ -719,8 +726,8 @@
*/
public void testUnresolvedDisposalMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/SpiderProducer_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 35);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 31);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 35);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 31);
}
/**
@@ -731,7 +738,7 @@
*/
public void testMultipleDisposersForProducer() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, 13, 16);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, 13, 16);
}
/**
@@ -742,8 +749,8 @@
*/
public void testParameterizedTypeWithWildcard() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/broken/parameterizedReturnTypeWithWildcard/SpiderProducerWildCardType_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1011, 1026);
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 1100, 1125);
+ getAnnotationTest().assertAnnotationIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1011, 1026);
+ getAnnotationTest().assertAnnotationIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 1100, 1125);
}
/**
@@ -754,7 +761,7 @@
*/
public void testTypeVariable() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
}
/**
@@ -765,10 +772,10 @@
*/
public void testParameterizedTypeWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 15, 22);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 13);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 18);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 20);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 15, 22);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 13);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 18);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 20);
}
/**
@@ -782,7 +789,7 @@
*/
public void testProducerAnnotatedInject() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ProducerAnnotatedInjectBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 8);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 8);
}
/**
@@ -793,7 +800,7 @@
*/
public void testNonStaticProducerOfSessionBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/NonStaticProducerOfSessionBeanBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, 9);
}
/**
@@ -804,7 +811,7 @@
*/
public void testDecoratorMustNotHaveProducerField() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerFieldBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 9);
}
/**
@@ -815,7 +822,7 @@
*/
public void testInterceptorMustNotHaveProducerField() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerFieldBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 16);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 16);
}
/**
@@ -826,7 +833,7 @@
*/
public void testResourceWithELName() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/resources/ProducerFieldsBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, 15, 19, 24, 27, 31);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, 15, 19, 24, 27, 31);
}
/*
@@ -851,7 +858,7 @@
*/
public void testTooManyInitializerAnnotatedConstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, 24, 29);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, 24, 29);
}
/**
@@ -862,7 +869,7 @@
*/
public void testConstructorHasDisposesParameter() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES, 24, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES, 24, 25);
}
/**
@@ -873,7 +880,7 @@
*/
public void testConstructorHasObservesParameter() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES, 25, 26);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES, 25, 26);
}
/**
@@ -884,7 +891,7 @@
*/
public void testStaticInitializerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
}
/**
@@ -895,8 +902,8 @@
*/
public void testInitializerMethodHasParameterAnnotatedDisposes() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedDisposes/Capercaillie_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 25, 1003, 1010);
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 26, 1048, 1057);
+ getAnnotationTest().assertAnnotationIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 25, 1003, 1010);
+ getAnnotationTest().assertAnnotationIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 26, 1048, 1057);
}
/**
@@ -907,7 +914,7 @@
*/
public void testGenericInitializerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, 7);
}
/**
@@ -918,7 +925,7 @@
*/
public void testNamedInjectPoint() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/NamedInjectionBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, 10, 16);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, 10, 16);
}
/**
@@ -938,8 +945,8 @@
assertTrue(lines.contains(new Integer(6)));
}
-// AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Farmer"), 6);
-// AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Simple"), 6);
+// getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Farmer"), 6);
+// getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Simple"), 6);
}
/**
@@ -950,7 +957,7 @@
*/
public void testSpecializingAndSpecializedBeanHasName() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/specializingAndSpecializedBeanHaveName/HighSchool_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, "HighSchool_Broken.getStarPupil()", "School.getStarPupil()"), 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, "HighSchool_Broken.getStarPupil()", "School.getStarPupil()"), 25);
}
/**
@@ -961,7 +968,7 @@
*/
public void testSpecializingInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, 9);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, 9);
}
/**
@@ -972,7 +979,7 @@
*/
public void testSpecializingDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, 10);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, 10);
}
/**
@@ -1002,7 +1009,7 @@
*/
public void testTypeVariableInjectionPoint() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/FarmBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, 11, 15);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, 11, 15);
}
/**
@@ -1013,7 +1020,7 @@
*/
public void testAnnotationMemberWithoutNonBinding() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_QUALIFIER_TYPE_MEMBER, 35);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_QUALIFIER_TYPE_MEMBER, 35);
}
/**
@@ -1024,7 +1031,7 @@
*/
public void testArrayMemberWithoutNonBinding() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER, 34);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER, 34);
}
/**
@@ -1035,7 +1042,7 @@
*/
public void testSessionScopedBeanWithInjectionPoint() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 27);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 27);
}
/**
@@ -1048,8 +1055,8 @@
*/
public void testBeansWithInjectionPointParams() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/producer/ProducerWInjections.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 14, 24, 28, 31);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 18);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 14, 24, 28, 31);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 18);
}
/**
@@ -1060,7 +1067,7 @@
*/
public void testMultipleDelegateInjectionPoints() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/multipleDelegateInjectionPoints/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DELEGATE, 31, 32);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MULTIPLE_DELEGATE, 31, 32);
}
/**
@@ -1071,9 +1078,9 @@
*/
public void testNoDelegateInjectionPoints() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/noDelegateInjectionPoints/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_DELEGATE, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MISSING_DELEGATE, 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_DELEGATE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.MISSING_DELEGATE);
}
/**
@@ -1084,13 +1091,13 @@
*/
public void testDecoratorDelegateInjectionPoints() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE, 33);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE, 33);
}
/**
@@ -1101,13 +1108,13 @@
*/
public void testNonDecoratorWithDecoratesAnnotationNotOK() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/nonDecoratorWithDecorates/Elf.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE, 24);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE, 24);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
}
/**
@@ -1118,7 +1125,7 @@
*/
public void testNotAllDecoratedTypesImplemented() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"), 31);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"), 31);
}
/**
@@ -1129,21 +1136,21 @@
*/
public void testAllDecoratedTypesImplemented() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerWithMethod.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE.substring(0, 60) + ".*");
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE.substring(0, 60) + ".*");
}
/**
@@ -1154,7 +1161,7 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterInInterfcaeInFiled() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
}
/**
@@ -1165,7 +1172,7 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterInInterfcaeInMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampWithMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<java.lang.String>"), 10);
+ getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<java.lang.String>"), 10);
}
/**
@@ -1179,7 +1186,7 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterWithInterfaceInFiled() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerOk.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
}
/**
@@ -1193,7 +1200,7 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterWithInterfaceInMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerWithMethodOk.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
}
/**
@@ -1207,13 +1214,13 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterInFiled() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerOk.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLogger.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
}
/**
@@ -1226,13 +1233,13 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterInMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerWithMethodOk.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerWithMethod.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
+ getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
}
/**
@@ -1243,10 +1250,10 @@
*/
public void testNoInterceptorBinfdingsInInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NoInterceptorBinfdingsInInterceptor.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING, 7);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/SecureTransaction.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING);
}
/**
@@ -1258,7 +1265,7 @@
*/
public void testInterceptorBinfdingsInInterceptorWithPreDestroyBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
}
/**
@@ -1270,7 +1277,7 @@
*/
public void testInterceptorBinfdingsInInterceptorWithPostConstructBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
}
/**
@@ -1281,9 +1288,9 @@
*/
public void testInterceptorBinfdingsInInterceptorWithLifeCycleMethodOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/CatInterceptor.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
}
/**
@@ -1294,7 +1301,7 @@
*/
public void testClassLevelInterceptorBindingWithFinalMethodBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassLevelInterceptorBindingWithFinalMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
}
/**
@@ -1305,7 +1312,7 @@
*/
public void testClassWithMethodLevelInterceptorBindingWithFinalMethodBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassWithMethodLevelInterceptorBindingWithFinalMethodBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
}
/**
@@ -1316,7 +1323,7 @@
*/
public void testFinalClassWithClassLevelInterceptorBindingBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FinalClassWithClassLevelInterceptorBindingBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 4);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 4);
}
/**
@@ -1327,7 +1334,7 @@
*/
public void testFinalClassWithMethodLevelInterceptorBindingBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FinalClassWithMethodLevelInterceptorBindingBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 3);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 3);
}
/**
@@ -1338,8 +1345,8 @@
*/
public void testClassLevelInterceptorBindingOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassLevelInterceptorBindingOk.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
}
/**
@@ -1350,8 +1357,8 @@
*/
public void testClassWithMethodLevelInterceptorBindingOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassWithMethodLevelInterceptorBindingOk.java");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
}
/**
@@ -1365,9 +1372,9 @@
*/
public void testInterceptorBindingsWithConflictingAnnotationMembersNotOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/invalidBindingAnnotations/Foo.java");
-// AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 19, 20);
+// getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 19, 20);
//At present CDICoreValidator puts marker to class name
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 21);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 21);
}
/**
@@ -1378,8 +1385,8 @@
*/
public void testAnnotationTypeMemberWithoutNonBindingInInterceptorByndingType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/members/InterceptorBindingMemberBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 19);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 20);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 19);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 20);
}
/**
@@ -1390,8 +1397,8 @@
*/
public void testArrayTypeMemberWithoutNonBindingInInterceptorByndingType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/members/InterceptorBindingMemberBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 21);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 22);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 21);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 22);
}
/**
@@ -1402,7 +1409,7 @@
*/
public void testObserverMethodMustHaveOnlyOneEventParameter() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/tooManyParameters/YorkshireTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, 24, 24);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, 24, 24);
}
/**
@@ -1413,7 +1420,7 @@
*/
public void testObserverMethodAnnotatedProducesFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 25);
}
/**
@@ -1424,7 +1431,7 @@
*/
public void testObserverMethodAnnotatedInitializerFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 25, 26);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 25, 26);
}
/**
@@ -1435,7 +1442,7 @@
*/
public void testObserverMethodWithDisposesParamFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 28, 28);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 28, 28);
}
/**
@@ -1447,7 +1454,7 @@
public void testObserverMethodOnEnterpriseBeanNotBusinessMethodOrStaticFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/notBusinessMethod/TibetanTerrier_Broken.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, new String[]{"observeSomeEvent", "TibetanTerrier_Broken"});
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 25);
+ getAnnotationTest().assertAnnotationIsCreated(file, bindedErrorMessage, 25);
}
/**
@@ -1460,7 +1467,7 @@
public void testObserverMethodOnSingletonBeanIsBusinessMethodOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/observers/ClassFragmentLogger.java");
String bindedErrorMessage = NLS.bind(CDIValidationMessages.ILLEGAL_OBSERVER_IN_SESSION_BEAN, new String[]{"addEntry", "ClassFragmentLogger"});
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 21);
+ getAnnotationTest().assertAnnotationIsNotCreated(file, bindedErrorMessage, 21);
}
/**
@@ -1471,7 +1478,7 @@
*/
public void testObserverMethodInInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, 10);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, 10);
}
/**
@@ -1482,7 +1489,7 @@
*/
public void testObserverMethodInDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_DECORATOR, 14);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_IN_DECORATOR, 14);
}
/**
@@ -1493,6 +1500,6 @@
*/
public void testDependentBeanWithConditionalObserverMethodIsDefinitionError() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/dependentIsConditionalObserver/AlarmSystem.java");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, 24);
+ getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, 24);
}
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java 2012-08-13 22:32:45 UTC (rev 43014)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -130,8 +130,8 @@
job.schedule();
}
- private boolean init(IValidationContext helper, IReporter reporter) {
- if(disabled) {
+ private boolean init(IValidationContext helper, IReporter reporter, boolean test) {
+ if(!test && disabled) {
return false;
}
if(context==null) {
@@ -182,7 +182,11 @@
* @param reporter
*/
public void validateString(Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter) {
- if(!init(helper, reporter)) {
+ validateString(dirtyRegions, helper, reporter, false);
+ }
+
+ protected void validateString(Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter, boolean test) {
+ if(!init(helper, reporter, test)) {
return;
}
validate(context.getStringValidators(), dirtyRegions, helper, reporter);
@@ -196,7 +200,11 @@
* @param reporter
*/
public void validateJavaElement(Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter) {
- if(!init(helper, reporter)) {
+ validateJavaElement(dirtyRegions, helper, reporter, false);
+ }
+
+ protected void validateJavaElement(Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter, boolean test) {
+ if(!init(helper, reporter, test)) {
return;
}
validate(context.getJavaElementValidators(), dirtyRegions, helper, reporter);
@@ -210,7 +218,7 @@
public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
if(count==0) {
// Don't validate the file first time since WTP invokes the validator right after connection.
- init(helper, reporter);
+ init(helper, reporter, false);
count++;
} else {
List<IRegion> regions = new ArrayList<IRegion>();
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java 2012-08-13 22:32:45 UTC (rev 43014)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -48,6 +48,8 @@
*/
abstract public class TempMarkerManager extends ValidationErrorManager {
+ public static final String MESSAGE_TYPE_ATTRIBUTE_NAME = "jbt.type";
+
protected boolean asYouTypeValidation;
protected int messageCounter;
@@ -136,14 +138,17 @@
}
public IMessage addMessage(IResource target, int lineNumber, ITextSourceReference location, String preferenceKey, String textMessage, String[] messageArguments) {
- int severity = getSeverity(preferenceKey, target);
IMessage message = null;
- try {
- if(severity!=-1 && (severity!=IMessage.NORMAL_SEVERITY || !hasSuppressWarningsAnnotation(preferenceKey, location))) {
- message = addMesssage(target, lineNumber, location.getStartPosition(), location.getLength(), severity, preferenceKey, textMessage, messageArguments);
+ IResource actualTarget = location.getResource();
+ if(target.equals(actualTarget)) {
+ int severity = getSeverity(preferenceKey, target);
+ try {
+ if(severity!=-1 && (severity!=IMessage.NORMAL_SEVERITY || !hasSuppressWarningsAnnotation(preferenceKey, location))) {
+ message = addMesssage(target, lineNumber, location.getStartPosition(), location.getLength(), severity, preferenceKey, textMessage, messageArguments);
+ }
+ } catch (JavaModelException e) {
+ CommonPlugin.getDefault().logError(e);
}
- } catch (JavaModelException e) {
- CommonPlugin.getDefault().logError(e);
}
return message;
}
@@ -178,6 +183,10 @@
message.setAttribute(PREFERENCE_KEY_ATTRIBUTE_NAME, preferenceKey);
message.setAttribute(PREFERENCE_PAGE_ID_NAME, preferencePageId);
}
+ String type = getMarkerType();
+ if(type!=null) {
+ message.setAttribute(MESSAGE_TYPE_ATTRIBUTE_NAME, type);
+ }
}
return message;
}
Modified: trunk/common/tests/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF 2012-08-13 22:32:45 UTC (rev 43014)
+++ trunk/common/tests/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF 2012-08-13 23:04:40 UTC (rev 43015)
@@ -36,7 +36,8 @@
org.eclipse.ltk.core.refactoring;bundle-version="3.5.0",
org.jboss.tools.common.model;bundle-version="3.3.0",
org.eclipse.search;bundle-version="3.7.0",
- org.jboss.tools.common.ui
+ org.jboss.tools.common.ui,
+ org.jboss.tools.common.model.ui
Bundle-Version: 3.4.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .
Added: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.base.test.validation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.jboss.tools.common.base.test.BaseTestPlugin;
+import org.jboss.tools.common.util.IEditorWrapper;
+import org.jboss.tools.common.validation.AsYouTypeValidatorManager;
+import org.jboss.tools.common.validation.TempMarkerManager;
+import org.jboss.tools.test.util.WorkbenchUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+import org.jboss.tools.tests.IAnnotationTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public abstract class AbstractAnnotationTest extends TestCase implements IAnnotationTest {
+
+ private Set<IResource> validatedResources = new HashSet<IResource>();
+
+ protected abstract String getMarkerType();
+
+ private ISourceViewer getTextViewer(IEditorPart editorPart) {
+ ISourceViewer viewer = null;
+ ITextEditor textEditor = null;
+ if (editorPart instanceof IEditorWrapper) {
+ editorPart = ((IEditorWrapper) editorPart).getEditor();
+ }
+ if (editorPart instanceof ITextEditor) {
+ textEditor = (ITextEditor) editorPart;
+ } else {
+ textEditor = editorPart == null ? null : (ITextEditor)editorPart.getAdapter(ITextEditor.class);
+ }
+ if(textEditor instanceof JavaEditor) {
+ viewer = ((JavaEditor)textEditor).getViewer();
+ } else if(textEditor instanceof StructuredTextEditor) {
+ viewer = ((StructuredTextEditor)textEditor).getTextViewer();
+ }
+ return viewer;
+ }
+
+ private void modifyDocument(IDocument document) throws BadLocationException {
+ String s = document.get(document.getLength()-1, 1);
+ document.replace(document.getLength() - 1, 1, s + " ");
+ }
+
+ public void assertAnnotationsEqualToMarkers(final IResource resource) throws CoreException {
+ if(validatedResources.contains(resource)) {
+ return;
+ }
+ validatedResources.add(resource);
+
+ IMarker[] allMarkers = AbstractResourceMarkerTest.findMarkers(resource, getMarkerType(), ".*", true);
+ StringBuffer markersSB = new StringBuffer("Marker annotations: [\r\n"); //$NON-NLS-1$
+ int i=0;
+ for (IMarker marker : allMarkers) {
+ String message = marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
+ int line = marker.getAttribute(IMarker.LINE_NUMBER, -1);
+ String mType = marker.getType();
+ int startInt = marker.getAttribute(IMarker.CHAR_START, -1);
+ int endInt = marker.getAttribute(IMarker.CHAR_END, -1);
+ markersSB.append(++i).append(") message=\"").append(message).append("\"; line=\"").append(line).append("\"; start=\"").append(startInt).append("\"; end=\"").append(endInt).append("\"; type=\"").append(mType).append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+ markersSB.append("]"); //$NON-NLS-1$
+
+ IEditorPart editorPart = WorkbenchUtils.openEditor(resource.getFullPath());
+ assertNotNull(editorPart);
+ AsYouTypeValidatorManager manager = new AsYouTypeValidatorManager() {
+ public void validateString(Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter) {
+ validateString(dirtyRegions, helper, reporter, true);
+ }
+ public void validateJavaElement(Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter) {
+ validateJavaElement(dirtyRegions, helper, reporter, true);
+ }
+ };
+ IDocument document = null;
+
+ try {
+ AsYouTypeValidatorManager.setDisabled(true);
+ ISourceViewer viewer = getTextViewer(editorPart);
+ assertNotNull(viewer);
+ document = viewer.getDocument();
+ manager.connect(document);
+ modifyDocument(document);
+
+ Collection<IRegion> dirtyRegions = new ArrayList<IRegion>();
+ final IDocument finalDocument = document;
+ dirtyRegions.add(new IRegion() {
+ @Override
+ public int getOffset() {
+ return 0;
+ }
+ @Override
+ public int getLength() {
+ return finalDocument.getLength();
+ }
+ });
+
+ IValidationContext helper = new IValidationContext() {
+ @Override
+ public Object loadModel(String symbolicName) {
+ return null;
+ }
+ @Override
+ public Object loadModel(String symbolicName, Object[] parms) {
+ return null;
+ }
+ @Override
+ public String[] getURIs() {
+ return new String[] {resource.getFullPath().toString()};
+ }
+ };
+
+ IReporter reporter = new IReporter() {
+ private List<IMessage> messages = new ArrayList<IMessage>();
+ @Override
+ public void addMessage(IValidator origin, IMessage message) {
+ messages.add(message);
+ }
+ @Override
+ public void displaySubtask(IValidator validator, IMessage message) {
+ }
+ @Override
+ public List getMessages() {
+ return messages;
+ }
+ @Override
+ public boolean isCancelled() {
+ return false;
+ }
+ @Override
+ public void removeAllMessages(IValidator origin) {
+ }
+ @Override
+ public void removeAllMessages(IValidator origin, Object object) {
+ }
+ @Override
+ public void removeMessageSubset(IValidator validator, Object obj, String groupName) {
+ }
+ };
+
+ manager.validateJavaElement(dirtyRegions, helper, reporter);
+// manager.validateString(dirtyRegions, helper, reporter);
+
+ StringBuffer messagesSB = new StringBuffer("AYT annotations: [\r\n"); //$NON-NLS-1$
+ List<IMessage> messages = new ArrayList<IMessage>();
+ i=0;
+ for (Object object : reporter.getMessages()) {
+ IMessage message = (IMessage)object;
+ Object mType = message.getAttribute(TempMarkerManager.MESSAGE_TYPE_ATTRIBUTE_NAME);
+ if(getMarkerType().equals(mType)) {
+ messages.add(message);
+ String text = message.getText();
+ int line = message.getLineNumber();
+ int start = message.getOffset();
+ int end = start + message.getLength();
+ messagesSB.append(++i).append(") message=\"").append(text).append("\"; line=\"").append(line).append("\"; start=\"").append(start).append("\"; end=\"").append(end).append("\"; type=\"").append(mType).append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+ }
+ messagesSB.append("]"); //$NON-NLS-1$
+
+ assertEquals("The number of markers doesn't equal to the number of AYT messages for " + resource + ".\r\nThe full list of the markers and messages:\r\n" + markersSB + "\r\n" + messagesSB, allMarkers.length, messages.size());
+
+ for (IMessage message : messages) {
+ assertTrue("Can't find message: [" + message + "] for " + resource + ".\r\nThe full list of the markers and messages:\r\n" + markersSB + "\r\n" + messagesSB, contains(allMarkers, message));
+ }
+ } catch (BadLocationException e) {
+ throw new CoreException(new Status(IStatus.ERROR, BaseTestPlugin.PLUGIN_ID, e.getMessage(), e));
+ } finally {
+ AsYouTypeValidatorManager.setDisabled(false);
+ if(document!=null) {
+ manager.disconnect(document);
+ }
+ if (editorPart != null) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeEditor(editorPart, false);
+ }
+ }
+ }
+
+ private boolean contains(IMarker[] markers, IMessage message) throws CoreException {
+ for (IMarker marker : markers) {
+ if(equaled(marker, message)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean equaled(IMarker marker, IMessage message) throws CoreException {
+ String markerText = marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
+ int markerLine = marker.getAttribute(IMarker.LINE_NUMBER, -1);
+ int markerStart = marker.getAttribute(IMarker.CHAR_START, -1);
+ int markerEnd = marker.getAttribute(IMarker.CHAR_END, -1);
+
+ String messageText = message.getText();
+ int messageLine = message.getLineNumber();
+ int messageStart = message.getOffset();
+ int messageEnd = messageStart + message.getLength();
+
+ return markerText.equals(messageText) && markerLine==messageLine && markerStart==messageStart && markerEnd==messageEnd;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.tests.IAnnotationTest#assertAnnotationIsCreated(org.eclipse.core.resources.IResource, java.lang.String, int[])
+ */
+ @Override
+ public void assertAnnotationIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
+ assertAnnotationsEqualToMarkers(resource);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.tests.IAnnotationTest#assertAnnotationIsCreated(org.eclipse.core.resources.IResource, java.lang.String, boolean, int[])
+ */
+ @Override
+ public void assertAnnotationIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
+ assertAnnotationsEqualToMarkers(resource);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.tests.IAnnotationTest#assertAnnotationIsNotCreated(org.eclipse.core.resources.IResource, java.lang.String)
+ */
+ @Override
+ public void assertAnnotationIsNotCreated(IResource resource, String message) throws CoreException {
+ assertAnnotationsEqualToMarkers(resource);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.tests.IAnnotationTest#assertAnnotationIsNotCreated(org.eclipse.core.resources.IResource, java.lang.String, int)
+ */
+ @Override
+ public void assertAnnotationIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
+ assertAnnotationsEqualToMarkers(resource);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.tests.IAnnotationTest#assertAnnotationIsCreatedForGivenPosition(org.eclipse.core.resources.IResource, java.lang.String, int, int, int)
+ */
+ @Override
+ public void assertAnnotationIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
+ assertAnnotationsEqualToMarkers(resource);
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/tests/plugins/org.jboss.tools.tests/.classpath
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/.classpath 2012-08-13 22:32:45 UTC (rev 43014)
+++ trunk/tests/plugins/org.jboss.tools.tests/.classpath 2012-08-13 23:04:40 UTC (rev 43015)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF 2012-08-13 22:32:45 UTC (rev 43014)
+++ trunk/tests/plugins/org.jboss.tools.tests/META-INF/MANIFEST.MF 2012-08-13 23:04:40 UTC (rev 43015)
@@ -17,5 +17,5 @@
org.jboss.tools.tests
Bundle-ClassPath: .
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Activator: org.jboss.tools.tests.TestsPlugin
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2012-08-13 22:32:45 UTC (rev 43014)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -30,7 +30,7 @@
* @author eskimo
*
*/
-public class AbstractResourceMarkerTest extends TestCase {
+public class AbstractResourceMarkerTest extends TestCase implements IAnnotationTest {
public static final String MARKER_TYPE = "org.eclipse.wst.validation.problemmarker";
@@ -171,11 +171,10 @@
if(lines.isEmpty()) {
IMarker[] allMarkers = findMarkers(resource, null, ".*", true);
StringBuffer sb = new StringBuffer("Marker matches the '"); //$NON-NLS-1$
- sb.append(errorMessage).append("' pattern wasn't found. Here is a list of found markers in ").append(resource.getFullPath().toOSString()).append(allMarkers.length==0?" : [": " : [\r\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ sb.append(errorMessage).append("' pattern wasn't found. Here is the list of found markers in ").append(resource.getFullPath().toOSString()).append(allMarkers.length==0?" : [": " : [\r\n"); //$NON-NLS-1$ //$NON-NLS-2$
int i=0;
for (IMarker marker : allMarkers) {
String message = marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
- marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
int line = marker.getAttribute(IMarker.LINE_NUMBER, -1);
String mType = marker.getType();
sb.append(i).append(") line=\"").append(line).append("\"; type=\"").append(mType).append("\"; message=\"").append(message).append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
@@ -403,4 +402,29 @@
return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>").replace("(", "\\(").replace(")", "\\)")
.replace("{", "\\{").replace("}", "\\}").replace("'", "\\'");
}
+
+ @Override
+ public void assertAnnotationIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
+ assertMarkerIsCreated(resource, pattern, expectedLines);
+ }
+
+ @Override
+ public void assertAnnotationIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
+ assertMarkerIsCreated(resource, message, pattern, expectedLines);
+ }
+
+ @Override
+ public void assertAnnotationIsNotCreated(IResource resource, String message) throws CoreException {
+ assertMarkerIsNotCreated(resource, message);
+ }
+
+ @Override
+ public void assertAnnotationIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
+ assertMarkerIsNotCreated(resource, message, expectedLine);
+ }
+
+ @Override
+ public void assertAnnotationIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
+ assertMarkerIsCreatedForGivenPosition(resource, message, lineNumber, startPosition, endPosition);
+ }
}
\ No newline at end of file
Added: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/IAnnotationTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/IAnnotationTest.java (rev 0)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/IAnnotationTest.java 2012-08-13 23:04:40 UTC (rev 43015)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.tests;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IAnnotationTest {
+
+ void assertAnnotationIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException;
+ void assertAnnotationIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException;
+ void assertAnnotationIsNotCreated(IResource resource, String message) throws CoreException;
+ void assertAnnotationIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException;
+ void assertAnnotationIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException;
+}
\ No newline at end of file
Property changes on: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/IAnnotationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 8 months
JBoss Tools SVN: r43014 - trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/persistence.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-13 18:32:45 -0400 (Mon, 13 Aug 2012)
New Revision: 43014
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/persistence/SeamPersistenceTest.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in local variables in tests wherever it is possible.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/persistence/SeamPersistenceTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/persistence/SeamPersistenceTest.java 2012-08-13 22:29:37 UTC (rev 43013)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/persistence/SeamPersistenceTest.java 2012-08-13 22:32:45 UTC (rev 43014)
@@ -12,7 +12,7 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-import java.util.Set;
+import java.util.Collection;
import junit.framework.TestCase;
@@ -59,7 +59,7 @@
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdi, "/src/test/EntityManagerTest.java", "manager");
assertNotNull(p);
- Set<IBean> bs = cdi.getBeans(false, p);
+ Collection<IBean> bs = cdi.getBeans(false, p);
assertEquals(1, bs.size());
}
@@ -68,7 +68,7 @@
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdi, "/src/test/EntityManager2Test.java", "manager");
assertNotNull(p);
- Set<IBean> bs = cdi.getBeans(false, p);
+ Collection<IBean> bs = cdi.getBeans(false, p);
assertEquals(1, bs.size());
}
@@ -77,7 +77,7 @@
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdi, "/src/test/EntityManagerTest.java", "session");
assertNotNull(p);
- Set<IBean> bs = cdi.getBeans(false, p);
+ Collection<IBean> bs = cdi.getBeans(false, p);
assertFalse(bs.isEmpty());
}
@@ -86,7 +86,7 @@
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdi, "/src/test/EntityManager2Test.java", "session");
assertNotNull(p);
- Set<IBean> bs = cdi.getBeans(false, p);
+ Collection<IBean> bs = cdi.getBeans(false, p);
assertEquals(1, bs.size());
}
}
13 years, 8 months
JBoss Tools SVN: r43013 - trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-13 18:29:37 -0400 (Mon, 13 Aug 2012)
New Revision: 43013
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in local variables in tests wherever it is possible.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2012-08-13 22:23:55 UTC (rev 43012)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2012-08-13 22:29:37 UTC (rev 43013)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.text.ext.test;
import java.util.ArrayList;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
@@ -61,7 +61,7 @@
}
public void testInjectedPointHyperlinkDetector() throws Exception {
- Set<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/BasicLogger.java", true);
+ Collection<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/BasicLogger.java", true);
IBean bean=null;
for(IBean b : beans){
bean = b;
@@ -92,7 +92,7 @@
}
public void testInjectedPointHyperlinkDetectorWithComment() throws Exception {
- Set<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/BasicLogger.java", true);
+ Collection<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/BasicLogger.java", true);
IBean bean=null;
for(IBean b : beans){
bean = b;
@@ -118,7 +118,7 @@
}
public void testInjectedProducerMethodParametersHyperlinkDetector() throws Exception {
- Set<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/CustomProducerImpl.java", true);
+ Collection<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/CustomProducerImpl.java", true);
IBean bean=null;
for(IBean b : beans){
bean = b;
@@ -145,7 +145,7 @@
}
public void testInjectedConstructorParametersHyperlinkDetector() throws Exception {
- Set<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/context/dependent/Fox.java", true);
+ Collection<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/context/dependent/Fox.java", true);
IBean bean=null;
for(IBean b : beans){
bean = b;
@@ -164,7 +164,7 @@
}
public void testInjectedInitializerParametersHyperlinkDetector() throws Exception {
- Set<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/context/dependent/Fox.java", true);
+ Collection<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/context/dependent/Fox.java", true);
IBean bean=null;
for(IBean b : beans){
bean = b;
13 years, 8 months
JBoss Tools SVN: r43012 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test: v30 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-13 18:23:55 -0400 (Mon, 13 Aug 2012)
New Revision: 43012
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ConfigBeansInjectionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/ConfigBeansInjectionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/SeamBeansTest.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in local variables in tests wherever it is possible.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ConfigBeansInjectionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ConfigBeansInjectionTest.java 2012-08-13 22:12:10 UTC (rev 43011)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/ConfigBeansInjectionTest.java 2012-08-13 22:23:55 UTC (rev 43012)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.config.core.test;
-import java.util.Set;
+import java.util.Collection;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IClassBean;
@@ -25,7 +25,7 @@
public void testClassBeanInjection() {
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdiProject, INJECTIONS_CLASS_PATH, "b5");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
@@ -38,7 +38,7 @@
public void testVirtualFieldProducer() {
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdiProject, INJECTIONS_CLASS_PATH, "s");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
@@ -51,7 +51,7 @@
public void testMethodProducer() {
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdiProject, INJECTIONS_CLASS_PATH, "t1");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerMethod);
@@ -64,7 +64,7 @@
public void testFieldProducer() {
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdiProject, INJECTIONS_CLASS_PATH, "t3");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerField);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java 2012-08-13 22:12:10 UTC (rev 43011)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java 2012-08-13 22:23:55 UTC (rev 43012)
@@ -11,11 +11,11 @@
package org.jboss.tools.cdi.seam.config.core.test;
import java.io.IOException;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
-import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDIConstants;
@@ -50,7 +50,7 @@
* ASSERT: Model contains 1 bean with type MyBean1.
*/
public void testModifyingATrivialBean() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean1");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean1");
assertEquals(1, beans.size());
}
@@ -65,7 +65,7 @@
* ASSERT: Model contains 1 bean with type MyBean2.
*/
public void testReplacingATrivialBean() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean2");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean2");
assertEquals(1, beans.size());
}
@@ -79,7 +79,7 @@
* ASSERT: Model contains 2 beans with type MyBean3.
*/
public void testCreatingNewTrivialBean() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean3");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean3");
assertEquals(2, beans.size());
//The same in dependent project
@@ -99,7 +99,7 @@
* ASSERT: Model contains 3 beans with type MyBean4.
*/
public void testCreatingTwoNewTrivialBeans() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean4");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean4");
assertEquals(3, beans.size());
//The same in dependent project
@@ -124,10 +124,10 @@
*
*/
public void testModifyingAQualifiedBean() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean1",
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean1",
new String[]{"org.jboss.beans.test02.MyQualifier1"});
assertEquals(1, beans1.size());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean1",
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean1",
new String[]{"org.jboss.beans.test02.MyQualifier1",
"org.jboss.beans.test02.MyQualifier2"});
assertEquals(1, beans2.size());
@@ -158,10 +158,10 @@
* ASSERT: Model contains 1 bean with type MyBean2 and qualifier MyQualifier2.
*/
public void testReplacingAQualifiedBean() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean2",
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean2",
new String[]{"org.jboss.beans.test02.MyQualifier1"});
assertTrue(beans1.isEmpty());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean2",
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean2",
new String[]{"org.jboss.beans.test02.MyQualifier2"});
assertEquals(1, beans2.size());
@@ -193,7 +193,7 @@
*
*/
public void testCreatingTwoNewQualifiedBeans() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean4");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean4");
assertEquals(3, beans.size());
//The same in dependent project
@@ -214,7 +214,7 @@
* ASSERT: Model contains 1 named bean with name "test03-1-b".
*/
public void testModifyingANamedBean() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean1");
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean1");
assertEquals(1, beans1.size());
IBean b = beans1.iterator().next();
assertEquals("test03-1-b", b.getName());
@@ -239,7 +239,7 @@
* ASSERT: Model contains 1 named bean with name "test03-2-b".
*/
public void testReplacingANamedBean() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean2");
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean2");
assertEquals(1, beans1.size());
IBean b = beans1.iterator().next();
assertEquals("test03-2-b", b.getName());
@@ -265,9 +265,9 @@
* ASSERT: Model contains named beans "test03-3-a", "test03-3-b", "test03-3-c".
*/
public void testCreatingNamedBeans() throws CoreException, IOException {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean3");
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean3");
assertEquals(3, beans.size());
- Set<String> names = new HashSet<String>();
+ Collection<String> names = new HashSet<String>();
for (IBean b: beans) {
names.add(b.getName());
}
@@ -300,7 +300,7 @@
* ASSERT: That bean is field producer.
*/
public void testModifyingBeanWithFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType1");
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType1");
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
@@ -330,12 +330,12 @@
* ASSERT: That bean has name "test04-2-a".
*/
public void testModifyingBeanWithModifiedFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType2",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType2",
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
- Set<IQualifierDeclaration> qs = b.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> qs = b.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
map.put(q.getTypeName(), q);
@@ -363,12 +363,12 @@
* ASSERT: That bean has qualifier MyQualifier with kind="kind-04-3".
*/
public void testModifyingBeanWithFieldMadeProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType3",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType3",
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
- Set<IQualifierDeclaration> qs = b.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> qs = b.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
map.put(q.getTypeName(), q);
@@ -390,7 +390,7 @@
* ASSERT: Model contains no bean with type MyType4.
*/
public void testReplacingBeanWithFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType4");
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType4");
assertTrue(beans.isEmpty());
}
@@ -411,17 +411,17 @@
* ASSERT: That bean has injection point field with qualifier MyQualifier with kind="kind-04-5-a".
*/
public void testReplacingBeanWithModifiedFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType5",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType5",
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertTrue(beans.isEmpty());
beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean5", new String[0]);
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
- Set<IInjectionPoint> is = b.getInjectionPoints();
+ Collection<IInjectionPoint> is = b.getInjectionPoints();
assertEquals(1, is.size());
IInjectionPoint p = is.iterator().next();
- Set<IQualifierDeclaration> qs = p.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> qs = p.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
map.put(q.getTypeName(), q);
@@ -452,27 +452,27 @@
* ASSERT: That injection point is resolved to bean MyType6.
*/
public void testCreatingBeanWithFieldMadeProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType6", new String[0]);
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType6", new String[0]);
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6",
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6",
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertEquals(1, beans1.size());
IBean b1 = beans1.iterator().next();
- Set<IInjectionPoint> is1 = b1.getInjectionPoints();
+ Collection<IInjectionPoint> is1 = b1.getInjectionPoints();
assertTrue(is1.isEmpty());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6", new String[0]);
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6", new String[0]);
assertEquals(1, beans2.size());
IBean b2 = beans2.iterator().next();
- Set<IInjectionPoint> is2 = b2.getInjectionPoints();
+ Collection<IInjectionPoint> is2 = b2.getInjectionPoints();
assertEquals(1, is2.size());
IInjectionPoint p = is2.iterator().next();
- Set<IBean> beansI = cdiProject.getBeans(false, p);
+ Collection<IBean> beansI = cdiProject.getBeans(false, p);
assertTrue(beansI.contains(b));
}
@@ -501,20 +501,20 @@
*
*/
public void testCreatingBeanWithMethodMadeProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1",
new String[]{"org.jboss.beans.test05.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerMethod);
- Set<IInjectionPoint> is = b.getInjectionPoints();
+ Collection<IInjectionPoint> is = b.getInjectionPoints();
assertEquals(1, is.size());
IInjectionPoint p = is.iterator().next();
- Set<IBean> beansI = cdiProject.getBeans(false, p);
+ Collection<IBean> beansI = cdiProject.getBeans(false, p);
assertEquals(1, beansI.size());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
assertEquals(1, beans2.size());
IBean b2 = beans2.iterator().next();
@@ -538,26 +538,26 @@
*
*/
public void testCreatingBeanWithConstructor() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyBean2", new String[0]);
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyBean2", new String[0]);
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IClassBean);
- Set<IInjectionPoint> is = b.getInjectionPoints();
+ Collection<IInjectionPoint> is = b.getInjectionPoints();
IInjectionPoint p = getParameterInjectionPoint(is);
assertNotNull(p);
- Set<IBean> beansI = cdiProject.getBeans(false, p);
+ Collection<IBean> beansI = cdiProject.getBeans(false, p);
assertEquals(1, beansI.size());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
assertEquals(1, beans2.size());
IBean b2 = beans2.iterator().next();
assertTrue(beansI.contains(b2));
}
- private IInjectionPoint getParameterInjectionPoint(Set<IInjectionPoint> is) {
+ private IInjectionPoint getParameterInjectionPoint(Collection<IInjectionPoint> is) {
Iterator<IInjectionPoint> it = is.iterator();
while(it.hasNext()) {
IInjectionPoint i = it.next();
@@ -584,7 +584,7 @@
* ASSERT: Injection point field 'two' in MyBean1 is not resolved to a bean.
*/
public void testVirtualFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "java.lang.String",
+ Collection<IBean> beans = cdiProject.getBeans(false, "java.lang.String",
new String[]{"org.jboss.beans.test06.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
@@ -593,11 +593,11 @@
String value = (String)d.getMemberValue(null);
assertEquals("one", value);
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean1", new String[0]);
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean1", new String[0]);
assertEquals(1, beans1.size());
IBean b1 = beans1.iterator().next();
- Set<IInjectionPoint> is = b1.getInjectionPoints();
+ Collection<IInjectionPoint> is = b1.getInjectionPoints();
assertEquals(2, is.size());
IInjectionPoint one = null;
IInjectionPoint two = null;
@@ -619,7 +619,7 @@
assertNotNull(one);
assertNotNull(two);
- Set<IBean> beansI = cdiProject.getBeans(false, one);
+ Collection<IBean> beansI = cdiProject.getBeans(false, one);
assertEquals(1, beansI.size());
assertTrue(beansI.contains(b));
@@ -655,7 +655,7 @@
* ASSERT: The other of them is a bean with type MyType1 InlineBeanQualifier qualifier.
*/
public void testVirtualFieldProducerWithNoBeanConstructor() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyType1",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyType1",
new String[]{"org.jboss.beans.test06.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
@@ -669,11 +669,11 @@
// assertNotNull(inlineBeanQ);
// Object inlineIndex1 = inlineBeanQ.getMemberValue(null);
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean2", new String[0]);
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean2", new String[0]);
assertEquals(1, beans1.size());
IBean b1 = beans1.iterator().next();
- Set<IInjectionPoint> is = b1.getInjectionPoints();
+ Collection<IInjectionPoint> is = b1.getInjectionPoints();
assertEquals(2, is.size());
IInjectionPoint one = null;
IInjectionPoint two = null;
@@ -695,7 +695,7 @@
assertNotNull(one);
assertNotNull(two);
- Set<IBean> beansI = cdiProject.getBeans(false, two);
+ Collection<IBean> beansI = cdiProject.getBeans(false, two);
assertEquals(1, beansI.size());
assertTrue(beansI.contains(b));
@@ -716,23 +716,23 @@
}
public void testVirtualFieldProducerForInterface() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyInterface",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyInterface",
new String[]{CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IClassBean); // we keep it as a class bean
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean3", new String[0]);
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean3", new String[0]);
assertEquals(1, beans1.size());
IBean b1 = beans1.iterator().next();
- Set<IInjectionPoint> is = b1.getInjectionPoints();
+ Collection<IInjectionPoint> is = b1.getInjectionPoints();
assertEquals(1, is.size());
IInjectionPoint i = is.iterator().next();
assertNotNull(i);
- Set<IBean> beansI = cdiProject.getBeans(false, i);
+ Collection<IBean> beansI = cdiProject.getBeans(false, i);
assertEquals(1, beansI.size());
assertTrue(beansI.contains(b));
@@ -749,7 +749,7 @@
*
*/
public void testInnerBeanWithConstructor() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyType1",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyType1",
new String[]{CDIConstants.ANY_QUALIFIER_TYPE_NAME});
assertEquals(2, beans.size());
IBean inner = null;
@@ -771,10 +771,10 @@
Object inlineIndex = inlineBeanQ.getMemberValue(null);
assertNotNull(inlineIndex);
- Set<IInjectionPoint> is = inner.getInjectionPoints();
+ Collection<IInjectionPoint> is = inner.getInjectionPoints();
IInjectionPoint p = getParameterInjectionPoint(is);
assertNotNull(p);
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
}
@@ -794,7 +794,7 @@
* ASSERT: Model of dependent project contains 1 named bean with name "test07-1-b".
*/
public void testModifyingBeanInDependentProject() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test07.MyBean1");
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test07.MyBean1");
assertEquals(1, beans1.size());
IBean b = beans1.iterator().next();
assertEquals("test07-1-a", b.getName());
@@ -806,11 +806,11 @@
assertEquals("test07-1-b", b.getName());
}
- protected Set<IBean> getBeansByClassName(String className) {
+ protected Collection<IBean> getBeansByClassName(String className) {
return cdiProject.getBeans(false, className, new String[0]);
}
- protected Set<IBean> getBeansByClassNameInDependentProject(String className) {
+ protected Collection<IBean> getBeansByClassNameInDependentProject(String className) {
return cdiDependentProject.getBeans(false, className, new String[0]);
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/ConfigBeansInjectionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/ConfigBeansInjectionTest.java 2012-08-13 22:12:10 UTC (rev 43011)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/ConfigBeansInjectionTest.java 2012-08-13 22:23:55 UTC (rev 43012)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.config.core.test.v30;
-import java.util.Set;
+import java.util.Collection;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IClassBean;
@@ -25,7 +25,7 @@
public void testClassBeanInjection() {
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdiProject, INJECTIONS_CLASS_PATH, "b5");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
@@ -38,7 +38,7 @@
public void testVirtualFieldProducer() {
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdiProject, INJECTIONS_CLASS_PATH, "s");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
@@ -51,7 +51,7 @@
public void testMethodProducer() {
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdiProject, INJECTIONS_CLASS_PATH, "t1");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerMethod);
@@ -64,7 +64,7 @@
public void testFieldProducer() {
IInjectionPoint p = DependentProjectTest.getInjectionPointField(cdiProject, INJECTIONS_CLASS_PATH, "t3");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerField);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/SeamBeansTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/SeamBeansTest.java 2012-08-13 22:12:10 UTC (rev 43011)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/SeamBeansTest.java 2012-08-13 22:23:55 UTC (rev 43012)
@@ -11,11 +11,11 @@
package org.jboss.tools.cdi.seam.config.core.test.v30;
import java.io.IOException;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
-import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDIConstants;
@@ -50,7 +50,7 @@
* ASSERT: Model contains 1 bean with type MyBean1.
*/
public void testModifyingATrivialBean() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean1");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean1");
assertEquals(1, beans.size());
}
@@ -65,7 +65,7 @@
* ASSERT: Model contains 1 bean with type MyBean2.
*/
public void testReplacingATrivialBean() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean2");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean2");
assertEquals(1, beans.size());
}
@@ -79,7 +79,7 @@
* ASSERT: Model contains 2 beans with type MyBean3.
*/
public void testCreatingNewTrivialBean() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean3");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean3");
assertEquals(2, beans.size());
//The same in dependent project
@@ -99,7 +99,7 @@
* ASSERT: Model contains 3 beans with type MyBean4.
*/
public void testCreatingTwoNewTrivialBeans() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean4");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean4");
assertEquals(3, beans.size());
//The same in dependent project
@@ -124,10 +124,10 @@
*
*/
public void testModifyingAQualifiedBean() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean1",
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean1",
new String[]{"org.jboss.beans.test02.MyQualifier1"});
assertEquals(1, beans1.size());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean1",
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean1",
new String[]{"org.jboss.beans.test02.MyQualifier1",
"org.jboss.beans.test02.MyQualifier2"});
assertEquals(1, beans2.size());
@@ -158,10 +158,10 @@
* ASSERT: Model contains 1 bean with type MyBean2 and qualifier MyQualifier2.
*/
public void testReplacingAQualifiedBean() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean2",
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean2",
new String[]{"org.jboss.beans.test02.MyQualifier1"});
assertTrue(beans1.isEmpty());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean2",
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test02.MyBean2",
new String[]{"org.jboss.beans.test02.MyQualifier2"});
assertEquals(1, beans2.size());
@@ -193,7 +193,7 @@
*
*/
public void testCreatingTwoNewQualifiedBeans() throws CoreException, IOException {
- Set<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean4");
+ Collection<IBean> beans = getBeansByClassName("org.jboss.beans.test01.MyBean4");
assertEquals(3, beans.size());
//The same in dependent project
@@ -214,7 +214,7 @@
* ASSERT: Model contains 1 named bean with name "test03-1-b".
*/
public void testModifyingANamedBean() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean1");
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean1");
assertEquals(1, beans1.size());
IBean b = beans1.iterator().next();
assertEquals("test03-1-b", b.getName());
@@ -239,7 +239,7 @@
* ASSERT: Model contains 1 named bean with name "test03-2-b".
*/
public void testReplacingANamedBean() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean2");
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean2");
assertEquals(1, beans1.size());
IBean b = beans1.iterator().next();
assertEquals("test03-2-b", b.getName());
@@ -265,9 +265,9 @@
* ASSERT: Model contains named beans "test03-3-a", "test03-3-b", "test03-3-c".
*/
public void testCreatingNamedBeans() throws CoreException, IOException {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean3");
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test03.MyBean3");
assertEquals(3, beans.size());
- Set<String> names = new HashSet<String>();
+ Collection<String> names = new HashSet<String>();
for (IBean b: beans) {
names.add(b.getName());
}
@@ -300,7 +300,7 @@
* ASSERT: That bean is field producer.
*/
public void testModifyingBeanWithFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType1");
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType1");
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
@@ -330,12 +330,12 @@
* ASSERT: That bean has name "test04-2-a".
*/
public void testModifyingBeanWithModifiedFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType2",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType2",
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
- Set<IQualifierDeclaration> qs = b.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> qs = b.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
map.put(q.getTypeName(), q);
@@ -363,12 +363,12 @@
* ASSERT: That bean has qualifier MyQualifier with kind="kind-04-3".
*/
public void testModifyingBeanWithFieldMadeProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType3",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType3",
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
- Set<IQualifierDeclaration> qs = b.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> qs = b.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
map.put(q.getTypeName(), q);
@@ -390,7 +390,7 @@
* ASSERT: Model contains no bean with type MyType4.
*/
public void testReplacingBeanWithFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType4");
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType4");
assertTrue(beans.isEmpty());
}
@@ -411,17 +411,17 @@
* ASSERT: That bean has injection point field with qualifier MyQualifier with kind="kind-04-5-a".
*/
public void testReplacingBeanWithModifiedFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType5",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType5",
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertTrue(beans.isEmpty());
beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean5", new String[0]);
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
- Set<IInjectionPoint> is = b.getInjectionPoints();
+ Collection<IInjectionPoint> is = b.getInjectionPoints();
assertEquals(1, is.size());
IInjectionPoint p = is.iterator().next();
- Set<IQualifierDeclaration> qs = p.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> qs = p.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
map.put(q.getTypeName(), q);
@@ -452,27 +452,27 @@
* ASSERT: That injection point is resolved to bean MyType6.
*/
public void testCreatingBeanWithFieldMadeProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType6", new String[0]);
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType6", new String[0]);
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6",
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6",
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertEquals(1, beans1.size());
IBean b1 = beans1.iterator().next();
- Set<IInjectionPoint> is1 = b1.getInjectionPoints();
+ Collection<IInjectionPoint> is1 = b1.getInjectionPoints();
assertTrue(is1.isEmpty());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6", new String[0]);
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6", new String[0]);
assertEquals(1, beans2.size());
IBean b2 = beans2.iterator().next();
- Set<IInjectionPoint> is2 = b2.getInjectionPoints();
+ Collection<IInjectionPoint> is2 = b2.getInjectionPoints();
assertEquals(1, is2.size());
IInjectionPoint p = is2.iterator().next();
- Set<IBean> beansI = cdiProject.getBeans(false, p);
+ Collection<IBean> beansI = cdiProject.getBeans(false, p);
assertTrue(beansI.contains(b));
}
@@ -501,20 +501,20 @@
*
*/
public void testCreatingBeanWithMethodMadeProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1",
new String[]{"org.jboss.beans.test05.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerMethod);
- Set<IInjectionPoint> is = b.getInjectionPoints();
+ Collection<IInjectionPoint> is = b.getInjectionPoints();
assertEquals(1, is.size());
IInjectionPoint p = is.iterator().next();
- Set<IBean> beansI = cdiProject.getBeans(false, p);
+ Collection<IBean> beansI = cdiProject.getBeans(false, p);
assertEquals(1, beansI.size());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
assertEquals(1, beans2.size());
IBean b2 = beans2.iterator().next();
@@ -538,26 +538,26 @@
*
*/
public void testCreatingBeanWithConstructor() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyBean2", new String[0]);
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyBean2", new String[0]);
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IClassBean);
- Set<IInjectionPoint> is = b.getInjectionPoints();
+ Collection<IInjectionPoint> is = b.getInjectionPoints();
IInjectionPoint p = getParameterInjectionPoint(is);
assertNotNull(p);
- Set<IBean> beansI = cdiProject.getBeans(false, p);
+ Collection<IBean> beansI = cdiProject.getBeans(false, p);
assertEquals(1, beansI.size());
- Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
+ Collection<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
assertEquals(1, beans2.size());
IBean b2 = beans2.iterator().next();
assertTrue(beansI.contains(b2));
}
- private IInjectionPoint getParameterInjectionPoint(Set<IInjectionPoint> is) {
+ private IInjectionPoint getParameterInjectionPoint(Collection<IInjectionPoint> is) {
Iterator<IInjectionPoint> it = is.iterator();
while(it.hasNext()) {
IInjectionPoint i = it.next();
@@ -584,7 +584,7 @@
* ASSERT: Injection point field 'two' in MyBean1 is not resolved to a bean.
*/
public void testVirtualFieldProducer() {
- Set<IBean> beans = cdiProject.getBeans(false, "java.lang.String",
+ Collection<IBean> beans = cdiProject.getBeans(false, "java.lang.String",
new String[]{"org.jboss.beans.test06.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
@@ -593,11 +593,11 @@
String value = (String)d.getMemberValue(null);
assertEquals("one", value);
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean1", new String[0]);
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean1", new String[0]);
assertEquals(1, beans1.size());
IBean b1 = beans1.iterator().next();
- Set<IInjectionPoint> is = b1.getInjectionPoints();
+ Collection<IInjectionPoint> is = b1.getInjectionPoints();
assertEquals(2, is.size());
IInjectionPoint one = null;
IInjectionPoint two = null;
@@ -619,7 +619,7 @@
assertNotNull(one);
assertNotNull(two);
- Set<IBean> beansI = cdiProject.getBeans(false, one);
+ Collection<IBean> beansI = cdiProject.getBeans(false, one);
assertEquals(1, beansI.size());
assertTrue(beansI.contains(b));
@@ -655,7 +655,7 @@
* ASSERT: The other of them is a bean with type MyType1 InlineBeanQualifier qualifier.
*/
public void testVirtualFieldProducerWithNoBeanConstructor() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyType1",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyType1",
new String[]{"org.jboss.beans.test06.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
@@ -669,11 +669,11 @@
// assertNotNull(inlineBeanQ);
// Object inlineIndex1 = inlineBeanQ.getMemberValue(null);
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean2", new String[0]);
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean2", new String[0]);
assertEquals(1, beans1.size());
IBean b1 = beans1.iterator().next();
- Set<IInjectionPoint> is = b1.getInjectionPoints();
+ Collection<IInjectionPoint> is = b1.getInjectionPoints();
assertEquals(2, is.size());
IInjectionPoint one = null;
IInjectionPoint two = null;
@@ -695,7 +695,7 @@
assertNotNull(one);
assertNotNull(two);
- Set<IBean> beansI = cdiProject.getBeans(false, two);
+ Collection<IBean> beansI = cdiProject.getBeans(false, two);
assertEquals(1, beansI.size());
assertTrue(beansI.contains(b));
@@ -716,23 +716,23 @@
}
public void testVirtualFieldProducerForInterface() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyInterface",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyInterface",
new String[]{CDIConstants.DEFAULT_QUALIFIER_TYPE_NAME});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IClassBean); // we keep it as a class bean
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean3", new String[0]);
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test06.MyBean3", new String[0]);
assertEquals(1, beans1.size());
IBean b1 = beans1.iterator().next();
- Set<IInjectionPoint> is = b1.getInjectionPoints();
+ Collection<IInjectionPoint> is = b1.getInjectionPoints();
assertEquals(1, is.size());
IInjectionPoint i = is.iterator().next();
assertNotNull(i);
- Set<IBean> beansI = cdiProject.getBeans(false, i);
+ Collection<IBean> beansI = cdiProject.getBeans(false, i);
assertEquals(1, beansI.size());
assertTrue(beansI.contains(b));
@@ -749,7 +749,7 @@
*
*/
public void testInnerBeanWithConstructor() {
- Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyType1",
+ Collection<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test06.MyType1",
new String[]{CDIConstants.ANY_QUALIFIER_TYPE_NAME});
assertEquals(2, beans.size());
IBean inner = null;
@@ -771,10 +771,10 @@
Object inlineIndex = inlineBeanQ.getMemberValue(null);
assertNotNull(inlineIndex);
- Set<IInjectionPoint> is = inner.getInjectionPoints();
+ Collection<IInjectionPoint> is = inner.getInjectionPoints();
IInjectionPoint p = getParameterInjectionPoint(is);
assertNotNull(p);
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(1, bs.size());
}
@@ -794,7 +794,7 @@
* ASSERT: Model of dependent project contains 1 named bean with name "test07-1-b".
*/
public void testModifyingBeanInDependentProject() throws CoreException, IOException {
- Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test07.MyBean1");
+ Collection<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test07.MyBean1");
assertEquals(1, beans1.size());
IBean b = beans1.iterator().next();
assertEquals("test07-1-a", b.getName());
@@ -806,11 +806,11 @@
assertEquals("test07-1-b", b.getName());
}
- protected Set<IBean> getBeansByClassName(String className) {
+ protected Collection<IBean> getBeansByClassName(String className) {
return cdiProject.getBeans(false, className, new String[0]);
}
- protected Set<IBean> getBeansByClassNameInDependentProject(String className) {
+ protected Collection<IBean> getBeansByClassNameInDependentProject(String className) {
return cdiDependentProject.getBeans(false, className, new String[0]);
}
13 years, 8 months
JBoss Tools SVN: r43011 - in trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test: .settings and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-13 18:12:10 -0400 (Mon, 13 Aug 2012)
New Revision: 43011
Added:
trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/.settings/org.eclipse.jdt.core.prefs
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeBeansTest.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.deltaspike.core.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/.settings/org.eclipse.jdt.core.prefs 2012-08-13 22:12:10 UTC (rev 43011)
@@ -0,0 +1,7 @@
+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.deltaspike.core.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeBeansTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeBeansTest.java 2012-08-13 22:11:04 UTC (rev 43010)
+++ trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeBeansTest.java 2012-08-13 22:12:10 UTC (rev 43011)
@@ -10,8 +10,8 @@
******************************************************************************/
package org.jboss.tools.cdi.deltaspike.core.test;
+import java.util.Collection;
import java.util.Map;
-import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Path;
@@ -50,7 +50,7 @@
assertTrue(def.isAnnotationPresent(CDIConstants.NAMED_QUALIFIER_TYPE_NAME));
assertTrue(def.isAnnotationPresent(DeltaspikeConstants.EXCLUDE_ANNOTATION_TYPE_NAME));
- Set<IBean> bs = cdi.getBeans(def.getResource().getFullPath());
+ Collection<IBean> bs = cdi.getBeans(def.getResource().getFullPath());
assertTrue(bs.isEmpty());
}
@@ -70,7 +70,7 @@
IInjectionPointField f1 = DependentProjectTest.getInjectionPointField(cdi, project, "/src/deltaspike/message/MyBean.java", "messages"); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull(f1);
- Set<IBean> bs = cdi.getBeans(true, f1);
+ Collection<IBean> bs = cdi.getBeans(true, f1);
assertEquals(1, bs.size());
IInjectionPointField f2 = DependentProjectTest.getInjectionPointField(cdi, project, "/src/deltaspike/message/MyBean.java", "messageContext"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -83,12 +83,12 @@
IProject project = getTestProject();
ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
- Set<IBean> bs = cdi.getBeans(new Path("/DeltaspikeCoreTest/src/deltaspike/handler/MyHandlers.java")); //$NON-NLS-1$
+ Collection<IBean> bs = cdi.getBeans(new Path("/DeltaspikeCoreTest/src/deltaspike/handler/MyHandlers.java")); //$NON-NLS-1$
IClassBean cb = null;
for (IBean b: bs) {
if(b instanceof IClassBean) cb = (IClassBean)b;
}
- Set<IInjectionPoint> ps = cb.getInjectionPoints();
+ Collection<IInjectionPoint> ps = cb.getInjectionPoints();
assertEquals(1, ps.size());
IInjectionPoint p = ps.iterator().next();
assertTrue(p instanceof IInjectionPointParameter);
@@ -104,7 +104,7 @@
DeltaspikeSecurityBindingConfiguration c = extension.getContext().getConfiguration("deltaspike.security.CustomSecurityBinding"); //$NON-NLS-1$
assertNotNull(c);
- Set<DeltaspikeAuthorityMethod> as = c.getAuthorizerMembers();
+ Collection<DeltaspikeAuthorityMethod> as = c.getAuthorizerMembers();
assertEquals(3, as.size());
Map<AbstractMemberDefinition, SecurityBindingDeclaration> bs = c.getBoundMembers();
assertEquals(3, bs.size());
13 years, 8 months
JBoss Tools SVN: r43010 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-08-13 18:11:04 -0400 (Mon, 13 Aug 2012)
New Revision: 43010
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/DependentProjectTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/TwoWebContentFoldersTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/TypeTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/AssignabilityOfRawAndParameterizedTypesTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BeanDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BeanSpecializationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BuiltInBeanInjectionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/CDIUtilTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/CoreTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseQualifierDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseResolutionByTypeTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InjectionPointTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InjectionPointWithNewQualifierTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NameDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NamedBeanRefactoringTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ObserverMethodResolutionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ProducerMethodDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierWithMembersTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResolvedTypesCacheTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResourceExclusionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/SelectedAlternativeTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/AmbiguousDependencyTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/CircularDependencyTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/DynamicLookupTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/ResolutionByNameTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/ResolutionByTypeTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/UnsatisfiedDependencyTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
Log:
JBIDE-12417
https://issues.jboss.org/browse/JBIDE-12417
Replaced Set by Collection in local variables in tests wherever it is possible.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/DependentProjectTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/DependentProjectTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/DependentProjectTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -11,8 +11,8 @@
package org.jboss.tools.cdi.core.test;
import java.io.IOException;
+import java.util.Collection;
import java.util.Iterator;
-import java.util.Set;
import junit.framework.TestCase;
@@ -67,8 +67,8 @@
IKbProject kb2 = KbProjectFactory.getKbProject(project2, true);
((KbProject)kb2).store();
CDICoreNature cdi2 = CDICorePlugin.getCDI(project2, true);
- Set<CDICoreNature> dependsOn = cdi2.getCDIProjects();
- Set<CDICoreNature> usedBy = cdi2.getDependentProjects();
+ Collection<CDICoreNature> dependsOn = cdi2.getCDIProjects();
+ Collection<CDICoreNature> usedBy = cdi2.getDependentProjects();
assertEquals(1, dependsOn.size());
assertEquals(1, usedBy.size());
cdi2.reloadProjectDependencies();
@@ -127,7 +127,7 @@
private IProducer getProducer(String file) {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
- Set<IBean> beans = cdi2.getBeans(new Path("/CDITest2/src/test/Test1.java"));
+ Collection<IBean> beans = cdi2.getBeans(new Path("/CDITest2/src/test/Test1.java"));
IProducer producer = null;
for (IBean b: beans) {
if(b instanceof IProducer) {
@@ -150,7 +150,7 @@
public void testAlternativesInDependentProjects() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPointField f = getInjectionPointField(cdi2, "/src/cdi/test/alternative/case1/X.java", "a");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertEquals(1, bs.size());
assertEquals("A", bs.iterator().next().getBeanClass().getElementName());
}
@@ -166,7 +166,7 @@
public void testAlternativesInDependentProjects2() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPoint f = getInjectionPointField(cdi2, "/src/cdi/test/alternative/case2/X.java", "a");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertEquals(1, bs.size());
assertEquals("C", bs.iterator().next().getBeanClass().getElementName());
}
@@ -182,7 +182,7 @@
public void testAlternativesInDependentProjects3() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPoint f = getInjectionPointField(cdi2, "/src/cdi/test/alternative/case3/X.java", "a");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertEquals(1, bs.size());
assertEquals("B", bs.iterator().next().getBeanClass().getElementName());
}
@@ -198,7 +198,7 @@
public void testAlternativesInDependentProjects4_1() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPoint f = getInjectionPointField(cdi2, "/src/cdi/test/alternative/case4/X.java", "a");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertEquals(1, bs.size());
assertEquals("A", bs.iterator().next().getBeanClass().getElementName());
}
@@ -216,7 +216,7 @@
ICDIProject cdi1 = CDICorePlugin.getCDIProject(project1, true);
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPoint f = getInjectionPointField(cdi1, "/src/cdi/test/alternative/case4/Y.java", "b");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertEquals(1, bs.size());
assertEquals("B", bs.iterator().next().getBeanClass().getElementName());
}
@@ -232,7 +232,7 @@
public void testAlternativesInDependentProjects5() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPoint f = getInjectionPointField(cdi2, "/src/cdi/test/alternative/case5/X.java", "a");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertEquals(1, bs.size());
assertEquals("C", bs.iterator().next().getBeanClass().getElementName());
}
@@ -248,7 +248,7 @@
public void testAlternativesInDependentProjects6() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPoint f = getInjectionPointField(cdi2, "/src/cdi/test/alternative/case6/X.java", "a");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertEquals(2, bs.size());
}
@@ -263,7 +263,7 @@
public void testAlternativesInDependentProjects7() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPoint f = getInjectionPointField(cdi2, "/src/cdi/test/alternative/case7/X.java", "p");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertTrue(bs.isEmpty());
}
@@ -278,7 +278,7 @@
public void testAlternativesInDependentProjects8() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
IInjectionPoint f = getInjectionPointField(cdi2, "/src/cdi/test/alternative/case8/X.java", "p");
- Set<IBean> bs = cdi2.getBeans(true, f);
+ Collection<IBean> bs = cdi2.getBeans(true, f);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertTrue(b instanceof IProducerMethod);
@@ -286,7 +286,7 @@
public void testIndirectDependency() throws CoreException, IOException {
ICDIProject cdi3 = CDICorePlugin.getCDIProject(project3, true);
- Set<IBean> beans = cdi3.getBeans(new Path("/CDITest1/src/cdi/test/MyBean.java"));
+ Collection<IBean> beans = cdi3.getBeans(new Path("/CDITest1/src/cdi/test/MyBean.java"));
assertFalse(beans.isEmpty());
IQualifier q = cdi3.getQualifier("cdi.test.MyQualifier");
assertNotNull(q);
@@ -294,13 +294,13 @@
public void testInjectionOfTypeRepeatedInJarCopies() throws CoreException {
ICDIProject cdi2 = CDICorePlugin.getCDIProject(project2, true);
- Set<IBean> bs = cdi2.getBeans(new Path("/CDITest2/src/test/MyExampleInjection.java"));
+ Collection<IBean> bs = cdi2.getBeans(new Path("/CDITest2/src/test/MyExampleInjection.java"));
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
- Set<IInjectionPoint> ps = b.getInjectionPoints();
+ Collection<IInjectionPoint> ps = b.getInjectionPoints();
assertEquals(1, ps.size());
IInjectionPoint p = ps.iterator().next();
- Set<IBean> injected = cdi2.getBeans(false, p);
+ Collection<IBean> injected = cdi2.getBeans(false, p);
assertEquals(1, injected.size());
IBean i = injected.iterator().next();
assertTrue(i instanceof IProducerMethod);
@@ -350,12 +350,12 @@
IInjectionPoint point2 = getInjectionPointField(cdi2, "/src/test/BeanI.java", "i");
assertNotNull(point2);
- Set<IBean> bs2 = cdi2.getBeans(false, point2);
+ Collection<IBean> bs2 = cdi2.getBeans(false, point2);
assertEquals(1, bs2.size());
IInjectionPoint point3 = getInjectionPointField(cdi3, project2, "/src/test/BeanI.java", "i");
assertNotNull(point3);
- Set<IBean> bs3 = cdi3.getBeans(false, point3);
+ Collection<IBean> bs3 = cdi3.getBeans(false, point3);
assertEquals(1, bs3.size());
RemoveJarFromClasspathTest.replaceFile(project2, "/src/test/BeanI.changed", "/src/test/BeanI.java");
@@ -385,15 +385,15 @@
public void testFindObservedEvents() throws CoreException {
ICDIProject cdi1 = CDICorePlugin.getCDIProject(project1, true);
- Set<IBean> bs = cdi1.getBeans(new Path("/CDITest1/src/cdi/test/observers/CDIBeanTest.java"));
+ Collection<IBean> bs = cdi1.getBeans(new Path("/CDITest1/src/cdi/test/observers/CDIBeanTest.java"));
assertFalse(bs.isEmpty());
IBean b = bs.iterator().next();
assertTrue(b instanceof IClassBean);
IClassBean cb = (IClassBean)b;
- Set<IObserverMethod> ms = cb.getObserverMethods();
+ Collection<IObserverMethod> ms = cb.getObserverMethods();
assertEquals(1, ms.size());
IObserverMethod m = ms.iterator().next();
- Set<IInjectionPoint> ps = cdi1.findObservedEvents(m.getObservedParameters().iterator().next());
+ Collection<IInjectionPoint> ps = cdi1.findObservedEvents(m.getObservedParameters().iterator().next());
assertEquals(1, ps.size());
IInjectionPoint p = ps.iterator().next();
assertTrue(p.getDeclaringProject() == CDICorePlugin.getCDIProject(project2, true));
@@ -405,7 +405,7 @@
public void testNonrelevantInjectionPointAtResolvingObserverMethods() {
ICDIProject cdi1 = CDICorePlugin.getCDIProject(project1, true);
IInjectionPointField tamingEvent = getInjectionPointField(cdi1, "/src/cdi/test/observers/CDIBeanTest.java", "point");
- Set<IObserverMethod> observers = tamingEvent.getCDIProject().resolveObserverMethods(tamingEvent);
+ Collection<IObserverMethod> observers = tamingEvent.getCDIProject().resolveObserverMethods(tamingEvent);
assertTrue(observers.isEmpty());
}
@@ -430,14 +430,14 @@
public static IInjectionPointField getInjectionPointField(ICDIProject cdi, IProject project, String beanClassFilePath, String fieldName) {
IFile file = project.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();
if(b instanceof IProducer) it.remove();
}
assertEquals("Wrong number of the beans", 1, beans.size());
- Set<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
+ Collection<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
for (IInjectionPoint injectionPoint : injections) {
if(injectionPoint instanceof IInjectionPointField) {
IInjectionPointField field = (IInjectionPointField)injectionPoint;
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/TwoWebContentFoldersTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/TwoWebContentFoldersTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/TwoWebContentFoldersTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.core.test;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import junit.framework.TestCase;
@@ -42,7 +42,7 @@
public void testBeansXMLInDifferentWebContentFolders() throws CoreException, IOException {
ICDIProject cdi = CDICorePlugin.getCDIProject(project, true);
- Set<IBean> bs = cdi.getBeans("bean1", false);
+ Collection<IBean> bs = cdi.getBeans("bean1", false);
assertEquals(1, bs.size());
assertTrue(bs.iterator().next().isSelectedAlternative());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/TypeTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/TypeTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/TypeTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,8 +10,8 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test;
+import java.util.Collection;
import java.util.ConcurrentModificationException;
-import java.util.Set;
import junit.framework.TestCase;
@@ -73,7 +73,7 @@
@Override
public void run() {
- Set<IParametedType> types = t.getAllTypes();
+ Collection<IParametedType> types = t.getAllTypes();
size = types.size();
try {
for (IParametedType t1: types) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/AssignabilityOfRawAndParameterizedTypesTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/AssignabilityOfRawAndParameterizedTypesTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/AssignabilityOfRawAndParameterizedTypesTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
@@ -33,7 +33,7 @@
* @throws CoreException
*/
public void testAssignabilityToRawType() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.Dao");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.Dao");
assertEquals("Wrong number of the beans", 4, beans.size());
}
@@ -46,7 +46,7 @@
public void testAssignabilityOfParameterizedTypeWithActualTypesToParameterizedTypeWithActualTypes() throws CoreException {
IType type = EclipseJavaUtil.findType(EclipseUtil.getJavaProject(cdiProject.getNature().getProject()), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.MapProducer");
IParametedType parametedType = cdiProject.getNature().getTypeFactory().getParametedType(type, "QMap<QInteger;QInteger;>;");
- Set<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[0]);
+ Collection<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[0]);
assertEquals("Wrong number of the beans", 2, beans.size());
type = EclipseJavaUtil.findType(EclipseUtil.getJavaProject(cdiProject.getNature().getProject()), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.IntegerHashMap");
@@ -64,7 +64,7 @@
*/
public void testAssignabilityOfParameterizedTypeWithActualTypesToParameterizedTypeWithWildcards() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/InjectedBean.java", "map");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.IntegerHashMap");
}
@@ -81,7 +81,7 @@
*/
public void testAssignabilityOfParameterizedTypeWithTypeVariablesToParameterizedTypeWithWildcards() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/AssignabilityOfRawAndParameterizedTypes.java", "injection");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanTypes(beans.iterator().next(), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.Result", "java.lang.Object");
}
@@ -94,7 +94,7 @@
*/
public void testAssignabilityOfParameterizedTypeWithTypeVariablesToParameterizedTypeWithWildcards2() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/AssignabilityOfRawAndParameterizedTypes.java", "injection2");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanTypes(beans.iterator().next(), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.Result", "java.lang.Object");
}
@@ -107,7 +107,7 @@
*/
public void testAssignabilityOfParameterizedTypeWithTypeVariablesToParameterizedTypeWithActualTypes() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/AssignabilityOfRawAndParameterizedTypes.java", "injection3");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanTypes(beans.iterator().next(), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.Result", "java.lang.Object");
}
@@ -120,7 +120,7 @@
*/
public void testAssignabilityOfParameterizedTypeWithTypeVariablesToParameterizedTypeTypeVariable() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/AssignabilityOfRawAndParameterizedTypes.java", "injection4");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanTypes(beans.iterator().next(), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.parameterized.Result", "java.lang.Object");
}
@@ -131,7 +131,7 @@
//@Inject Set<String> s1;
//@Produces <X> HashSet<X> getSet()
IInjectionPointField injection = getInjectionPointField(cls, "s1");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
//@Inject Set<? extends Set<String>> s2;
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BeanDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BeanDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BeanDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,8 +10,8 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
+import java.util.Collection;
import java.util.List;
-import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.core.IType;
@@ -35,13 +35,13 @@
*/
public void testBeanTypesNonEmpty() throws JavaModelException {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/bean/RedSnapper.java");
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
assertEquals("There should be the only bean in org.jboss.jsr299.tck.tests.definition.bean.RedSnapper", 1, beans.size());
beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.definition.bean.RedSnapper");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.bean.RedSnapper type", 1, beans.size());
IBean bean = beans.iterator().next();
assertTrue("No legal types were found for org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", bean.getLegalTypes().size() > 0);
- Set<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
+ Collection<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
assertEquals("There should be two type declarations in org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", declarations.size(), 2);
assertLocationEquals(declarations, 936, 10);
assertLocationEquals(declarations, 958, 6);
@@ -55,9 +55,9 @@
* @throws JavaModelException
*/
public void testQualifiersNonEmpty() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.RedSnapper");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.RedSnapper");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.bean.RedSnapper type", 1, beans.size());
- Set<IQualifier> qs = beans.iterator().next().getQualifiers();
+ Collection<IQualifier> qs = beans.iterator().next().getQualifiers();
assertTrue("No qualifiers were found for org.jboss.jsr299.tck.tests.definition.bean.RedSnapper bean.", qs.size() > 0);
// Use for next, more sophisticated test
@@ -93,7 +93,7 @@
*
*/
public void testHasScopeType() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.RedSnapper");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.RedSnapper");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.bean.RedSnapper type", 1, beans.size());
IBean bean = beans.iterator().next();
IScope scope = bean.getScope();
@@ -109,7 +109,7 @@
* @throws JavaModelException
*/
public void testPrivitiveTypes() throws JavaModelException {
- Set<IBean> beans = getBeans("java.lang.Integer");
+ Collection<IBean> beans = getBeans("java.lang.Integer");
assertFalse("Cannot find bean java.lang.Integer", beans.isEmpty());
beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.Animal");
assertFalse("Cannot find bean org.jboss.jsr299.tck.tests.definition.bean.Animal", beans.isEmpty());
@@ -125,7 +125,7 @@
* section 11.1 ba)
*/
public void testBeanTypes() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.Tarantula");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.Tarantula");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.bean.Tarantula type", 1, beans.size());
IBean bean = beans.iterator().next();
assertContainsBeanTypes(bean, "org.jboss.jsr299.tck.tests.definition.bean.Tarantula",
@@ -135,7 +135,7 @@
"org.jboss.jsr299.tck.tests.definition.bean.DeadlySpider",
"org.jboss.jsr299.tck.tests.definition.bean.DeadlyAnimal");
- Set<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
+ Collection<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
assertEquals("There should be three type declarations in org.jboss.jsr299.tck.tests.definition.bean.Tarantula bean.", declarations.size(), 3);
assertLocationEquals(declarations, 859, 9);
assertLocationEquals(declarations, 877, 6);
@@ -148,7 +148,7 @@
* @throws JavaModelException
*/
public void testAbstractApiType() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.FriendlyAntelope");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.FriendlyAntelope");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.bean.FriendlyAntelope type", 1, beans.size());
IBean bean = beans.iterator().next();
assertContainsBeanTypes(bean, "org.jboss.jsr299.tck.tests.definition.bean.FriendlyAntelope",
@@ -156,7 +156,7 @@
"org.jboss.jsr299.tck.tests.definition.bean.Animal",
"java.lang.Object");
- Set<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
+ Collection<ITypeDeclaration> declarations = bean.getAllTypeDeclarations();
assertEquals("There should be three type declarations in org.jboss.jsr299.tck.tests.definition.bean.FriendlyAntelope bean.", declarations.size(), 2);
assertLocationEquals(declarations, 842, 16);
assertLocationEquals(declarations, 867, 16);
@@ -168,7 +168,7 @@
* @throws JavaModelException
*/
public void testFinalApiType() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.DependentFinalTuna");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.DependentFinalTuna");
assertFalse("No beans found for org.jboss.jsr299.tck.tests.definition.bean.DependentFinalTuna type", beans.isEmpty());
}
@@ -179,7 +179,7 @@
* @throws JavaModelException
*/
public void testMultipleStereotypes() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.ComplicatedTuna");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.ComplicatedTuna");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.bean.ComplicatedTuna type", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type of org.jboss.jsr299.tck.tests.definition.bean.ComplicatedTuna bean", "javax.enterprise.context.RequestScoped", bean.getScope().getSourceType().getFullyQualifiedName());
@@ -192,7 +192,7 @@
* @throws JavaModelException
*/
public void testBeanExtendsAnotherBean() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.Spider");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.Spider");
assertFalse("No beans found for org.jboss.jsr299.tck.tests.definition.bean.Spider type", beans.isEmpty());
beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.Tarantula");
assertFalse("No beans found for org.jboss.jsr299.tck.tests.definition.bean.Tarantula type", beans.isEmpty());
@@ -204,14 +204,14 @@
* @throws JavaModelException
*/
public void testBeanClassOnSimpleBean() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.Horse");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.Horse");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.bean.Horse type", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong Bean Class type of org.jboss.jsr299.tck.tests.definition.bean.Horse bean", "org.jboss.jsr299.tck.tests.definition.bean.Horse", bean.getBeanClass().getFullyQualifiedName());
}
public void testCyclicParametedType() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.AbstractJavaSource");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.bean.AbstractJavaSource");
assertFalse(beans.isEmpty());
IBean bean = beans.iterator().next();
IParametedType t = ((ClassBean)bean).getDefinition().getParametedType();
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BeanSpecializationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BeanSpecializationTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BeanSpecializationTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -27,7 +27,7 @@
* @throws JavaModelException
*/
public void testSimpleSpecializingBeanHasQualifiersOfSpecializedAndSpecializingBean() throws JavaModelException {
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.LazyFarmer", "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.Landowner");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.LazyFarmer", "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.Landowner");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertContainsBeanTypes(false, bean, "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.Farmer");
@@ -45,7 +45,7 @@
* @throws JavaModelException
*/
public void testEnterpriseSpecializingBeanHasQualifiersOfSpecializedAndSpecializingBean() throws JavaModelException {
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.LazyFarmerLocal", "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.Landowner");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.LazyFarmerLocal", "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.Landowner");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertContainsBeanTypes(false, bean, "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.FarmerLocal");
@@ -63,7 +63,7 @@
* @throws JavaModelException
*/
public void testSimpleSpecializingBeanHasNameOfSpecializedBean() throws JavaModelException {
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.LazyFarmer", "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.Landowner");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.LazyFarmer", "org.jboss.jsr299.tck.tests.inheritance.specialization.simple.Landowner");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Incorrect bean name", "farmer", bean.getName());
@@ -76,14 +76,14 @@
* @throws JavaModelException
*/
public void testEnterpriseSpecializingBeanHasNameOfSpecializedBean() throws JavaModelException {
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.LazyFarmerLocal", "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.Landowner");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.LazyFarmerLocal", "org.jboss.jsr299.tck.tests.inheritance.specialization.enterprise.Landowner");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Incorrect bean name", "farmer", bean.getName());
}
public void testSimpleSpecializingBeanDefinesNameWhenSpecializedBeanIsNotNamed() throws JavaModelException {
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.implementation.simple.lifecycle.TameLion", "org.jboss.jsr299.tck.tests.implementation.simple.lifecycle.Tame");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.implementation.simple.lifecycle.TameLion", "org.jboss.jsr299.tck.tests.implementation.simple.lifecycle.Tame");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Incorrect bean name", "tameLion", bean.getName());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BuiltInBeanInjectionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BuiltInBeanInjectionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/BuiltInBeanInjectionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,9 +10,8 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.CDIConstants;
@@ -35,7 +34,7 @@
IInjectionPointField field = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/implementation/builtin/UserTransactionInjectedBean.java", "userTransaction");
assertNotNull(field);
- Set<IBean> beans = field.getCDIProject().getBeans(false, field);
+ Collection<IBean> beans = field.getCDIProject().getBeans(false, field);
assertFalse(beans.isEmpty());
IBean b = beans.iterator().next();
@@ -51,7 +50,7 @@
IInjectionPointField field = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorFactoryInjectedBean.java", "defaultValidatorFactory");
assertNotNull(field);
- Set<IBean> beans = field.getCDIProject().getBeans(false, field);
+ Collection<IBean> beans = field.getCDIProject().getBeans(false, field);
assertFalse(beans.isEmpty());
IBean b = beans.iterator().next();
@@ -67,7 +66,7 @@
IInjectionPointField field = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/implementation/builtin/DefaultValidatorInjectedBean.java", "defaultValidator");
assertNotNull(field);
- Set<IBean> beans = field.getCDIProject().getBeans(false, field);
+ Collection<IBean> beans = field.getCDIProject().getBeans(false, field);
assertFalse(beans.isEmpty());
IBean b = beans.iterator().next();
@@ -83,7 +82,7 @@
IInjectionPointField field = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/implementation/builtin/PrincipalInjectedBean.java", "principal");
assertNotNull(field);
- Set<IBean> beans = field.getCDIProject().getBeans(false, field);
+ Collection<IBean> beans = field.getCDIProject().getBeans(false, field);
assertFalse(beans.isEmpty());
IBean b = beans.iterator().next();
@@ -99,7 +98,7 @@
IInjectionPointField field = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/context/conversation/BuiltInConversation.java", "manager");
assertNotNull(field);
- Set<IBean> beans = field.getCDIProject().getBeans(false, field);
+ Collection<IBean> beans = field.getCDIProject().getBeans(false, field);
assertFalse(beans.isEmpty());
IBean b = beans.iterator().next();
@@ -115,7 +114,7 @@
IInjectionPointField field = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/context/conversation/BuiltInConversation.java", "conversation");
assertNotNull(field);
- Set<IBean> beans = field.getCDIProject().getBeans(false, field);
+ Collection<IBean> beans = field.getCDIProject().getBeans(false, field);
assertFalse(beans.isEmpty());
IBean b = beans.iterator().next();
@@ -138,7 +137,7 @@
String c_active = "JavaSource/org/jboss/jsr299/tck/tests/jbt/builtin/ConversationImpl.changed";
String c_original = "JavaSource/org/jboss/jsr299/tck/tests/jbt/builtin/ConversationImpl.original";
- Set<IBean> beans = cdiProject.getBeans(CDIConstants.CONVERSATION_BEAN_NAME, false);
+ Collection<IBean> beans = cdiProject.getBeans(CDIConstants.CONVERSATION_BEAN_NAME, false);
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
assertTrue(b instanceof IClassBean);
@@ -169,7 +168,7 @@
IInjectionPointField field = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/BeanWithInjectionPointMetadata.java", "injectedMetadata");
assertNotNull(field);
- Set<IBean> beans = field.getCDIProject().getBeans(false, field);
+ Collection<IBean> beans = field.getCDIProject().getBeans(false, field);
assertFalse(beans.isEmpty());
IBean b = beans.iterator().next();
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/CDIUtilTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/CDIUtilTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/CDIUtilTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,13 +10,12 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
+import java.util.Collection;
import java.util.HashSet;
-import java.util.Set;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.ILocalVariable;
-import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.cdi.core.IBean;
@@ -36,7 +35,7 @@
*/
public void testMethodParameter() throws Exception {
IClassBean bean = getClassBean("org.jboss.jsr299.tck.tests.jbt.core.TestInjection", "JavaSource/org/jboss/jsr299/tck/tests/jbt/core/TestInjection.java");
- Set<IInjectionPoint> injections = bean.getInjectionPoints();
+ Collection<IInjectionPoint> injections = bean.getInjectionPoints();
assertEquals(9, injections.size());
for (IInjectionPoint injectionPoint : injections) {
IAnnotationDeclaration declaration = CDIUtil.getAnnotationDeclaration(injectionPoint, "org.jboss.jsr299.tck.tests.jbt.core.TestQualifier");
@@ -58,8 +57,8 @@
public void testFindInjectionPoint() throws Exception {
String path = "JavaSource/org/jboss/jsr299/tck/tests/jbt/core/TestInjection2.java";
IClassBean bean = getClassBean("org.jboss.jsr299.tck.tests.jbt.core.TestInjection2", path);
- Set<IBean> bs = cdiProject.getBeans(new Path("/tck/" + path));
- Set<IInjectionPointParameter> ps = CDIUtil.getInjectionPointParameters(bean);
+ Collection<IBean> bs = cdiProject.getBeans(new Path("/tck/" + path));
+ Collection<IInjectionPointParameter> ps = CDIUtil.getInjectionPointParameters(bean);
assertEquals("Unexpected number of injection points.", 10, ps.size());
int testcount = 0;
for (IInjectionPointParameter p: ps) {
@@ -88,8 +87,8 @@
public void testFindInjectionPoint2() throws Exception {
String path = "JavaSource/org/jboss/jsr299/tck/tests/jbt/core/TestInjection2.java";
- Set<IBean> bs = cdiProject.getBeans(new Path("/tck/" + path));
- Set<IInjectionPoint> ps = new HashSet<IInjectionPoint>();
+ Collection<IBean> bs = cdiProject.getBeans(new Path("/tck/" + path));
+ Collection<IInjectionPoint> ps = new HashSet<IInjectionPoint>();
for (IBean b: bs) {
ps.addAll(b.getInjectionPoints());
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/CoreTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/CoreTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/CoreTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IBeanField;
@@ -32,12 +32,12 @@
assertTrue(beans.length>0);
for (IBean bean : beans) {
assertElementName(bean);
- Set<IParametedType> types = bean.getAllTypes();
+ Collection<IParametedType> types = bean.getAllTypes();
for (IParametedType type : types) {
String name = type.getSimpleName();
assertNotNull(name);
}
- Set<IInjectionPoint> points = bean.getInjectionPoints();
+ Collection<IInjectionPoint> points = bean.getInjectionPoints();
for (IInjectionPoint point : points) {
assertElementName(point);
if(point.getType()!=null) {
@@ -45,7 +45,7 @@
}
}
if(bean instanceof IClassBean) {
- Set<IBeanMethod> methods = ((IClassBean)bean).getAllMethods();
+ Collection<IBeanMethod> methods = ((IClassBean)bean).getAllMethods();
for (IBeanMethod method : methods) {
assertElementName(method);
}
@@ -60,7 +60,7 @@
public void testFieldName() throws Exception {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/jbt/core/NamedElement.java");
- Set<IProducer> producers = bean.getProducers();
+ Collection<IProducer> producers = bean.getProducers();
assertEquals(2, producers.size());
boolean found = false;
for (IProducer producer : producers) {
@@ -75,7 +75,7 @@
public void testMethodName() throws Exception {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/jbt/core/NamedElement.java");
- Set<IProducer> producers = bean.getProducers();
+ Collection<IProducer> producers = bean.getProducers();
boolean found = false;
for (IProducer producer : producers) {
if(producer instanceof IBeanMethod) {
@@ -89,7 +89,7 @@
public void testParamName() throws Exception {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/jbt/core/NamedElement.java");
- Set<IInjectionPoint> injections = bean.getInjectionPoints();
+ Collection<IInjectionPoint> injections = bean.getInjectionPoints();
assertEquals(1, injections.size());
assertEquals("arg1", injections.iterator().next().getElementName());
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DecoratorDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -41,7 +41,7 @@
*/
public void testDecoratedTypes() throws JavaModelException, CoreException {
IDecorator decorator = getDecorator("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
- Set<IParametedType> types = decorator.getDecoratedTypes();
+ Collection<IParametedType> types = decorator.getDecoratedTypes();
assertContainsTypes(types,
"org.jboss.jsr299.tck.tests.decorators.definition.Foo",
"org.jboss.jsr299.tck.tests.decorators.definition.Bar",
@@ -93,7 +93,7 @@
/*
* Invocation getBeans(false, f) returns all beans that match type and qualifiers.
*/
- Set<IBean> bs = cdiProject.getBeans(false, f);
+ Collection<IBean> bs = cdiProject.getBeans(false, f);
assertEquals(1, bs.size());
assertTrue(bs.iterator().next() instanceof IDecorator);
/*
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -27,7 +27,7 @@
* @throws JavaModelException
*/
public void testStereotypeWithEmptyNamed() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed.FallowDeer");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed.FallowDeer");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong EL name.", "fallowDeer", bean.getName());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseQualifierDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseQualifierDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseQualifierDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.JavaModelException;
@@ -31,10 +31,10 @@
public void testQualifierDeclaredInheritedIsInherited() throws CoreException {
IQualifierDeclaration hairy = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/enterprise/LongHairedDog.java", "org.jboss.jsr299.tck.tests.definition.qualifier.enterprise.Hairy");
IParametedType type = getType("org.jboss.jsr299.tck.tests.definition.qualifier.enterprise.BorderCollieLocal");
- Set<IBean> beans = cdiProject.getBeans(true, type, hairy);
+ Collection<IBean> beans = cdiProject.getBeans(true, type, hairy);
// assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers.", 2, qualifiers.size());
assertContainsQualifier(bean, hairy);
assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
@@ -47,7 +47,7 @@
public void testQualifierNotDeclaredInheritedIsNotInherited() throws JavaModelException {
IQualifierDeclaration skinny = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCat.java", "org.jboss.jsr299.tck.tests.definition.qualifier.enterprise.Skinny");
IParametedType type = getType("org.jboss.jsr299.tck.tests.definition.qualifier.enterprise.TameSkinnyHairlessCatLocal");
- Set<IBean> beans = cdiProject.getBeans(true, type, skinny);
+ Collection<IBean> beans = cdiProject.getBeans(true, type, skinny);
assertTrue("Wrong number of beans.", beans.isEmpty());
}
@@ -58,10 +58,10 @@
public void testQualifierDeclaredInheritedIsIndirectlyInherited() throws CoreException {
IQualifierDeclaration hairy = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/enterprise/LongHairedDog.java", "org.jboss.jsr299.tck.tests.definition.qualifier.enterprise.Hairy");
IParametedType type = getType("org.jboss.jsr299.tck.tests.definition.qualifier.enterprise.EnglishBorderCollieLocal");
- Set<IBean> beans = cdiProject.getBeans(true, type, hairy);
+ Collection<IBean> beans = cdiProject.getBeans(true, type, hairy);
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers.", 2, qualifiers.size());
assertContainsQualifier(bean, hairy);
assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
@@ -74,7 +74,7 @@
public void testQualifierNotDeclaredInheritedIsNotIndirectlyInherited() throws JavaModelException {
IQualifierDeclaration skinny = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/enterprise/SkinnyHairlessCat.java", "org.jboss.jsr299.tck.tests.definition.qualifier.enterprise.Skinny");
IParametedType type = getType("org.jboss.jsr299.tck.tests.definition.qualifier.enterprise.FamousCatLocal");
- Set<IBean> beans = cdiProject.getBeans(true, type, skinny);
+ Collection<IBean> beans = cdiProject.getBeans(true, type, skinny);
assertTrue("Wrong number of beans.", beans.isEmpty());
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseResolutionByTypeTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseResolutionByTypeTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseResolutionByTypeTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.IBean;
@@ -27,7 +27,7 @@
* @throws CoreException
*/
public void testBeanTypesOnSessionBean() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.CapercaillieLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.CapercaillieLocal");
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanTypes(beans.iterator().next(), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.CapercaillieLocal", "java.lang.Object");
beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.ScottishBirdLocal");
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseScopeDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -27,7 +27,7 @@
*/
public void testScopeTypeDeclaredInheritedIsInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.BorderCollieLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.BorderCollieLocal");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -41,7 +41,7 @@
*/
public void testScopeTypeNotDeclaredInheritedIsNotInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.SiameseLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.SiameseLocal");
IBean bean = beans.iterator().next();
assertFalse("Wrong scope type",
"org.jboss.jsr299.tck.tests.definition.scope.enterprise.FooScoped"
@@ -56,7 +56,7 @@
*/
public void testScopeTypeDeclaredInheritedIsIndirectlyInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.EnglishBorderCollieLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.EnglishBorderCollieLocal");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -70,7 +70,7 @@
*/
public void testScopeTypeNotDeclaredInheritedIsNotIndirectlyInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.BengalTigerLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.enterprise.BengalTigerLocal");
IBean bean = beans.iterator().next();
assertFalse("Wrong scope type",
"org.jboss.jsr299.tck.tests.definition.scope.enterprise.FooScoped"
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -28,7 +28,7 @@
*/
public void testStereotypeDeclaredInheritedIsInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.BorderCollieLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.BorderCollieLocal");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -42,7 +42,7 @@
*/
public void testStereotypeNotDeclaredInheritedIsNotInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.BarracudaLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.BarracudaLocal");
IBean bean = beans.iterator().next();
assertFalse("Wrong scope type",
"javax.enterprise.context.RequestScoped".equals(bean.getScope()
@@ -56,7 +56,7 @@
*/
public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.EnglishBorderCollieLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.EnglishBorderCollieLocal");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -70,7 +70,7 @@
*/
public void testStereotypeNotDeclaredInheritedIsNotIndirectlyInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.TameBarracudaLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.TameBarracudaLocal");
IBean bean = beans.iterator().next();
assertFalse("Wrong scope type",
"javax.enterprise.context.RequestScoped".equals(bean.getScope()
@@ -84,7 +84,7 @@
*/
public void testStereotypeScopeIsOverriddenByInheritedScope()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.ChihuahuaLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.ChihuahuaLocal");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.SessionScoped", bean.getScope()
@@ -98,7 +98,7 @@
*/
public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.MexicanChihuahuaLocal");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.MexicanChihuahuaLocal");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.SessionScoped", bean.getScope()
@@ -106,10 +106,10 @@
}
public void testAdditionalStereotype() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed.Sambar");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed.Sambar");
IBean bean = beans.iterator().next();
assertEquals("sambar", bean.getName());
- Set<IStereotypeDeclaration> s = bean.getStereotypeDeclarations();
+ Collection<IStereotypeDeclaration> s = bean.getStereotypeDeclarations();
assertEquals(2, s.size());
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InjectionPointTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InjectionPointTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InjectionPointTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,16 +10,13 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.List;
-import java.util.Set;
+import java.util.Collection;
import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInjectionPointParameter;
-import org.jboss.tools.cdi.core.IQualifierDeclaration;
-import org.jboss.tools.common.java.IAnnotationDeclaration;
import org.jboss.tools.common.java.IParametedType;
/**
@@ -33,7 +30,7 @@
*/
public void testQualifierTypeAnnotatedConstructor() {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Duck.java");
- Set<IInjectionPointParameter> points = CDIUtil.getInjectionPointParameters(bean);
+ Collection<IInjectionPointParameter> points = CDIUtil.getInjectionPointParameters(bean);
assertEquals("There should be two injection point parameters in the bean.", 2, points.size());
}
@@ -43,7 +40,7 @@
*/
public void testBindingTypeOnInitializerParameter() {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java");
- Set<IInjectionPointParameter> points = CDIUtil.getInjectionPointParameters(bean);
+ Collection<IInjectionPointParameter> points = CDIUtil.getInjectionPointParameters(bean);
assertEquals("There should be two injection point parameters in the bean.", 1, points.size());
}
@@ -51,7 +48,7 @@
public void testMethodParameter() {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/FarmBroken.java");
assertNotNull("Can't find the bean.", bean);
- Set<IInjectionPoint> injections = bean.getInjectionPoints();
+ Collection<IInjectionPoint> injections = bean.getInjectionPoints();
for (IInjectionPoint injectionPoint : injections) {
if(injectionPoint instanceof IInjectionPointParameter) {
IInjectionPointParameter param = (IInjectionPointParameter)injectionPoint;
@@ -65,19 +62,19 @@
public void testObserverMethodParameters() {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/AnimalObserver.java");
assertNotNull("Can't find the bean.", bean);
- Set<IInjectionPoint> injections = bean.getInjectionPoints();
+ Collection<IInjectionPoint> injections = bean.getInjectionPoints();
assertEquals(1, injections.size());
}
public void testDisposerMethodParameters() {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/DisposerOk.java");
assertNotNull("Can't find the bean.", bean);
- Set<IInjectionPoint> injections = bean.getInjectionPoints();
+ Collection<IInjectionPoint> injections = bean.getInjectionPoints();
assertEquals(2, injections.size());
}
public void testGetInjections() {
- Set<IInjectionPoint> ps = cdiProject.getInjections("org.jboss.jsr299.tck.tests.lookup.injection.Fox");
+ Collection<IInjectionPoint> ps = cdiProject.getInjections("org.jboss.jsr299.tck.tests.lookup.injection.Fox");
assertTrue(!ps.isEmpty());
ps = cdiProject.getInjections("org.jboss.jsr299.tck.tests.context.dependent.Tarantula");
@@ -87,7 +84,7 @@
public void testParameterInjectionsWithQualifierWithMemberValues() {
IInjectionPointParameter injectionPoint = getInjectionPointParameter("JavaSource/org/jboss/jsr299/tck/tests/lookup/injection/NamedParameters.java", "setA");
assertNotNull(injectionPoint);
- Set<IBean> resolved = cdiProject.getBeans(false, injectionPoint);
+ Collection<IBean> resolved = cdiProject.getBeans(false, injectionPoint);
assertTrue(resolved.isEmpty());
injectionPoint = getInjectionPointParameter("JavaSource/org/jboss/jsr299/tck/tests/lookup/injection/NamedParameters.java", "setABC");
@@ -99,7 +96,7 @@
public void testDefaultValuesInQualifierProperties() {
IInjectionPoint injectionPoint = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/lookup/qualifier/MyBean.java", "i");
assertNotNull(injectionPoint);
- Set<IBean> resolved = cdiProject.getBeans(false, injectionPoint);
+ Collection<IBean> resolved = cdiProject.getBeans(false, injectionPoint);
assertFalse(resolved.isEmpty());
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InjectionPointWithNewQualifierTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InjectionPointWithNewQualifierTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InjectionPointWithNewQualifierTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDIConstants;
@@ -27,14 +27,14 @@
public void testNewHashSetParameter() throws CoreException {
IInjectionPointParameter injection = getInjectionPointParameter("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Dragon.java", "initialize");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "java.util.HashSet");
}
public void testNewArrayListField() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/Griffin.java", "list");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "java.util.ArrayList");
IBean b = beans.iterator().next();
@@ -43,7 +43,7 @@
public void testNewCustomBeanField() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewLionConsumer.java", "lion");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.implementation.simple.newSimpleBean.Lion");
IBean b = beans.iterator().next();
@@ -52,7 +52,7 @@
//Check that new bean has exactly one qualifier - @New.
IQualifierDeclaration d = b.getQualifierDeclarations().iterator().next();
assertEquals(CDIConstants.NEW_QUALIFIER_TYPE_NAME, d.getType().getFullyQualifiedName());
- Set<IQualifier> qs = b.getQualifiers();
+ Collection<IQualifier> qs = b.getQualifiers();
assertEquals(1, qs.size());
IQualifier q = qs.iterator().next();
assertEquals(CDIConstants.NEW_QUALIFIER_TYPE_NAME, q.getSourceType().getFullyQualifiedName());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/InterceptorDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -35,7 +36,7 @@
* @throws JavaModelException
*/
public void testStereotypeInterceptorBindings() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.interceptors.definition.SecureTransaction");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.interceptors.definition.SecureTransaction");
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
assertTrue("The bean should be an interceptor", bean instanceof IClassBean);
@@ -56,16 +57,16 @@
//Y inherits X indirectly through Q.
//X declares inheritable BindingA and BindingC and non-inheritable BindingB
//Q overrides declaring BindingC with another value.
- Set<IBean> beans = getBeans(false, "org.jboss.jsr299.tck.tests.interceptors.definition.inheritance.Y");
+ Collection<IBean> beans = getBeans(false, "org.jboss.jsr299.tck.tests.interceptors.definition.inheritance.Y");
assertEquals("Wrong number of the beans", 1, beans.size());
IClassBean bean = (IClassBean)beans.iterator().next();
- Set<IInterceptorBinding> bs = bean.getInterceptorBindings();
+ Collection<IInterceptorBinding> bs = bean.getInterceptorBindings();
assertEquals("Wrong number of interceptor bindings", 2, bs.size());
assertContainsBindings(bs, "org.jboss.jsr299.tck.tests.interceptors.definition.inheritance.BindingA", "org.jboss.jsr299.tck.tests.interceptors.definition.inheritance.BindingC");
assertNotContainsBindings(bs, "tck.tests.interceptors.definition.inheritance.BindingB");
- Set<IInterceptorBindingDeclaration> ds = bean.getInterceptorBindingDeclarations(true);
+ Collection<IInterceptorBindingDeclaration> ds = bean.getInterceptorBindingDeclarations(true);
assertEquals("Wrong number of interceptor binding declarations", 2, ds.size());
assertContainsBindingDeclarationWithValue(ds, "org.jboss.jsr299.tck.tests.interceptors.definition.inheritance.BindingC", "c2");
@@ -90,7 +91,7 @@
IInterceptorBinding b = cdiProject.getInterceptorBinding("org.jboss.jsr299.tck.tests.jbt.validation.interceptors.StereotypeAndBinding");
assertNotNull(b);
- Set<IBean> beans = getBeans(false, "org.jboss.jsr299.tck.tests.jbt.validation.interceptors.InterceptorWithStereotypeThatIsBinding");
+ Collection<IBean> beans = getBeans(false, "org.jboss.jsr299.tck.tests.jbt.validation.interceptors.InterceptorWithStereotypeThatIsBinding");
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
assertTrue("The bean should be an interceptor", bean instanceof IClassBean);
@@ -103,7 +104,7 @@
/*
* Invocation getBeans(false, f) returns all beans that match type and qualifiers.
*/
- Set<IBean> bs = cdiProject.getBeans(false, f);
+ Collection<IBean> bs = cdiProject.getBeans(false, f);
assertEquals(1, bs.size());
assertTrue(bs.iterator().next() instanceof IInterceptor);
/*
@@ -113,7 +114,7 @@
assertTrue(bs.isEmpty());
}
- void assertContainsBindings(Set<IInterceptorBinding> bs, String... classNames) {
+ void assertContainsBindings(Collection<IInterceptorBinding> bs, String... classNames) {
Set<String> bsn = new HashSet<String>();
for (IInterceptorBinding b: bs) {
bsn.add(b.getSourceType().getFullyQualifiedName());
@@ -123,8 +124,8 @@
}
}
- void assertNotContainsBindings(Set<IInterceptorBinding> bs, String... classNames) {
- Set<String> bsn = new HashSet<String>();
+ void assertNotContainsBindings(Collection<IInterceptorBinding> bs, String... classNames) {
+ Collection<String> bsn = new HashSet<String>();
for (IInterceptorBinding b: bs) {
bsn.add(b.getSourceType().getFullyQualifiedName());
}
@@ -133,7 +134,7 @@
}
}
- void assertContainsBindingDeclarationWithValue(Set<IInterceptorBindingDeclaration> bs, String className, String value) throws JavaModelException {
+ void assertContainsBindingDeclarationWithValue(Collection<IInterceptorBindingDeclaration> bs, String className, String value) throws JavaModelException {
for (IInterceptorBindingDeclaration b: bs) {
if(className.equals(b.getInterceptorBinding().getSourceType().getFullyQualifiedName())) {
IMemberValuePair[] ps = b.getMemberValuePairs();
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NameDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NameDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NameDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -28,8 +28,8 @@
*/
public void testNonDefaultNamed() throws JavaModelException {
// IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/name/Moose.java");
-// Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.Moose");
+// Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.Moose");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.name.Moose type.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong EL name of org.jboss.jsr299.tck.tests.definition.name.Moose bean.", "aMoose", bean.getName());
@@ -44,7 +44,7 @@
* @throws JavaModelException
*/
public void testDefaultNamed() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.Haddock");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.Haddock");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.name.Haddock type.", 1, beans.size());
IBean bean = beans.iterator().next();
assertNotNull("org.jboss.jsr299.tck.tests.definition.name.Haddock bean should have an EL name.", bean.getName());
@@ -58,7 +58,7 @@
* @throws JavaModelException
*/
public void testStereotypeDefaultsName() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.RedSnapper");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.RedSnapper");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.name.RedSnapper type.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong EL name of org.jboss.jsr299.tck.tests.definition.name.RedSnapper bean.", "redSnapper", bean.getName());
@@ -71,7 +71,7 @@
* @throws JavaModelException
*/
public void testNotNamedInJava() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.SeaBass");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.SeaBass");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.name.SeaBass type.", 1, beans.size());
IBean bean = beans.iterator().next();
assertNull("org.jboss.jsr299.tck.tests.definition.name.SeaBass bean should not have any EL name.", bean.getName());
@@ -83,7 +83,7 @@
* @throws JavaModelException
*/
public void testNotNamedInStereotype() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.Minnow");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.name.Minnow");
assertEquals("There should be the only bean with org.jboss.jsr299.tck.tests.definition.name.Minnow type.", 1, beans.size());
IBean bean = beans.iterator().next();
assertNull("org.jboss.jsr299.tck.tests.definition.name.Minnow bean should not have any EL name.", bean.getName());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NamedBeanRefactoringTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NamedBeanRefactoringTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NamedBeanRefactoringTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.core.test.tck;
import java.util.ArrayList;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -119,7 +119,7 @@
assertNotNull("Can't get CDI project.", cdiProject);
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
for (IBean bean : beans) {
if (bean.getName() != null && name.equals(bean.getName())) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ObserverMethodResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ObserverMethodResolutionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ObserverMethodResolutionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.core.IMethod;
@@ -31,7 +31,7 @@
public void testNonrelevantInjectionPoint() {
IInjectionPointField tamingEvent = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java", "tamingCommand");
- Set<IObserverMethod> observers = tamingEvent.getCDIProject().resolveObserverMethods(tamingEvent);
+ Collection<IObserverMethod> observers = tamingEvent.getCDIProject().resolveObserverMethods(tamingEvent);
assertTrue(observers.isEmpty());
}
@@ -42,7 +42,7 @@
IInjectionPointField generalEvent = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java", "generalEvent");
assertNotNull(generalEvent);
- Set<IObserverMethod> observers = generalEvent.getCDIProject().resolveObserverMethods(generalEvent);
+ Collection<IObserverMethod> observers = generalEvent.getCDIProject().resolveObserverMethods(generalEvent);
IObserverMethod tamedObserver = null;
IObserverMethod recognizedFriendObserver = null;
for (IObserverMethod m: observers) {
@@ -61,7 +61,7 @@
IInjectionPointField tamingEvent = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java", "tamingEvent");
assertNotNull(tamingEvent);
- Set<IObserverMethod> observers = tamingEvent.getCDIProject().resolveObserverMethods(tamingEvent);
+ Collection<IObserverMethod> observers = tamingEvent.getCDIProject().resolveObserverMethods(tamingEvent);
assertFalse(observers.isEmpty());
IObserverMethod tamedObserver = null;
@@ -77,13 +77,13 @@
assertNotNull(tamedObserver);
assertNull(recognizedFriendObserver);
- Set<IParameter> p = tamedObserver.getObservedParameters();
+ Collection<IParameter> p = tamedObserver.getObservedParameters();
assertTrue(p.size() == 1);
IParameter observerParameter = p.iterator().next();
assertFalse(observerParameter instanceof IInjectionPointParameter);
- Set<IInjectionPoint> points = tamedObserver.getClassBean().getCDIProject().findObservedEvents(observerParameter);
+ Collection<IInjectionPoint> points = tamedObserver.getClassBean().getCDIProject().findObservedEvents(observerParameter);
assertTrue(points.size() == 1);
assertTrue(points.contains(tamingEvent));
}
@@ -92,7 +92,7 @@
IInjectionPointField solicitingEvent = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java", "solicitingEvent");
assertNotNull(solicitingEvent);
- Set<IObserverMethod> observers = solicitingEvent.getCDIProject().resolveObserverMethods(solicitingEvent);
+ Collection<IObserverMethod> observers = solicitingEvent.getCDIProject().resolveObserverMethods(solicitingEvent);
IObserverMethod tamedObserver = null;
IObserverMethod recognizedFriendObserver = null;
@@ -116,7 +116,7 @@
IInjectionPointField friendlyEvent = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java", "friendlyEvent");
assertNotNull(friendlyEvent);
- Set<IObserverMethod> observers = friendlyEvent.getCDIProject().resolveObserverMethods(friendlyEvent);
+ Collection<IObserverMethod> observers = friendlyEvent.getCDIProject().resolveObserverMethods(friendlyEvent);
assertFalse(observers.isEmpty());
IObserverMethod tamedObserver = null;
@@ -132,20 +132,20 @@
assertNull(tamedObserver);
assertNotNull(recognizedFriendObserver);
- Set<IParameter> p = recognizedFriendObserver.getObservedParameters();
+ Collection<IParameter> p = recognizedFriendObserver.getObservedParameters();
assertTrue(p.size() == 1);
IParameter observerParameter = p.iterator().next();
assertFalse(observerParameter instanceof IInjectionPointParameter);
- Set<IInjectionPoint> points = recognizedFriendObserver.getClassBean().getCDIProject().findObservedEvents(observerParameter);
+ Collection<IInjectionPoint> points = recognizedFriendObserver.getClassBean().getCDIProject().findObservedEvents(observerParameter);
assertTrue(points.size() == 1);
assertTrue(points.contains(friendlyEvent));
}
public void testResolveObserverMethod() {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java");
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
IClassBean cb = null;
for (IBean b: beans) {
if(b instanceof IClassBean) {
@@ -153,7 +153,7 @@
}
}
assertNotNull(cb);
- Set<IInitializerMethod> ps = cb.getInitializers();
+ Collection<IInitializerMethod> ps = cb.getInitializers();
IInitializerMethod mp = ps.isEmpty() ? null : ps.iterator().next();
assertNotNull(mp);
assertEquals("foo", mp.getMethod().getElementName());
@@ -166,11 +166,11 @@
IInjectionPointField tamingEvent = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/event/fires/DogWhisperer.java", "tamingEvent");
assertNotNull(tamingEvent);
- Set<IBean> beans = tamingEvent.getCDIProject().getBeans(false, tamingEvent);
+ Collection<IBean> beans = tamingEvent.getCDIProject().getBeans(false, tamingEvent);
assertFalse(beans.isEmpty());
IBean b = beans.iterator().next();
- Set<IQualifier> qs = b.getQualifiers();
+ Collection<IQualifier> qs = b.getQualifiers();
assertEquals(3, qs.size());
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ProducerMethodDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ProducerMethodDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ProducerMethodDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,8 +10,8 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
+import java.util.Collection;
import java.util.List;
-import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.core.JavaModelException;
@@ -32,9 +32,9 @@
* @throws JavaModelException
*/
public void testBindingTypesAppliedToProducerMethodParameters() throws JavaModelException {
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.implementation.producer.method.definition.Tarantula", "org.jboss.jsr299.tck.tests.implementation.producer.method.definition.Deadliest");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.implementation.producer.method.definition.Tarantula", "org.jboss.jsr299.tck.tests.implementation.producer.method.definition.Deadliest");
IBean bean = beans.iterator().next();
- Set<IInjectionPoint> injections = bean.getInjectionPoints();
+ Collection<IInjectionPoint> injections = bean.getInjectionPoints();
assertEquals("Wrong number of injection points in the producer.", 2, injections.size());
// TODO use real location for injection points.
assertLocationEquals(injections, 1287, 29);
@@ -45,7 +45,7 @@
public void testParameterDefinition() {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/SpiderProducer.java");
- Set<IBean> bs = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> bs = cdiProject.getBeans(file.getFullPath());
IProducerMethod producer = null;
for (IBean bean: bs) {
if(bean instanceof IProducerMethod) {
@@ -64,7 +64,7 @@
public void testParameterDefinitionOnBrokenMethod() {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/SpiderProducer_Broken.java");
- Set<IBean> bs = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> bs = cdiProject.getBeans(file.getFullPath());
IProducerMethod producer = null;
for (IBean bean: bs) {
if(bean instanceof IProducerMethod) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IType;
@@ -34,10 +34,10 @@
* @throws JavaModelException
*/
public void testDefaultQualifierDeclaredInJava() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.Order");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.Order");
assertEquals("Wrong number of beans with org.jboss.jsr299.tck.tests.definition.qualifier.Order type.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers for org.jboss.jsr299.tck.tests.definition.qualifier.Order type.", 2, qualifiers.size());
assertContainsQualifierType(bean, "javax.enterprise.inject.Default");
assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
@@ -49,12 +49,12 @@
* @throws JavaModelException
*/
public void testDefaultQualifierForInjectionPoint() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.Order");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.Order");
assertEquals("Wrong number of beans with org.jboss.jsr299.tck.tests.definition.qualifier.Order type.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IInjectionPoint> points = bean.getInjectionPoints();
+ Collection<IInjectionPoint> points = bean.getInjectionPoints();
IInjectionPoint point = points.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
// TODO do we need to care about default qualifiers for InjectionPoint in CDI Tools?
// assertContainsQualifierType(point, "javax.enterprise.inject.Default");
}
@@ -70,7 +70,7 @@
* section 2.3.2 ba)
*/
public void testQualifierDeclaresBindingAnnotation() {
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.definition.qualifier.Tarantula", "org.jboss.jsr299.tck.tests.definition.qualifier.Tame");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.definition.qualifier.Tarantula", "org.jboss.jsr299.tck.tests.definition.qualifier.Tame");
assertFalse("Wrong number of beans with org.jboss.jsr299.tck.tests.definition.qualifier.Tarantula type and org.jboss.jsr299.tck.tests.definition.qualifier.Tame qualifier.", beans.isEmpty());
}
@@ -81,13 +81,13 @@
*/
public void testQualifiersDeclaredInJava() throws CoreException {
IQualifierDeclaration synchronous = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/Cat.java", "org.jboss.jsr299.tck.tests.definition.qualifier.Synchronous");
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.definition.qualifier.Cat", "org.jboss.jsr299.tck.tests.definition.qualifier.Synchronous");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.definition.qualifier.Cat", "org.jboss.jsr299.tck.tests.definition.qualifier.Synchronous");
assertEquals("Wrong number of beans with org.jboss.jsr299.tck.tests.definition.qualifier.Cat type and org.jboss.jsr299.tck.tests.definition.qualifier.Synchronous qualifier.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers.", 2, qualifiers.size());
assertContainsQualifier(bean, synchronous);
- Set<IQualifierDeclaration> declarations = bean.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> declarations = bean.getQualifierDeclarations();
assertEquals("Wrong number of qualifier declarations.", 1, declarations.size());
// TODO use correct start position instead of 0.
assertLocationEquals(declarations, 856, 12);
@@ -101,12 +101,12 @@
IQualifierDeclaration chunky = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/Cod.java", "org.jboss.jsr299.tck.tests.definition.qualifier.Chunky");
IQualifierDeclaration whitefish = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/Cod.java", "org.jboss.jsr299.tck.tests.definition.qualifier.Whitefish");
IParametedType type = getType("org.jboss.jsr299.tck.tests.definition.qualifier.Cod");
- Set<IBean> beans = cdiProject.getBeans(true, type, chunky, whitefish);
+ Collection<IBean> beans = cdiProject.getBeans(true, type, chunky, whitefish);
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers.", 4, qualifiers.size());
- Set<IQualifierDeclaration> declarations = bean.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> declarations = bean.getQualifierDeclarations();
assertEquals("Wrong number of qualifier declarations.", 3, declarations.size());
assertLocationEquals(declarations, 882, 10);
assertLocationEquals(declarations, 894, 24);
@@ -117,16 +117,16 @@
* @throws JavaModelException
*/
public void testFieldInjectedFromProducerMethod() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.Barn");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.Barn");
assertEquals("Wrong number of beans with org.jboss.jsr299.tck.tests.definition.qualifier.Barn type.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IInjectionPoint> points = bean.getInjectionPoints();
+ Collection<IInjectionPoint> points = bean.getInjectionPoints();
IInjectionPoint point = points.iterator().next();
- Set<IQualifierDeclaration> declarations = point.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> declarations = point.getQualifierDeclarations();
assertEquals("Wrong number of qualifier declarations.", 1, declarations.size());
assertLocationEquals(declarations, 914, 5);
- Set<IBean> injectedBeans = cdiProject.getBeans(true, point);
+ Collection<IBean> injectedBeans = cdiProject.getBeans(true, point);
assertEquals("Wrong number of beans.", 1, injectedBeans.size());
IBean injectedBean = injectedBeans.iterator().next();
IType beanClass = injectedBean.getBeanClass();
@@ -146,10 +146,10 @@
public void testQualifierDeclaredInheritedIsInherited() throws CoreException {
IQualifierDeclaration hairy = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/LongHairedDog.java", "org.jboss.jsr299.tck.tests.definition.qualifier.Hairy");
IParametedType type = getType("org.jboss.jsr299.tck.tests.definition.qualifier.BorderCollie");
- Set<IBean> beans = cdiProject.getBeans(true, type, hairy);
+ Collection<IBean> beans = cdiProject.getBeans(true, type, hairy);
assertFalse("Wrong number of beans.", beans.isEmpty());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers for org.jboss.jsr299.tck.tests.definition.qualifier.BorderCollie type.", 2, qualifiers.size());
assertContainsQualifier(bean, hairy);
assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
@@ -160,10 +160,10 @@
* @throws JavaModelException
*/
public void testQualifierNotDeclaredInheritedIsNotInherited() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.ShetlandPony");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.ShetlandPony");
assertFalse("Wrong number of beans.", beans.isEmpty());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals(
"Wrong number of qualifiers for org.jboss.jsr299.tck.tests.definition.qualifier.BorderCollie type.",
2, qualifiers.size());
@@ -178,10 +178,10 @@
public void testQualifierDeclaredInheritedIsBlockedByIntermediateClass() throws CoreException {
IQualifierDeclaration hairy = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/ClippedBorderCollie.java", "org.jboss.jsr299.tck.tests.definition.qualifier.Hairy");
IParametedType type = getType("org.jboss.jsr299.tck.tests.definition.qualifier.ClippedBorderCollie");
- Set<IBean> beans = cdiProject.getBeans(true, type, hairy);
+ Collection<IBean> beans = cdiProject.getBeans(true, type, hairy);
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers for org.jboss.jsr299.tck.tests.definition.qualifier.ClippedBorderCollie type.", 2, qualifiers.size());
assertContainsQualifier(bean, hairy);
assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
@@ -194,10 +194,10 @@
public void testQualifierDeclaredInheritedIsIndirectlyInherited() throws CoreException {
IQualifierDeclaration hairy = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/definition/qualifier/LongHairedDog.java", "org.jboss.jsr299.tck.tests.definition.qualifier.Hairy");
IParametedType type = getType("org.jboss.jsr299.tck.tests.definition.qualifier.EnglishBorderCollie");
- Set<IBean> beans = cdiProject.getBeans(true, type, hairy);
+ Collection<IBean> beans = cdiProject.getBeans(true, type, hairy);
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers for org.jboss.jsr299.tck.tests.definition.qualifier.EnglishBorderCollie type.", 2, qualifiers.size());
assertContainsQualifier(bean, hairy);
assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
@@ -208,10 +208,10 @@
* @throws JavaModelException
*/
public void testQualifierNotDeclaredInheritedIsNotIndirectlyInherited() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.MiniatureShetlandPony");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.MiniatureShetlandPony");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals(
"Wrong number of qualifiers for org.jboss.jsr299.tck.tests.definition.qualifier.BorderCollie type.",
2, qualifiers.size());
@@ -220,11 +220,11 @@
}
public void testQualifierDeclaredWithInnerType() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier",
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier",
"org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier.InnerQualifier");
assertEquals("Wrong number of beans with org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier type.", 1, beans.size());
IBean bean = beans.iterator().next();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
assertEquals("Wrong number of qualifiers for org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier type.", 2, qualifiers.size());
assertContainsQualifierType(bean, "org.jboss.jsr299.tck.tests.definition.qualifier.BeanWithInnerQualifier$InnerQualifier");
assertContainsQualifierType(bean, "javax.enterprise.inject.Any");
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierWithMembersTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierWithMembersTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierWithMembersTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.IBean;
@@ -23,82 +23,82 @@
public void testQualifierWithStaticImportInInjectingBeanAndNonStaticInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "chequePaymentProcessor");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.AdvancedPaymentProcessor");
}
public void testQualifierWithNonStaticImportInInjectingBeanAndNonStaticInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "chequePaymentProcessor2");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.AdvancedPaymentProcessor");
}
public void testQualifierWithoutImportInInjectingBeanAndNonStaticInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "chequePaymentProcessor3");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.AdvancedPaymentProcessor");
}
public void testQualifierWithStaticImportInInjectingBeanAndStaticInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "cashPaymentProcessor");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.CashPaymentProcessor");
}
public void testQualifierWithNonStaticImportInInjectingBeanAndStaticInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "cashPaymentProcessor2");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.CashPaymentProcessor");
}
public void testQualifierWithoutImportInInjectingBeanAndStaticInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "cashPaymentProcessor3");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.CashPaymentProcessor");
}
public void testQualifierWithStaticImportInInjectingBeanAndWithoutImportInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "otherPaymentProcessor");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.OtherPaymentProcessor");
}
public void testQualifierWithNonStaticImportInInjectingBeanAndWithoutImportInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "otherPaymentProcessor2");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.OtherPaymentProcessor");
}
public void testQualifierWithoutImportInInjectingBeanAndWithoutImportInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "otherPaymentProcessor3");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.OtherPaymentProcessor");
}
public void testQualifierWithNonStaticImportInInjectingBeanUnresolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "unresolvedCreditCardPaymentProcessor");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 0, beans.size());
}
public void testQualifierWithStaticImportInInjectingBeanUnresolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "unresolvedCreditCardPaymentProcessor2");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 0, beans.size());
}
public void testQualifierWithoutImportInInjectingBeanUnresolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/ObtainsInstanceBean.java", "unresolvedCreditCardPaymentProcessor3");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 0, beans.size());
}
@@ -118,7 +118,7 @@
*/
public void testQualifierCoincidingSimpleNameInInjectingBeanAndCoincidingSimpleNameInInjectedBeanResolved() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/coincidence/ObtainsInstanceBean.java", "cashPaymentProcessor");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.jbt.resolution.coincidence.FirstPaymentProcessor");
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResolvedTypesCacheTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResolvedTypesCacheTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResolvedTypesCacheTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -11,14 +11,13 @@
package org.jboss.tools.cdi.core.test.tck;
import java.io.IOException;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.CDICorePlugin;
@@ -64,7 +63,7 @@
IInjectionPointField injectionPoint = getInjectionPointField(PATH_A, "a");
assertNotNull(injectionPoint);
- Set<IBean> bs = cdiProject.getBeans(true, injectionPoint);
+ Collection<IBean> bs = cdiProject.getBeans(true, injectionPoint);
assertEquals(1, bs.size());
IBean b = bs.iterator().next();
assertEquals("org.jboss.jsr299.tck.tests.jbt.resolution.cache.C$D", b.getBeanClass().getFullyQualifiedName());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResourceExclusionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResourceExclusionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ResourceExclusionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -21,7 +21,7 @@
public class ResourceExclusionTest extends TCKTest {
public void testExclusion() throws JavaModelException {
- Set<IBean> beans = cdiProject.getBeans("myExcludedBean", false);
+ Collection<IBean> beans = cdiProject.getBeans("myExcludedBean", false);
assertEquals("Wrong number of beans.", 0, beans.size());
beans = cdiProject.getBeans("myExcludedBean2", false);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ScopeDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -27,13 +27,13 @@
* @throws JavaModelException
*/
public void testScopeTypesAreExtensible() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Mullet");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Mullet");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"org.jboss.jsr299.tck.tests.definition.scope.AnotherScopeType",
bean.getScope().getSourceType().getFullyQualifiedName());
- Set<IScopeDeclaration> declarations = bean.getScopeDeclarations();
+ Collection<IScopeDeclaration> declarations = bean.getScopeDeclarations();
assertEquals("Wrong number of scope declarations", 1, declarations
.size());
assertLocationEquals(declarations, 848, 17);
@@ -45,13 +45,13 @@
* @throws JavaModelException
*/
public void testScopeDeclaredInJava() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.SeaBass");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.SeaBass");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
.getSourceType().getFullyQualifiedName());
- Set<IScopeDeclaration> declarations = bean.getScopeDeclarations();
+ Collection<IScopeDeclaration> declarations = bean.getScopeDeclarations();
assertEquals("Wrong number of scope declarations", 1, declarations
.size());
assertLocationEquals(declarations, 898, 14);
@@ -63,7 +63,7 @@
* @throws JavaModelException
*/
public void testDefaultScope() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Order");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Order");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
@@ -76,13 +76,13 @@
* @throws JavaModelException
*/
public void testScopeSpecifiedAndStereotyped() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Minnow");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Minnow");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
.getSourceType().getFullyQualifiedName());
- Set<IScopeDeclaration> declarations = bean.getScopeDeclarations();
+ Collection<IScopeDeclaration> declarations = bean.getScopeDeclarations();
assertEquals("Wrong number of scope declarations", 1, declarations
.size());
assertLocationEquals(declarations, 920, 14);
@@ -95,12 +95,12 @@
*/
public void testMultipleIncompatibleScopeStereotypesWithScopeSpecified()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Pollock");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Pollock");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
bean.getScope().getSourceType().getFullyQualifiedName());
- Set<IScopeDeclaration> declarations = bean.getScopeDeclarations();
+ Collection<IScopeDeclaration> declarations = bean.getScopeDeclarations();
assertEquals("Wrong number of scope declarations", 1, declarations
.size());
assertLocationEquals(declarations, 930, 10);
@@ -113,7 +113,7 @@
*/
public void testMultipleCompatibleScopeStereotypes()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Grayling");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.Grayling");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
@@ -128,13 +128,13 @@
*/
public void testWebBeanScopeTypeOverridesStereotype()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.RedSnapper");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.RedSnapper");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
.getSourceType().getFullyQualifiedName());
- Set<IScopeDeclaration> declarations = bean.getScopeDeclarations();
+ Collection<IScopeDeclaration> declarations = bean.getScopeDeclarations();
assertEquals("Wrong number of scope declarations", 1, declarations
.size());
assertLocationEquals(declarations, 915, 14);
@@ -147,7 +147,7 @@
*/
public void testScopeTypeDeclaredInheritedIsInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.BorderCollie");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.BorderCollie");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -161,7 +161,7 @@
*/
public void testScopeTypeNotDeclaredInheritedIsNotInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.ShetlandPony");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.ShetlandPony");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
@@ -175,7 +175,7 @@
*/
public void testScopeTypeDeclaredInheritedIsBlockedByIntermediateScopeTypeMarkedInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.GoldenRetriever");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.GoldenRetriever");
assertEquals("Wrong number of beans.", 1, beans.size());
}
@@ -186,7 +186,7 @@
*/
public void testScopeTypeDeclaredInheritedIsBlockedByIntermediateScopeTypeNotMarkedInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.GoldenLabrador");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.GoldenLabrador");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
@@ -200,7 +200,7 @@
*/
public void testScopeTypeDeclaredInheritedIsIndirectlyInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.EnglishBorderCollie");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.EnglishBorderCollie");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -214,7 +214,7 @@
*/
public void testScopeTypeNotDeclaredInheritedIsNotIndirectlyInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.MiniatureClydesdale");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.scope.MiniatureClydesdale");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/SelectedAlternativeTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/SelectedAlternativeTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/SelectedAlternativeTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.Path;
import org.jboss.tools.cdi.core.IBean;
@@ -48,7 +48,7 @@
* • the alternative is a producer method, field or resource, and the bean class that declares the method or field is listed
*/
public void testSelectedAlternativeProducer() {
- Set<IBean> beans = cdiProject.getBeans(new Path("/tck/JavaSource/org/jboss/jsr299/tck/tests/policy/EnabledSheepProducer.java"));
+ Collection<IBean> beans = cdiProject.getBeans(new Path("/tck/JavaSource/org/jboss/jsr299/tck/tests/policy/EnabledSheepProducer.java"));
int producerCount = 0;
for (IBean bean: beans) {
if(bean instanceof IProducer) {
@@ -65,8 +65,8 @@
*/
public void testProducerInAlternativeClassBean() {
IInjectionPoint p = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/lookup/injection/alternative/D.java", "b");
- Set<IBean> unresolved = cdiProject.getBeans(false, p);
- Set<IBean> resolved = cdiProject.getBeans(true, p);
+ Collection<IBean> unresolved = cdiProject.getBeans(false, p);
+ Collection<IBean> resolved = cdiProject.getBeans(true, p);
assertEquals(1, resolved.size());
assertEquals(2, unresolved.size());
System.out.println("");
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -29,13 +29,13 @@
* @throws JavaModelException
*/
public void testStereotypeWithScopeType() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Moose");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Moose");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
.getSourceType().getFullyQualifiedName());
- Set<IStereotypeDeclaration> declarations = bean
+ Collection<IStereotypeDeclaration> declarations = bean
.getStereotypeDeclarations();
assertEquals("Wrong number of stereotype declarations", 1, declarations
.size());
@@ -48,7 +48,7 @@
* @throws JavaModelException
*/
public void testStereotypeWithoutScopeType() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Reindeer");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Reindeer");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
@@ -61,7 +61,7 @@
* @throws JavaModelException
*/
public void testOneStereotypeAllowed() throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.LongHairedDog");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.LongHairedDog");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -73,7 +73,7 @@
* section 2.7 d)
*/
public void testMultipleStereotypesAllowed() {
- Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.definition.stereotype.HighlandCow", "org.jboss.jsr299.tck.tests.definition.stereotype.Tame");
+ Collection<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.definition.stereotype.HighlandCow", "org.jboss.jsr299.tck.tests.definition.stereotype.Tame");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertNull("The bean should not have any EL name.", bean.getName());
@@ -81,7 +81,7 @@
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
.getSourceType().getFullyQualifiedName());
- Set<? extends ITextSourceReference> declarations = bean.getQualifierDeclarations(false);
+ Collection<? extends ITextSourceReference> declarations = bean.getQualifierDeclarations(false);
assertEquals("Wrong number of qualifier declarations", 1, declarations.size());
assertLocationEquals(declarations, 877, 5);
@@ -98,7 +98,7 @@
*/
public void testExplicitScopeOverridesMergedScopesFromMultipleStereotype()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Springbok");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Springbok");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
@@ -113,7 +113,7 @@
*/
public void testStereotypeDeclaredInheritedIsInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.BorderCollie");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.BorderCollie");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -127,7 +127,7 @@
*/
public void testStereotypeNotDeclaredInheritedIsNotInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.ShetlandPony");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.ShetlandPony");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
@@ -141,7 +141,7 @@
*/
public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.EnglishBorderCollie");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.EnglishBorderCollie");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.RequestScoped", bean.getScope()
@@ -155,7 +155,7 @@
*/
public void testStereotypeNotDeclaredInheritedIsNotIndirectlyInherited()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.MiniatureClydesdale");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.MiniatureClydesdale");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
@@ -169,7 +169,7 @@
*/
public void testStereotypeScopeIsOverriddenByInheritedScope()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Chihuahua");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Chihuahua");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.SessionScoped", bean.getScope()
@@ -183,7 +183,7 @@
*/
public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
throws JavaModelException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.MexicanChihuahua");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.MexicanChihuahua");
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
"javax.enterprise.context.SessionScoped", bean.getScope()
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
@@ -27,7 +27,7 @@
* @throws JavaModelException
*/
public void testInheritence() throws JavaModelException {
- Set<IBean> beans = getBeans(false, "org.jboss.jsr299.tck.tests.definition.stereotype.inheritance.Horse");
+ Collection<IBean> beans = getBeans(false, "org.jboss.jsr299.tck.tests.definition.stereotype.inheritance.Horse");
assertEquals("Wrong number of beans.", 1, beans.size());
IBean bean = beans.iterator().next();
assertEquals("Wrong scope type",
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -13,10 +13,10 @@
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import junit.framework.TestCase;
@@ -164,20 +164,20 @@
return tckP;
}
- protected Set<IBean> getBeans(String typeName, String... qualifierNames) throws JavaModelException {
+ protected Collection<IBean> getBeans(String typeName, String... qualifierNames) throws JavaModelException {
return getBeans(true, typeName, qualifierNames);
}
- protected Set<IBean> getBeans(boolean resolve, String typeName, String... qualifierNames) throws JavaModelException {
+ protected Collection<IBean> getBeans(boolean resolve, String typeName, String... qualifierNames) throws JavaModelException {
IParametedType type = getType(typeName);
assertNotNull("Can't find " + typeName + " type.", type);
- Set<IType> qualifiers = new HashSet<IType>();
+ Collection<IType> qualifiers = new HashSet<IType>();
for (String name : qualifierNames) {
IType qualifier = EclipseJavaUtil.findType(EclipseUtil.getJavaProject(cdiProject.getNature().getProject()), name);
assertNotNull("Can't find " + name + " type.", qualifier);
qualifiers.add(qualifier);
}
- Set<IBean> beans = cdiProject.getBeans(resolve, type, qualifiers.toArray(new IType[0]));
+ Collection<IBean> beans = cdiProject.getBeans(resolve, type, qualifiers.toArray(new IType[0]));
assertNotNull("There is no beans with " + typeName + " type", beans);
return beans;
}
@@ -189,7 +189,7 @@
protected IClassBean getClassBean(String fullyQualifiedTypeName, String path) {
IFile file = tckProject.getFile(path);
assertTrue(file.exists());
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
for (IBean bean : beans) {
if(bean instanceof IClassBean && (fullyQualifiedTypeName==null || fullyQualifiedTypeName.equals(bean.getBeanClass().getFullyQualifiedName()))) {
return (IClassBean)bean;
@@ -210,10 +210,10 @@
protected IQualifierDeclaration getQualifierDeclarationFromClass(String beanFilePath, String annotationTypeName) throws JavaModelException {
IFile file = tckProject.getFile(beanFilePath);
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
assertFalse("Can't find any bean in " + beanFilePath, beans.isEmpty());
for (IBean bean : beans) {
- Set<IQualifierDeclaration> declarations = bean.getQualifierDeclarations();
+ Collection<IQualifierDeclaration> declarations = bean.getQualifierDeclarations();
IParametedType type = getType(annotationTypeName);
for (IQualifierDeclaration declaration : declarations) {
if(declaration.getType() != null && type.getType().getElementName().equals(declaration.getType().getElementName())) {
@@ -227,7 +227,7 @@
protected IAnnotationDeclaration createAnnotationDeclarationForAnnotation(String beanClassFilePath, String annotationTypeName) throws JavaModelException {
IFile file = tckProject.getFile(beanClassFilePath);
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
IBean bean = beans.iterator().next();
IType beanClass = bean.getBeanClass();
final IParametedType type = getType(annotationTypeName);
@@ -248,7 +248,7 @@
}
protected void assertTheOnlyBean(String typeName) throws JavaModelException {
- Set<IBean> beans = getBeans(typeName);
+ Collection<IBean> beans = getBeans(typeName);
assertEquals("There should be the only bean with " + typeName + " type", 1, beans.size());
}
@@ -280,7 +280,7 @@
}
}
- public static void assertLocationEquals(Set<? extends ITextSourceReference> references, int startPosition, int length) {
+ public static void assertLocationEquals(Collection<? extends ITextSourceReference> references, int startPosition, int length) {
for (ITextSourceReference reference : references) {
if(reference.getStartPosition()==startPosition) {
assertLocationEquals(reference, startPosition, length);
@@ -303,7 +303,7 @@
assertEquals("Wrong number of types.", typeNames.length, bean.getLegalTypes().size());
}
for (String typeName : typeNames) {
- Set<IParametedType> types = bean.getLegalTypes();
+ Collection<IParametedType> types = bean.getLegalTypes();
StringBuffer allTypes = new StringBuffer("[");
boolean found = false;
for (IParametedType type : types) {
@@ -327,7 +327,7 @@
assertEquals("Wrong number of types.", typeSignatures.length, bean.getLegalTypes().size());
}
for (String typeSignature : typeSignatures) {
- Set<IParametedType> types = bean.getLegalTypes();
+ Collection<IParametedType> types = bean.getLegalTypes();
StringBuffer allTypes = new StringBuffer("[");
boolean found = false;
for (IParametedType type : types) {
@@ -342,7 +342,7 @@
}
}
- public static void assertDoesNotContainBeanClasses(Set<IBean> beans, String... beanClassNames) throws CoreException {
+ public static void assertDoesNotContainBeanClasses(Collection<IBean> beans, String... beanClassNames) throws CoreException {
StringBuffer sb = new StringBuffer("[");
for (String beanClassName : beanClassNames) {
sb.append(beanClassName).append("; ");
@@ -355,14 +355,14 @@
protected IInjectionPointField getInjectionPointField(String beanClassFilePath, String fieldName) {
IFile file = tckProject.getFile(beanClassFilePath);
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
Iterator<IBean> it = beans.iterator();
while(it.hasNext()) {
IBean b = it.next();
if(b instanceof IProducer) it.remove();
}
assertEquals("Wrong number of the beans", 1, beans.size());
- Set<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
+ Collection<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
for (IInjectionPoint injectionPoint : injections) {
if(injectionPoint instanceof IInjectionPointField) {
IInjectionPointField field = (IInjectionPointField)injectionPoint;
@@ -377,14 +377,14 @@
protected IInjectionPointParameter getInjectionPointParameter(String beanClassFilePath, String methodName) {
IFile file = tckProject.getFile(beanClassFilePath);
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Collection<IBean> beans = cdiProject.getBeans(file.getFullPath());
Iterator<IBean> it = beans.iterator();
while(it.hasNext()) {
IBean b = it.next();
if(b instanceof IProducer) it.remove();
}
assertEquals("Wrong number of the beans", 1, beans.size());
- Set<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
+ Collection<IInjectionPoint> injections = beans.iterator().next().getInjectionPoints();
for (IInjectionPoint injectionPoint : injections) {
if(injectionPoint instanceof IInjectionPointParameter) {
IInjectionPointParameter param = (IInjectionPointParameter)injectionPoint;
@@ -397,11 +397,11 @@
return null;
}
- public static void assertContainsBeanClasses(Set<IBean> beans, String... beanClassNames) throws CoreException {
+ public static void assertContainsBeanClasses(Collection<IBean> beans, String... beanClassNames) throws CoreException {
assertContainsBeanClasses(true, beans, beanClassNames);
}
- public static void assertContainsBeanClasses(boolean checkTheNumberOfBeans, Set<IBean> beans, String... beanClassNames) throws CoreException {
+ public static void assertContainsBeanClasses(boolean checkTheNumberOfBeans, Collection<IBean> beans, String... beanClassNames) throws CoreException {
if(checkTheNumberOfBeans) {
assertEquals("Wrong number of beans.", beanClassNames.length, beans.size());
}
@@ -415,11 +415,11 @@
}
}
- public static void assertContainsBeanClass(Set<IBean> beans, String beanClassName) throws CoreException {
+ public static void assertContainsBeanClass(Collection<IBean> beans, String beanClassName) throws CoreException {
assertTrue("Didn't find " + beanClassName, containsBeanClass(beans, beanClassName));
}
- private static boolean doesNotContainBeanClass(Set<IBean> beans, String beanClassName) throws CoreException {
+ private static boolean doesNotContainBeanClass(Collection<IBean> beans, String beanClassName) throws CoreException {
for (IBean bean : beans) {
if(beanClassName.equals(bean.getBeanClass().getFullyQualifiedName())) {
return false;
@@ -428,7 +428,7 @@
return true;
}
- private static boolean containsBeanClass(Set<IBean> beans, String beanClassName) throws CoreException {
+ private static boolean containsBeanClass(Collection<IBean> beans, String beanClassName) throws CoreException {
for (IBean bean : beans) {
if(beanClassName.equals(bean.getBeanClass().getFullyQualifiedName())) {
return true;
@@ -437,11 +437,11 @@
return false;
}
- public static void assertContainsTypes(Set<IParametedType> types, String... typeNames) throws CoreException {
+ public static void assertContainsTypes(Collection<IParametedType> types, String... typeNames) throws CoreException {
assertContainsTypes(true, types, typeNames);
}
- public static void assertContainsTypes(boolean checkTheNumberOfTypes, Set<IParametedType> types, String... typeNames) throws CoreException {
+ public static void assertContainsTypes(boolean checkTheNumberOfTypes, Collection<IParametedType> types, String... typeNames) throws CoreException {
if(checkTheNumberOfTypes) {
assertEquals("The number of types should be the same", typeNames.length, types.size());
}
@@ -450,7 +450,7 @@
}
}
- public static void assertContainsType(Set<IParametedType> types, String typeName) throws CoreException {
+ public static void assertContainsType(Collection<IParametedType> types, String typeName) throws CoreException {
StringBuffer allTheTypes = new StringBuffer("[ ");
for (IParametedType type : types) {
allTheTypes.append(type.getType().getFullyQualifiedName()).append(" ,");
@@ -462,7 +462,7 @@
}
}
- private static boolean containsType(Set<IParametedType> types, String typeName) throws CoreException {
+ private static boolean containsType(Collection<IParametedType> types, String typeName) throws CoreException {
for (IParametedType type : types) {
if(typeName.equals(type.getType().getFullyQualifiedName())) {
return true;
@@ -473,7 +473,7 @@
public static void assertContainsQualifier(IBean bean, IQualifierDeclaration declaration) throws CoreException {
String typeName = declaration.getQualifier().getSourceType().getFullyQualifiedName();
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
StringBuffer allTypes = new StringBuffer("[");
boolean found = false;
for (IQualifier qualifier : qualifiers) {
@@ -485,7 +485,7 @@
}
allTypes.append("]");
assertTrue(bean.getResource().getFullPath() + " bean (qualifiers - " + allTypes.toString() + ") should have the qualifier with " + typeName + " type.", found);
- Set<IQualifierDeclaration> declarations = bean.getQualifierDeclarations(true);
+ Collection<IQualifierDeclaration> declarations = bean.getQualifierDeclarations(true);
for (IQualifierDeclaration d : declarations) {
if(CDIProject.getAnnotationDeclarationKey(d).equals(CDIProject.getAnnotationDeclarationKey(declaration)) ) {
return;
@@ -499,7 +499,7 @@
}
public static void assertContainsQualifierType(boolean theNumbersOfQualifierShouldBeTheSame, IBean bean, String... typeNames) {
- Set<IQualifier> qualifiers = bean.getQualifiers();
+ Collection<IQualifier> qualifiers = bean.getQualifiers();
if(theNumbersOfQualifierShouldBeTheSame) {
assertEquals("Defferent numbers of qualifiers", typeNames.length, qualifiers.size());
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/AmbiguousDependencyTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/AmbiguousDependencyTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/AmbiguousDependencyTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck.lookup;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.IBean;
@@ -28,7 +28,7 @@
*/
public void testAmbiguousDependency() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java", "animal");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertTrue(beans.size()>1);
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/CircularDependencyTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/CircularDependencyTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/CircularDependencyTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,8 +10,8 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck.lookup;
+import java.util.Collection;
import java.util.HashSet;
-import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.IBean;
@@ -101,7 +101,7 @@
}
public IClassBean getOnlyClassBean(String type) throws CoreException {
- Set<IBean> beans = getBeans(type);
+ Collection<IBean> beans = getBeans(type);
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
assertTrue(bean instanceof IClassBean);
@@ -111,10 +111,10 @@
public void assertOnlyInjectionOfClassBeanReslovedToAnotherClassBean(String classBeanType, String injectionClassBeanType) throws CoreException {
IBean bean = getOnlyClassBean(classBeanType);
- Set<IInjectionPoint> points = bean.getInjectionPoints();
+ Collection<IInjectionPoint> points = bean.getInjectionPoints();
assertEquals("Wrong number of the injections", 1, points.size());
IInjectionPoint point = points.iterator().next();
- Set<IBean> beans = cdiProject.getBeans(true, point);
+ Collection<IBean> beans = cdiProject.getBeans(true, point);
assertEquals("Wrong number of the beans", 1, beans.size());
bean = beans.iterator().next();
assertTrue(bean instanceof IClassBean);
@@ -123,10 +123,10 @@
public void assertOnlyInjectionOfClassBeanReslovedToProducerMethodOfSameClass(String classBeanType) throws CoreException {
IBean bean = getOnlyClassBean(classBeanType);
- Set<IInjectionPoint> points = bean.getInjectionPoints();
+ Collection<IInjectionPoint> points = bean.getInjectionPoints();
assertEquals("Wrong number of the injections", 1, points.size());
IInjectionPoint point = points.iterator().next();
- Set<IBean> beans = cdiProject.getBeans(true, point);
+ Collection<IBean> beans = cdiProject.getBeans(true, point);
assertEquals("Wrong number of the beans", 1, beans.size());
bean = beans.iterator().next();
assertTrue(bean instanceof IProducerMethod);
@@ -135,8 +135,8 @@
public void assertOnlyInjectionConstructorOfClassBeanReslovedToAnotherClassBean(String classBeanType, String injectionClassBeanType) throws CoreException {
IBean bean = getOnlyClassBean(classBeanType);
- Set<IInjectionPoint> allPoints = bean.getInjectionPoints();
- Set<IInjectionPointParameter> points = new HashSet<IInjectionPointParameter>();
+ Collection<IInjectionPoint> allPoints = bean.getInjectionPoints();
+ Collection<IInjectionPointParameter> points = new HashSet<IInjectionPointParameter>();
for (IInjectionPoint injectionPoint : allPoints) {
if(injectionPoint instanceof IInjectionPointParameter) {
points.add((IInjectionPointParameter)injectionPoint);
@@ -144,7 +144,7 @@
}
assertEquals("Wrong number of the injections", 1, points.size());
IInjectionPoint point = points.iterator().next();
- Set<IBean> beans = cdiProject.getBeans(true, point);
+ Collection<IBean> beans = cdiProject.getBeans(true, point);
assertEquals("Wrong number of the beans", 1, beans.size());
bean = beans.iterator().next();
assertTrue(bean instanceof IClassBean);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/DynamicLookupTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/DynamicLookupTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/DynamicLookupTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck.lookup;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.IBean;
@@ -28,14 +28,14 @@
*/
public void testObtainsInjectsInstance() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInstanceBean.java", "paymentProcessor");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals(1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.lookup.dynamic.AdvancedPaymentProcessor");
}
public void testObtainsInjectsProvider() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInstanceBean.java", "paymentProcessor2");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals(1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.lookup.dynamic.AdvancedPaymentProcessor");
}
@@ -46,7 +46,7 @@
*/
public void testObtainsAmbiguousInjectsInstance() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/lookup/dynamic/ObtainsInstanceBean.java", "anyPaymentProcessor");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals(3, beans.size());
assertContainsBeanClasses(beans, "org.jboss.jsr299.tck.tests.lookup.dynamic.AdvancedPaymentProcessor", "org.jboss.jsr299.tck.tests.lookup.dynamic.SimplePaymentProcessor", "org.jboss.jsr299.tck.tests.lookup.dynamic.RemotePaymentProcessor");
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/ResolutionByNameTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/ResolutionByNameTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/ResolutionByNameTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -11,7 +11,7 @@
package org.jboss.tools.cdi.core.test.tck.lookup;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -41,7 +41,7 @@
*/
public void testAmbiguousELNamesResolved() throws CoreException {
// Cod, Plaice and AlaskaPlaice are named "whitefishJBT" - Cod is a not-enabled policy, AlaskaPlaice specializes Plaice
- Set<IBean> beans = cdiProject.getBeans("whitefishJBT", true);
+ Collection<IBean> beans = cdiProject.getBeans("whitefishJBT", true);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClass(beans, "org.jboss.jsr299.tck.tests.lookup.byname.AlaskaPlaice");
@@ -80,7 +80,7 @@
*/
public void testAbstractClassAnnotatedNamed() throws CoreException {
String abstractClass = "abstractClass";
- Set<IBean> beans = cdiProject.getBeans(abstractClass, false);
+ Collection<IBean> beans = cdiProject.getBeans(abstractClass, false);
assertTrue(beans.isEmpty());
beans = cdiProject.getBeans("producerInAbstractClass", false);
@@ -93,12 +93,12 @@
IAnnotationDeclaration named = cb.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
assertEquals(abstractClass, named.getMemberValue(null));
- Set<IInjectionPoint> injections = cdiProject.getInjections("org.jboss.jsr299.tck.tests.jbt.lookup.NotBean");
+ Collection<IInjectionPoint> injections = cdiProject.getInjections("org.jboss.jsr299.tck.tests.jbt.lookup.NotBean");
assertEquals(2, injections.size());
for (IInjectionPoint p: injections) {
assertTrue(p instanceof IInjectionPointField);
IField f = ((IInjectionPointField)p).getField();
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
if("f1".endsWith(f.getElementName())) {
assertEquals("Injection field f1 cannot be resolved to abstract class bean.", 0, bs.size());
} else if("f2".endsWith(f.getElementName())) {
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/ResolutionByTypeTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/ResolutionByTypeTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/ResolutionByTypeTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck.lookup;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -39,7 +40,7 @@
* @throws CoreException
*/
public void testDefaultBindingTypeAssumed() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Tuna");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Tuna");
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanTypes(false, beans.iterator().next(), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Tuna");
}
@@ -51,7 +52,7 @@
* @throws CoreException
*/
public void testResolveByType() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Tuna", "javax.enterprise.inject.Default");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Tuna", "javax.enterprise.inject.Default");
assertEquals("Wrong number of the beans", 1, beans.size());
beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Animal", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.FishILike");
assertEquals("Wrong number of the beans", 3, beans.size());
@@ -65,7 +66,7 @@
* @throws CoreException
*/
public void testAllQualifiersSpecifiedForResolutionMustAppearOnBean() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Animal", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Chunky", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Whitefish");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Animal", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Chunky", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Whitefish");
assertEquals("Wrong number of the beans", 1, beans.size());
beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.ScottishFish", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Whitefish");
assertEquals("Wrong number of the beans", 2, beans.size());
@@ -81,7 +82,7 @@
public void testResolveByTypeWithTypeParameter() throws CoreException {
IType type = EclipseJavaUtil.findType(EclipseUtil.getJavaProject(cdiProject.getNature().getProject()), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.ScottishFishFarmer");
IParametedType parametedType = cdiProject.getNature().getTypeFactory().getParametedType(type, "QFarmer<QScottishFish;>;");
- Set<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[0]);
+ Collection<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[0]);
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanClasses(beans, "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.ScottishFishFarmer");
}
@@ -95,7 +96,7 @@
public void testResolveByTypeWithArray() throws CoreException {
IType type = EclipseJavaUtil.findType(EclipseUtil.getJavaProject(cdiProject.getNature().getProject()), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.SpiderProducer");
IParametedType parametedType = cdiProject.getNature().getTypeFactory().getParametedType(type, "[QSpider;");
- Set<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[0]);
+ Collection<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[0]);
assertEquals("Wrong number of the beans", 1, beans.size());
assertTrue("The bean should be a producer method.", beans.iterator().next() instanceof IProducerMethod);
}
@@ -107,12 +108,12 @@
* @throws CoreException
*/
public void testResolveByTypeWithPrimitives() throws CoreException {
- Set<IBean> beans = getBeans("java.lang.Double", "javax.enterprise.inject.Any");
+ Collection<IBean> beans = getBeans("java.lang.Double", "javax.enterprise.inject.Any");
// There is checks for 2 beans (not for 3) in TCK but actually there is one more bean in another package which matches. So let's check for 3 beans.
assertEquals("Wrong number of the beans", 3, beans.size());
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/NumberProducer.java");
assertNotNull("Bean can't be a null", bean);
- Set<IInjectionPoint> injections = bean.getInjectionPoints();
+ Collection<IInjectionPoint> injections = bean.getInjectionPoints();
assertEquals("Wrong number of the injection points", 2, injections.size());
for (IInjectionPoint injectionPoint : injections) {
beans = cdiProject.getBeans(true, injectionPoint);
@@ -122,11 +123,11 @@
public void testAbstractClassIsNotEligibleForInjection() throws CoreException {
IClassBean bean = getClassBean("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/chain/CurrentProject.java");
- Set<IInjectionPoint> injections = bean.getInjectionPoints();
+ Collection<IInjectionPoint> injections = bean.getInjectionPoints();
assertEquals("Wrong number of the injection points", 1, injections.size());
IInjectionPoint injectionPoint = injections.iterator().next();
assertNotNull(injectionPoint);
- Set<IBean> bs = cdiProject.getBeans(true, injectionPoint);
+ Collection<IBean> bs = cdiProject.getBeans(true, injectionPoint);
assertEquals(2, bs.size());
Set<String> names = new HashSet<String>();
System.out.println(bs.size());
@@ -147,7 +148,7 @@
IQualifierDeclaration expensiveQualifier = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/RoundWhitefish.java", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Expensive");
IQualifierDeclaration whitefishQualifier = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/RoundWhitefish.java", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Whitefish");
IParametedType type = getType("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Animal");
- Set<IBean> beans = cdiProject.getBeans(true, type, new IQualifierDeclaration[]{expensiveQualifier, whitefishQualifier});
+ Collection<IBean> beans = cdiProject.getBeans(true, type, new IQualifierDeclaration[]{expensiveQualifier, whitefishQualifier});
assertContainsBeanClasses(beans, new String[]{"org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.RoundWhitefish", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Halibut"});
}
@@ -158,7 +159,7 @@
* @throws CoreException
*/
public void testPolicyNotAvailableInNonDeploymentArchive() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Spider");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Spider");
assertFalse("Wrong number of the beans", beans.isEmpty());
assertDoesNotContainBeanClasses(beans, new String[]{"org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.CrabSpider", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.DaddyLongLegs"});
beans = cdiProject.getBeans("crabSpider", true);
@@ -172,7 +173,7 @@
* @throws CoreException
*/
public void testBeanTypesOnManagedBean() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Canary");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Canary");
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Bird");
@@ -189,7 +190,7 @@
public void testGenericBeanTypesOnManagedBean() throws CoreException {
IType type = EclipseJavaUtil.findType(EclipseUtil.getJavaProject(cdiProject.getNature().getProject()), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Emu");
IParametedType parametedType = cdiProject.getNature().getTypeFactory().getParametedType(type, "QFlightlessBird<QAustralian;>;");
- Set<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[0]);
+ Collection<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[0]);
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
@@ -213,7 +214,7 @@
* @throws CoreException
*/
public void testBeanTypesOnProducerMethod() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Parrot");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Parrot");
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanTypes(beans.iterator().next(), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Parrot", "java.lang.Object");
@@ -232,7 +233,7 @@
IParametedType parametedType = cdiProject.getNature().getTypeFactory().getParametedType(type, "QCat<QEuropean;>;");
IQualifierDeclaration qualifier = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Tame");
assertNotNull("Can't find the qualifier.", qualifier);
- Set<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[]{qualifier});
+ Collection<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[]{qualifier});
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
@@ -255,7 +256,7 @@
IParametedType parametedType = cdiProject.getNature().getTypeFactory().getParametedType(type, "QCat<QAfrican;>;");
IQualifierDeclaration qualifier = getQualifierDeclarationFromClass("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java", "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Wild");
assertNotNull("Can't find the qualifier.", qualifier);
- Set<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[]{qualifier});
+ Collection<IBean> beans = cdiProject.getBeans(true, parametedType, new IQualifierDeclaration[]{qualifier});
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
@@ -274,7 +275,7 @@
* @throws CoreException
*/
public void testBeanTypesOnProducerField() throws CoreException {
- Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Dove");
+ Collection<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Dove");
assertEquals("Wrong number of the beans", 1, beans.size());
assertContainsBeanTypes(beans.iterator().next(), "org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.Dove", "java.lang.Object");
@@ -284,7 +285,7 @@
public void testInjectionResolutionOfRestrictedProducerField() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/Zoo.java", "cats");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
assertTrue(bean instanceof IProducerField);
@@ -292,7 +293,7 @@
public void testInjectionResolutionOfRestrictedProducerMethod() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/Zoo.java", "lions");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals("Wrong number of the beans", 1, beans.size());
IBean bean = beans.iterator().next();
assertTrue(bean instanceof IProducerMethod);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/UnsatisfiedDependencyTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/UnsatisfiedDependencyTest.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/lookup/UnsatisfiedDependencyTest.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.cdi.core.test.tck.lookup;
-import java.util.Set;
+import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.IBean;
@@ -28,7 +28,7 @@
*/
public void testUnsatisfiedDependency() throws CoreException {
IInjectionPointField injection = getInjectionPointField("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java", "vanilla");
- Set<IBean> beans = cdiProject.getBeans(true, injection);
+ Collection<IBean> beans = cdiProject.getBeans(true, injection);
assertEquals(0, beans.size());
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2012-08-13 22:09:57 UTC (rev 43009)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2012-08-13 22:11:04 UTC (rev 43010)
@@ -12,16 +12,14 @@
package org.jboss.tools.cdi.core.test.tck.validation;
import java.text.MessageFormat;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.jboss.tools.cdi.core.IBean;
-import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPointField;
import org.jboss.tools.cdi.core.IInjectionPointParameter;
-import org.jboss.tools.cdi.core.IProducerField;
-import org.jboss.tools.cdi.core.IProducerMethod;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
@@ -63,7 +61,7 @@
AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 9, 25, 26);
IInjectionPointField p = getInjectionPointField(path, "s5");
- Set<IBean> bs = cdiProject.getBeans(false, p);
+ Collection<IBean> bs = cdiProject.getBeans(false, p);
assertEquals(3, bs.size());
Set<String> keys = new HashSet<String>();
@@ -76,7 +74,7 @@
assertTrue(keys.contains("TestNamed.foo6()"));
IInjectionPointParameter pp = getInjectionPointParameter(path, "doSmth");
- Set<IBean> bs2 = cdiProject.getBeans(false, pp);
+ Collection<IBean> bs2 = cdiProject.getBeans(false, pp);
assertEquals(3, bs2.size());
bs2.removeAll(bs);
assertTrue(bs2.isEmpty());
13 years, 8 months