JBoss Tools SVN: r31506 - trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-25 20:48:04 -0400 (Wed, 25 May 2011)
New Revision: 31506
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8576
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26 00:44:19 UTC (rev 31505)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26 00:48:04 UTC (rev 31506)
@@ -33,7 +33,7 @@
}
public void testInjectionAnnotatedInputField() throws Exception {
- IFile file = project.getFile("src/org/jboss/beans/validation/test/Validation.java");
+ IFile file = getTestProject().getFile("src/org/jboss/beans/validation/test/Validation.java");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 18, 23);
AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 20, 28);
13 years, 1 month
JBoss Tools SVN: r31505 - trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-25 20:44:19 -0400 (Wed, 25 May 2011)
New Revision: 31505
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/META-INF/MANIFEST.MF
Log:
https://issues.jboss.org/browse/JBIDE-8576
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/META-INF/MANIFEST.MF 2011-05-26 00:44:09 UTC (rev 31504)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/META-INF/MANIFEST.MF 2011-05-26 00:44:19 UTC (rev 31505)
@@ -12,7 +12,6 @@
org.jboss.tools.common.model.ui,
org.jboss.tools.common.base.test,
org.jboss.tools.cdi.core,
- org.jboss.tools.cdi.core.test,
org.jboss.tools.cdi.seam.config.core,
org.jboss.tools.cdi.seam.config.core.test,
org.jboss.tools.cdi.seam.config.ui,
13 years, 1 month
JBoss Tools SVN: r31504 - trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-25 20:44:09 -0400 (Wed, 25 May 2011)
New Revision: 31504
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test/CdiSeamConfigUIAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-8576
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test/CdiSeamConfigUIAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test/CdiSeamConfigUIAllTests.java 2011-05-26 00:32:38 UTC (rev 31503)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test/CdiSeamConfigUIAllTests.java 2011-05-26 00:44:09 UTC (rev 31504)
@@ -10,13 +10,12 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.config.ui.test;
-import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.jboss.tools.cdi.core.test.CDICoreTestSetup;
-import org.jboss.tools.cdi.seam.config.core.test.SeamConfigTestSetup;
-
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.jboss.tools.cdi.seam.config.core.test.SeamConfigTestSetup;
+
public class CdiSeamConfigUIAllTests {
public static Test suite() {
13 years, 1 month
JBoss Tools SVN: r31503 - in trunk: cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-25 20:32:38 -0400 (Wed, 25 May 2011)
New Revision: 31503
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
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/DependentProjectValidationTest.java
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/ELValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8576
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AnnotationsValidationTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IFile;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* Wrong targets in CDI annotation types.
@@ -25,99 +26,99 @@
public void testQualifierWithMissingTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_MissingTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 36);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 36);
}
public void testQualifierWithMissingRetention() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_MissingRetention.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, 36);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, 36);
}
public void testQualifierWithWrongTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/broken/Hairy_WrongTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 32);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 32);
}
public void testQualifierWithTargetOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/qualifier/HairyTargetOk.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 14);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 14);
}
public void testStereotypeWithMissingTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 19);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 19);
}
public void testStereotypeWithMissingRetention() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE, 19);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE, 19);
}
public void testStereotypeWithWrongTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 15);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE.substring(0, 56) + ".*", 15);
}
public void testScopeWithMissingTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_MissingTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 33);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 33);
}
public void testScopeWithMissingRetention() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_MissingRetention.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_SCOPE_TYPE, 33);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_SCOPE_TYPE, 33);
}
public void testScopeWithWrongTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/scope/broken/FooScoped_WrongTarget.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 30);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_SCOPE_TYPE.substring(0, 52) + ".*", 30);
}
public void testStereotypesWithAdditionalStereotypesWithTMFTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/StereotypeTMFBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_TMF, "StereotypeWTypeTarget", "StereotypeTMFBroken"), 15);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_TMF, "StereotypeWTypeTarget", "StereotypeTMFBroken"), 15);
}
public void testStereotypesWithAdditionalStereotypesWithMTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/StereotypeMBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_M, "StereotypeWTypeTarget", "StereotypeMBroken"), 13);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_M, "StereotypeWTypeTarget", "StereotypeMBroken"), 13);
}
public void testStereotypesWithAdditionalStereotypesWithFTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/StereotypeFBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_F, "StereotypeWTypeTarget", "StereotypeFBroken"), 13);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_F, "StereotypeWTypeTarget", "StereotypeFBroken"), 13);
}
public void testStereotypesWithAdditionalStereotypesWithMFTarget() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/StereotypeMFBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_MF, "StereotypeWTypeTarget", "StereotypeMFBroken"), 14);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_MF, "StereotypeWTypeTarget", "StereotypeMFBroken"), 14);
}
public void testStereotypesWithAdditionalStereotypesOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/StereotypeOk.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_TMF, "StereotypeWTypeTarget", "StereotypeOk"), 13);
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_M, "StereotypeWTypeTarget", "StereotypeOk"), 13);
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_F, "StereotypeWTypeTarget", "StereotypeOk"), 13);
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_MF, "StereotypeWTypeTarget", "StereotypeOk"), 13);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_TMF, "StereotypeWTypeTarget", "StereotypeOk"), 13);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_M, "StereotypeWTypeTarget", "StereotypeOk"), 13);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_F, "StereotypeWTypeTarget", "StereotypeOk"), 13);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_STEREOTYPE_TYPE_MF, "StereotypeWTypeTarget", "StereotypeOk"), 13);
}
public void testInterceptorBindingWithAdditionalInterceptorBindings() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/InterceptorBindingBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE, "InterceptorBindingWTypeTarget", "InterceptorBindingBroken"), 16);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE, "InterceptorBindingWTypeTarget", "InterceptorBindingBroken"), 16);
}
public void testInterceptorBindingWithAdditionalInterceptorBindingsOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/InterceptorBindingOk.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE, "InterceptorBindingWTypeTarget", "InterceptorBindingOk"), 15);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE, "InterceptorBindingWTypeTarget", "InterceptorBindingOk"), 15);
}
public void testInterceptorBindingsForStereotypes() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/StereotypeWithInterceptorBindingBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE_FOR_STEREOTYPE, "StereotypeWithInterceptorBindingBroken", "InterceptorBindingWTypeTarget"), 16);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE_FOR_STEREOTYPE, "StereotypeWithInterceptorBindingBroken", "InterceptorBindingWTypeTarget"), 16);
}
public void testInterceptorBindingsForStereotypesOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/target/StereotypeOk.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE_FOR_STEREOTYPE, "StereotypeOk", "InterceptorBindingWTypeTarget"), 15);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.ILLEGAL_TARGET_IN_INTERCEPTOR_BINDING_TYPE_FOR_STEREOTYPE, "StereotypeOk", "InterceptorBindingWTypeTarget"), 15);
}
}
\ 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/BeansXmlValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IFile;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -34,8 +35,8 @@
*/
public void testNoAlternativeClassWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, false, 7);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, 19);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, false, 7);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, 19);
}
/**
@@ -45,8 +46,8 @@
*/
public void testIllegalAlternativeClassWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 4);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 19);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 4);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 19);
}
/**
@@ -57,8 +58,8 @@
*/
public void testNoAlternativeAnnotationWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 12);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 17);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 12);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 17);
}
/**
@@ -68,8 +69,8 @@
*/
public void testIllegalAlternativeAnnotationWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 15);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 17);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 15);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 17);
}
/**
@@ -79,9 +80,9 @@
*/
public void testSameAlternativeClassListedTwice() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 20, 22, 26, 27);
- assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 17);
- assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 19);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 20, 22, 26, 27);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 17);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 19);
}
/**
@@ -91,8 +92,8 @@
*/
public void testNonExistantDecoratorClassInBeansXmlNotOK() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, 34);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, BAR_DECORATOR_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, 34);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, BAR_DECORATOR_LINE);
}
/**
@@ -102,8 +103,8 @@
*/
public void testEnabledDecoratorNotADecorator() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, 37);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, BAR_DECORATOR_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, 37);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, BAR_DECORATOR_LINE);
}
/**
@@ -113,8 +114,8 @@
*/
public void testDecoratorListedTwiceInBeansXmlNotOK() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, 39, 40);
- assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, BAR_DECORATOR_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, 39, 40);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, BAR_DECORATOR_LINE);
}
/**
@@ -124,8 +125,8 @@
*/
public void testNonExistantClassInBeansXmlNotOk() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, FOO_LINE);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, CAT_INTERCEPTOR_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, FOO_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, CAT_INTERCEPTOR_LINE);
}
/**
@@ -135,8 +136,8 @@
*/
public void testNonInterceptorClassInBeansXmlNotOk() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, NON_INTERCEPTOR_LINE);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, CAT_INTERCEPTOR_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, NON_INTERCEPTOR_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, CAT_INTERCEPTOR_LINE);
}
/**
@@ -146,7 +147,7 @@
*/
public void testSameInterceptorClassListedTwiceInBeansXmlNotOk() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, FORD_INTERCEPTOR_1_LINE, FORD_INTERCEPTOR_2_LINE);
- assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, CAT_INTERCEPTOR_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, FORD_INTERCEPTOR_1_LINE, FORD_INTERCEPTOR_2_LINE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, CAT_INTERCEPTOR_LINE);
}
}
\ 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/DefenitionErrorsValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DefenitionErrorsValidationTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -32,7 +33,7 @@
*/
public void testLegalTypesInTyped() throws Exception {
IFile petShopFile = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
- assertMarkerIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD, 25);
}
/**
@@ -43,7 +44,7 @@
*/
public void testInterceptorWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithWrongScopeBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 8);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_INTERCEPTOR, 8);
}
/**
@@ -54,7 +55,7 @@
*/
public void testDecoratorWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/DecoratorWithWrongScopeBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_DECORATOR, 7);
}
/**
@@ -65,7 +66,7 @@
*/
public void testMultipleBeanScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/BeanWithTooManyScopeTypes_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS, 22, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS, 22, 23);
}
/**
@@ -77,7 +78,7 @@
*/
public void testBeanWithMultipleScopedStereotypes() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/scopeConflict/Scallop_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, 24, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE, 24, 25);
}
/**
@@ -88,9 +89,9 @@
*/
public void testNamedInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 9);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NamedStereotypedInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_HAS_NAME, 7);
}
/**
@@ -101,9 +102,9 @@
*/
public void testNamedDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 10);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/NamedStereotypedDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_HAS_NAME, 8);
}
/**
@@ -114,7 +115,7 @@
*/
public void testAlternativeInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/AlternativeInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, 7);
}
/**
@@ -125,7 +126,7 @@
*/
public void testAlternativeDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/AlternativeDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, 7);
}
/**
@@ -136,7 +137,7 @@
*/
public void testStereotypeScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/tooManyScopes/StereotypeWithTooManyScopeTypes_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, 32, 33);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, 32, 33);
}
/**
@@ -147,7 +148,7 @@
*/
public void testNonEmptyNamedForStereotype() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/nonEmptyNamed/StereotypeWithNonEmptyNamed_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_DECLARES_NON_EMPTY_NAME, 31);
}
/**
@@ -158,7 +159,7 @@
*/
public void testAnnotatedStereotype() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithBindingTypes_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, 30);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_QUALIFIER_IN_STEREOTYPE, 30);
}
/**
@@ -169,7 +170,7 @@
*/
public void testTypedStereotype() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/stereotype/broken/withBindingType/StereotypeWithTyped_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.STEREOTYPE_IS_ANNOTATED_TYPED, 15);
}
/**
@@ -180,7 +181,7 @@
*/
public void testInterceptorCanNotAlsoBeDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorCanNotBeDecorator/InterceptingDecorator.java");
- assertMarkerIsCreated(file, CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, 24, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.BOTH_INTERCEPTOR_AND_DECORATOR, 24, 25);
}
/**
@@ -191,7 +192,7 @@
*/
public void testNonDependentScopedBeanCanNotHavePublicField() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/dependentWithPublicField/Leopard_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD, 25);
}
/**
@@ -202,7 +203,7 @@
*/
public void testNonDependentGenericManagedBeanNotOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/bean/genericbroken/FooBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_GENERIC_TYPE, 21);
}
/**
@@ -214,7 +215,7 @@
*/
public void testSpecializingClassExtendsNonSimpleBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend3/Cow_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
}
/**
@@ -226,7 +227,7 @@
*/
public void testSpecializingClassDirectlyExtendsNothing() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend2/Cow_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
}
/**
@@ -238,7 +239,7 @@
*/
public void testSpecializingClassDirectlyExtendsEnterpriseBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/extendejb/Tractor_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
}
/**
@@ -250,7 +251,7 @@
*/
public void testSpecializingClassImplementsInterfaceAndExtendsNothing() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/noextend1/Donkey_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_MANAGED_BEAN, 21);
}
/**
@@ -262,7 +263,7 @@
*/
public void testStatelessWithRequestScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithRequestScope/Beagle_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -274,7 +275,7 @@
*/
public void testStatelessWithApplicationScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithApplicationScope/Dachshund_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -286,7 +287,7 @@
*/
public void testStatelessWithConversationScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithConversationScope/Boxer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
/**
@@ -298,7 +299,7 @@
*/
public void testStatelessWithSessionScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/statelessWithSessionScope/Bullmastiff_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_STATELESS_SESSION_BEAN, 23);
}
@@ -311,7 +312,7 @@
*/
public void testSingletonWithConversationScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithConversationScope/Husky_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 24);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 24);
}
/**
@@ -323,7 +324,7 @@
*/
public void testSingletonWithSessionScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/IrishTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 25);
}
/**
@@ -335,7 +336,7 @@
*/
public void testSingletonWithRequestScopeFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/Greyhound_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SINGLETON_SESSION_BEAN, 23);
}
/**
@@ -346,7 +347,7 @@
*/
public void testSessionBeanAnnotatedInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, 8, 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, 8, 9);
}
/**
@@ -357,7 +358,7 @@
*/
public void testSessionBeanAnnotatedDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/SessionBeanAnnotatedDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, 6, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, 6, 7);
}
/**
@@ -368,7 +369,7 @@
*/
public void testNonDependentGenericSessionBeanNotOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/sessionbeans/FooBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, 6);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_SESSION_BEAN_WITH_GENERIC_TYPE, 6);
}
/**
@@ -379,7 +380,7 @@
*/
public void testSpecializingClassDirectlyExtendsSimpleBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsSimpleBean/Tractor_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
}
/**
@@ -390,7 +391,7 @@
*/
public void testSpecializingEnterpriseClassImplementsInterfaceAndExtendsNothing() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/implementInterfaceAndExtendsNothing/Donkey_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
}
/**
@@ -401,7 +402,7 @@
*/
public void testSpecializingEnterpriseClassDirectlyExtendsNothing() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/directlyExtendsNothing/Cow_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_SESSION_BEAN, 22);
}
/**
@@ -415,7 +416,7 @@
*/
public void testParameterizedReturnTypeWithWildcard() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithWildcard/SpiderProducer.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, 24);
}
/**
@@ -429,9 +430,9 @@
*/
public void testParameterizedType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterizedTypeWithTypeParameter2/TProducer.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, 13);
}
/**
@@ -442,10 +443,10 @@
*/
public void testParameterizedReturnTypeWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 29, 43);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 25);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 35);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 39);
+ 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);
}
/**
@@ -455,8 +456,8 @@
*/
public void testParameterizedReturnTypeWithoutTypeVariableOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 52);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 57);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 52);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_METHOD, 57);
}
/**
@@ -467,7 +468,7 @@
*/
public void testInitializerMethodAnnotatedProduces() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/methodAnnotatedProduces/Pheasant_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 25);
}
/**
@@ -478,7 +479,7 @@
*/
public void testProducerMethodWithParameterAnnotatedDisposes() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedDisposes/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 25, 26);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 25, 26);
}
/**
@@ -489,7 +490,7 @@
*/
public void testProducerMethodWithParameterAnnotatedObserves() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/producer/method/broken/parameterAnnotatedObserves/SpiderProducer_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 26);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 26);
}
/**
@@ -501,7 +502,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"});
- assertMarkerIsCreated(file, bindedErrorMessage, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 25);
}
/**
@@ -514,7 +515,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"});
- assertMarkerIsNotCreated(file, bindedErrorMessage, 14);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 14);
}
/**
@@ -527,7 +528,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"});
- assertMarkerIsCreated(file, bindedErrorMessage, 13);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 13);
}
/**
@@ -541,7 +542,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"});
- assertMarkerIsNotCreated(file, bindedErrorMessage, 15);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 15);
}
/**
@@ -552,7 +553,7 @@
*/
public void testDecoratorMustNotHaveProducerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 10);
}
/**
@@ -563,7 +564,7 @@
*/
public void testInterceptorMustNotHaveProducerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 17);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 17);
}
/**
@@ -574,7 +575,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");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, 24);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_STATIC, 24);
}
/**
@@ -585,7 +586,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");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, 24);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SPECIALIZING_PRODUCER_OVERRIDE, 24);
}
/**
@@ -596,7 +597,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");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, 30, 30);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, 30, 30);
}
/**
@@ -607,7 +608,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");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 30, 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_DISPOSES, 30, 31);
}
/**
@@ -618,7 +619,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");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 32, 32);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 32, 32);
}
/**
@@ -629,7 +630,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");
- assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 32, 33);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 32, 33);
}
/**
@@ -641,10 +642,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"});
- assertMarkerIsCreated(file, bindedErrorMessage, 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(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"});
- assertMarkerIsNotCreated(file, bindedErrorMessage, 73);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 73);
}
/**
@@ -657,7 +658,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"});
- assertMarkerIsNotCreated(file, bindedErrorMessage, 18);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 18);
}
/**
@@ -670,7 +671,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"});
- assertMarkerIsCreated(file, bindedErrorMessage, 18);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 18);
}
/**
@@ -684,7 +685,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"});
- assertMarkerIsNotCreated(file, bindedErrorMessage, 20);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 20);
}
/**
@@ -695,7 +696,7 @@
*/
public void testDecoratorDeclaresDisposer() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6, 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6, 9);
}
/**
@@ -706,7 +707,7 @@
*/
public void testInterceptorDeclaresDisposer() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FordInterceptor.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8, 16);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8, 16);
}
/**
@@ -717,8 +718,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");
- assertMarkerIsCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 35);
- assertMarkerIsNotCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 35);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.NO_PRODUCER_MATCHING_DISPOSER, 31);
}
/**
@@ -729,7 +730,7 @@
*/
public void testMultipleDisposersForProducer() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, 13, 16);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DISPOSERS_FOR_PRODUCER, 13, 16);
}
/**
@@ -740,8 +741,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");
- assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1011, 1026);
- assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 1100, 1125);
+ AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 23, 1011, 1026);
+ AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_HAS_WILDCARD, 24, 1100, 1125);
}
/**
@@ -752,7 +753,7 @@
*/
public void testTypeVariable() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/SpiderProducerVariableType_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_FIELD_TYPE_IS_VARIABLE, 10);
}
/**
@@ -763,10 +764,10 @@
*/
public void testParameterizedTypeWithWrongScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ParameterizedTypeWithWrongScope_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 15, 22);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 13);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 18);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_FOR_PRODUCER_FIELD, 20);
+ 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);
}
/**
@@ -780,7 +781,7 @@
*/
public void testProducerAnnotatedInject() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/ProducerAnnotatedInjectBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 8);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 8);
}
/**
@@ -791,7 +792,7 @@
*/
public void testNonStaticProducerOfSessionBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/NonStaticProducerOfSessionBeanBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN, 9);
}
/**
@@ -802,7 +803,7 @@
*/
public void testDecoratorMustNotHaveProducerField() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/DecoratorHasProducerFieldBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_DECORATOR, 9);
}
/**
@@ -813,7 +814,7 @@
*/
public void testInterceptorMustNotHaveProducerField() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/producers/InterceptorHasProducerFieldBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 16);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, 16);
}
/**
@@ -824,7 +825,7 @@
*/
public void testResourceWithELName() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/resources/ProducerFieldsBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, 15, 19, 24, 27, 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.RESOURCE_PRODUCER_FIELD_SETS_EL_NAME, 15, 19, 24, 27, 31);
}
/*
@@ -849,7 +850,7 @@
*/
public void testTooManyInitializerAnnotatedConstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/tooManyInitializerAnnotatedConstructors/Goose_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, 24, 29);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_INJECTION_CONSTRUCTORS, 24, 29);
}
/**
@@ -860,7 +861,7 @@
*/
public void testConstructorHasDisposesParameter() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasDisposesParameter/DisposingConstructor.java");
- assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES, 24, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES, 24, 25);
}
/**
@@ -871,7 +872,7 @@
*/
public void testConstructorHasObservesParameter() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/simple/definition/constructorHasObservesParameter/ObservingConstructor.java");
- assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES, 25, 26);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES, 25, 26);
}
/**
@@ -882,7 +883,7 @@
*/
public void testStaticInitializerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, 11);
}
/**
@@ -893,8 +894,8 @@
*/
public void testInitializerMethodHasParameterAnnotatedDisposes() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/implementation/initializer/broken/parameterAnnotatedDisposes/Capercaillie_Broken.java");
- assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 25, 1003, 1010);
- assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 26, 1048, 1057);
+ AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 25, 1003, 1010);
+ AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(file, CDIValidationMessages.DISPOSER_ANNOTATED_INJECT, 26, 1048, 1057);
}
/**
@@ -905,7 +906,7 @@
*/
public void testGenericInitializerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GenericInitializerMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.GENERIC_METHOD_ANNOTATED_INJECT, 7);
}
/**
@@ -916,7 +917,7 @@
*/
public void testNamedInjectPoint() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/NamedInjectionBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, 10, 16);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, 10, 16);
}
/**
@@ -927,8 +928,8 @@
*/
public void testBeanDoesNotHaveSomeTypeOfSpecializedBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/MissingTypeBeanBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Farmer"), 6);
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.MISSING_TYPE_IN_SPECIALIZING_BEAN, "MissingTypeBeanBroken", "Farmer", "Simple"), 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);
}
/**
@@ -939,7 +940,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");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, "HighSchool_Broken.getStarPupil()", "School.getStarPupil()"), 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.CONFLICTING_NAME_IN_SPECIALIZING_BEAN, "HighSchool_Broken.getStarPupil()", "School.getStarPupil()"), 25);
}
/**
@@ -950,7 +951,7 @@
*/
public void testSpecializingInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INTERCEPTOR_ANNOTATED_SPECIALIZES, 9);
}
/**
@@ -961,7 +962,7 @@
*/
public void testSpecializingDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/specialization/SpecializingDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.DECORATOR_ANNOTATED_SPECIALIZES, 10);
}
/**
@@ -972,7 +973,7 @@
*/
public void testDecoratorNotResolved() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/decorator/House.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_DECORATOR, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_DECORATOR, 23);
}
/**
@@ -983,7 +984,7 @@
*/
public void testInterceptorNotResolved() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InjectInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_INTERCEPTOR, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INJECTED_INTERCEPTOR, 7);
}
/**
@@ -994,7 +995,7 @@
*/
public void testTypeVariableInjectionPoint() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/FarmBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, 11, 15);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, 11, 15);
}
/**
@@ -1005,7 +1006,7 @@
*/
public void testAnnotationMemberWithoutNonBinding() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_QUALIFIER_TYPE_MEMBER, 35);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_QUALIFIER_TYPE_MEMBER, 35);
}
/**
@@ -1016,7 +1017,7 @@
*/
public void testArrayMemberWithoutNonBinding() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER, 34);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER, 34);
}
/**
@@ -1027,7 +1028,7 @@
*/
public void testSessionScopedBeanWithInjectionPoint() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/broken/normal/scope/Cat_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 27);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_SCOPE_WHEN_TYPE_INJECTIONPOINT_IS_INJECTED, 27);
}
/**
@@ -1038,7 +1039,7 @@
*/
public void testMultipleDelegateInjectionPoints() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/multipleDelegateInjectionPoints/TimestampLogger.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DELEGATE, 31, 32);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_DELEGATE, 31, 32);
}
/**
@@ -1049,9 +1050,9 @@
*/
public void testNoDelegateInjectionPoints() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/noDelegateInjectionPoints/TimestampLogger.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_DELEGATE, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_DELEGATE, 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_DELEGATE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_DELEGATE);
}
/**
@@ -1062,13 +1063,13 @@
*/
public void testDecoratorDelegateInjectionPoints() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE, 33);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INJECTION_POINT_DELEGATE, 33);
}
/**
@@ -1079,13 +1080,13 @@
*/
public void testNonDecoratorWithDecoratesAnnotationNotOK() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/nonDecoratorWithDecorates/Elf.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE, 24);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE, 24);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_BEAN_DECLARING_DELEGATE);
}
/**
@@ -1096,7 +1097,7 @@
*/
public void testNotAllDecoratedTypesImplemented() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/notAllDecoratedTypesImplemented/TimestampLogger.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"), 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"), 31);
}
/**
@@ -1107,21 +1108,21 @@
*/
public void testAllDecoratedTypesImplemented() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLogger.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
+ 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"));
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerWithMethod.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "EnhancedLogger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "TimestampLogger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "MockLogger"));
+ 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"));
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/FooDecorator.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE.substring(0, 60) + ".*");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE.substring(0, 60) + ".*");
}
/**
@@ -1132,7 +1133,7 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterInInterfcaeInFiled() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
}
/**
@@ -1143,7 +1144,7 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterInInterfcaeInMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampWithMethodBroken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<java.lang.String>"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "IClazz<java.lang.String>"), 10);
}
/**
@@ -1157,7 +1158,7 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterWithInterfaceInFiled() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerOk.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
}
/**
@@ -1171,7 +1172,7 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterWithInterfaceInMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampLoggerWithMethodOk.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
}
/**
@@ -1185,13 +1186,13 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterInFiled() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerOk.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(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");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ 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"));
}
/**
@@ -1204,13 +1205,13 @@
*/
public void testDelegateSpecifiesDifferentTypeParameterInMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/delegates/TimestampParametedLoggerWithMethodOk.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<org.jboss.jsr299.tck.tests.jbt.validation.decorators.delegates.Logger>"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(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");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Logger"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Clazz<java.lang.String>"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Test"));
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DELEGATE_HAS_ILLEGAL_TYPE, "Object"));
+ 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"));
}
/**
@@ -1221,10 +1222,10 @@
*/
public void testNoInterceptorBinfdingsInInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/NoInterceptorBinfdingsInInterceptor.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING, 7);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/SecureTransaction.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_INTERCEPTOR_BINDING);
}
/**
@@ -1236,7 +1237,7 @@
*/
public void testInterceptorBinfdingsInInterceptorWithPreDestroyBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPreDestroyBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
}
/**
@@ -1248,7 +1249,7 @@
*/
public void testInterceptorBinfdingsInInterceptorWithPostConstructBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithPostConstructorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING, 7);
}
/**
@@ -1259,9 +1260,9 @@
*/
public void testInterceptorBinfdingsInInterceptorWithLifeCycleMethodOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/InterceptorWithLifeCycleMethodOk.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/CatInterceptor.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_LIFECYCLE_CALLBACK_INTERCEPTOR_BINDING);
}
/**
@@ -1272,7 +1273,7 @@
*/
public void testClassLevelInterceptorBindingWithFinalMethodBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassLevelInterceptorBindingWithFinalMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
}
/**
@@ -1283,7 +1284,7 @@
*/
public void testClassWithMethodLevelInterceptorBindingWithFinalMethodBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassWithMethodLevelInterceptorBindingWithFinalMethodBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD, 6);
}
/**
@@ -1294,7 +1295,7 @@
*/
public void testFinalClassWithClassLevelInterceptorBindingBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FinalClassWithClassLevelInterceptorBindingBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 4);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 4);
}
/**
@@ -1305,7 +1306,7 @@
*/
public void testFinalClassWithMethodLevelInterceptorBindingBroken() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FinalClassWithMethodLevelInterceptorBindingBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 3);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS, 3);
}
/**
@@ -1316,8 +1317,8 @@
*/
public void testClassLevelInterceptorBindingOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassLevelInterceptorBindingOk.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
}
/**
@@ -1328,8 +1329,8 @@
*/
public void testClassWithMethodLevelInterceptorBindingOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ClassWithMethodLevelInterceptorBindingOk.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
- assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_CLASS);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_INTERCEPTOR_BINDING_METHOD);
}
/**
@@ -1343,9 +1344,9 @@
*/
public void testInterceptorBindingsWithConflictingAnnotationMembersNotOk() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/interceptors/definition/broken/invalidBindingAnnotations/Foo.java");
-// assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 19, 20);
+// AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 19, 20);
//At present CDICoreValidator puts marker to class name
- assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.CONFLICTING_INTERCEPTOR_BINDINGS, 21);
}
/**
@@ -1356,8 +1357,8 @@
*/
public void testAnnotationTypeMemberWithoutNonBindingInInterceptorByndingType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/members/InterceptorBindingMemberBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 19);
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 20);
+ 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);
}
/**
@@ -1368,8 +1369,8 @@
*/
public void testArrayTypeMemberWithoutNonBindingInInterceptorByndingType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/members/InterceptorBindingMemberBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 21);
- assertMarkerIsNotCreated(file, CDIValidationMessages.MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, 22);
+ 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);
}
/**
@@ -1380,7 +1381,7 @@
*/
public void testObserverMethodMustHaveOnlyOneEventParameter() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/tooManyParameters/YorkshireTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, 24, 24);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_OBSERVING_PARAMETERS, 24, 24);
}
/**
@@ -1391,7 +1392,7 @@
*/
public void testObserverMethodAnnotatedProducesFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isProducer/BorderTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_PARAMETER_ILLEGALLY_ANNOTATED_OBSERVES, 25, 25);
}
/**
@@ -1402,7 +1403,7 @@
*/
public void testObserverMethodAnnotatedInitializerFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isInitializer/AustralianTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 25, 26);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 25, 26);
}
/**
@@ -1413,7 +1414,7 @@
*/
public void testObserverMethodWithDisposesParamFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/isDisposer/FoxTerrier_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 28, 28);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, 28, 28);
}
/**
@@ -1425,7 +1426,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"});
- assertMarkerIsCreated(file, bindedErrorMessage, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, bindedErrorMessage, 25);
}
/**
@@ -1438,7 +1439,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"});
- assertMarkerIsNotCreated(file, bindedErrorMessage, 21);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, bindedErrorMessage, 21);
}
/**
@@ -1449,7 +1450,7 @@
*/
public void testObserverMethodInInterceptor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/ObserverMethodInInterceptorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_INTERCEPTOR, 10);
}
/**
@@ -1460,7 +1461,7 @@
*/
public void testObserverMethodInDecorator() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/decorators/ObserverMethodInDecoratorBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_DECORATOR, 14);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_IN_DECORATOR, 14);
}
/**
@@ -1471,6 +1472,6 @@
*/
public void testDependentBeanWithConditionalObserverMethodIsDefinitionError() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/event/broken/observer/dependentIsConditionalObserver/AlarmSystem.java");
- assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, 24);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_CONDITIONAL_OBSERVER, 24);
}
}
\ 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/DependentProjectValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DependentProjectValidationTest.java 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DependentProjectValidationTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -23,6 +23,7 @@
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -67,13 +68,13 @@
JobUtils.waitForIdle();
IFile testBean3 = project3.getFile("src/cdi/test3/TestBean3.java");
- assertMarkerIsNotCreated(testBean3, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean3.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testBean3, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean3.foo()"), 10);
IFile testBean4 = project4.getFile("src/cdi/test4/TestBean4.java");
- assertMarkerIsNotCreated(testBean4, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "TestBean4.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testBean4, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "TestBean4.foo()"), 10);
IFile testBean5 = project5.getFile("src/cdi/test5/TestBean5.java");
- assertMarkerIsNotCreated(testBean5, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean5.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testBean5, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean5.foo()"), 10);
IFile scope = project2.getFile(new Path("src/test/TestScope.java"));
IFile normalScope = project2.getFile(new Path("src/test/TestNormalScope.validation"));
@@ -83,13 +84,13 @@
JobUtils.waitForIdle(1000);
testBean3 = project3.getFile("src/cdi/test3/TestBean3.java");
- assertMarkerIsCreated(testBean3, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean3.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(testBean3, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean3.foo()"), 10);
testBean4 = project4.getFile("src/cdi/test4/TestBean4.java");
- assertMarkerIsCreated(testBean4, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "TestBean4.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(testBean4, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "TestBean4.foo()"), 10);
testBean5 = project5.getFile("src/cdi/test5/TestBean5.java");
- assertMarkerIsCreated(testBean5, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean5.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(testBean5, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean5.foo()"), 10);
normalScope = project2.getFile(new Path("src/test/TestScope.java"));
scope = project2.getFile(new Path("src/test/TestScope.validation"));
@@ -99,13 +100,13 @@
JobUtils.waitForIdle(1000);
testBean3 = project3.getFile("src/cdi/test3/TestBean3.java");
- assertMarkerIsNotCreated(testBean3, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean3.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testBean3, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean3.foo()"), 10);
testBean4 = project4.getFile("src/cdi/test4/TestBean4.java");
- assertMarkerIsNotCreated(testBean4, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "TestBean4.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testBean4, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "TestBean4.foo()"), 10);
testBean5 = project5.getFile("src/cdi/test5/TestBean5.java");
- assertMarkerIsNotCreated(testBean5, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean5.foo()"), 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testBean5, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "TestBean5.foo()"), 10);
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
JobUtils.waitForIdle();
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 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/DeploymentProblemsValidationTests.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -19,6 +19,7 @@
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -34,9 +35,9 @@
*/
public void testInconsistentSpecialization() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Maid.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Maid, Manager", "Employee"), 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Maid, Manager", "Employee"), 21);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/inconsistent/Manager.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Manager, Maid", "Employee"), 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.INCONSISTENT_SPECIALIZATION, "Manager, Maid", "Employee"), 21);
}
/**
@@ -47,9 +48,9 @@
*/
public void testAmbiguousDependency() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 34);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 34);
}
/**
@@ -60,9 +61,9 @@
*/
public void testUnsatisfiedDependency() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 25);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 25);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 34);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 34);
}
/**
@@ -73,8 +74,8 @@
*/
public void testAmbiguousDependencyForInstance() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/InjectionInstance.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 8);
- assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 11);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 8);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 11);
}
/**
@@ -85,8 +86,8 @@
*/
public void testUnsatisfiedDependencyForInstance() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/InjectionInstance.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 9);
- assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
}
/**
@@ -96,9 +97,9 @@
*/
public void testBeansWithDefaultCounstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/resolution/defaultconstructors/CurrentProject.java");
- assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 12);
- assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
- assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 15);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 12);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 15);
}
/**
@@ -109,13 +110,13 @@
*/
public void testPrimitiveInjectionPointResolvedToNonPrimitiveProducerMethod() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/GameBroken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 7, 19);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 9);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 10);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 11);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 20);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 21);
- assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 22);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 7, 19);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 9);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 10);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 11);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 20);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 21);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, 22);
}
/**
@@ -128,9 +129,9 @@
*/
public void testInjectionPointWithArrayType() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/InjectionPointBean_Broken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType[]", "ArrayProducer.produce()"), 6);
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType", "TestType"), 7);
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType[]", "ArrayProducer.produce2()"), 8);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType[]", "ArrayProducer.produce()"), 6);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType", "TestType"), 7);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, "TestType[]", "ArrayProducer.produce2()"), 8);
}
/**
@@ -143,10 +144,10 @@
*/
public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/Number_Broken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "NumberProducer.produce()"), 9);
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "long", "NumberProducer.foo"), 13);
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "Short", "NumberProducer.foo2"), 17);
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "NumberProducer.foo3"), 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "int", "NumberProducer.produce()"), 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "long", "NumberProducer.foo"), 13);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "Short", "NumberProducer.foo2"), 17);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, "boolean", "NumberProducer.foo3"), 21);
}
/**
@@ -159,7 +160,7 @@
*/
public void testClassWithPrivateConstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/privateConstructor/InjectionPointBean.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "Unproxyable_Broken", "Unproxyable_Broken"), 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "Unproxyable_Broken", "Unproxyable_Broken"), 23);
}
/**
@@ -168,7 +169,7 @@
*/
public void testClassWithDefaultConstructor() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/unproxyable/Number_Broken.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "BeanWithDefaultConsturctor", "BeanWithDefaultConsturctor"), 24);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, "BeanWithDefaultConsturctor", "BeanWithDefaultConsturctor"), 24);
}
/**
@@ -181,7 +182,7 @@
*/
public void testInjectionPointWhichResolvesToNormalScopedFinalBean() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalClass/FishFarm.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, "Tuna_Broken", "Tuna_Broken"), 24);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, "Tuna_Broken", "Tuna_Broken"), 24);
}
/**
@@ -194,7 +195,7 @@
*/
public void testClassWithFinalMethodCannotBeProxied() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/clientProxy/unproxyable/finalMethod/FishFarm.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, "Tuna_Broken", "Tuna_Broken"), 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, "Tuna_Broken", "Tuna_Broken"), 23);
}
/**
@@ -207,9 +208,9 @@
*/
public void testDuplicateNamedBeans() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Cod.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "Cod, Sole"), 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "Cod, Sole"), 21);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/byname/duplicateNameResolution/Sole.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "Sole, Cod"), 21);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, "Sole, Cod"), 21);
}
/**
@@ -220,7 +221,7 @@
*/
public void testDuplicateBeanNamePrefix() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/byname/duplicatePrefixResolution/ExampleWebsite_Broken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNRESOLVABLE_EL_NAME, "example.com", "com", "example", "Example"), 22);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.UNRESOLVABLE_EL_NAME, "example.com", "com", "example", "Example"), 22);
}
/**
@@ -232,7 +233,7 @@
*/
public void testAppliesToFinalManagedBeanClass() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/finalBeanClass/TimestampLogger.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, "MockLogger"), 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, "MockLogger"), 31);
}
/**
@@ -244,7 +245,7 @@
*/
public void testAppliesToFinalMethodOnManagedBeanClass() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/broken/finalBeanMethod/TimestampLogger.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, "MockLogger", "log(String string)"), 31);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, "MockLogger", "log(String string)"), 31);
}
/**
@@ -256,8 +257,8 @@
JobUtils.waitForIdle();
IFile testInjection = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/revalidation/TestBeanBroken.java");
- assertMarkerIsNotCreated(testInjection, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 7);
- assertMarkerIsNotCreated(testInjection, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 7);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testInjection, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 7);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testInjection, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 7);
IFile testBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/revalidation/TestBeanImpl2.java");
IFile testBeanImpl = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/revalidation/TestBeanImpl2.validation");
@@ -266,7 +267,7 @@
tckProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
JobUtils.waitForIdle(1000);
- assertMarkerIsCreated(testInjection, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 7);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(testInjection, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 7);
testBeanImpl = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/revalidation/TestBeanImpl2.java");
testBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/inject/revalidation/TestBeanImpl2Original.validation");
@@ -275,8 +276,8 @@
tckProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
JobUtils.waitForIdle(1000);
- assertMarkerIsNotCreated(testInjection, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 7);
- assertMarkerIsNotCreated(testInjection, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 7);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testInjection, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 7);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(testInjection, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 7);
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
JobUtils.waitForIdle();
@@ -291,6 +292,6 @@
*/
public void testSimpleWebBeanWithNonSerializableImplementationClassFails() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/context/passivating/broken/nonPassivationCapableManagedBeanHasPassivatingScope/Hamina_Broken.java");
- assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, "Hamina_Broken", "SessionScoped"), 22);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, "Hamina_Broken", "SessionScoped"), 22);
}
}
\ 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/ELValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELValidationTest.java 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELValidationTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -18,6 +18,7 @@
import org.jboss.tools.jst.web.kb.internal.validation.ELValidationMessages;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -30,9 +31,9 @@
try {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/TestBean.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
file = tckProject.getFile("WebContent/elValidation.xhtml");
- assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 9);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 9);
IFile namedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NamedBean.java");
IFile newNamedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NewNamedBean.validation");
@@ -42,9 +43,9 @@
JobUtils.waitForIdle(1000);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/TestBean.java");
- assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
file = tckProject.getFile("WebContent/elValidation.xhtml");
- assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 9);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 9);
newNamedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NamedBean.java");
namedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NamedBean.validation");
@@ -54,9 +55,9 @@
JobUtils.waitForIdle(1000);
file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/TestBean.java");
- assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
file = tckProject.getFile("WebContent/elValidation.xhtml");
- assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 9);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 9);
} finally {
IFile newNamedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NamedBean.java");
IFile namedBean = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/NamedBean.validation");
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -12,13 +12,10 @@
import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.jst.web.kb.internal.validation.ValidationContext;
import org.jboss.tools.jst.web.kb.validation.IValidator;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -35,33 +32,4 @@
}
return null;
}
-
- public static int getMarkersNumber(IResource resource) {
- return AbstractResourceMarkerTest.getMarkersNumberByGroupName(resource, null);
- }
-
- public static void assertMarkerIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
- assertMarkerIsCreated(resource, pattern, true, expectedLines);
- }
-
- public static void assertMarkerIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, pattern?convertMessageToPatern(message):message, pattern, expectedLines);
- }
-
- public static void assertMarkerIsNotCreated(IResource resource, String message) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message));
- }
-
- public static void assertMarkerIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), expectedLine);
- }
-
- public static void assertMarkerIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), lineNumber, startPosition, endPosition);
- }
-
- public static String convertMessageToPatern(String message) {
- return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>").replace("(", "\\(").replace(")", "\\)")
- .replace("{", "\\{").replace("}", "\\}").replace("'", "\\'");
- }
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF/MANIFEST.MF 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF/MANIFEST.MF 2011-05-26 00:32:38 UTC (rev 31503)
@@ -20,7 +20,6 @@
org.jboss.tools.jst.web.kb,
org.jboss.tools.cdi.xml,
org.jboss.tools.cdi.seam.solder.core,
- org.eclipse.jst.standard.schemas,
- org.jboss.tools.cdi.core.test
+ org.eclipse.jst.standard.schemas
Export-Package: org.jboss.tools.cdi.seam.config.core.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -20,9 +20,9 @@
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.ICDIProject;
-import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
import org.jboss.tools.cdi.seam.config.core.validation.SeamConfigValidationMessages;
import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
*
@@ -65,30 +65,30 @@
}
public void testBeanResolution() throws CoreException {
- ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
- ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean1"));
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean1"));
}
public void testFieldResolution() throws CoreException {
- ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "param"), 21);
- ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "value"), 28);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "param"), 21);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "value"), 28);
}
public void testMethodResolution() throws CoreException {
//It is unresolved member because no member with that name is found.
- ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method2"), 38);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method2"), 38);
- ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 34);
- ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 34);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 34);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 34);
- ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 42);
- ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 42);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 42);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 42);
- ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 47);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 47);
}
public void testAnnotationMemberResolution() throws CoreException {
- ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field3"), 15);
- ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field1"));
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field3"), 15);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field1"));
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF 2011-05-26 00:32:38 UTC (rev 31503)
@@ -11,5 +11,4 @@
org.eclipse.core.resources;bundle-version="3.7.100",
org.jboss.tools.tests,
org.eclipse.core.runtime;bundle-version="3.7.0",
- org.jboss.tools.cdi.core,
- org.jboss.tools.cdi.core.test
+ org.jboss.tools.cdi.core
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -15,8 +15,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
* @author Alexey Kazakov
@@ -34,12 +34,12 @@
public void testInjectionAnnotatedInputField() throws Exception {
IFile file = project.getFile("src/org/jboss/beans/validation/test/Validation.java");
- ValidationTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 18, 23);
- ValidationTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 20, 28);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 18, 23);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 20, 28);
- ValidationTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 9);
- ValidationTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 11);
- ValidationTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 14);
- ValidationTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 14);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 9);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 11);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 14);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 14);
}
}
\ No newline at end of file
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 2011-05-26 00:12:43 UTC (rev 31502)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2011-05-26 00:32:38 UTC (rev 31503)
@@ -376,4 +376,29 @@
this.pattern = pattern;
}
}
+
+ public static void assertMarkerIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
+ assertMarkerIsCreated(resource, pattern, true, expectedLines);
+ }
+
+ public static void assertMarkerIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
+ assertMarkerIsCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, pattern?convertMessageToPatern(message):message, pattern, expectedLines);
+ }
+
+ public static void assertMarkerIsNotCreated(IResource resource, String message) throws CoreException {
+ assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message));
+ }
+
+ public static void assertMarkerIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
+ assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), expectedLine);
+ }
+
+ public static void assertMarkerIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
+ assertMarkerIsCreatedForGivenPosition(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), lineNumber, startPosition, endPosition);
+ }
+
+ public static String convertMessageToPatern(String message) {
+ return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>").replace("(", "\\(").replace(")", "\\)")
+ .replace("{", "\\{").replace("}", "\\}").replace("'", "\\'");
+ }
}
\ No newline at end of file
13 years, 1 month
JBoss Tools SVN: r31502 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core: generic and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-25 20:12:43 -0400 (Wed, 25 May 2011)
New Revision: 31502
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerField.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerMethod.java
Removed:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/definition/GenericProducerField.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericClassBean.java
Log:
JBIDE-8674
https://issues.jboss.org/browse/JBIDE-8674
Deleted: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/definition/GenericProducerField.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/definition/GenericProducerField.java 2011-05-26 00:10:29 UTC (rev 31501)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/definition/GenericProducerField.java 2011-05-26 00:12:43 UTC (rev 31502)
@@ -1,7 +0,0 @@
-package org.jboss.tools.cdi.seam.solder.core.definition;
-
-import org.jboss.tools.cdi.internal.core.impl.ProducerField;
-
-public class GenericProducerField extends ProducerField {
-
-}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java 2011-05-26 00:10:29 UTC (rev 31501)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java 2011-05-26 00:12:43 UTC (rev 31502)
@@ -104,12 +104,21 @@
ti.setType(t.getType(), context.getRootContext(), 0);
List<MethodDefinition> ps = ti.getMethods();
for (MethodDefinition m: ps) {
- if(m.isAnnotationPresent(PRODUCES_ANNOTATION_TYPE_NAME)) {
+ if(m.isAnnotationPresent(PRODUCES_ANNOTATION_TYPE_NAME)
+ || m.isAnnotationPresent(UNWRAPS_ANNOTATION_TYPE_NAME)) {
for (IAnnotationDeclaration d: list) {
m.addAnnotation(((AnnotationDeclaration)d).getDeclaration(), context.getRootContext());
}
}
}
+ List<FieldDefinition> fs = ti.getFields();
+ for (FieldDefinition f: fs) {
+ if(f.isAnnotationPresent(PRODUCES_ANNOTATION_TYPE_NAME)) {
+ for (IAnnotationDeclaration d: list) {
+ f.addAnnotation(((AnnotationDeclaration)d).getDeclaration(), context.getRootContext());
+ }
+ }
+ }
replaceGenericInjections(ti, list);
GenericClassBean cb = new GenericClassBean();
@@ -142,11 +151,13 @@
List<MethodDefinition> ms = ti.getMethods();
for (MethodDefinition m: ms) {
- if(m.isAnnotationPresent(INJECT_ANNOTATION_TYPE_NAME)) {
+ boolean isObserver = m.isObserver();
+ if(m.isAnnotationPresent(INJECT_ANNOTATION_TYPE_NAME) || isObserver) {
boolean isMethodGeneric = m.isAnnotationPresent(GENERIC_QUALIFIER_TYPE_NAME);
List<ParameterDefinition> ps = m.getParameters();
for (ParameterDefinition p: ps) {
- if(isMethodGeneric || p.isAnnotationPresent(GENERIC_QUALIFIER_TYPE_NAME)) {
+ if(isMethodGeneric || p.isAnnotationPresent(GENERIC_QUALIFIER_TYPE_NAME)
+ || (isObserver && p.isAnnotationPresent(OBSERVERS_ANNOTATION_TYPE_NAME))) {
for (IAnnotationDeclaration d: list) {
p.addAnnotation(((AnnotationDeclaration)d).getDeclaration(), context.getRootContext());
}
Copied: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerField.java (from rev 31448, trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/definition/GenericProducerField.java)
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerField.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerField.java 2011-05-26 00:12:43 UTC (rev 31502)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.seam.solder.core.generic;
+
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IScope;
+import org.jboss.tools.cdi.internal.core.impl.ProducerField;
+import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class GenericBeanProducerField extends ProducerField {
+
+ public GenericBeanProducerField() {}
+
+ public IScope getScope() {
+ IScope result = null;
+ if(definition.isAnnotationPresent(CDISeamSolderConstants.APPLY_SCOPE_ANNOTATION_TYPE_NAME)) {
+ if(getParent() instanceof GenericClassBean) {
+ IBean generic = ((GenericClassBean)getParent()).getGenericProducerBean();
+ if(generic != null) {
+ result = generic.getScope();
+ }
+ }
+ }
+ if(result == null) {
+ result = super.getScope();
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerField.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerMethod.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerMethod.java 2011-05-26 00:12:43 UTC (rev 31502)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.seam.solder.core.generic;
+
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IScope;
+import org.jboss.tools.cdi.internal.core.impl.ProducerMethod;
+import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class GenericBeanProducerMethod extends ProducerMethod {
+
+ public GenericBeanProducerMethod() {}
+
+ public IScope getScope() {
+ IScope result = null;
+ if(definition.isAnnotationPresent(CDISeamSolderConstants.APPLY_SCOPE_ANNOTATION_TYPE_NAME)) {
+ if(getParent() instanceof GenericClassBean) {
+ IBean generic = ((GenericClassBean)getParent()).getGenericProducerBean();
+ if(generic != null) {
+ result = generic.getScope();
+ }
+ }
+ }
+ if(result == null) {
+ result = super.getScope();
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanProducerMethod.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericClassBean.java 2011-05-26 00:10:29 UTC (rev 31501)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericClassBean.java 2011-05-26 00:12:43 UTC (rev 31502)
@@ -15,7 +15,11 @@
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.internal.core.impl.AbstractBeanElement;
import org.jboss.tools.cdi.internal.core.impl.ClassBean;
+import org.jboss.tools.cdi.internal.core.impl.ProducerField;
+import org.jboss.tools.cdi.internal.core.impl.ProducerMethod;
import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.FieldDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.MethodDefinition;
import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants;
/**
@@ -28,6 +32,14 @@
public GenericClassBean() {}
+ protected ProducerMethod newProducerMethod(MethodDefinition m) {
+ return new GenericBeanProducerMethod();
+ }
+
+ protected ProducerField newProducerField(FieldDefinition f) {
+ return new GenericBeanProducerField();
+ }
+
public void setGenericProducerBeanDefinition(AbstractMemberDefinition def) {
genericProducerBean = def;
}
13 years, 1 month
JBoss Tools SVN: r31501 - trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-25 20:10:29 -0400 (Wed, 25 May 2011)
New Revision: 31501
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
Log:
JBIDE-9006
https://issues.jboss.org/browse/JBIDE-9006
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2011-05-26 00:09:39 UTC (rev 31500)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2011-05-26 00:10:29 UTC (rev 31501)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -107,7 +108,7 @@
ICDIProject cdiProject = cdiNature.getDelegate();
if(cdiProject != null){
IInjectionPoint injectionPoint = findInjectedPoint(cdiProject, element, position, file);
- IParameter param = findObserverParameter(cdiProject, element, offset, file);
+ Set<IParameter> param = findObserverParameter(cdiProject, element, offset, file);
if(injectionPoint != null){
Set<IObserverMethod> observerMethods = cdiProject.resolveObserverMethods(injectionPoint);
@@ -115,7 +116,9 @@
hyperlinks.add(new ObserverMethodListHyperlink(textViewer, region, observerMethods, document, hyperlinks.size()));
} else if(param != null) {
- Set<IInjectionPoint> events = cdiProject.findObservedEvents(param);
+ Set<IInjectionPoint> events = new HashSet<IInjectionPoint>();
+ for (IParameter p: param)
+ events.addAll(cdiProject.findObservedEvents(p));
if(events.size() > 0)
hyperlinks.add(new EventListHyperlink(textViewer, region, events, document, hyperlinks.size()));
@@ -138,27 +141,26 @@
return CDIUtil.findInjectionPoint(beans, element, offset);
}
- private IParameter findObserverParameter(ICDIProject cdiProject, IJavaElement element, int offset, IFile file) throws JavaModelException {
+ private Set<IParameter> findObserverParameter(ICDIProject cdiProject, IJavaElement element, int offset, IFile file) throws JavaModelException {
+ HashSet<IParameter> result = new HashSet<IParameter>();
Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
for (IBean bean: beans) {
if(bean instanceof IClassBean) {
- Set<IBeanMethod> observers = ((IClassBean)bean).getObserverMethods();
- for (IBeanMethod bm: observers) {
- if(bm instanceof IObserverMethod) {
- ISourceRange sr = bm.getMethod().getSourceRange();
- if(sr.getOffset() <= offset && sr.getOffset() + sr.getLength() >= offset) {
- IObserverMethod obs = (IObserverMethod)bm;
- Set<IParameter> ps = obs.getObservedParameters();
- if(!ps.isEmpty()) {
- return ps.iterator().next();
- }
+ Set<IObserverMethod> observers = ((IClassBean)bean).getObserverMethods();
+ for (IObserverMethod bm: observers) {
+ ISourceRange sr = bm.getMethod().getSourceRange();
+ if(sr.getOffset() <= offset && sr.getOffset() + sr.getLength() >= offset) {
+ IObserverMethod obs = (IObserverMethod)bm;
+ Set<IParameter> ps = obs.getObservedParameters();
+ if(!ps.isEmpty()) {
+ result.add(ps.iterator().next());
}
}
}
}
}
- return null;
+ return result;
}
}
13 years, 1 month
JBoss Tools SVN: r31500 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-25 20:09:39 -0400 (Wed, 25 May 2011)
New Revision: 31500
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java
Log:
JBIDE-9006
https://issues.jboss.org/browse/JBIDE-9006
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java 2011-05-26 00:09:14 UTC (rev 31499)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/testmodel/CDIBean.java 2011-05-26 00:09:39 UTC (rev 31500)
@@ -16,6 +16,7 @@
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInterceptorBinding;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
+import org.jboss.tools.cdi.core.IObserverMethod;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IProducer;
import org.jboss.tools.cdi.core.IQualifier;
@@ -236,7 +237,7 @@
}
@Override
- public Set<IBeanMethod> getObserverMethods() {
+ public Set<IObserverMethod> getObserverMethods() {
// TODO Auto-generated method stub
return null;
}
13 years, 1 month
JBoss Tools SVN: r31499 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-25 20:09:14 -0400 (Wed, 25 May 2011)
New Revision: 31499
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
Log:
JBIDE-9006
https://issues.jboss.org/browse/JBIDE-9006
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2011-05-26 00:07:51 UTC (rev 31498)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2011-05-26 00:09:14 UTC (rev 31499)
@@ -123,15 +123,13 @@
private IParameter findObserverParameter(Set<IBean> beans, IMethod method) throws JavaModelException {
for (IBean bean: beans) {
if(bean instanceof IClassBean) {
- Set<IBeanMethod> observers = ((IClassBean)bean).getObserverMethods();
- for (IBeanMethod bm: observers) {
- if(bm instanceof IObserverMethod) {
- if(bm.getMethod().equals(method)){
- IObserverMethod obs = (IObserverMethod)bm;
- Set<IParameter> ps = obs.getObservedParameters();
- if(!ps.isEmpty()) {
- return ps.iterator().next();
- }
+ Set<IObserverMethod> observers = ((IClassBean)bean).getObserverMethods();
+ for (IObserverMethod bm: observers) {
+ if(bm.getMethod().equals(method)){
+ IObserverMethod obs = (IObserverMethod)bm;
+ Set<IParameter> ps = obs.getObservedParameters();
+ if(!ps.isEmpty()) {
+ return ps.iterator().next();
}
}
}
13 years, 1 month
JBoss Tools SVN: r31498 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-25 20:07:51 -0400 (Wed, 25 May 2011)
New Revision: 31498
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParameter.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-9006
https://issues.jboss.org/browse/JBIDE-9006
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java 2011-05-26 00:02:45 UTC (rev 31497)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IClassBean.java 2011-05-26 00:07:51 UTC (rev 31498)
@@ -52,7 +52,7 @@
*
* @return a set of observer methods of the bean
*/
- Set<IBeanMethod> getObserverMethods();
+ Set<IObserverMethod> getObserverMethods();
/**
* Returns all the directly derived classes that declare annotation @Specializes
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParameter.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParameter.java 2011-05-26 00:02:45 UTC (rev 31497)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IParameter.java 2011-05-26 00:07:51 UTC (rev 31498)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.cdi.core;
+import java.util.Set;
+
import org.jboss.tools.common.text.ITextSourceReference;
/**
@@ -51,4 +53,10 @@
* @return the bean method which has this parameter
*/
IBeanMethod getBeanMethod();
+
+ /**
+ *
+ * @return qualifier declarations for this parameter
+ */
+ public Set<IQualifierDeclaration> getQualifierDeclarations();
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-05-26 00:02:45 UTC (rev 31497)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-05-26 00:07:51 UTC (rev 31498)
@@ -22,18 +22,17 @@
import java.util.TreeMap;
import java.util.TreeSet;
-import org.apache.xerces.util.SynchronizedSymbolTable;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CatchClause;
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
@@ -65,9 +64,7 @@
import org.jboss.tools.cdi.internal.core.impl.definition.DefinitionContext;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
import org.jboss.tools.cdi.internal.core.scanner.ImplementationCollector;
-import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.INodeReference;
@@ -494,17 +491,17 @@
return true;
}
- public static boolean areMatchingEventQualifiers(Set<IQualifierDeclaration> eventQualifiers, IType... paramQualifiers) throws CoreException {
- if(!eventQualifiers.isEmpty() || paramQualifiers.length != 0) {
+ public static boolean areMatchingEventQualifiers(Set<IQualifierDeclaration> eventQualifiers, Set<IQualifierDeclaration> paramQualifiers) throws CoreException {
+ if(!eventQualifiers.isEmpty() || paramQualifiers.isEmpty()) {
TreeSet<String> paramKeys = new TreeSet<String>();
- for (IType d: paramQualifiers) {
- paramKeys.add(d.getFullyQualifiedName());
+ for (IQualifierDeclaration d: paramQualifiers) {
+ paramKeys.add(getAnnotationDeclarationKey(d));
}
TreeSet<String> eventKeys = new TreeSet<String>();
for (IAnnotationDeclaration d: eventQualifiers) {
- eventKeys.add(d.getType().getFullyQualifiedName());
+ eventKeys.add(getAnnotationDeclarationKey(d));
}
if(!eventKeys.contains(CDIConstants.ANY_QUALIFIER_TYPE_NAME)) {
@@ -813,19 +810,18 @@
IParametedType eventType = getEventType(injectionPoint.getType());
if(eventType != null) {
- for (IClassBean b: classBeans.values()) {
- Set<IBeanMethod> ms = b.getObserverMethods();
- for (IBeanMethod m: ms) {
- if(m instanceof IObserverMethod) {
- IObserverMethod om = (IObserverMethod)m;
- Set<IParameter> params = om.getObservedParameters();
- if(params.isEmpty()) continue;
+ for (IBean ib: allBeans) {
+ if(!(ib instanceof IClassBean)) continue;
+ IClassBean b = (IClassBean)ib;
+ Set<IObserverMethod> ms = b.getObserverMethods();
+ for (IObserverMethod m: ms) {
+ IObserverMethod om = (IObserverMethod)m;
+ Set<IParameter> params = om.getObservedParameters();
+ if(!params.isEmpty()) {
IParameter param = params.iterator().next();
IParametedType paramType = param.getType();
- if(!((ParametedType)eventType).isAssignableTo((ParametedType)paramType, true)) {
- continue;
- }
- if(areMatchingEventQualifiers(param, injectionPoint)) {
+ if(((ParametedType)eventType).isAssignableTo((ParametedType)paramType, true)
+ && areMatchingEventQualifiers(param, injectionPoint)) {
result.add(om);
}
}
@@ -851,15 +847,8 @@
}
private boolean areMatchingEventQualifiers(IParameter observerParam, IInjectionPoint event) {
- Set<IQualifier> qs = ((Parameter)observerParam).getQualifiers();
- List<IType> paramQualifiers = new ArrayList<IType>();
- for (IQualifier q: qs) {
- if(q.getSourceType() != null) paramQualifiers.add(q.getSourceType());
- }
try {
- if(areMatchingEventQualifiers(event.getQualifierDeclarations(), paramQualifiers.toArray(new IType[0]))) {
- return true;
- }
+ return areMatchingEventQualifiers(event.getQualifierDeclarations(), observerParam.getQualifierDeclarations());
} catch (CoreException err) {
CDICorePlugin.getDefault().logError(err);
}
@@ -867,22 +856,22 @@
}
public Set<IInjectionPoint> findObservedEvents(IParameter observedEventParameter) {
- Set<IInjectionPoint> result = new HashSet<IInjectionPoint>();
+ Map<IField, IInjectionPoint> result = new HashMap<IField, IInjectionPoint>();
if(observedEventParameter.getBeanMethod() instanceof IObserverMethod) {
IParametedType paramType = observedEventParameter.getType();
- for (IClassBean b: classBeans.values()) {
+ for (IBean ib: allBeans) {
+ if(!(ib instanceof IClassBean)) {
+ continue;
+ }
+ IClassBean b = (IClassBean)ib;
Set<IInjectionPoint> ps = b.getInjectionPoints();
for (IInjectionPoint p: ps) {
- if(p.getType() == null && p instanceof IInjectionPointField) {
- System.out.println("shit");
- continue;
- }
- if(p instanceof IInjectionPointField) {
+ if(p instanceof IInjectionPointField && p.getType() != null) {
IParametedType eventType = getEventType(p.getType());
if(eventType != null && ((ParametedType)eventType).isAssignableTo((ParametedType)paramType, true)) {
if(areMatchingEventQualifiers(observedEventParameter, p)) {
- result.add(p);
+ result.put(((IInjectionPointField)p).getField(), p);
}
}
}
@@ -890,7 +879,7 @@
}
}
- return result;
+ return new HashSet<IInjectionPoint>(result.values());
}
public Set<IBeanMethod> resolveDisposers(IProducerMethod producer) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2011-05-26 00:02:45 UTC (rev 31497)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2011-05-26 00:07:51 UTC (rev 31498)
@@ -29,6 +29,7 @@
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IInterceptorBinding;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
+import org.jboss.tools.cdi.core.IObserverMethod;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IParameter;
import org.jboss.tools.cdi.core.IProducer;
@@ -215,11 +216,11 @@
return CDIUtil.getAllInterceptorBindings(this);
}
- public Set<IBeanMethod> getObserverMethods() {
- Set<IBeanMethod> result = new HashSet<IBeanMethod>();
+ public Set<IObserverMethod> getObserverMethods() {
+ Set<IObserverMethod> result = new HashSet<IObserverMethod>();
for (BeanMethod m: methods) {
- if(m.isObserver()) {
- result.add(m);
+ if(m.isObserver() && m instanceof IObserverMethod) {
+ result.add((IObserverMethod)m);
}
}
return result;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java 2011-05-26 00:02:45 UTC (rev 31497)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/Parameter.java 2011-05-26 00:07:51 UTC (rev 31498)
@@ -1,16 +1,19 @@
package org.jboss.tools.cdi.internal.core.impl;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import org.eclipse.jdt.core.ILocalVariable;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.ISourceReference;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBeanMethod;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IParameter;
import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
import org.jboss.tools.cdi.internal.core.impl.definition.ParameterDefinition;
public class Parameter extends BeanMember implements IParameter {
@@ -88,4 +91,17 @@
return result;
}
+ public Set<IQualifierDeclaration> getQualifierDeclarations() {
+ Set<IQualifierDeclaration> result = new HashSet<IQualifierDeclaration>();
+
+ List<IAnnotationDeclaration> ds = definition.getAnnotations();
+ for (IAnnotationDeclaration d: ds) {
+ if(d instanceof IQualifierDeclaration) {
+ result.add((IQualifierDeclaration)d);
+ }
+ }
+
+ return result;
+ }
+
}
\ No newline at end of file
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 2011-05-26 00:02:45 UTC (rev 31497)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-26 00:07:51 UTC (rev 31498)
@@ -68,6 +68,7 @@
import org.jboss.tools.cdi.core.IInterceptorBinded;
import org.jboss.tools.cdi.core.IInterceptorBinding;
import org.jboss.tools.cdi.core.IInterceptorBindingDeclaration;
+import org.jboss.tools.cdi.core.IObserverMethod;
import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IParameter;
import org.jboss.tools.cdi.core.IProducer;
@@ -799,11 +800,11 @@
}
private void validateObserves(IClassBean bean) {
- Set<IBeanMethod> observes = bean.getObserverMethods();
+ Set<IObserverMethod> observes = bean.getObserverMethods();
if (observes.isEmpty()) {
return;
}
- for (IBeanMethod observer : observes) {
+ for (IObserverMethod observer : observes) {
List<IParameter> params = observer.getParameters();
Set<ITextSourceReference> declarations = new HashSet<ITextSourceReference>();
for (IParameter param : params) {
13 years, 1 month
JBoss Tools SVN: r31497 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation and 17 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-05-25 20:02:45 -0400 (Wed, 25 May 2011)
New Revision: 31497
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.classpath
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.settings/org.eclipse.jdt.core.prefs
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/bin/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/cdi-api.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/javax.inject.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/jboss-interceptor-api.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/seam-faces-3.0.0.Final.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/META-INF/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/META-INF/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean1.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean2.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/build.properties
trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/CDISeamFacesCoreAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-8576
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2011-05-25 23:42:43 UTC (rev 31496)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -93,4 +93,5 @@
public String WELD_BEAN_MANAGER_TYPE_NAME = "org.jboss.weld.manager.BeanManagerImpl";
+ public String SEAM_FACES_INPUT_FIELD_TYPE_NAME = "org.jboss.seam.faces.validation.InputField";
}
\ No newline at end of file
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 2011-05-25 23:42:43 UTC (rev 31496)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -21,8 +21,6 @@
import java.util.Set;
import java.util.StringTokenizer;
-import javax.management.ValueExp;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -37,7 +35,6 @@
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IMemberValuePair;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
@@ -89,7 +86,6 @@
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.impl.ParametedType;
-import org.jboss.tools.cdi.internal.core.impl.Parameter;
import org.jboss.tools.cdi.internal.core.impl.SessionBean;
import org.jboss.tools.cdi.internal.core.impl.definition.Dependencies;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
@@ -1339,7 +1335,6 @@
* - injection point other than injected field declares a @Named annotation that does not specify the value member
*/
if(injection instanceof IInjectionPointParameter) {
-// IInjectionPointParameter pinjection = (IInjectionPointParameter)injection;
IAnnotationDeclaration named = injection.getAnnotation(CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
if (named != null) {
Object value = named.getMemberValue(null);
@@ -1396,119 +1391,129 @@
* - If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
*/
IType type = getTypeOfInjection(injection);
- boolean instance = type!=null && CDIConstants.INSTANCE_TYPE_NAME.equals(type.getFullyQualifiedName());
- Set<IBean> allBeans = cdiProject.getBeans(false, injection);
- for (IBean bean : allBeans) {
- if(!bean.getBeanClass().isReadOnly()) {
- getValidationContext().addLinkedCoreResource(SHORT_ID, injection.getSourcePath().toOSString(), bean.getResource().getFullPath(), false);
- }
+ IAnnotationDeclaration faces = injection.getAnnotation(CDIConstants.SEAM_FACES_INPUT_FIELD_TYPE_NAME);
+ // If the injection point annotated @InputField then don't try to resolve it.
+ // Despite this annotation is from Seam Faces module and is not part of JSR-299 it's much easy to check this annotation here instead of moving this check to Seam Faces plug-in.
+ // See https://issues.jboss.org/browse/JBIDE-8576
+ if(faces==null && injection instanceof IInjectionPointParameter) {
+ IInjectionPointParameter param = (IInjectionPointParameter)injection;
+ faces = param.getBeanMethod().getAnnotation(CDIConstants.SEAM_FACES_INPUT_FIELD_TYPE_NAME);
}
- if(type!=null && beans.isEmpty() && !instance) {
- addError(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_INJECTION_POINTS, reference, injection.getResource(), UNSATISFIED_INJECTION_POINTS_ID);
- } else if(beans.size()>1 && !instance) {
- addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
- } else if(beans.size()==1) {
- IBean bean = beans.iterator().next();
- if(!bean.getBeanClass().isReadOnly()) {
- /*
- * 5.2.4. Primitive types and null values
- * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
- */
- if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
- addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
+ if(faces==null) {
+ boolean instance = type!=null && CDIConstants.INSTANCE_TYPE_NAME.equals(type.getFullyQualifiedName());
+ Set<IBean> allBeans = cdiProject.getBeans(false, injection);
+ for (IBean bean : allBeans) {
+ if(!bean.getBeanClass().isReadOnly()) {
+ getValidationContext().addLinkedCoreResource(SHORT_ID, injection.getSourcePath().toOSString(), bean.getResource().getFullPath(), false);
}
- /*
- * 5.1.4. Inter-module injection
- * - a decorator can not be injected
- * - an interceptor can not be injected
- */
- if(bean instanceof IDecorator) {
- addError(CDIValidationMessages.INJECTED_DECORATOR, CDIPreferences.INJECTED_DECORATOR, reference, injection.getResource());
- } else if(bean instanceof IInterceptor) {
- addError(CDIValidationMessages.INJECTED_INTERCEPTOR, CDIPreferences.INJECTED_INTERCEPTOR, reference, injection.getResource());
- }
- /*
- * 5.4.1. Unproxyable bean types
- * - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
- * the container automatically detects the problem and treats it as a deployment problem.
- */
- if(bean.getScope().isNorlmalScope() && injection.getType()!=null) {
- // - Array types cannot be proxied by the container.
- String typeSignature = injection.getType().getSignature();
- int kind = Signature.getTypeSignatureKind(typeSignature);
- if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else if(injection.getType().isPrimitive()) {
- // - Primitive types cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else if(bean instanceof IClassBean) {
- try {
- if(Flags.isFinal(bean.getBeanClass().getFlags())) {
- // - Classes which are declared final cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- } else {
- IMethod[] methods = bean.getBeanClass().getMethods();
- boolean hasDefaultConstructor = false;
- boolean hasConstructor = false;
- for (IMethod method : methods) {
- hasConstructor = hasConstructor || method.isConstructor();
- hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
- if(Flags.isFinal(method.getFlags())) {
- // - Classes which have final methods cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- hasDefaultConstructor = true;
- break;
+ }
+ if(type!=null && beans.isEmpty() && !instance) {
+ addError(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_INJECTION_POINTS, reference, injection.getResource(), UNSATISFIED_INJECTION_POINTS_ID);
+ } else if(beans.size()>1 && !instance) {
+ addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.AMBIGUOUS_INJECTION_POINTS, reference, injection.getResource(), AMBIGUOUS_INJECTION_POINTS_ID);
+ } else if(beans.size()==1) {
+ IBean bean = beans.iterator().next();
+ if(!bean.getBeanClass().isReadOnly()) {
+ /*
+ * 5.2.4. Primitive types and null values
+ * - injection point of primitive type resolves to a bean that may have null values, such as a producer method with a non-primitive return type or a producer field with a non-primitive type
+ */
+ if(bean.isNullable() && injection.getType()!=null && injection.getType().isPrimitive()) {
+ addError(CDIValidationMessages.INJECT_RESOLVES_TO_NULLABLE_BEAN, CDIPreferences.INJECT_RESOLVES_TO_NULLABLE_BEAN, reference, injection.getResource());
+ }
+ /*
+ * 5.1.4. Inter-module injection
+ * - a decorator can not be injected
+ * - an interceptor can not be injected
+ */
+ if(bean instanceof IDecorator) {
+ addError(CDIValidationMessages.INJECTED_DECORATOR, CDIPreferences.INJECTED_DECORATOR, reference, injection.getResource());
+ } else if(bean instanceof IInterceptor) {
+ addError(CDIValidationMessages.INJECTED_INTERCEPTOR, CDIPreferences.INJECTED_INTERCEPTOR, reference, injection.getResource());
+ }
+ /*
+ * 5.4.1. Unproxyable bean types
+ * - If an injection point whose declared type cannot be proxied by the container resolves to a bean with a normal scope,
+ * the container automatically detects the problem and treats it as a deployment problem.
+ */
+ if(bean.getScope().isNorlmalScope() && injection.getType()!=null) {
+ // - Array types cannot be proxied by the container.
+ String typeSignature = injection.getType().getSignature();
+ int kind = Signature.getTypeSignatureKind(typeSignature);
+ if(kind == Signature.ARRAY_TYPE_SIGNATURE) {
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_ARRAY_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(injection.getType().isPrimitive()) {
+ // - Primitive types cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_PRIMITIVE_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else if(bean instanceof IClassBean) {
+ try {
+ if(Flags.isFinal(bean.getBeanClass().getFlags())) {
+ // - Classes which are declared final cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_FINAL_TYPE, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ } else {
+ IMethod[] methods = bean.getBeanClass().getMethods();
+ boolean hasDefaultConstructor = false;
+ boolean hasConstructor = false;
+ for (IMethod method : methods) {
+ hasConstructor = hasConstructor || method.isConstructor();
+ hasDefaultConstructor = hasDefaultConstructor || (method.isConstructor() && !Flags.isPrivate(method.getFlags()) && method.getParameterNames().length==0);
+ if(Flags.isFinal(method.getFlags())) {
+ // - Classes which have final methods cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_FM, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ hasDefaultConstructor = true;
+ break;
+ }
}
+ if(!hasDefaultConstructor && hasConstructor) {
+ // - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
+ addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
+ }
}
- if(!hasDefaultConstructor && hasConstructor) {
- // - Classes which don't have a non-private constructor with no parameters cannot be proxied by the container.
- addError(MessageFormat.format(CDIValidationMessages.UNPROXYABLE_BEAN_TYPE_WITH_NPC, injection.getType().getSimpleName(), bean.getSimpleJavaName()), CDIPreferences.UNPROXYABLE_BEAN_TYPE, reference, injection.getResource());
- }
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
}
}
- }
- if(injection.getClassBean() instanceof IDecorator && injection.isDelegate() && bean instanceof IClassBean) {
- try {
- IType beanClass = bean.getBeanClass();
- if(Flags.isFinal(beanClass.getFlags())) {
- // 8.3. Decorator resolution
- // - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
- // the problem and treats it as a deployment problem.
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getSimpleJavaName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
- } else {
- // 8.3. Decorator resolution
- // - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
- // the container automatically detects the problem and treats it as a deployment problem.
- IType decoratorClass = injection.getClassBean().getBeanClass();
- IMethod[] methods = decoratorClass.getMethods();
- boolean reported = false;
- if(methods!=null) {
- for (IMethod method : methods) {
- if(!Flags.isPrivate(method.getFlags()) && !Flags.isStatic(method.getFlags())) {
- IMethod[] beanMethods = beanClass.findMethods(method);
- if(beanMethods!=null) {
- for (IMethod beanMethod : beanMethods) {
- int flags = beanMethod.getFlags();
- if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
- String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
- addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getSimpleJavaName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
- reported = true;
+ if(injection.getClassBean() instanceof IDecorator && injection.isDelegate() && bean instanceof IClassBean) {
+ try {
+ IType beanClass = bean.getBeanClass();
+ if(Flags.isFinal(beanClass.getFlags())) {
+ // 8.3. Decorator resolution
+ // - If a decorator matches a managed bean, and the managed bean class is declared final, the container automatically detects
+ // the problem and treats it as a deployment problem.
+ addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_CLASS, bean.getSimpleJavaName()), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ } else {
+ // 8.3. Decorator resolution
+ // - If a decorator matches a managed bean with a non-static, non-private, final method, and the decorator also implements that method,
+ // the container automatically detects the problem and treats it as a deployment problem.
+ IType decoratorClass = injection.getClassBean().getBeanClass();
+ IMethod[] methods = decoratorClass.getMethods();
+ boolean reported = false;
+ if(methods!=null) {
+ for (IMethod method : methods) {
+ if(!Flags.isPrivate(method.getFlags()) && !Flags.isStatic(method.getFlags())) {
+ IMethod[] beanMethods = beanClass.findMethods(method);
+ if(beanMethods!=null) {
+ for (IMethod beanMethod : beanMethods) {
+ int flags = beanMethod.getFlags();
+ if(!Flags.isPrivate(flags) && !Flags.isStatic(flags) && Flags.isFinal(flags)) {
+ String methodName = Signature.toString(beanMethod.getSignature(), beanMethod.getElementName(), beanMethod.getParameterNames(), false, false);
+ addError(MessageFormat.format(CDIValidationMessages.DECORATOR_RESOLVES_TO_FINAL_METHOD, bean.getSimpleJavaName(), methodName), CDIPreferences.DECORATOR_RESOLVES_TO_FINAL_BEAN, reference, injection.getResource());
+ reported = true;
+ break;
+ }
+ }
+ if(reported) {
break;
}
}
- if(reported) {
- break;
- }
}
}
}
}
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
}
- } catch (JavaModelException e) {
- CDICorePlugin.getDefault().logError(e);
}
}
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java 2011-05-25 23:42:43 UTC (rev 31496)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ValidationTest.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -40,27 +40,27 @@
return AbstractResourceMarkerTest.getMarkersNumberByGroupName(resource, null);
}
- protected static void assertMarkerIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
+ public static void assertMarkerIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
assertMarkerIsCreated(resource, pattern, true, expectedLines);
}
- protected static void assertMarkerIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
+ public static void assertMarkerIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
AbstractResourceMarkerTest.assertMarkerIsCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, pattern?convertMessageToPatern(message):message, pattern, expectedLines);
}
- protected static void assertMarkerIsNotCreated(IResource resource, String message) throws CoreException {
+ public static void assertMarkerIsNotCreated(IResource resource, String message) throws CoreException {
AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message));
}
- protected static void assertMarkerIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
+ public static void assertMarkerIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), expectedLine);
}
- protected static void assertMarkerIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
+ public static void assertMarkerIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), lineNumber, startPosition, endPosition);
}
- protected static String convertMessageToPatern(String message) {
+ public static String convertMessageToPatern(String message) {
return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>").replace("(", "\\(").replace(")", "\\)")
.replace("{", "\\{").replace("}", "\\}").replace("'", "\\'");
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF/MANIFEST.MF 2011-05-25 23:42:43 UTC (rev 31496)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/META-INF/MANIFEST.MF 2011-05-26 00:02:45 UTC (rev 31497)
@@ -20,6 +20,7 @@
org.jboss.tools.jst.web.kb,
org.jboss.tools.cdi.xml,
org.jboss.tools.cdi.seam.solder.core,
- org.eclipse.jst.standard.schemas
+ org.eclipse.jst.standard.schemas,
+ org.jboss.tools.cdi.core.test
Export-Package: org.jboss.tools.cdi.seam.config.core.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java 2011-05-25 23:42:43 UTC (rev 31496)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -16,14 +16,13 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
import org.jboss.tools.cdi.seam.config.core.validation.SeamConfigValidationMessages;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
*
@@ -66,56 +65,30 @@
}
public void testBeanResolution() throws CoreException {
- assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
- assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean1"));
+ ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
+ ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean1"));
}
public void testFieldResolution() throws CoreException {
- assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "param"), 21);
- assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "value"), 28);
+ ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "param"), 21);
+ ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "value"), 28);
}
public void testMethodResolution() throws CoreException {
//It is unresolved member because no member with that name is found.
- assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method2"), 38);
+ ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method2"), 38);
- assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 34);
- assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 34);
+ ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 34);
+ ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 34);
- assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 42);
- assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 42);
+ ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 42);
+ ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 42);
- assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 47);
+ ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 47);
}
public void testAnnotationMemberResolution() throws CoreException {
- assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field3"), 15);
- assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field1"));
+ ValidationTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field3"), 15);
+ ValidationTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field1"));
}
-
- protected static void assertMarkerIsCreated(IResource resource, String pattern, int... expectedLines) throws CoreException {
- assertMarkerIsCreated(resource, pattern, true, expectedLines);
- }
-
- protected static void assertMarkerIsCreated(IResource resource, String message, boolean pattern, int... expectedLines) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, pattern?convertMessageToPatern(message):message, pattern, expectedLines);
- }
-
- protected static void assertMarkerIsNotCreated(IResource resource, String message) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message));
- }
-
- protected static void assertMarkerIsNotCreated(IResource resource, String message, int expectedLine) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), expectedLine);
- }
-
- protected static void assertMarkerIsCreatedForGivenPosition(IResource resource, String message, int lineNumber, int startPosition, int endPosition) throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreatedForGivenPosition(resource, AbstractResourceMarkerTest.MARKER_TYPE, convertMessageToPatern(message), lineNumber, startPosition, endPosition);
- }
-
- protected static String convertMessageToPatern(String message) {
- return message.replace("[", "\\[").replace("]", "\\]").replace("<", "\\<").replace(">", "\\>").replace("(", "\\(").replace(")", "\\)")
- .replace("{", "\\{").replace("}", "\\}").replace("'", "\\'");
- }
-
-}
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF 2011-05-25 23:42:43 UTC (rev 31496)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/META-INF/MANIFEST.MF 2011-05-26 00:02:45 UTC (rev 31497)
@@ -7,4 +7,9 @@
Require-Bundle: org.jboss.tools.cdi.seam.faces.core,
org.eclipse.jdt.core,
org.junit,
- org.jboss.tools.jst.web.kb
+ org.jboss.tools.jst.web.kb,
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.jboss.tools.tests,
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.cdi.core,
+ org.jboss.tools.cdi.core.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/build.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/build.properties 2011-05-25 23:42:43 UTC (rev 31496)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/build.properties 2011-05-26 00:02:45 UTC (rev 31497)
@@ -4,4 +4,5 @@
.,\
plugin.properties,\
about.html,\
- plugin.xml
+ plugin.xml,\
+ projects/
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.classpath
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.classpath (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.classpath 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="lib" path="lib/cdi-api.jar"/>
+ <classpathentry kind="lib" path="lib/javax.inject.jar"/>
+ <classpathentry kind="lib" path="lib/jboss-interceptor-api.jar"/>
+ <classpathentry kind="lib" path="lib/seam-faces-3.0.0.Final.jar" sourcepath="/home/igels/.m2/repository/org/jboss/seam/faces/seam-faces/3.0.0.Final/seam-faces-3.0.0.Final-sources.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SeamFacesTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.cdi.core.cdibuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ <nature>org.jboss.tools.cdi.core.cdinature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.settings/org.eclipse.jdt.core.prefs 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,12 @@
+#Fri May 13 12:44:03 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/cdi-api.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/cdi-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/javax.inject.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/javax.inject.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/jboss-interceptor-api.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/jboss-interceptor-api.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/seam-faces-3.0.0.Final.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/lib/seam-faces-3.0.0.Final.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/META-INF/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/META-INF/beans.xml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/META-INF/beans.xml 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<beans>
+</beans>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/META-INF/beans.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean1.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean1.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean1.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,5 @@
+package org.jboss.beans.validation.test;
+
+public class MyBean1 {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean1.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean2.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean2.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean2.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,5 @@
+package org.jboss.beans.validation.test;
+
+public class MyBean2 extends MyBean1 {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/MyBean2.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,31 @@
+package org.jboss.beans.validation.test;
+
+import javax.inject.Inject;
+
+import org.jboss.seam.faces.validation.InputField;
+
+public class Validation {
+
+ @Inject @InputField MyBean1 beanOk;
+
+ @Inject @InputField String bean2Ok;
+
+ @Inject @InputField
+ public void setMyBeanOk(MyBean1 bean, String bean2) {
+
+ }
+
+ @Inject MyBean1 beanBroken;
+
+ @Inject String bean2Broken;
+
+ @Inject
+ public void setMyBeanBroken(MyBean1 bean) {
+
+ }
+
+ @Inject
+ public void setMyBeanBroken(String bean) {
+
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/projects/SeamFacesTest/src/org/jboss/beans/validation/test/Validation.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/CDISeamFacesCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/CDISeamFacesCoreAllTests.java 2011-05-25 23:42:43 UTC (rev 31496)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/CDISeamFacesCoreAllTests.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -23,9 +23,12 @@
public static Test suite() {
JavaModelManager.getIndexManager().disable();
- TestSuite suite = new TestSuite("Seam Solder Faces Tests");
+ TestSuite suiteAll = new TestSuite("Seam Faces Tests");
- suite.addTestSuite(SeamFacesTagLibTest.class);
+ TestSuite suite = new TestSuite("Seam Faces Project Tests");
+ suite.addTestSuite(SeamFacesValidationTest.class);
+ suiteAll.addTest(new SeamFacesTestSetup(suite));
+ suiteAll.addTestSuite(SeamFacesTagLibTest.class);
return suite;
}
}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.seam.faces.core.test;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamFacesTestSetup extends TestSetup {
+
+ protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.faces.core.test";
+ protected static String PROJECT_NAME = "SeamFacesTest";
+ protected static String PROJECT_PATH = "/projects/SeamFacesTest";
+
+ protected IProject project;
+
+ public SeamFacesTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
+ if(project == null || !project.exists()) {
+ project = ResourcesUtils.importProject(PLUGIN_ID, PROJECT_PATH);
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
+ project.delete(true, true, null);
+ JobUtils.waitForIdle();
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesTestSetup.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java 2011-05-26 00:02:45 UTC (rev 31497)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.seam.faces.core.test;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.cdi.core.test.tck.validation.ValidationTest;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamFacesValidationTest extends TestCase {
+
+ protected IProject project;
+
+ public IProject getTestProject() {
+ if(project==null) {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(SeamFacesTestSetup.PROJECT_NAME);
+ }
+ return project;
+ }
+
+ public void testInjectionAnnotatedInputField() throws Exception {
+ IFile file = project.getFile("src/org/jboss/beans/validation/test/Validation.java");
+ ValidationTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 18, 23);
+ ValidationTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 20, 28);
+
+ ValidationTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 9);
+ ValidationTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 11);
+ ValidationTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 14);
+ ValidationTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 14);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.faces.core.test/src/org/jboss/tools/cdi/seam/faces/core/test/SeamFacesValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 1 month