@Test
public void testAddRemoveOperation() throws Exception {
// add new connector
cli.sendLine("/socket-binding-group=standard-sockets/socket-binding=test:add(port=8181)");
CLIOpResult result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
assertTrue(result.isIsOutcomeSuccess());
cli.sendLine("/subsystem=web/connector=test-connector:add(socket-binding=test, scheme=http, protocol=\"HTTP/1.1\", enabled=true)");
result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
assertTrue(result.isIsOutcomeSuccess());
// check that the connector is live
String cURL = "http://" + url.getHost() + ":8181";
String response = HttpRequest.get(cURL, 10, TimeUnit.SECONDS);
assertTrue("Invalid response: " + response, response.indexOf("JBoss") >=0);
// remove connector
cli.sendLine("/subsystem=web/connector=test-connector:remove");
result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
assertTrue(result.isIsOutcomeSuccess());
cli.sendLine("/socket-binding-group=standard-sockets/socket-binding=test:remove");
result = cli.readAllAsOpResult(WAIT_TIMEOUT, WAIT_LINETIMEOUT);
assertTrue(result.isIsOutcomeSuccess());
// check that the connector is no longer live
Thread.sleep(5000);
boolean failed = false;
try {