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("src/test-shared/resources/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 StageResourceImporterTest method setup.
@Before
public void setup() throws Exception {
dbHelper.onSetUp();
configHelper.usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
graphFactory = new InMemoryTempGraphFactory();
importer = new StageResourceImporter("test/data/cruise/artifacts", xmlApiService, stageService, pipelineHistoryService, systemEnvironment);
failureSetup = new TestFailureSetup(materialRepository, dbHelper, pipelineTimeline, configHelper, transactionTemplate);
}
use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class BackgroundStageLoaderStageStatusListener method handle.
public void handle(StageFeedEntry feedEntry, final PipelineInstanceLoader pipelineInstanceLoader) {
StageIdentifier stageIdentifier = feedEntry.getStageIdentifier();
LOGGER.debug("handling stage:<{}>...", stageIdentifier);
try {
stageStorage.save(stageResourceImporter.load(stageIdentifier, new InMemoryTempGraphFactory(), transformerRegistry));
LOGGER.debug("importing stage:<{}> finished.", stageIdentifier);
} catch (GoIntegrationException e) {
LOGGER.error("Can not import stage <{}>, will skip to next...", stageIdentifier, e);
}
}
use of com.thoughtworks.studios.shine.semweb.sesame.InMemoryTempGraphFactory in project gocd by gocd.
the class StageStorage method load.
public Graph load(StageIdentifier stageIdentifier) {
String fileName = stagePath(stageIdentifier);
try {
InputStream inputStream = new BufferedInputStream(new FileInputStream(fileName));
Graph tempGraph = new InMemoryTempGraphFactory().createTempGraph();
tempGraph.addTriplesFromTurtle(inputStream);
inputStream.close();
return tempGraph;
} catch (IOException e) {
throw new ShineRuntimeException(String.format("Unable to read stage n3 file for " + stageIdentifier + "(file: %s). This should never happen.", fileName), e);
}
}
Aggregations