[193816] validators are still being triggered when they use contentTypeBinding
diff --git a/tests/org.eclipse.wst.common.tests.validation/src/org/eclipse/wst/validation/tests/testcase/TestSuite4.java b/tests/org.eclipse.wst.common.tests.validation/src/org/eclipse/wst/validation/tests/testcase/TestSuite4.java
index 837cf64..c729ce5 100644
--- a/tests/org.eclipse.wst.common.tests.validation/src/org/eclipse/wst/validation/tests/testcase/TestSuite4.java
+++ b/tests/org.eclipse.wst.common.tests.validation/src/org/eclipse/wst/validation/tests/testcase/TestSuite4.java
@@ -88,8 +88,13 @@
super.tearDown();
}
- public void testTest1() throws CoreException, UnsupportedEncodingException, InterruptedException {
- Tracing.log("TestSuite4-01: testTest1 starting");
+ /**
+ * Ensure that the facet version expressions are working. We define two validators T4A and T4B. The first one operates on Java 5
+ * and the second on Java 6. Since we have created a project that has been set to Java 5, we only expect the T4A validator
+ * to be called.
+ */
+ public void testFacetVersions() throws CoreException, UnsupportedEncodingException, InterruptedException {
+ Tracing.log("TestSuite4-01: testFacetVersions starting");
IProgressMonitor monitor = new NullProgressMonitor();
ValidationFramework vf = ValidationFramework.getDefault();
IProject[] projects = new IProject[1];
@@ -98,7 +103,7 @@
int errors = vr.getSeverityError();
assertEquals("Number of errors", 1, errors);
- Tracing.log("TestSuite4-02:testTest1 finished");
+ Tracing.log("TestSuite4-02:testFacetVersions finished");
}
diff --git a/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/T2B.java b/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/T2B.java
index d326194..ad4b47a 100644
--- a/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/T2B.java
+++ b/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/T2B.java
@@ -16,10 +16,9 @@
public void cleanup(IReporter reporter) {
}
- public void validate(IValidationContext helper, IReporter reporter)
- throws ValidationException {
+ public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
String[] uris = helper.getURIs();
- if (uris != null)Tracing.log("T2B-01: number of urs = " + uris.length);
+ if (uris != null)Tracing.log("T2B-01: number of URIs = " + uris.length);
}
}
diff --git a/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/T4B.java b/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/T4B.java
index 5cffd21..8f9f7e1 100644
--- a/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/T4B.java
+++ b/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/T4B.java
@@ -3,7 +3,7 @@
import org.eclipse.wst.common.tests.validation.Activator;
/**
- * This validator is used to test facet versions. It should be called on projects that have a version 5 java facet.
+ * This validator is used to test facet versions. It should be called on projects that have a version 6 java facet.
* @author karasiuk
*
*/
diff --git a/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/TestValidator2.java b/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/TestValidator2.java
index fc1469c..747f7e2 100644
--- a/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/TestValidator2.java
+++ b/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/TestValidator2.java
@@ -29,7 +29,7 @@
@Override
public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor){
ValidationResult vr = new ValidationResult();
- ValidatorMessage vm = ValidatorMessage.create("A sample message from Test2", resource);
+ ValidatorMessage vm = ValidatorMessage.create("A sample message from " + getName(), resource);
vm.setAttribute(IMarker.LINE_NUMBER, 1);
vm.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
vr.add(vm);
@@ -38,7 +38,7 @@
if (sev != null){
Severity ms = sev.getCurrent();
if (ms != Severity.Ignore){
- vm = ValidatorMessage.create("A different message from Test2", resource);
+ vm = ValidatorMessage.create("A different message from " + getName(), resource);
vm.setAttribute(IMarker.LINE_NUMBER, 2);
vm.setAttribute(IMarker.SEVERITY, ms.getMarkerSeverity());
vr.add(vm);
diff --git a/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/TestValidator3.java b/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/TestValidator3.java
index 459e614..4d19243 100644
--- a/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/TestValidator3.java
+++ b/tests/org.eclipse.wst.common.tests.validation/validators/org/eclipse/wst/validation/tests/TestValidator3.java
@@ -10,18 +10,23 @@
import org.eclipse.wst.validation.ValidatorMessage;
import org.eclipse.wst.validation.internal.Tracing;
-
+/**
+ * A validator that processes *.html and *.htm files.
+ * @author karasiuk
+ *
+ */
public class TestValidator3 extends AbstractValidator {
+ private static final String Name = "TestValidator3";
static final String ID = "org.eclipse.wst.validation.tests.TestValidator3";
public String getName() {
- return "TestValidator3";
+ return Name;
}
@Override
public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor){
- Tracing.log("TestValidator3-04: validating: " + resource);
+ Tracing.log(Name+"-04: validating: " + resource);
checkState(state);
if (resource.getName().equals("test.html")){
@@ -40,12 +45,12 @@
}
ValidationResult vr = new ValidationResult();
- ValidatorMessage vm = ValidatorMessage.create("A sample message from Test3", resource);
+ ValidatorMessage vm = ValidatorMessage.create("A sample message from " + getName(), resource);
vm.setAttribute(IMarker.LINE_NUMBER, 1);
vm.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
vr.add(vm);
- vm = ValidatorMessage.create("A different message from Test3", resource);
+ vm = ValidatorMessage.create("A different message from " + getName(), resource);
vm.setAttribute(IMarker.LINE_NUMBER, 3);
vm.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
vr.add(vm);
@@ -56,7 +61,7 @@
@Override
public void validationStarting(IProject project, ValidationState state, IProgressMonitor monitor) {
String name = project == null ? "NULL" : project.getName();
- Tracing.log("TestValidator3-05: thinks validation is starting for project: ", name);
+ Tracing.log(Name+"-05: thinks validation is starting for project: ", name);
if (!checkState(state)){
state.put(ID, "my state");
}
@@ -67,20 +72,20 @@
@Override
public void validationFinishing(IProject project, ValidationState state, IProgressMonitor monitor) {
String name = project == null ? "NULL" : project.getName();
- Tracing.log("TestValidator3-01: thinks validation is finishing for project: ", name);
+ Tracing.log(Name+"-01: thinks validation is finishing for project: ", name);
checkState(state);
}
@Override
public void clean(IProject project, ValidationState state, IProgressMonitor monitor) {
String name = project == null ? "NULL" : project.getName();
- Tracing.log("TestValidator3-02: thinks a clean has been requested for project: ", name);
+ Tracing.log(Name+"-02: thinks a clean has been requested for project: ", name);
checkState(state);
}
private boolean checkState(ValidationState state){
if (state.get(ID) != null){
- Tracing.log("TestValidator3-03: has state information");
+ Tracing.log(Name+"-03: has state information");
return true;
}
return false;