use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class AntJUnitGRDDLTest method happyPathConversionWithAllData.
@Test
public void happyPathConversionWithAllData() throws Exception {
String kitchenSinkXUnitXML = "<?xml version='1.0' encoding='UTF-8' ?>" + "<testsuite errors='0' failures='0' hostname='phydeaux3.corporate.thoughtworks.com' name='com.thoughtworks.studios.shine.cruise.GoOntologyTest' tests='2' time='0.601' timestamp='2009-12-18T20:26:42'>" + "<properties>" + "<property name='java.runtime.name' value='Java SE Runtime Environment' />" + "<property name='sun.boot.library.path' value='/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Libraries' />" + "</properties>" + "<testcase classname='com.thoughtworks.studios.shine.cruise.GoOntologyTest' name='canCreateGraph' time='0.57' />" + "<system-out><![CDATA[]]></system-out>" + "<system-err><![CDATA[]]></system-err>" + "</testsuite>";
InputStream xunitXMLStream = new ByteArrayInputStream(kitchenSinkXUnitXML.getBytes());
Graph graph = transformer.transform(xunitXMLStream, new InMemoryTempGraphFactory());
String sparql = "PREFIX xunit: <" + XUnitOntology.URI + "> " + "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE { " + "?testCase a xunit:TestCase ; " + "xunit:testCaseName \"canCreateGraph\"^^xsd:string ; " + "xunit:testCaseClassName \"com.thoughtworks.studios.shine.cruise.GoOntologyTest\"^^xsd:string ; " + "xunit:testSuiteName \"com.thoughtworks.studios.shine.cruise.GoOntologyTest\"^^xsd:string . " + "}";
assertAskIsTrue(graph, sparql);
}
use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class JobResourceImporterTest method listArtifactFilesReturnsEmptyListWhenJobArtifactPathIsAGlob.
@Test
public void listArtifactFilesReturnsEmptyListWhenJobArtifactPathIsAGlob() {
JobResourceImporter rdfImporter = new JobResourceImporter("test/data/cruise", new InMemoryTempGraphFactory(), transformerRegistry, xmlApiService, systemEnvironment);
File[] files = rdfImporter.getArtifactFilesOfType("artifacts", "job2/**/*.xml", "xml");
assertThat(files.length, equalTo(0));
}
use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class LazyStageGraphLoaderTest method initStageStorage.
@Before
public void initStageStorage() {
stageStorage = new StageStorage(new File(System.getProperty("java.io.tmpdir"), "shine").getAbsolutePath());
stageStorage.clear();
graphFactory = new InMemoryTempGraphFactory();
}
use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class StageStorageTest method setUp.
@Before
public void setUp() throws Exception {
tempFiles = new TempFiles();
File tempFolder = tempFiles.createUniqueFolder("shine");
stageStorage = new StageStorage(tempFolder.getAbsolutePath());
stageStorage.clear();
graphFactory = new InMemoryTempGraphFactory();
pipelineInstanceLoader = mock(PipelineInstanceLoader.class);
}
use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class XMLArtifactImporterTest method testSubsequentHandlerIsUsedWhenFirstCannotHandleArtifact.
@Test
public void testSubsequentHandlerIsUsedWhenFirstCannotHandleArtifact() throws Exception {
artifactImporter.registerHandler(new StubHandler(false, "http://foobar/"));
artifactImporter.registerHandler(new StubHandler(true, "http://A-OK/"));
Graph graph = new InMemoryTempGraphFactory().createTempGraph();
URIReference parent = graph.createURIReference(BAR_CLASS, "http://parent/");
artifactImporter.importFile(graph, parent, new ByteArrayInputStream("<foo />".getBytes()));
String askForFirstHandler = "PREFIX ex: <http://example.com/example.owl#> " + "ASK WHERE { " + "<http://parent/> ex:foo <http://foobar/> " + "}";
assertAskIsFalse(graph, askForFirstHandler);
String askForSecondHandler = "PREFIX ex: <http://example.com/example.owl#> " + "ASK WHERE { " + "<http://parent/> ex:foo <http://A-OK/> " + "}";
assertAskIsTrue(graph, askForSecondHandler);
}
Aggregations