|
@@ -13,52 +13,50 @@ import org.yakindu.src.operationcallbackimpl.OperationCallbackImplStatemachine;
|
|
|
import org.yakindu.src.operationcallbackimpl.OperationCallbackImplStatemachine.State;
|
|
|
|
|
|
public class UnimplementedOCBTest {
|
|
|
-
|
|
|
+
|
|
|
private OperationCallbackImplStatemachine statemachine;
|
|
|
-
|
|
|
+
|
|
|
@Rule
|
|
|
public ExpectedException exceptions = ExpectedException.none();
|
|
|
-
|
|
|
+
|
|
|
@Before
|
|
|
public void setUp() {
|
|
|
statemachine = new OperationCallbackImplStatemachine();
|
|
|
- statemachine.init();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Test
|
|
|
- public void testUnimplementedInternal() throws IllegalStateException{
|
|
|
+ public void testUnimplementedInternal() throws IllegalStateException {
|
|
|
exceptions.expect(IllegalStateException.class);
|
|
|
exceptions.expectMessage("Operation callback for internal must be set.");
|
|
|
- statemachine.enter();
|
|
|
+ statemachine.init();
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Test
|
|
|
public void testUnimplementedInterfacce() {
|
|
|
- statemachine.setInternalOperationCallback(new InternalOCBImpl());
|
|
|
-
|
|
|
+ statemachine.setInternalOperationCallback(new InternalOCBImpl());
|
|
|
exceptions.expect(IllegalStateException.class);
|
|
|
exceptions.expectMessage("Operation callback for interface sCInterface must be set.");
|
|
|
-
|
|
|
- statemachine.enter();
|
|
|
+ statemachine.init();
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
public void testUnimplementedNamedInterface() {
|
|
|
statemachine.setInternalOperationCallback(new InternalOCBImpl());
|
|
|
statemachine.getSCInterface().setSCInterfaceOperationCallback(new InterfaceOCBImpl());
|
|
|
-
|
|
|
exceptions.expect(IllegalStateException.class);
|
|
|
exceptions.expectMessage("Operation callback for interface sCINamed must be set.");
|
|
|
-
|
|
|
- statemachine.enter();
|
|
|
+ statemachine.init();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Test
|
|
|
public void testImplementedOCBs(){
|
|
|
statemachine.setInternalOperationCallback(new InternalOCBImpl());
|
|
|
statemachine.getSCInterface().setSCInterfaceOperationCallback(new InterfaceOCBImpl());
|
|
|
statemachine.getSCINamed().setSCINamedOperationCallback(new NamedInterfaceOCBImpl());
|
|
|
+ statemachine.init();
|
|
|
statemachine.enter();
|
|
|
+
|
|
|
assertTrue(statemachine.isStateActive(State.main_region_StateA));
|
|
|
}
|
|
|
}
|