Search in sources :

Example 1 with StudyTransition

use of com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition in project ArachneCentralAPI by OHDSI.

the class StudyStateMachineTest method testAnalysisListDiscriminatorChangingInfo.

@Test
public void testAnalysisListDiscriminatorChangingInfo() {
    Study activeStudy = createStudy(ACTIVE);
    activeStudy.getAnalyses().add(new Analysis());
    // now study has one analysis and transitions from Active to Initiate should have Info status
    List<StudyTransition> availableStates = stateMachine.getAvailableStates(activeStudy);
    assertEquals(2, availableStates.size());
    assertTrue(availableStates.get(0).isInfo());
    assertFalse(availableStates.get(1).isInfo());
}
Also used : Study(com.odysseusinc.arachne.portal.model.Study) StudyTransition(com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition) Analysis(com.odysseusinc.arachne.portal.model.Analysis) Test(org.junit.Test)

Example 2 with StudyTransition

use of com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition in project ArachneCentralAPI by OHDSI.

the class StudyStateMachineTest method testAnalysisListDiscriminatorDoingNothing.

@Test
public void testAnalysisListDiscriminatorDoingNothing() {
    Study activeStudy = createStudy(ACTIVE);
    List<StudyTransition> availableStates = stateMachine.getAvailableStates(activeStudy);
    assertEquals(2, availableStates.size());
    assertFalse(availableStates.get(0).isInfo());
    assertFalse(availableStates.get(1).isInfo());
}
Also used : Study(com.odysseusinc.arachne.portal.model.Study) StudyTransition(com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition) Test(org.junit.Test)

Example 3 with StudyTransition

use of com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition in project ArachneCentralAPI by OHDSI.

the class StudyStateMachineTest method testAvailableStates.

@Test
public void testAvailableStates() {
    Study study = createStudy(INITIATE);
    List<StudyTransition> transitionsFrom = stateMachine.getTransitionsFrom(study.getStatus());
    assertEquals(1, transitionsFrom.size());
    assertEquals(transitionsFrom.get(0).getFrom().getName(), INITIATE);
    assertEquals(transitionsFrom.get(0).getTo().getName(), ACTIVE);
}
Also used : Study(com.odysseusinc.arachne.portal.model.Study) StudyTransition(com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition) Test(org.junit.Test)

Aggregations

Study (com.odysseusinc.arachne.portal.model.Study)3 StudyTransition (com.odysseusinc.arachne.portal.model.statemachine.study.StudyTransition)3 Test (org.junit.Test)3 Analysis (com.odysseusinc.arachne.portal.model.Analysis)1