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

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Aug 16 21:12:12 EDT 2012


Author: akazakov
Date: 2012-08-16 21:12:11 -0400 (Thu, 16 Aug 2012)
New Revision: 43081

Added:
   trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.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/ELValidationTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
   trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.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-16 23:40:33 UTC (rev 43080)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java	2012-08-17 01:12:11 UTC (rev 43081)
@@ -57,6 +57,7 @@
 import org.jboss.tools.cdi.core.test.tck.validation.AYTAnnotationValidationTest;
 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;
 import org.jboss.tools.cdi.core.test.tck.validation.AnnotationsValidationTest;
 import org.jboss.tools.cdi.core.test.tck.validation.BeansXmlValidationTest;
 import org.jboss.tools.cdi.core.test.tck.validation.BuilderOrderValidationTest;
@@ -139,9 +140,7 @@
 		suite.addTestSuite(AYTDeploymentProblemsValidationTests.class);
 //		suite.addTestSuite(BeansXmlValidationTest.class);
 		suite.addTestSuite(AYTAnnotationValidationTest.class);
-//		suite.addTestSuite(CoreValidationTest.class);
-//		suite.addTestSuite(ELValidationTest.class);
-//		suite.addTestSuite(SuppressWarningsTests.class);
+		suite.addTestSuite(AYTSuppressWarningsTests.class);
 
 		// Refactoring test
 		suite.addTestSuite(NamedBeanRefactoringTest.class);

Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.java	                        (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/AYTSuppressWarningsTests.java	2012-08-17 01:12:11 UTC (rev 43081)
@@ -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 AYTSuppressWarningsTests extends SuppressWarningsTests {
+
+	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/AYTSuppressWarningsTests.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/ELValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELValidationTest.java	2012-08-16 23:40:33 UTC (rev 43080)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/ELValidationTest.java	2012-08-17 01:12:11 UTC (rev 43081)
@@ -32,22 +32,22 @@
 			AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
 			file = tckProject.getFile("WebContent/elValidation.xhtml");
 			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");
 			namedBean.setContents(newNamedBean.getContents(), IFile.FORCE, new NullProgressMonitor());
 			TestUtil.validate(namedBean);
-	
+
 			file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/TestBean.java");
 			AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
 			file = tckProject.getFile("WebContent/elValidation.xhtml");
 			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");
 			newNamedBean.setContents(namedBean.getContents(), IFile.FORCE, new NullProgressMonitor());
 			TestUtil.validate(newNamedBean);
-	
+
 			file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/el/TestBean.java");
 			AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "foo"), 6);
 			file = tckProject.getFile("WebContent/elValidation.xhtml");

Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java	2012-08-16 23:40:33 UTC (rev 43080)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/SuppressWarningsTests.java	2012-08-17 01:12:11 UTC (rev 43081)
@@ -22,7 +22,6 @@
 import org.jboss.tools.common.base.test.validation.TestUtil;
 import org.jboss.tools.jst.web.kb.internal.validation.ELValidationMessages;
 import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
 
 /**
  * @author Alexey Kazakov
@@ -36,72 +35,74 @@
 		((IPersistentPreferenceStore)store).save();
 	}
 
-	private void restorePreferences(String preference) throws Exception{
+	private void restorePreferences(String preference, IFile file) throws Exception{
 		IPreferenceStore store = CDICorePlugin.getDefault().getPreferenceStore();
 		store.putValue(preference, CDIPreferences.ERROR);
 		((IPersistentPreferenceStore)store).save();
+		TestUtil.validate(file);
 	}
 
 	private void modifyPreferences() throws Exception{
 		modifyPreferences(CDIPreferences.PRODUCER_ANNOTATED_INJECT);
 	}
 
-	private void restorePreferences() throws Exception{
-		restorePreferences(CDIPreferences.PRODUCER_ANNOTATED_INJECT);
+	private void restorePreferences(IFile file) throws Exception{
+		restorePreferences(CDIPreferences.PRODUCER_ANNOTATED_INJECT, file);
 	}
 
 	public void testWOSuppress() throws Exception {
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 20, 24, 28, 31, 39, 42, 45);
+		getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 20, 24, 28, 31, 39, 42, 45);
 	}
 
 	public void testClass() throws Exception {
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 8);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 8);
 
 		file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 7, 12, 38);
+		getAnnotationTest().assertAnnotationIsCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 7, 12, 38);
 	}
 
 	public void testFieldWithSuppressInParentElement() throws Exception {
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 13);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 13);
 	}
 
 	public void testField() throws Exception {
+		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
+		IFile file2 = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
 		try {
 			modifyPreferences();
 			boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
-			IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
 			TestUtil.validate(file);
-			AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17);
-			AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 19);
+			getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17);
+			getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 19);
 	
-			file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
-			AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 15, 17, 23);
+			getAnnotationTest().assertAnnotationIsCreated(file2, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 15, 17, 23);
 			ResourcesUtils.setBuildAutomatically(saveAutoBuild);
 		} finally {
-			restorePreferences();
+			restorePreferences(file);
+			restorePreferences(file2);
 		}
 	}
 
 	public void testParam() throws Exception {
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 22);
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 31);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 22);
+		getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 31);
 	}
 
 	public void testMultipleSuppress() throws Exception {
+		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
 		try {
 			modifyPreferences();
 			boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
-			IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
 			TestUtil.validate(file);
-			AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
-			AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 26);
+			getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
+			getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 26);
 			ResourcesUtils.setBuildAutomatically(saveAutoBuild);
 		} finally {
-			restorePreferences();
+			restorePreferences(file);
 		}
 	}
 
@@ -109,19 +110,19 @@
 		boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
 		TestUtil.validate(file);
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17, 19, 26);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 27);
+		getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.PRODUCER_ANNOTATED_INJECT, 17, 19, 26);
 		ResourcesUtils.setBuildAutomatically(saveAutoBuild);
 	}
 
 	public void testNameAll() throws Exception {
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 35);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 35);
 	}
 
 	public void testGroupName() throws Exception {
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 49);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 49);
 	}
 
 	/**
@@ -131,20 +132,20 @@
 	public void testEL() throws Exception {
 		String message = NLS.bind(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "abc");
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, message, 39);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, message, 39);
 
 		file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, message, 34);
+		getAnnotationTest().assertAnnotationIsCreated(file, message, 34);
 	}
 
 	public void testWarningsOnClassNameRegion() throws Exception {
 		String message = NLS.bind(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, "Rabbit", "SessionScoped");
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Rabbit.java");
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, message, 9);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, message, 9);
 
 		message = NLS.bind(CDIValidationMessages.NOT_PASSIVATION_CAPABLE_BEAN, "AnotherRabbit", "SessionScoped");
 		file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherRabbit.java");
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, message, 8);
+		getAnnotationTest().assertAnnotationIsCreated(file, message, 8);
 	}
 
 	/**
@@ -154,41 +155,41 @@
 	 * @throws Exception
 	 */
 	public void testWarningsOnTyped() throws Exception {
+		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Rabbit.java");
 		try {
 			modifyPreferences(CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION);
 			boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
-			IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Rabbit.java");
 			TestUtil.validate(file);
-			AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 13);
+			getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 13);
 			ResourcesUtils.setBuildAutomatically(saveAutoBuild);
 		} finally {
-			restorePreferences(CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION);
+			restorePreferences(CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, file);
 		}
 
