diff options
Diffstat (limited to 'src')
4 files changed, 42 insertions, 0 deletions
diff --git a/src/batchtools/rsTester/src/test/java/com/galois/fiveui/RunDescriptionTest.java b/src/batchtools/rsTester/src/test/java/com/galois/fiveui/RunDescriptionTest.java index a815f0a..b3a5f49 100644 --- a/src/batchtools/rsTester/src/test/java/com/galois/fiveui/RunDescriptionTest.java +++ b/src/batchtools/rsTester/src/test/java/com/galois/fiveui/RunDescriptionTest.java @@ -71,6 +71,33 @@ public class RunDescriptionTest { assertObjEqual("Object deserialized incorrectly.", oracle, actual); } + + /** + * Test method for {@link com.galois.fiveui.RSTestDescription}. + * @throws FileNotFoundException + */ + @Test + public final void testDeserialize_deps1() throws FileNotFoundException { + + String jsonFileName = RUN_DESCRIPTION_DIR + "sample6.json"; + String ruleSetLoc = + RUN_DESCRIPTION_DIR + "../ruleSets/alwaysErrorsDeps.json"; + + RuleSet rsOracle = + new RuleSet("Testing RuleSet with dependencies", + "Testing rule set; always errors.", + ImmutableList.of("makeError.js"), + ImmutableList.of("dep1.js", "dep2.js")); + rsOracle.setDirectory(RUN_DESCRIPTION_DIR + "../ruleSets/"); + + RSTestDescription oracle = + new RSTestDescription(ruleSetLoc, + new ArrayList<RSTestDescription.URIMap>(), rsOracle); + + RSTestDescription actual = RSTestDescription.parse(jsonFileName); + assertObjEqual("Object deserialized incorrectly.", oracle, actual); + } + /** * Test method for {@link com.galois.fiveui.RSTestDescription}. * @throws FileNotFoundException diff --git a/src/batchtools/rsTester/src/test/resources/ruleSets/alwaysErrorsDeps.json b/src/batchtools/rsTester/src/test/resources/ruleSets/alwaysErrorsDeps.json new file mode 100644 index 0000000..49ddd0c --- /dev/null +++ b/src/batchtools/rsTester/src/test/resources/ruleSets/alwaysErrorsDeps.json @@ -0,0 +1,5 @@ +{ "name": "Testing RuleSet with dependencies" +, "description": "Testing rule set; always errors." +, "dependencies": [ "dep1.js", "dep2.js" ] +, "rules": [ "makeError.js" ] +}
\ No newline at end of file diff --git a/src/batchtools/rsTester/src/test/resources/ruleSets/makeError.js b/src/batchtools/rsTester/src/test/resources/ruleSets/makeError.js new file mode 100644 index 0000000..57897c3 --- /dev/null +++ b/src/batchtools/rsTester/src/test/resources/ruleSets/makeError.js @@ -0,0 +1,5 @@ +exports.name = "Generate Errors"; +exports.description = "Always report an error"; +exports.rule = function(report) { + report.error("error", null); +};
\ No newline at end of file diff --git a/src/batchtools/rsTester/src/test/resources/runDescriptions/sample6.json b/src/batchtools/rsTester/src/test/resources/runDescriptions/sample6.json new file mode 100644 index 0000000..3a3cc65 --- /dev/null +++ b/src/batchtools/rsTester/src/test/resources/runDescriptions/sample6.json @@ -0,0 +1,5 @@ +{ + 'ruleSet': '../ruleSets/alwaysErrorsDeps.json', + 'tests': [ + ] +} |