use of com.thoughtworks.studios.shine.semweb.grddl.XSLTTransformerRegistry in project gocd by gocd.
the class StageResourceImporterTest method shouldNotImportStageNotCompleted.
@Test(expected = CanNotImportABuildingStageException.class)
public void shouldNotImportStageNotCompleted() throws Exception {
TestFailureSetup.SavedStage savedStage = failureSetup.setupPipelineInstanceWithoutTestXmlStubbing(false, null, new Date());
importer.load(savedStage.stageId, graphFactory, new XSLTTransformerRegistry());
}
use of com.thoughtworks.studios.shine.semweb.grddl.XSLTTransformerRegistry in project gocd by gocd.
the class StageResourceImporterTest method shouldImportPipelineBuildTriggers.
@Test
public void shouldImportPipelineBuildTriggers() throws Exception {
TestFailureSetup.SavedStage savedStage = failureSetup.setupPipelineInstanceWithoutTestXmlStubbing(true, null, new Date());
Graph graph = importer.load(savedStage.stageId, graphFactory, new XSLTTransformerRegistry());
for (Modification modification : savedStage.pipeline.getMaterialRevisions().getRevisions().get(0).getModifications()) {
String changeSetUri = ScmMaterial.changesetUrl(modification, baseUrl, modification.getMaterialInstance().getId());
assertTrue(graph.containsResourceWithURI(changeSetUri));
String ask = "" + "PREFIX cruise: <" + GoOntology.URI + "> " + "PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE {" + " <" + PipelineXmlViewModel.httpUrlForPipeline(baseUrl, savedStage.pipeline.getId(), savedStage.pipeline.getName()) + "> cruise:pipelineTrigger <" + changeSetUri + "> . " + "}";
assertAskIsTrue(graph, ask);
}
}
use of com.thoughtworks.studios.shine.semweb.grddl.XSLTTransformerRegistry in project gocd by gocd.
the class AntJUnitGRDDLTest method setUp.
@Before
public void setUp() throws Exception {
InputStream xunitXMLStream = new ByteArrayInputStream(minimalXUnitXML.getBytes());
XSLTTransformerRegistry xsltTransformerRegistry = new XSLTTransformerRegistry();
transformer = new GRDDLTransformer(xsltTransformerRegistry, XSLTTransformerRegistry.XUNIT_ANT_JUNIT_GRDDL_XSL);
minimalDataGraph = transformer.transform(xunitXMLStream, new InMemoryTempGraphFactory());
}
use of com.thoughtworks.studios.shine.semweb.grddl.XSLTTransformerRegistry in project gocd by gocd.
the class StageResourceImporterTest method canLoadAllStageInfoAfterImportIt.
@Test
public void canLoadAllStageInfoAfterImportIt() throws Exception {
TestFailureSetup.SavedStage savedStage = failureSetup.setupPipelineInstanceWithoutTestXmlStubbing(true, null, new Date());
Pipeline pipeline = savedStage.pipeline;
Graph graph = importer.load(savedStage.stageId, graphFactory, new XSLTTransformerRegistry());
String pipelineUrl = PipelineXmlViewModel.httpUrlForPipeline(baseUrl, pipeline.getId(), pipeline.getName());
Stage stage = savedStage.stage;
String stageUrl = new StageXmlViewModel(stage).httpUrl(baseUrl);
String jobUrl = new JobXmlViewModel(stage.getJobInstances().get(0)).httpUrl(baseUrl);
String ask = "" + "PREFIX cruise: <" + GoOntology.URI + "> " + "PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE {" + " <" + pipelineUrl + "> a cruise:Pipeline ." + " <" + pipelineUrl + "> cruise:hasStage <" + stageUrl + "> ." + " <" + stageUrl + "> a cruise:Stage ." + " <" + stageUrl + "> cruise:hasJob <" + jobUrl + "> ." + " <" + jobUrl + "> a cruise:Job . " + "}";
assertAskIsTrue(graph, ask);
}
use of com.thoughtworks.studios.shine.semweb.grddl.XSLTTransformerRegistry in project gocd by gocd.
the class StageResourceImporterTest method shouldNotImportPreviousNextPipelinePointer.
@Test
public void shouldNotImportPreviousNextPipelinePointer() throws Exception {
TestFailureSetup.SavedStage savedStageFirst = failureSetup.setupPipelineInstanceWithoutTestXmlStubbing(true, null, new Date());
TestFailureSetup.SavedStage savedStageSecond = failureSetup.setupPipelineInstanceWithoutTestXmlStubbing(true, null, new Date());
TestFailureSetup.SavedStage savedStageThird = failureSetup.setupPipelineInstanceWithoutTestXmlStubbing(true, null, new Date());
Graph graph = importer.load(savedStageSecond.stageId, graphFactory, new XSLTTransformerRegistry());
Pipeline pipelineSecond = savedStageSecond.pipeline;
assertTrue(graph.containsResourceWithURI(PipelineXmlViewModel.httpUrlForPipeline(baseUrl, pipelineSecond.getId(), pipelineSecond.getName())));
Pipeline pipelineFirst = savedStageFirst.pipeline;
assertFalse(graph.containsResourceWithURI(PipelineXmlViewModel.httpUrlForPipeline(baseUrl, pipelineFirst.getId(), pipelineFirst.getName())));
Pipeline pipelineThird = savedStageThird.pipeline;
assertFalse(graph.containsResourceWithURI(PipelineXmlViewModel.httpUrlForPipeline(baseUrl, pipelineThird.getId(), pipelineThird.getName())));
String askForPreviousPointer = "" + "PREFIX cruise: <" + GoOntology.URI + "> " + "PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE {" + " [] cruise:previousPipeline [] . " + "}";
assertAskIsFalse(graph, askForPreviousPointer);
String askForNextPointer = "" + "PREFIX cruise: <" + GoOntology.URI + "> " + "PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> " + "ASK WHERE {" + " [] cruise:nextPipeline [] . " + "}";
assertAskIsFalse(graph, askForNextPointer);
}
Aggregations