Search in sources :

Example 26 with InMemoryTempGraphFactory

use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.

the class AntJUnitReportRDFizerForRailsTestsReportTest method canReadRailsTestWithErrorOutput.

@Test
public void canReadRailsTestWithErrorOutput() throws Exception {
    AntJUnitReportRDFizer junitRDFizer = new AntJUnitReportRDFizer(new InMemoryTempGraphFactory(), XSLTTransformerRegistry);
    Graph graph = junitRDFizer.importFile("http://job", document(FileUtils.readFileToString(new File("src/test-shared/resources/ruby_xunit/errors/TEST-PostsControllerTest.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 'PostsControllerTest'^^xsd:string . " + "_:testCase xunit:testCaseName 'test_should_get_index'^^xsd:string . " + "_:testCase xunit:hasFailure _:failure . " + "_:failure xunit:isError 'true'^^xsd:boolean " + "}";
    assertAskIsTrue(graph, ask);
}
Also used : Graph(com.thoughtworks.studios.shine.semweb.Graph) InMemoryTempGraphFactory(com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory) File(java.io.File) Test(org.junit.Test)

Example 27 with InMemoryTempGraphFactory

use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.

the class AntJUnitReportRDFizerForTwistReportTest method canReadACombinedTestReport.

@Test
public void canReadACombinedTestReport() 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/TESTS-TestSuites.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 'scn'^^xsd:string . " + "_:testCase xunit:testCaseName 'Parameter type matching in data table.scn'^^xsd:string . " + "_:testCase xunit:hasFailure _:failure . " + "_:failure xunit:isError 'false'^^xsd:boolean " + "}";
    assertAskIsTrue(graph, ask);
}
Also used : Graph(com.thoughtworks.studios.shine.semweb.Graph) InMemoryTempGraphFactory(com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory) File(java.io.File) Test(org.junit.Test)

Example 28 with InMemoryTempGraphFactory

use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.

the class AntJUnitReportRDFizerTest method testDoesHandleJUnitXMLFile.

@Test
public void testDoesHandleJUnitXMLFile() throws DocumentException {
    String invalidXML = "<?xml version='1.0' encoding='UTF-8' ?><testsuite/>";
    AntJUnitReportRDFizer junitRDFizer = new AntJUnitReportRDFizer(new InMemoryTempGraphFactory(), XSLTTransformerRegistry);
    assertTrue(junitRDFizer.canHandle(document(invalidXML)));
}
Also used : InMemoryTempGraphFactory(com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory) Test(org.junit.Test)

Example 29 with InMemoryTempGraphFactory

use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.

the class NUnitRDFizerTest method setup.

@Before
public void setup() {
    XSLTTransformerRegistry transformerRegistry = new XSLTTransformerRegistry();
    AntJUnitReportRDFizer jUnitRDFizer = new AntJUnitReportRDFizer(new InMemoryTempGraphFactory(), transformerRegistry);
    nUnitRDFizer = new NUnitRDFizer(jUnitRDFizer, transformerRegistry);
}
Also used : XSLTTransformerRegistry(com.thoughtworks.studios.shine.semweb.grddl.XSLTTransformerRegistry) InMemoryTempGraphFactory(com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory) Before(org.junit.Before)

Example 30 with InMemoryTempGraphFactory

use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.

the class GoGRDDLResourceRDFizerTest method testCanHandleAcceptsCorrectRootElement.

@Test
public void testCanHandleAcceptsCorrectRootElement() throws DocumentException {
    GoGRDDLResourceRDFizer rdfizer = new GoGRDDLResourceRDFizer("job", "cruise/job-grddl.xsl", new InMemoryTempGraphFactory(), XSLTTransformerRegistry, null);
    assertTrue(rdfizer.canHandle(doc("<job />")));
    assertFalse(rdfizer.canHandle(doc("<stage />")));
}
Also used : InMemoryTempGraphFactory(com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory) Test(org.junit.Test)

Aggregations

InMemoryTempGraphFactory (com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory)37 Test (org.junit.Test)28 Graph (com.thoughtworks.studios.shine.semweb.Graph)18 File (java.io.File)14 ByteArrayInputStream (java.io.ByteArrayInputStream)9 InputStream (java.io.InputStream)7 Before (org.junit.Before)6 JobXmlViewModel (com.thoughtworks.go.server.domain.xml.JobXmlViewModel)2 XSLTTransformerRegistry (com.thoughtworks.studios.shine.semweb.grddl.XSLTTransformerRegistry)2 JobInstance (com.thoughtworks.go.domain.JobInstance)1 StageIdentifier (com.thoughtworks.go.domain.StageIdentifier)1 TestFailureSetup (com.thoughtworks.go.server.dao.sparql.TestFailureSetup)1 ShineRuntimeException (com.thoughtworks.studios.shine.ShineRuntimeException)1 StageStorage (com.thoughtworks.studios.shine.cruise.stage.details.StageStorage)1 BoundVariables (com.thoughtworks.studios.shine.semweb.BoundVariables)1 GRDDLTransformer (com.thoughtworks.studios.shine.semweb.grddl.GRDDLTransformer)1 BufferedInputStream (java.io.BufferedInputStream)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1