-		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherRabbit.java");
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 11);
+		file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherRabbit.java");
+		getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 11);
 	}
 
 	public void testMultipleSuppressFromElementAndItsParent() throws Exception {
 		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 45);
-		AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 44);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 45);
+		getAnnotationTest().assertAnnotationIsNotCreated(file, MessageFormat.format(CDIValidationMessages.DUPLCICATE_EL_NAME, ".*"), 44);
 	}
 
 	public void testWarningsOnAnnotatedParam() throws Exception {
+		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
 		try {
 			modifyPreferences(CDIPreferences.OBSERVER_ANNOTATED_INJECT);
 			boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
-			IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/Fish.java");
 			TestUtil.validate(file);
-			AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 51);
-			AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 52);
+			getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 51);
+			getAnnotationTest().assertAnnotationIsNotCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 52);
 			ResourcesUtils.setBuildAutomatically(saveAutoBuild);
 		} finally {
-			restorePreferences(CDIPreferences.OBSERVER_ANNOTATED_INJECT);
+			restorePreferences(CDIPreferences.OBSERVER_ANNOTATED_INJECT, file);
 		}
 
-		IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
-		AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 44, 45);
+		file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/suppresswarnings/AnotherFish.java");
+		getAnnotationTest().assertAnnotationIsCreated(file, CDIValidationMessages.OBSERVER_ANNOTATED_INJECT, 44, 45);
 	}
 }
\ No newline at end of file

Modified: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java	2012-08-16 23:40:33 UTC (rev 43080)
+++ trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/validation/AbstractAnnotationTest.java	2012-08-17 01:12:11 UTC (rev 43081)
@@ -78,9 +78,9 @@
 	}
 
 	public void assertAnnotationsEqualToMarkers(final IResource resource) throws CoreException {
-		if(validatedResources.contains(resource)) {
-			return;
-		}
+//		if(validatedResources.contains(resource)) {
+//			return;
+//		}
 		validatedResources.add(resource);
 
 		IMarker[] allMarkers = AbstractResourceMarkerTest.findMarkers(resource, getMarkerType(), ".*", true);
@@ -92,7 +92,15 @@
 			String mType = marker.getType();
 			int startInt = marker.getAttribute(IMarker.CHAR_START, -1);
 			int endInt = marker.getAttribute(IMarker.CHAR_END, -1);
-			markersSB.append(++i).append(") message=\"").append(message).append("\"; line=\"").append(line).append("\"; start=\"").append(startInt).append("\"; end=\"").append(endInt).append("\"; type=\"").append(mType).append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+			markersSB
+					.append(++i)
+					.append(") message=\"").append(message)
+					.append("\"; line=\"").append(line)
+					.append("\"; start=\"").append(startInt)
+					.append("\"; end=\"").append(endInt)
+					.append("\"; type=\"").append(mType)
+					.append("\"; sevirity=\"").append(marker.getAttribute(IMarker.SEVERITY))
+					.append(";\r\n");
 		}
 		markersSB.append("]"); //$NON-NLS-1$
 
@@ -187,7 +195,14 @@
 					int line = message.getLineNumber();
 					int start = message.getOffset();
 					int end = start + message.getLength();
-					messagesSB.append(++i).append(") message=\"").append(text).append("\"; line=\"").append(line).append("\"; start=\"").append(start).append("\"; end=\"").append(end).append("\"; type=\"").append(mType).append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+					messagesSB.append(++i)
+						.append(") message=\"").append(text)
+						.append("\"; line=\"").append(line)
+						.append("\"; start=\"").append(start)
+						.append("\"; end=\"").append(end)
+						.append("\"; type=\"").append(mType)
+						.append("\"; sevirity=\"").append(message.getSeverity())
+						.append("\";\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 				}
 			}
 			messagesSB.append("]"); //$NON-NLS-1$



More information about the jbosstools-commits mailing list