Search in sources :

Example 1 with ProcedureState

use of org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState in project hbase by apache.

the class TestProcedureToString method testStateMachineProcedure.

@Test
public void testStateMachineProcedure() {
    SimpleStateMachineProcedure p = new SimpleStateMachineProcedure();
    ProcedureState state = ProcedureState.RUNNABLE;
    p.setState(state);
    p.setNextState(ServerCrashState.SERVER_CRASH_ASSIGN);
    // Just assert that the toString basically works and has state in it.
    assertTrue(p.toString().contains(state.toString()));
    assertTrue(p.toString().contains(ServerCrashState.SERVER_CRASH_ASSIGN.toString()));
}
Also used : ProcedureState(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState) Test(org.junit.Test)

Example 2 with ProcedureState

use of org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState in project hbase by apache.

the class TestProcedureToString method testBasicToString.

/**
 * Test that I can override the toString for its state value.
 */
@Test
public void testBasicToString() {
    BasicProcedure p = new BasicProcedure();
    ProcedureState state = ProcedureState.RUNNABLE;
    p.setState(state);
    // Just assert that the toString basically works and has state in it.
    assertTrue(p.toString().contains(state.toString()));
    p = new DoublingStateStringBasicProcedure();
    p.setState(state);
    // Assert our override works and that we get double the state...
    String testStr = state.toString() + state.toString();
    assertTrue(p.toString().contains(testStr));
}
Also used : ProcedureState(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState) Test(org.junit.Test)

Aggregations

ProcedureState (org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.ProcedureState)2 Test (org.junit.Test)2