@AfterClass public static void tearDown() throws Exception { final ModelNode address = new ModelNode(); address.add("subsystem", "resource-adapters"); address.add("resource-adapter", "as7_1452.rar"); address.protect(); remove(address); closeModelControllerClient(); }
// @BeforeClass - called from @Deployment public static void setUp() throws Exception { initModelControllerClient("localhost", 9999); final ModelNode address = new ModelNode(); address.add("subsystem", "resource-adapters"); address.add("resource-adapter", "as7_1452.rar"); address.protect(); final ModelNode operation = new ModelNode(); operation.get(OP).set("add"); operation.get(OP_ADDR).set(address); operation.get("archive").set("as7_1452.rar"); operation.get("transaction-support").set("NoTransaction"); executeOperation(operation); final ModelNode addressConfigRes = address.clone(); addressConfigRes.add("config-properties", "Property"); addressConfigRes.protect(); final ModelNode operationConfigRes = new ModelNode(); operationConfigRes.get(OP).set("add"); operationConfigRes.get(OP_ADDR).set(addressConfigRes); operationConfigRes.get("value").set("A"); executeOperation(operationConfigRes); final ModelNode addressAdmin = address.clone(); addressAdmin.add("admin-objects", "java:jboss/ConfigPropertyAdminObjectInterface1"); addressAdmin.protect(); final ModelNode operationAdmin = new ModelNode(); operationAdmin.get(OP).set("add"); operationAdmin.get(OP_ADDR).set(addressAdmin); operationAdmin .get("class-name") .set( "org.jboss.as.test.smoke.embedded.deployment.rar.configproperty.ConfigPropertyAdminObjectImpl"); operationAdmin.get("jndi-name").set(AO_JNDI_NAME); executeOperation(operationAdmin); final ModelNode addressConfigAdm = addressAdmin.clone(); addressConfigAdm.add("config-properties", "Property"); addressConfigAdm.protect(); final ModelNode operationConfigAdm = new ModelNode(); operationConfigAdm.get(OP).set("add"); operationConfigAdm.get(OP_ADDR).set(addressConfigAdm); operationConfigAdm.get("value").set("C"); executeOperation(operationConfigAdm); final ModelNode addressConn = address.clone(); addressConn.add("connection-definitions", "java:jboss/ConfigPropertyConnectionFactory1"); addressConn.protect(); final ModelNode operationConn = new ModelNode(); operationConn.get(OP).set("add"); operationConn.get(OP_ADDR).set(addressConn); operationConn .get("class-name") .set( "org.jboss.as.test.smoke.embedded.deployment.rar.configproperty.ConfigPropertyManagedConnectionFactory"); operationConn.get("jndi-name").set(CF_JNDI_NAME); operationConn.get("pool-name").set("ConfigPropertyConnectionFactory"); executeOperation(operationConn); final ModelNode addressConfigConn = addressConn.clone(); addressConfigConn.add("config-properties", "Property"); addressConfigConn.protect(); final ModelNode operationConfigConn = new ModelNode(); operationConfigConn.get(OP).set("add"); operationConfigConn.get(OP_ADDR).set(addressConfigConn); operationConfigConn.get("value").set("B"); executeOperation(operationConfigConn); }