[286417] Remove and add back comment end tag JUnits broken
diff --git a/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/validation/JSPHTMLValidatorTest.java b/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/validation/JSPHTMLValidatorTest.java index d920900..f39e5e9 100644 --- a/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/validation/JSPHTMLValidatorTest.java +++ b/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/validation/JSPHTMLValidatorTest.java
@@ -142,8 +142,13 @@ fValidator.validate(context, reporter); assertFalse("There should be no validation errors on " + testFile, reporter.isMessageReported()); + //need to dynamically find where the --> is because + //its different on unix vs windows because of line endings + String contents = document.get(); + int endCommentIndex = contents.indexOf("-->"); + //remove --> - document.replace(361, 3, ""); + document.replace(endCommentIndex, 3, ""); //validate file with error reporter = new TestReporter(); @@ -151,7 +156,7 @@ assertTrue("There should be validation errors on " + testFile, reporter.isMessageReported()); //replace --> - document.replace(361, 0, "-->"); + document.replace(endCommentIndex, 0, "-->"); //validate clean file reporter = new TestReporter();
diff --git a/tests/org.eclipse.wst.html.ui.tests/src/org/eclipse/wst/html/ui/tests/validation/TestHTMLValidator.java b/tests/org.eclipse.wst.html.ui.tests/src/org/eclipse/wst/html/ui/tests/validation/TestHTMLValidator.java index 4071d84..aca6d1b 100644 --- a/tests/org.eclipse.wst.html.ui.tests/src/org/eclipse/wst/html/ui/tests/validation/TestHTMLValidator.java +++ b/tests/org.eclipse.wst.html.ui.tests/src/org/eclipse/wst/html/ui/tests/validation/TestHTMLValidator.java
@@ -86,8 +86,13 @@ fValidator.validate(context, reporter); assertFalse("There should be no validation errors on " + testFile, reporter.isMessageReported()); + //need to dynamically find where the --> is because + //its different on unix vs windows because of line endings + String contents = document.get(); + int endCommentIndex = contents.indexOf("-->"); + //remove --> - document.replace(258, 3, ""); + document.replace(endCommentIndex, 3, ""); //validate file with error reporter = new TestReporter(); @@ -95,7 +100,7 @@ assertTrue("There should be validation errors on " + testFile, reporter.isMessageReported()); //replace --> - document.replace(258, 0, "-->"); + document.replace(endCommentIndex, 0, "-->"); //validate clean file reporter = new TestReporter();
diff --git a/tests/org.eclipse.wst.xml.ui.tests/src/org/eclipse/wst/xml/ui/internal/validation/TestDelegatingSourceValidatorForXML.java b/tests/org.eclipse.wst.xml.ui.tests/src/org/eclipse/wst/xml/ui/internal/validation/TestDelegatingSourceValidatorForXML.java index 562522f..41a0562 100644 --- a/tests/org.eclipse.wst.xml.ui.tests/src/org/eclipse/wst/xml/ui/internal/validation/TestDelegatingSourceValidatorForXML.java +++ b/tests/org.eclipse.wst.xml.ui.tests/src/org/eclipse/wst/xml/ui/internal/validation/TestDelegatingSourceValidatorForXML.java
@@ -147,8 +147,13 @@ sourceValidator.validate(context, reporter); assertFalse("There should be no validation errors on " + testFile, reporter.isMessageReported()); + //need to dynamically find where the --> is because + //its different on unix vs windows because of line endings + String contents = document.get(); + int endCommentIndex = contents.indexOf("-->"); + //remove --> - document.replace(176, 3, ""); + document.replace(endCommentIndex, 3, ""); //validate file with error reporter = new TestReporter(); @@ -156,7 +161,7 @@ assertTrue("There should be validation errors on " + testFile, reporter.isMessageReported()); //replace --> - document.replace(176, 0, "-->"); + document.replace(endCommentIndex, 0, "-->"); //validate clean file reporter = new TestReporter();