[jbosstools-commits] JBoss Tools SVN: r43675 - in trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test: validation and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Sep 13 20:36:39 EDT 2012


Author: akazakov
Date: 2012-09-13 20:36:39 -0400 (Thu, 13 Sep 2012)
New Revision: 43675

Added:
   trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/AYTDeltaspikeInjectionValidationTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeInjectionValidationTest.java
Modified:
   trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeCoreAllTests.java
   trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeCoreTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeValidationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-12601 CDI as-you-type validator should not validate injections which use supported CDI extensions and ignored by the build CDI validator.

Modified: trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeCoreAllTests.java	2012-09-14 00:33:00 UTC (rev 43674)
+++ trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeCoreAllTests.java	2012-09-14 00:36:39 UTC (rev 43675)
@@ -15,6 +15,8 @@
 
 import org.eclipse.jdt.internal.core.JavaModelManager;
 import org.eclipse.wst.validation.ValidationFramework;
+import org.jboss.tools.cdi.deltaspike.core.test.validation.AYTDeltaspikeInjectionValidationTest;
+import org.jboss.tools.cdi.deltaspike.core.test.validation.DeltaspikeInjectionValidationTest;
 import org.jboss.tools.cdi.deltaspike.core.test.validation.DeltaspikeValidationTest;
 import org.jboss.tools.common.base.test.validation.ValidationExceptionTest;
 
@@ -35,7 +37,11 @@
 
 		TestSuite suite = new TestSuite("Deltaspike Core Project Tests"); //$NON-NLS-1$
 		suite.addTestSuite(DeltaspikeBeansTest.class);
+
+		// Validation tests
 		suite.addTestSuite(DeltaspikeValidationTest.class);
+		suite.addTestSuite(DeltaspikeInjectionValidationTest.class);
+		suite.addTestSuite(AYTDeltaspikeInjectionValidationTest.class);
 
 		suiteAll.addTest(new DeltaspikeCoreTestSetup(suite));
 

Modified: trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeCoreTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeCoreTest.java	2012-09-14 00:33:00 UTC (rev 43674)
+++ trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/DeltaspikeCoreTest.java	2012-09-14 00:36:39 UTC (rev 43675)
@@ -10,15 +10,14 @@
  ******************************************************************************/
 package org.jboss.tools.cdi.deltaspike.core.test;
 
-import junit.framework.TestCase;
-
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.cdi.core.test.tck.validation.AbstractValidationTest;
 
 /**
  * @author Alexey Kazakov
  */
-public class DeltaspikeCoreTest extends TestCase {
+public class DeltaspikeCoreTest extends AbstractValidationTest {
 
 	protected IProject getTestProject() throws Exception {
 		return ResourcesPlugin.getWorkspace().getRoot().getProject(DeltaspikeCoreTestSetup.PROJECT_NAME);

Added: trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/AYTDeltaspikeInjectionValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/AYTDeltaspikeInjectionValidationTest.java	                        (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/AYTDeltaspikeInjectionValidationTest.java	2012-09-14 00:36:39 UTC (rev 43675)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * 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.deltaspike.core.test.validation;
+
+import org.jboss.tools.cdi.core.test.tck.validation.CDIAnnotationTest;
+import org.jboss.tools.tests.IAnnotationTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class AYTDeltaspikeInjectionValidationTest extends DeltaspikeInjectionValidationTest {
+
+	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.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/AYTDeltaspikeInjectionValidationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeInjectionValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeInjectionValidationTest.java	                        (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeInjectionValidationTest.java	2012-09-14 00:36:39 UTC (rev 43675)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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.deltaspike.core.test.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.deltaspike.core.test.DeltaspikeCoreTest;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class DeltaspikeInjectionValidationTest extends DeltaspikeCoreTest {
+
+	public void testConfigPropertyValidation() throws Exception {
+		IFile file = getTestProject().getFile("src/deltaspike/config/SettingsBean.java"); //$NON-NLS-1$
+
+		getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 8);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
+		getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 16);
+	}
+}
\ No newline at end of file


Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeInjectionValidationTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeValidationTest.java	2012-09-14 00:33:00 UTC (rev 43674)
+++ trunk/cdi/tests/org.jboss.tools.cdi.deltaspike.core.test/src/org/jboss/tools/cdi/deltaspike/core/test/validation/DeltaspikeValidationTest.java	2012-09-14 00:36:39 UTC (rev 43675)
@@ -14,43 +14,33 @@
 import org.eclipse.osgi.util.NLS;
 import org.jboss.tools.cdi.deltaspike.core.test.DeltaspikeCoreTest;
 import org.jboss.tools.cdi.deltaspike.core.validation.DeltaspikeValidationMessages;
-import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
 
 /**
  * @author Alexey Kazakov
  */
 public class DeltaspikeValidationTest extends DeltaspikeCoreTest {
 
-	public void testConfigPropertyValidation() throws Exception {
-		IFile file = getTestProject().getFile("src/deltaspike/config/SettingsBean.java"); //$NON-NLS-1$
-		
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 8);
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 12);
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 16);
-	}
-
 	public void testHandlerValidation() throws Exception {
 		IFile file = getTestProject().getFile("src/deltaspike/handler/MyHandlers.java"); //$NON-NLS-1$
-		
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, DeltaspikeValidationMessages.INVALID_HANDLER_TYPE, 13);
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, DeltaspikeValidationMessages.INVALID_HANDLER_TYPE, 16);
+
+		getAnnotationTest().assertAnnotationIsNotCreated(file, DeltaspikeValidationMessages.INVALID_HANDLER_TYPE, 13);
+		getAnnotationTest().assertAnnotationIsCreated(file, DeltaspikeValidationMessages.INVALID_HANDLER_TYPE, 16);
 	}
 
 	public void testSecurityValidation() throws Exception {
 		IFile file = getTestProject().getFile("src/deltaspike/security/CustomAuthorizer.java"); //$NON-NLS-1$
 
 		String message = NLS.bind(DeltaspikeValidationMessages.INVALID_AUTHORIZER_NOT_BOOLEAN, "check3"); //$NON-NLS-1$
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, message, 25);
+		getAnnotationTest().assertAnnotationIsCreated(file, message, 25);
 
 		message = NLS.bind(DeltaspikeValidationMessages.INVALID_AUTHORIZER_NO_BINDINGS, "check4"); //$NON-NLS-1$
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, message, 30);
+		getAnnotationTest().assertAnnotationIsCreated(file, message, 30);
 
 		file = getTestProject().getFile("src/deltaspike/security/SecuredBean1.java"); //$NON-NLS-1$
 		message = NLS.bind(DeltaspikeValidationMessages.AMBIGUOUS_AUTHORIZER, "deltaspike.security.CustomSecurityBinding", "doSomething2"); //$NON-NLS-1$ //$NON-NLS-2$
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, message, 24);
+		getAnnotationTest().assertAnnotationIsCreated(file, message, 24);
 
 		message = NLS.bind(DeltaspikeValidationMessages.UNRESOLVED_AUTHORIZER, "deltaspike.security.CustomSecurityBinding", "doSomething3"); //$NON-NLS-1$ //$NON-NLS-2$
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, message, 29);
+		getAnnotationTest().assertAnnotationIsCreated(file, message, 29);
 	}
 }
\ No newline at end of file



More information about the jbosstools-commits mailing list