Compare commits

..

No commits in common. "9fb2276ac14c64e0eeda0bbcce1fd97e8c3f29c8" and "ee4e214f8e147349ea04510328e16cae064b3bee" have entirely different histories.

5 changed files with 5 additions and 13 deletions

View File

@ -7,6 +7,6 @@ package me.bvn13.fsm;
@FunctionalInterface
public interface StateHandler<T extends Fsm> {
void handle(T fsm);
void handle(T fms);
}

View File

@ -8,6 +8,6 @@ package me.bvn13.fsm;
@FunctionalInterface
public interface StateProcessor<T extends Fsm, E> {
void process(T fsm, E event);
void process(T fms, E event);
}

View File

@ -5,7 +5,7 @@ import me.bvn13.fsm.StateHandler;
public class DummyHandler<T extends Fsm> implements StateHandler<T> {
@Override
public void handle(T fsm) {
public void handle(T fms) {
}
}

View File

@ -5,7 +5,7 @@ import me.bvn13.fsm.StateProcessor;
public class DummyProcessor<T extends Fsm,E> implements StateProcessor<T,E> {
@Override
public void process(T fsm, E event) {
public void process(T fms, E event) {
}
}

View File

@ -92,8 +92,6 @@ public class FsmTest {
.withAfterHandler(fsm -> initAfter.set(true))
.withProcessor((fsm, event) -> initProcess.set(true))
.end()
.state("intermediate")
.end()
.finish("finish")
.withBeforeHandler(fsm -> finishBefore.set(true))
.withAfterHandler(fsm -> finishAfter.set(true))
@ -101,11 +99,6 @@ public class FsmTest {
.end()
.withTransition()
.from("init")
.to("intermediate")
.checking((fsm, event) -> true)
.end()
.withTransition()
.from("intermediate")
.to("finish")
.checking((fsm, event) -> true)
.end()
@ -114,10 +107,9 @@ public class FsmTest {
// @formatter:on
simpleFsm.process("");
simpleFsm.process("");
Assert.assertEquals("finish", simpleFsm.getCurrentState().getName());
//Assert.assertEquals("finish", simpleFsm.getCurrentState().getName());
Assert.assertTrue(initBefore.get());
Assert.assertTrue(initProcess.get());
Assert.assertTrue(initAfter.get());