Permalink
Browse files

Fixes issue with override of test framework method not present in older.

The method shouldTestSerializer must be overridden and return false when
using newer test framework and tests involve syntax/formatting where
serialized/formatted result differs in tokens. Added an interface to
make the code capable of running with both old and new test framework.
  • Loading branch information...
1 parent 2266de9 commit 9a901a90e86bc9dde9ced06162bb55d5da9b7127 @hlindberg hlindberg committed Apr 1, 2012
@@ -56,6 +56,10 @@
public class AbstractPuppetTests extends AbstractXtextTests {
+ interface SerializationTestControl {
+ public boolean shouldTestSerializer(XtextResource resource);
+ }
+
protected ValidatorTester<PPJavaValidator> tester;
protected final PPFactory pf = PPFactory.eINSTANCE;
@@ -42,7 +42,7 @@
* Tests for expressions not covered by separate test classes.
*
*/
-public class TestExpressions extends AbstractPuppetTests {
+public class TestExpressions extends AbstractPuppetTests implements AbstractPuppetTests.SerializationTestControl {
private PrintStream savedOut;
@@ -103,13 +103,8 @@ public void write(int arg0) throws IOException {
System.setOut(new PrintStream(sink));
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xtext.junit.AbstractXtextTests#shouldTestSerializer(org.eclipse.xtext.resource.XtextResource)
- */
@Override
- protected boolean shouldTestSerializer(XtextResource resource) {
+ public boolean shouldTestSerializer(XtextResource resource) {
return false;
}
@@ -28,7 +28,7 @@
* Test validation/linking of variables.
*
*/
-public class TestVariables extends AbstractPuppetTests {
+public class TestVariables extends AbstractPuppetTests implements AbstractPuppetTests.SerializationTestControl {
private PrintStream savedOut;
@@ -47,13 +47,8 @@ public void write(int arg0) throws IOException {
System.setOut(new PrintStream(sink));
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.xtext.junit.AbstractXtextTests#shouldTestSerializer(org.eclipse.xtext.resource.XtextResource)
- */
@Override
- protected boolean shouldTestSerializer(XtextResource resource) {
+ public boolean shouldTestSerializer(XtextResource resource) {
return false;
}

0 comments on commit 9a901a9

Please sign in to comment.