Author: scabanovich
Date: 2012-05-04 19:09:47 -0400 (Fri, 04 May 2012)
New Revision: 40809
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
Log:
JBIDE-11731
https://issues.jboss.org/browse/JBIDE-11731
Error message for beans.xml validation are modified.
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-05-04
21:55:43 UTC (rev 40808)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2012-05-04
23:09:47 UTC (rev 40809)
@@ -12,6 +12,7 @@
package org.jboss.tools.cdi.core.test.tck.validation;
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;
@@ -29,9 +30,9 @@
public void testBeansXMLInBin() throws Exception {
IFile file = tckProject.getFile("JavaSource/META-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, false, 6);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(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,
CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, 6);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
NLS.bind(CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME,
"cdi.test.alternative.Unxisting"), 6);
}
/**
@@ -42,8 +43,8 @@
*/
public void testNoAlternativeClassWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, false, 7);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, 19);
+ 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);
}
/**
@@ -53,8 +54,8 @@
*/
public void testIllegalAlternativeClassWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 4);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.ILLEGAL_ALTERNATIVE_BEAN_CLASS, 19);
+ 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);
}
/**
@@ -65,8 +66,8 @@
*/
public void testNoAlternativeAnnotationWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 12);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.UNKNOWN_ALTERNATIVE_ANNOTATION_NAME, 17);
+ 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);
}
/**
@@ -76,8 +77,8 @@
*/
public void testIllegalAlternativeAnnotationWithSpecifiedName() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 15);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.ILLEGAL_ALTERNATIVE_ANNOTATION, 17);
+ 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);
}
/**
@@ -99,8 +100,8 @@
*/
public void testNonExistantDecoratorClassInBeansXmlNotOK() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, 34);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.UNKNOWN_DECORATOR_BEAN_CLASS_NAME, BAR_DECORATOR_LINE);
+ 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);
}
/**
@@ -110,8 +111,8 @@
*/
public void testEnabledDecoratorNotADecorator() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, 37);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.ILLEGAL_DECORATOR_BEAN_CLASS, BAR_DECORATOR_LINE);
+ 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);
}
/**
@@ -132,8 +133,8 @@
*/
public void testNonExistantClassInBeansXmlNotOk() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, FOO_LINE);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.UNKNOWN_INTERCEPTOR_CLASS_NAME, CAT_INTERCEPTOR_LINE);
+ 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);
}
/**
@@ -143,8 +144,8 @@
*/
public void testNonInterceptorClassInBeansXmlNotOk() throws Exception {
IFile file = tckProject.getFile("WebContent/WEB-INF/beans.xml");
- AbstractResourceMarkerTest.assertMarkerIsCreated(file,
CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, NON_INTERCEPTOR_LINE);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(file,
CDIValidationMessages.ILLEGAL_INTERCEPTOR_CLASS, CAT_INTERCEPTOR_LINE);
+ 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);
}
/**