use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class JobResourceImporterTest method testLoadingFileThatDoesNotExist.
@Test
public void testLoadingFileThatDoesNotExist() throws GoIntegrationException, IOException, DocumentException {
Clock.fakeNowUTC(2008, 1, 20, 0, 0, 1);
when(xmlApiService.write(any(JobXmlViewModel.class), eq(baseUri))).thenReturn(docFor(jobWithArtifactsMissing));
JobResourceImporter rdfImporter = new JobResourceImporter("src/test-shared/resources/cruise/artifacts", new InMemoryTempGraphFactory(), transformerRegistry, xmlApiService, systemEnvironment);
Graph jobGraph = rdfImporter.importJob(JobInstanceMother.passed("foo"), "https://localhost:8154/go");
String ask = "PREFIX xunit: <" + XUnitOntology.URI + "> ASK WHERE { [] a xunit:TestCase }";
assertAskIsFalse(jobGraph, ask);
}
use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class JobResourceImporterTest method testArtifactsAreImported.
@Test
public void testArtifactsAreImported() throws Exception {
Clock.fakeNowUTC(2008, 1, 20, 0, 0, 1);
JobInstance failedJob = JobInstanceMother.failed("test");
Document document = docFor(happyJobResourceXML);
document.selectSingleNode("//link[@rel='self']/@href").setText(new JobXmlViewModel(failedJob).httpUrl(baseUri));
when(xmlApiService.write(any(JobXmlViewModel.class), eq(baseUri))).thenReturn(document);
JobResourceImporter rdfImporter = new JobResourceImporter("src/test-shared/resources/cruise/artifacts", new InMemoryTempGraphFactory(), transformerRegistry, xmlApiService, systemEnvironment);
Graph graph = rdfImporter.importJob(failedJob, baseUri);
String testCountSelect = "PREFIX xunit: <" + XUnitOntology.URI + "> SELECT ?testcase WHERE { ?testCase a xunit:TestCase }";
assertEquals(5, graph.select(testCountSelect).size());
}
Aggregations