use of com.thoughtworks.studios.shine.semweb.Graph in project gocd by gocd.
the class AntJUnitReportRDFizerForTwistReportTest method canReadTwistTestWithFailingOutput.
@Test
public void canReadTwistTestWithFailingOutput() throws Exception {
AntJUnitReportRDFizer junitRDFizer = new AntJUnitReportRDFizer(new InMemoryTempGraphFactory(), XSLTTransformerRegistry);
Graph graph = junitRDFizer.importFile("http://job", document(FileUtils.readFileToString(new File("src/test-shared/resources/twist_xunit/failing/TWIST_TEST--scenarios.AFailingTest.xml"), UTF_8)));
String ask = "prefix cruise: <" + GoOntology.URI + "> " + "PREFIX xunit: <" + XUnitOntology.URI + "> " + "prefix xsd: <http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE { " + "<http://job> xunit:hasTestCase _:testCase . " + "_:testCase a xunit:TestCase . " + "_:testCase xunit:testSuiteName 'ShineReadsCruiseStagesCompletedFeed.scn'^^xsd:string . " + "_:testCase xunit:testCaseName 'ShineReadsCruiseStagesCompletedFeed.scn'^^xsd:string . " + "_:testCase xunit:hasFailure _:failure . " + "_:failure xunit:isError 'false'^^xsd:boolean " + "}";
assertAskIsTrue(graph, ask);
}
use of com.thoughtworks.studios.shine.semweb.Graph in project gocd by gocd.
the class AntJUnitReportRDFizerForTwistReportTest method canReadTwistTestWithErrorOutput.
@Test
public void canReadTwistTestWithErrorOutput() throws Exception {
AntJUnitReportRDFizer junitRDFizer = new AntJUnitReportRDFizer(new InMemoryTempGraphFactory(), XSLTTransformerRegistry);
Graph graph = junitRDFizer.importFile("http://job", document(FileUtils.readFileToString(new File("src/test-shared/resources/twist_xunit/errors/TWIST_TEST--scenarios.AErrorTest.xml"), UTF_8)));
String ask = "prefix cruise: <" + GoOntology.URI + "> " + "PREFIX xunit: <" + XUnitOntology.URI + "> " + "prefix xsd: <http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE { " + "<http://job> xunit:hasTestCase _:testCase . " + "_:testCase a xunit:TestCase . " + "_:testCase xunit:testSuiteName 'ShineReadsCruiseStagesCompletedFeed.scn'^^xsd:string . " + "_:testCase xunit:testCaseName 'ShineReadsCruiseStagesCompletedFeed.scn'^^xsd:string . " + "_:testCase xunit:hasFailure _:failure . " + "_:failure xunit:isError 'true'^^xsd:boolean " + "}";
assertAskIsTrue(graph, ask);
}
use of com.thoughtworks.studios.shine.semweb.Graph in project gocd by gocd.
the class AntJUnitReportRDFizerTest method testLoadingPassingJUnit.
@Test
public void testLoadingPassingJUnit() throws Exception {
String passingTestXML = "<?xml version='1.0' encoding='UTF-8' ?>" + "<testsuite name='com.example.TheTest'>" + "<testcase classname='com.example.TheTest' name='testSomething' />" + "</testsuite>";
AntJUnitReportRDFizer junitRDFizer = new AntJUnitReportRDFizer(new InMemoryTempGraphFactory(), XSLTTransformerRegistry);
Graph graph = junitRDFizer.importFile("http://job", document(passingTestXML));
String ask = "prefix cruise: <" + GoOntology.URI + "> " + "prefix xunit: <" + XUnitOntology.URI + "> " + "prefix xsd: <http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE { " + "<http://job> xunit:hasTestCase _:testCase . " + "_:testCase a xunit:TestCase . " + "_:testCase xunit:testSuiteName 'com.example.TheTest'^^xsd:string . " + "_:testCase xunit:testCaseName 'testSomething'^^xsd:string . " + "OPTIONAL { ?testCase xunit:hasFailure ?failure } . " + "FILTER (!bound(?failure)) " + "}";
assertAskIsTrue(graph, ask);
}
use of com.thoughtworks.studios.shine.semweb.Graph in project gocd by gocd.
the class AntJUnitReportRDFizerTest method testLoadingFailingJUnit.
@Test
public void testLoadingFailingJUnit() throws Exception {
String failingTestXML = "<?xml version='1.0' encoding='UTF-8' ?>" + "<testsuite errors='1' failures='1' hostname='fake-host-name' name='com.example.TheTest' tests='1' time='1.058' timestamp='2009-12-25T00:34:36'>" + "<testcase classname='com.example.TheTest' name='testSomething' time='0.011'>" + "<failure message='foo' type='junit.framework.AssertionFailedError'>junit.framework.AssertionFailedError: foo" + "\tat com.example.TheTest.testSomething(TheTest.java:96)" + "</failure>" + "</testcase>" + "</testsuite>";
AntJUnitReportRDFizer junitRDFizer = new AntJUnitReportRDFizer(new InMemoryTempGraphFactory(), XSLTTransformerRegistry);
Graph graph = junitRDFizer.importFile("http://job", document(failingTestXML));
String ask = "prefix cruise: <" + GoOntology.URI + "> " + "PREFIX xunit: <" + XUnitOntology.URI + "> " + "prefix xsd: <http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE { " + "<http://job> xunit:hasTestCase _:testCase . " + "_:testCase a xunit:TestCase . " + "_:testCase xunit:testSuiteName 'com.example.TheTest'^^xsd:string . " + "_:testCase xunit:testCaseName 'testSomething'^^xsd:string . " + "_:testCase xunit:hasFailure _:failure . " + "_:failure xunit:isError 'false'^^xsd:boolean " + "}";
assertAskIsTrue(graph, ask);
}
use of com.thoughtworks.studios.shine.semweb.Graph in project gocd by gocd.
the class NUnitRDFizerTest method testLoadingPassingJUnit.
@Test
public void testLoadingPassingJUnit() throws Exception {
String passingTestXML = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>" + "<!--This file represents the results of running a test suite-->" + "<test-results name=\"/home/erik/coding/test/nunittests/Tests.dll\" total=\"4\" failures=\"1\" not-run=\"0\" date=\"2007-07-27\" time=\"11:18:43\">" + " <environment nunit-version=\"2.2.8.0\" clr-version=\"2.0.50727.42\" os-version=\"Unix 2.6.18.4\" platform=\"Unix\" cwd=\"/home/erik/coding/test/nunittests\" machine-name=\"akira.ramfelt.se\" user=\"erik\" user-domain=\"akira.ramfelt.se\" />" + " <culture-info current-culture=\"sv-SE\" current-uiculture=\"sv-SE\" />" + " <test-suite name=\"/home/erik/coding/test/nunittests/Tests.dll\" success=\"False\" time=\"0.404\" asserts=\"0\">" + " <results>" + " <test-suite name=\"AnotherNS\" success=\"True\" time=\"0.001\" asserts=\"0\">" + " <results>" + " <test-suite name=\"AnotherNS.OtherMainClassTest\" success=\"True\" time=\"0.001\" asserts=\"0\">" + " <results>" + " <test-case name=\"AnotherNS.OtherMainClassTest.TestPropertyValueAgain\" executed=\"True\" success=\"True\" time=\"0.001\" asserts=\"1\" />" + " </results>" + " </test-suite>" + " </results>" + " </test-suite>" + " </results>" + " </test-suite>" + "</test-results>";
Graph graph = nUnitRDFizer.importFile("http://job", document(passingTestXML));
String ask = "prefix cruise: <" + GoOntology.URI + "> " + "prefix xunit: <" + XUnitOntology.URI + "> " + "prefix xsd: <http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE { " + "<http://job> xunit:hasTestCase _:testCase . " + "_:testCase a xunit:TestCase . " + "_:testCase xunit:testSuiteName 'AnotherNS.OtherMainClassTest'^^xsd:string . " + "_:testCase xunit:testCaseName 'TestPropertyValueAgain'^^xsd:string . " + "OPTIONAL { ?testCase xunit:hasFailure ?failure } . " + "FILTER (!bound(?failure)) " + "}";
assertAskIsTrue(graph, ask);
}
Aggregations