@Override protected ModelControllerClient getModelControllerClient() { return managementClient.getControllerClient(); } }
@Override protected ModelControllerClient getModelControllerClient() { return managementClient.getControllerClient(); } }
/** * If required, calls {@link #executeReloadAndWaitForCompletion(ModelControllerClient)}. * * {@inheritDoc} */ @Override public void tearDown(final ManagementClient managementClient, final String containerId) throws Exception { if (after) { reloadIfRequired(managementClient.getControllerClient()); } } }
@Override public void tearDown(final org.jboss.as.arquillian.container.ManagementClient managementClient, final String containerId) throws Exception { tearDown(managementClient.getControllerClient()); }
/** * If required, calls {@link #executeReloadAndWaitForCompletion(ModelControllerClient)}. * * {@inheritDoc} */ @Override public void setup(final ManagementClient managementClient, final String containerId) throws Exception { if (before) { reloadIfRequired(managementClient.getControllerClient()); } }
@Override public void tearDown(final ManagementClient managementClient, final String containerId) { applyRemoveAllowReload(managementClient.getControllerClient(), domainAddress, false); applyRemoveAllowReload(managementClient.getControllerClient(), realmAddress, false); }
/** * Adds security realms retrieved from {@link #getSecurityRealms()}. */ public void setup(final ManagementClient managementClient, String containerId) throws Exception { this.managementClient = managementClient; setup(managementClient.getControllerClient(), containerId); }
/** * Creates a new deployer for deploying archives. * * @param client the management client to use */ public ArchiveDeployer(ManagementClient client) { this.client = client; this.deploymentManager = DeploymentManager.Factory.create(client.getControllerClient()); }
@Override public void close() throws Exception { ServerReload.executeReloadAndWaitForCompletion(client.getControllerClient(), fileName); ModelNode node = new ModelNode(); node.get(ModelDescriptionConstants.OP).set("write-config"); ModelNode result = client.getControllerClient().execute(node); if (!"success".equals(result.get(ClientConstants.OUTCOME).asString())) { fail("Failed to write config after restoring from snapshot " + result.asString()); } } };
@Override public void tearDown(final ManagementClient managementClient, final String containerId) { applyRemoveAllowReload(managementClient.getControllerClient(), undertowDomainAddress, false); if (useAuthenticationFactory()) { applyRemoveAllowReload(managementClient.getControllerClient(), httpAuthenticationAddress, false); } }
@Override public void tearDown(ManagementClient client, String unused) throws Exception { ResourceDeployer.tearDownSSL(client); ModelNode op = new ModelNode(); op.get("operation").set("remove"); op.get("address").add("subsystem", "security"); op.get("address").add("security-domain", "policy-security-cert"); client.getControllerClient().execute(op); } }
@Override public void setup(ManagementClient managementClient, String containerId) throws Exception { adminOperations = JMSOperationsProvider.getInstance(managementClient.getControllerClient()); adminOperations.createJmsQueue(QUEUE1_NAME, QUEUE1_JNDI_NAME); adminOperations.createJmsQueue(QUEUE2_NAME, QUEUE2_JNDI_NAME); adminOperations.createJmsQueue(QUEUE3_NAME, QUEUE3_JNDI_NAME); }
private ModelNode execute(ModelNode op) throws IOException { ModelNode outcome = managementClient.getControllerClient().execute( op ); if ( !Operations.isSuccessfulOutcome( outcome ) ) { throw new IllegalStateException( "Unsuccessful API call outcome: " + outcome ); } return outcome; } }
public long start(Properties properties) throws IOException { ModelNode op = Operations.createOperation( "start-job", jberetSubsystemAddress.toModelNode() ); op.get( "job-xml-name" ).set( MassIndexingJob.NAME ); if ( properties != null ) { op.get( "properties" ).set( toModelNode( properties ) ); } final ModelNode outcome = managementClient.getControllerClient().execute( op ); if ( !Operations.isSuccessfulOutcome( outcome ) ) { throw new IllegalStateException( "Could not start job: " + outcome ); } return outcome.get( "result" ).asLong(); }
public long restart(long executionId, Properties properties) throws IOException { ModelNode op = Operations.createOperation( "restart-job", jberetSubsystemAddress.toModelNode() ); op.get( "execution-id" ).set( executionId ); if ( properties != null ) { op.get( "properties" ).set( toModelNode( properties ) ); } final ModelNode outcome = managementClient.getControllerClient().execute( op ); if ( !Operations.isSuccessfulOutcome( outcome ) ) { throw new IllegalStateException( "Could not restart job: " + outcome ); } return outcome.get( "result" ).asLong(); }
private void addLogger(ModelNode node, String loggerLevel) throws IOException { ModelNode op = Operations.createAddOperation( node ); op.get( "level" ).set( loggerLevel ); final ModelNode result = managementClient.get().getControllerClient() .execute( op ); if ( !Operations.isSuccessfulOutcome( result ) ) { logger.warning( "Can't create " + node + " logger: " + result.toJSONString( false ) ); } }
@Override public void tearDown(ManagementClient managementClient, String s) throws Exception { ModelNode op = Operations.createUndefineAttributeOperation( ADDRESS_TRANSACTIONS_SUBSYSTEM, "default-timeout" ); ModelNode result = managementClient.getControllerClient().execute( op ); if ( !Operations.isSuccessfulOutcome( result ) ) { logger.warning( "Can't reset default transaction timeout: " + result.toJSONString( false ) ); } }
private void removeLogger(ModelNode node) throws IOException { final ModelNode result = managementClient.get().getControllerClient() .execute( Operations.createRemoveOperation( node ) ); if ( !Operations.isSuccessfulOutcome( result ) ) { logger.warning( "Can't remove " + node + " logger: " + result.toJSONString( false ) ); } }
public void beforeShutdown(@Observes BeforeStop event, ArquillianDescriptor descriptor) throws IOException { ModelNode result = managementClient.get().getControllerClient() .execute( Operations.createRemoveOperation( DATA_SOURCE_ADDRESS ) ); if ( !Operations.isSuccessfulOutcome( result ) ) { log.warning( "Can't remove data source: " + result.toJSONString( false ) ); } }
public void afterStart(@Observes AfterStart event, ArquillianDescriptor descriptor) throws IOException { ModelNode result = managementClient.get().getControllerClient() .execute( createAddDataSourceOperation() ); if ( !Operations.isSuccessfulOutcome( result ) ) { log.severe( "Can't create data source: " + result.toJSONString( false ) ); } }