Polish
This commit is contained in:
@@ -151,6 +151,7 @@ public class DefaultStateConfigurer<S, E>
|
||||
return state(state, entryActions, exitActions);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public StateConfigurer<S, E> state(S state, E... deferred) {
|
||||
Collection<E> d = null;
|
||||
|
||||
@@ -97,6 +97,7 @@ public interface StateConfigurer<S, E> extends
|
||||
* @param deferred the deferred events
|
||||
* @return configurer for chaining
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
StateConfigurer<S, E> state(S state, E... deferred);
|
||||
|
||||
/**
|
||||
|
||||
@@ -413,7 +413,6 @@ public class SubStateMachineTests extends AbstractStateMachineTests {
|
||||
@EnableStateMachine
|
||||
public static class Config1 extends EnumStateMachineConfigurerAdapter<TestStates, TestEvents> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void configure(StateMachineStateConfigurer<TestStates, TestEvents> states) throws Exception {
|
||||
states
|
||||
|
||||
@@ -225,7 +225,6 @@ public class ConfigurationTests extends AbstractStateMachineTests {
|
||||
@EnableStateMachine
|
||||
public static class Config5 extends EnumStateMachineConfigurerAdapter<TestStates, TestEvents> {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void configure(StateMachineStateConfigurer<TestStates, TestEvents> states) throws Exception {
|
||||
TestEntryAction action1 = action1();
|
||||
|
||||
@@ -175,16 +175,6 @@ public class ManualBuilderTests {
|
||||
transitionLatch.countDown();
|
||||
}
|
||||
|
||||
public void reset(int c1) {
|
||||
reset(c1, 0);
|
||||
}
|
||||
|
||||
public void reset(int c1, int c2) {
|
||||
stateChangedLatch = new CountDownLatch(c1);
|
||||
transitionLatch = new CountDownLatch(c2);
|
||||
stateChangedCount = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ public class DefaultStateConfigurerTests {
|
||||
|
||||
@Test
|
||||
public void testActionsInitialFirst() throws Exception {
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<Action<TestStates, TestEvents>> exitActions = Arrays.asList(testExitAction());
|
||||
|
||||
DefaultStateConfigurer<TestStates, TestEvents> configurer = new DefaultStateConfigurer<TestStates, TestEvents>();
|
||||
@@ -103,7 +102,6 @@ public class DefaultStateConfigurerTests {
|
||||
|
||||
@Test
|
||||
public void testActionsJustState() throws Exception {
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<Action<TestStates, TestEvents>> entryActions = Arrays.asList(testEntryAction());
|
||||
|
||||
DefaultStateConfigurer<TestStates, TestEvents> configurer = new DefaultStateConfigurer<TestStates, TestEvents>();
|
||||
|
||||
@@ -40,12 +40,12 @@ import org.springframework.statemachine.config.builders.StateMachineTransitionCo
|
||||
|
||||
/**
|
||||
* Tests for state entry and exit actions.
|
||||
*
|
||||
*
|
||||
* @author Janne Valkealahti
|
||||
*
|
||||
*/
|
||||
public class StateActionTests extends AbstractStateMachineTests {
|
||||
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testStateEntryExit() throws Exception {
|
||||
@@ -56,24 +56,22 @@ public class StateActionTests extends AbstractStateMachineTests {
|
||||
TestEntryAction testEntryAction = ctx.getBean("testEntryAction", TestEntryAction.class);
|
||||
assertThat(testExitAction, notNullValue());
|
||||
assertThat(testEntryAction, notNullValue());
|
||||
|
||||
|
||||
machine.start();
|
||||
machine.sendEvent(TestEvents.E1);
|
||||
assertThat(testExitAction.onExecuteLatch.await(2, TimeUnit.SECONDS), is(true));
|
||||
assertThat(testEntryAction.onExecuteLatch.await(2, TimeUnit.SECONDS), is(true));
|
||||
|
||||
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableStateMachine
|
||||
public static class Config1 extends EnumStateMachineConfigurerAdapter<TestStates, TestEvents> {
|
||||
|
||||
@Override
|
||||
public void configure(StateMachineStateConfigurer<TestStates, TestEvents> states) throws Exception {
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<Action<TestStates, TestEvents>> entryActions = Arrays.asList(testEntryAction());
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<Action<TestStates, TestEvents>> exitActions = Arrays.asList(testExitAction());
|
||||
states
|
||||
.withStates()
|
||||
@@ -100,7 +98,7 @@ public class StateActionTests extends AbstractStateMachineTests {
|
||||
public Action<TestStates, TestEvents> testExitAction() {
|
||||
return new TestExitAction();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public TaskExecutor taskExecutor() {
|
||||
return new SyncTaskExecutor();
|
||||
|
||||
@@ -261,9 +261,7 @@ public class TransitionTests extends AbstractStateMachineTests {
|
||||
|
||||
@Override
|
||||
public void configure(StateMachineStateConfigurer<TestStates, TestEvents> states) throws Exception {
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<Action<TestStates, TestEvents>> entryActions = Arrays.asList(testEntryAction());
|
||||
@SuppressWarnings("unchecked")
|
||||
Collection<Action<TestStates, TestEvents>> exitActions = Arrays.asList(testExitAction());
|
||||
states
|
||||
.withStates()
|
||||
|
||||
Reference in New Issue
Block a user