private ModelNode getRemoveSocketBindingOp(Connector conn) {
   ModelNode op =
       createOpNode(
           "socket-binding-group=standard-sockets/socket-binding=test-"
               + conn.getName()
               + socketBindingCount,
           "remove");
   return op;
 }
 private ModelNode getAddSocketBindingOp(Connector conn) {
   ModelNode op =
       createOpNode(
           "socket-binding-group=standard-sockets/socket-binding=test-"
               + conn.getName()
               + (++socketBindingCount),
           "add");
   op.get("port").set(8181);
   return op;
 }
  private void addConnector(Connector conn) throws Exception {

    // add socket binding
    ModelNode op = getAddSocketBindingOp(conn);
    executeOperation(op);

    // add connector
    op = getAddConnectorOp(conn);
    executeOperation(op);

    // check it is listed
    assertTrue(getConnectorList().contains("test-" + conn.getName() + "-connector"));
  }
  private void removeConnector(Connector conn) throws Exception {

    // remove connector
    ModelNode op = getRemoveConnectorOp(conn);
    executeOperation(op);

    Thread.sleep(5000);
    // check that the connector is not live
    String cURL = conn.getScheme() + "://" + url.getHost() + ":8181";

    assertFalse("Connector not removed.", WebUtil.testHttpURL(cURL));

    // remove socket binding
    op = getRemoveSocketBindingOp(conn);
    executeOperation(op);
  }
 private ModelNode getAddConnectorOp(Connector conn) {
   final ModelNode composite = Util.getEmptyOperation(COMPOSITE, new ModelNode());
   final ModelNode steps = composite.get(STEPS);
   ModelNode op =
       createOpNode("subsystem=web/connector=test-" + conn.getName() + "-connector", "add");
   op.get("socket-binding").set("test-" + conn.getName() + socketBindingCount);
   op.get("scheme").set(conn.getScheme());
   op.get("protocol").set(conn.getProtocol());
   op.get("secure").set(conn.isSecure());
   op.get("enabled").set(true);
   steps.add(op);
   if (conn.isSecure()) {
     ModelNode ssl =
         createOpNode(
             "subsystem=web/connector=test-" + conn.getName() + "-connector/ssl=configuration",
             "add");
     ssl.get("certificate-key-file").set(keyStoreFile.getAbsolutePath());
     ssl.get("password").set("test123");
     steps.add(ssl);
   }
   return composite;
 }
 private ModelNode getRemoveConnectorOp(Connector conn) {
   ModelNode op =
       createOpNode("subsystem=web/connector=test-" + conn.getName() + "-connector", "remove");
   return op;
 }