Author: akazakov
Date: 2012-08-17 14:42:55 -0400 (Fri, 17 Aug 2012)
New Revision: 43099
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTBeansXmlValidationTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10611 As-you-type CDI validation
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-08-17
17:06:51 UTC (rev 43098)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2012-08-17
18:42:55 UTC (rev 43099)
@@ -55,6 +55,7 @@
import org.jboss.tools.cdi.core.test.tck.lookup.ResolutionByTypeTest;
import org.jboss.tools.cdi.core.test.tck.lookup.UnsatisfiedDependencyTest;
import org.jboss.tools.cdi.core.test.tck.validation.AYTAnnotationValidationTest;
+import org.jboss.tools.cdi.core.test.tck.validation.AYTBeansXmlValidationTest;
import org.jboss.tools.cdi.core.test.tck.validation.AYTDefenitionErrorsValidationTest;
import
org.jboss.tools.cdi.core.test.tck.validation.AYTDeploymentProblemsValidationTests;
import org.jboss.tools.cdi.core.test.tck.validation.AYTSuppressWarningsTests;
@@ -138,7 +139,7 @@
// As-you-type validation tests
suite.addTestSuite(AYTDefenitionErrorsValidationTest.class);
suite.addTestSuite(AYTDeploymentProblemsValidationTests.class);
-// suite.addTestSuite(BeansXmlValidationTest.class);
+ suite.addTestSuite(AYTBeansXmlValidationTest.class);
suite.addTestSuite(AYTAnnotationValidationTest.class);
suite.addTestSuite(AYTSuppressWarningsTests.class);
@@ -162,7 +163,7 @@
suiteAll.addTestSuite(EnableCDISupportForJarTest.class);
suiteAll.addTestSuite(DependentProjectValidationTest.class);
suiteAll.addTest(new CDICoreTestSetup(suite));
-
+
suite = new TestSuite(BuilderOrderValidationTest.class.getName());
suite.addTestSuite(BuilderOrderValidationTest.class);
ProjectImportTestSetup testSetup = new ProjectImportTestSetup(suite,
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTBeansXmlValidationTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTBeansXmlValidationTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTBeansXmlValidationTest.java 2012-08-17
18:42:55 UTC (rev 43099)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck.validation;
+
+import org.jboss.tools.tests.IAnnotationTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class AYTBeansXmlValidationTest extends BeansXmlValidationTest {
+
+ private CDIAnnotationTest annotationTest = new CDIAnnotationTest();
+
+ @Override
+ protected IAnnotationTest getAnnotationTest() {
+ return annotationTest;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTBeansXmlValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2012-08-17
17:06:51 UTC (rev 43098)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2012-08-17
18:42:55 UTC (rev 43099)
@@ -14,7 +14,6 @@
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
@@ -30,9 +29,9 @@
public void testBeansXMLInBin() throws Exception {
IFile file = tckProject.getFile("JavaSource/META-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"cdi.test.alternative.Unxisting"), false, 6);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"cdi.test.alternative.Unxisting"), false, 6);
file = tckProject.getFile("WebContent/WEB-INF/classes/META-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"cdi.test.alternative.Unxisting"), 6);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"cdi.test.alternative.Unxisting"), 6);
}
/**
@@ -43,8 +42,8 @@
*/
public void testNoAlternativeClassWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"org.jboss.jsr299.tck.tests.policy.broken.incorrect.name.NonExistingClass"),
false, 7);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"org.jboss.jsr299.tck.tests.policy.broken.same.type.twice.Dog"), 19);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"org.jboss.jsr299.tck.tests.policy.broken.incorrect.name.NonExistingClass"),
false, 7);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"org.jboss.jsr299.tck.tests.policy.broken.same.type.twice.Dog"), 19);
}
/**
@@ -54,8 +53,8 @@
*/
public void testIllegalAlternativeClassWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS,
"org.jboss.jsr299.tck.tests.policy.broken.not.policy.Cat"), 4);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS,
"org.jboss.jsr299.tck.tests.policy.broken.same.type.twice.Dog"), 19);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS,
"org.jboss.jsr299.tck.tests.policy.broken.not.policy.Cat"), 4);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS,
"org.jboss.jsr299.tck.tests.policy.broken.same.type.twice.Dog"), 19);
}
/**
@@ -66,8 +65,8 @@
*/
public void testNoAlternativeAnnotationWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME,
"org.jboss.jsr299.tck.tests.policy.broken.not.policy.stereotype.NotExistingStereotype"),
12);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME,
"org.jboss.jsr299.tck.tests.jbt.validation.beansxml.AlternativeStereotype"),
17);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME,
"org.jboss.jsr299.tck.tests.policy.broken.not.policy.stereotype.NotExistingStereotype"),
12);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME,
"org.jboss.jsr299.tck.tests.jbt.validation.beansxml.AlternativeStereotype"),
17);
}
/**
@@ -77,8 +76,8 @@
*/
public void testIllegalAlternativeAnnotationWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION,
"org.jboss.jsr299.tck.tests.policy.broken.not.policy.stereotype.Mock"), 15);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION,
"org.jboss.jsr299.tck.tests.jbt.validation.beansxml.AlternativeStereotype"),
17);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION,
"org.jboss.jsr299.tck.tests.policy.broken.not.policy.stereotype.Mock"), 15);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION,
"org.jboss.jsr299.tck.tests.jbt.validation.beansxml.AlternativeStereotype"),
17);
}
/**
@@ -88,9 +87,9 @@
*/
public void testSameAlternativeClassListedTwice() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- 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);
+ getAnnotationTest().assertAnnotationIsCreated(file,
CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 20, 22, 26, 27);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 17);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
CDIValidationMessages.DUPLICATE_ALTERNATIVE_TYPE, 19);
}
/**
@@ -100,8 +99,8 @@
*/
public void testNonExistantDecoratorClassInBeansXmlNotOK() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME,
"com.acme.NonExistantDecoratorClass"), 34);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME,
"org.jboss.jsr299.tck.tests.decorators.resolution.BarDecorator"),
BAR_DECORATOR_LINE);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME,
"com.acme.NonExistantDecoratorClass"), 34);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME,
"org.jboss.jsr299.tck.tests.decorators.resolution.BarDecorator"),
BAR_DECORATOR_LINE);
}
/**
@@ -111,8 +110,8 @@
*/
public void testEnabledDecoratorNotADecorator() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS,
"org.jboss.jsr299.tck.tests.decorators.definition.broken.enabledDecoratorIsNotDecorator.TimestampLogger"),
37);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS,
"org.jboss.jsr299.tck.tests.decorators.resolution.BarDecorator"),
BAR_DECORATOR_LINE);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS,
"org.jboss.jsr299.tck.tests.decorators.definition.broken.enabledDecoratorIsNotDecorator.TimestampLogger"),
37);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS,
"org.jboss.jsr299.tck.tests.decorators.resolution.BarDecorator"),
BAR_DECORATOR_LINE);
}
/**
@@ -122,8 +121,8 @@
*/
public void testDecoratorListedTwiceInBeansXmlNotOK() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, 39, 40);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, BAR_DECORATOR_LINE);
+ getAnnotationTest().assertAnnotationIsCreated(file,
CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, 39, 40);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
CDIValidationMessages.DUPLICATE_DECORATOR_CLASS, BAR_DECORATOR_LINE);
}
/**
@@ -133,8 +132,8 @@
*/
public void testNonExistantClassInBeansXmlNotOk() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, "com.acme.Foo"),
FOO_LINE);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME,
"org.jboss.jsr299.tck.tests.jbt.validation.interceptors.CatInterceptor"),
CAT_INTERCEPTOR_LINE);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, "com.acme.Foo"),
FOO_LINE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME,
"org.jboss.jsr299.tck.tests.jbt.validation.interceptors.CatInterceptor"),
CAT_INTERCEPTOR_LINE);
}
/**
@@ -144,8 +143,8 @@
*/
public void testNonInterceptorClassInBeansXmlNotOk() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS,
"org.jboss.jsr299.tck.tests.interceptors.definition.broken.nonInterceptorClassInBeansXml.Foo"),
NON_INTERCEPTOR_LINE);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS,
"org.jboss.jsr299.tck.tests.jbt.validation.interceptors.CatInterceptor"),
CAT_INTERCEPTOR_LINE);
+ getAnnotationTest().assertAnnotationIsCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS,
"org.jboss.jsr299.tck.tests.interceptors.definition.broken.nonInterceptorClassInBeansXml.Foo"),
NON_INTERCEPTOR_LINE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
NLS.bind(CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS,
"org.jboss.jsr299.tck.tests.jbt.validation.interceptors.CatInterceptor"),
CAT_INTERCEPTOR_LINE);
}
/**
@@ -155,7 +154,7 @@
*/
public void testSameInterceptorClassListedTwiceInBeansXmlNotOk() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- 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);
+ getAnnotationTest().assertAnnotationIsCreated(file,
CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, FORD_INTERCEPTOR_1_LINE,
FORD_INTERCEPTOR_2_LINE);
+ getAnnotationTest().assertAnnotationIsNotCreated(file,
CDIValidationMessages.DUPLICATE_INTERCEPTOR_CLASS, CAT_INTERCEPTOR_LINE);
}
}
\ No newline at end of file