Ejemplo n.º 1
0
 private ModelNode getRemoveSocketBindingOp(Connector conn) {
   ModelNode op =
       createOpNode(
           "socket-binding-group=standard-sockets/socket-binding=test-"
               + conn.getName()
               + socketBindingCount,
           "remove");
   return op;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
  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"));
  }
Ejemplo n.º 4
0
  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);
  }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 private ModelNode getRemoveConnectorOp(Connector conn) {
   ModelNode op =
       createOpNode("subsystem=web/connector=test-" + conn.getName() + "-connector", "remove");
   return op;
 }