use of com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails in project irida by phac-nml.
the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsSuccessQuarterComplete.
/**
* Tests successfully building a workflow status from history details
* (quater complete).
*/
@Test
public void testBuildWorkflowStatusFromHistoryDetailsSuccessQuarterComplete() {
Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID, DATASET_ID2, DATASET_ID3));
stateIds.put("ok", Lists.newArrayList(DATASET_ID));
HistoryDetails historyDetails = new HistoryDetails();
historyDetails.setState("running");
historyDetails.setStateIds(stateIds);
GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
assertEquals("workflow status not in correct state", GalaxyWorkflowState.RUNNING, workflowStatus.getState());
assertEquals("percentage complete not correct", 0.25f, workflowStatus.getProportionComplete(), DELTA);
}
use of com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails in project irida by phac-nml.
the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsSuccessRunning.
/**
* Tests successfully building a workflow status from history details (still
* running).
*/
@Test
public void testBuildWorkflowStatusFromHistoryDetailsSuccessRunning() {
HistoryDetails historyDetails = new HistoryDetails();
historyDetails.setState("running");
Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID));
stateIds.put("ok", Lists.newArrayList(DATASET_ID));
historyDetails.setStateIds(stateIds);
GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
assertEquals("workflow status not in correct state", GalaxyWorkflowState.RUNNING, workflowStatus.getState());
assertEquals("percentage complete not correct", 0.5f, workflowStatus.getProportionComplete(), DELTA);
}
use of com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails in project irida by phac-nml.
the class GalaxyWorkflowStatusTest method testIsRunning.
/**
* Tests whether or not this workflow is still running.
*/
@Test
public void testIsRunning() {
HistoryDetails historyDetails = new HistoryDetails();
historyDetails.setState("running");
historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID)));
GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
assertTrue("Workflow is not still running", workflowStatus.isRunning());
}
use of com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails in project irida by phac-nml.
the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsMissingStateSuccess.
/**
* Tests building a GalaxyWorkflowStatus object which has a subset of
* the expected states and passing
*/
@Test
public void testBuildWorkflowStatusFromHistoryDetailsMissingStateSuccess() {
Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("ok", Lists.newArrayList(DATASET_ID));
stateIds.remove("running");
HistoryDetails historyDetails = new HistoryDetails();
historyDetails.setState("ok");
historyDetails.setStateIds(stateIds);
GalaxyWorkflowStatus.builder(historyDetails).build();
}
use of com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testLibraryDatasetToHistorySuccess.
/**
* Tests moving a library dataset to a history success.
* @throws ExecutionManagerObjectNotFoundException
* @throws CreateLibraryException
*/
@Test
public void testLibraryDatasetToHistorySuccess() throws CreateLibraryException, ExecutionManagerObjectNotFoundException {
Library library = buildEmptyLibrary("GalaxyHistoriesServiceIT.testLibraryDatasetToHistory");
String fileId = setupLibraries(library, galaxyInstanceAdmin);
History history = galaxyHistory.newHistoryForWorkflow();
HistoryDetails details = galaxyHistory.libraryDatasetToHistory(fileId, history);
assertNotNull(details);
}
Aggregations