@Test
public void testServerCommands() throws Exception {

    // CREATE
    // Test 0
    String sctpServerCommand = "sctp server create TestServer1 127.0.0.1 2905 stackname TestSCTP0";
    String result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(M3UAOAMMessages.NO_SCTP_MANAGEMENT_BEAN_FOR_NAME, "TestSCTP0"));
    // Test`1
    sctpServerCommand = "sctp server create TestServer1 127.0.0.1 2905";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.ADD_SERVER_SUCCESS, "TestServer1", this.management1.getName()));
    assertEquals(1, this.management1.getServers().size());
    assertEquals(0, this.management2.getServers().size());
    // Test`2
    sctpServerCommand = "sctp server create TestServer2 127.0.0.1 2906 sockettype TCP";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.ADD_SERVER_SUCCESS, "TestServer2", this.management1.getName()));
    assertEquals(2, this.management1.getServers().size());
    assertEquals(0, this.management2.getServers().size());
    // Test`3
    sctpServerCommand = "sctp server create TestServer3 127.0.0.1 2907 stackname TestSCTP2";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.ADD_SERVER_SUCCESS, "TestServer3", this.management2.getName()));
    assertEquals(1, this.management2.getServers().size());
    assertEquals(2, this.management1.getServers().size());
    // Test`4
    sctpServerCommand = "sctp server create TestServer4 127.0.0.1 2908 stackname TestSCTP2 sockettype TCP";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.ADD_SERVER_SUCCESS, "TestServer4", this.management2.getName()));
    assertEquals(2, this.management2.getServers().size());
    assertEquals(2, this.management1.getServers().size());
    // START
    // Test 5
    sctpServerCommand = "sctp server start TestServer4";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.START_SERVER_SUCCESS, "TestServer4", this.management2.getName()));
    Server server = this.management2.getServers().get(1);
    assertTrue(server.isStarted());
    // Test 6
    sctpServerCommand = "sctp server start TestServer2 stackname TestSCTP1";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.START_SERVER_SUCCESS, "TestServer2", this.management1.getName()));
    server = this.management2.getServers().get(1);
    assertTrue(server.isStarted());
    // STOP
    // Test 7
    sctpServerCommand = "sctp server stop TestServer2";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.STOP_SERVER_SUCCESS, "TestServer2", this.management1.getName()));
    server = this.management1.getServers().get(1);
    assertFalse(server.isStarted());
    // Test 8
    sctpServerCommand = "sctp server stop TestServer4 stackname TestSCTP2";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.STOP_SERVER_SUCCESS, "TestServer4", this.management2.getName()));
    server = this.management2.getServers().get(1);
    assertFalse(server.isStarted());
    // SHOW
    // Test 9
    sctpServerCommand = "sctp server show";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertTrue(result.contains("TestServer4") && result.contains("TestServer3"));
    assertFalse(result.contains("TestServer1") || result.contains("TestServer2"));
    // Test 10
    sctpServerCommand = "sctp server show stackname TestSCTP1";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertTrue(result.contains("TestServer1") && result.contains("TestServer2"));
    assertFalse(result.contains("TestServer3") || result.contains("TestServer4"));
    // DESTROY
    // Test 11
    sctpServerCommand = "sctp server destroy TestServer1";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.REMOVE_SERVER_SUCCESS, "TestServer1", this.management1.getName()));
    assertEquals(1, this.management1.getServers().size());
    // Test 12
    sctpServerCommand = "sctp server destroy TestServer2";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.REMOVE_SERVER_SUCCESS, "TestServer2", this.management1.getName()));
    assertEquals(0, this.management1.getServers().size());
    // Test 13
    sctpServerCommand = "sctp server destroy TestServer3 stackname TestSCTP2";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.REMOVE_SERVER_SUCCESS, "TestServer3", this.management2.getName()));
    assertEquals(1, this.management2.getServers().size());
    // Test 14
    sctpServerCommand = "sctp server destroy TestServer4";
    result = this.sctpShellExecutor.execute(sctpServerCommand.split(" "));
    assertEquals(result, String.format(SCTPOAMMessages.REMOVE_SERVER_SUCCESS, "TestServer4", this.management2.getName()));
    assertEquals(0, this.management2.getServers().size());
}