当前位置: 首页>>代码示例>>Java>>正文


Java ManagementClient类代码示例

本文整理汇总了Java中org.jboss.as.arquillian.container.ManagementClient的典型用法代码示例。如果您正苦于以下问题:Java ManagementClient类的具体用法?Java ManagementClient怎么用?Java ManagementClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ManagementClient类属于org.jboss.as.arquillian.container包,在下文中一共展示了ManagementClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public void setup(final ManagementClient managementClient, final String containerId) throws Exception {
	final ServerDeploymentManager manager = ServerDeploymentManager.Factory
			.create(managementClient.getControllerClient());
	final DeploymentPlan plan = manager.newDeploymentPlan()
			.add(new File("src/test/resources/isolations/" + TEST_DS_XML)).andDeploy().build();
	final Future<ServerDeploymentPlanResult> future = manager.execute(plan);
	final ServerDeploymentPlanResult result = future.get(20, SECONDS);
	final ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(plan.getId());
	if (actionResult != null) {
		final Throwable deploymentException = actionResult.getDeploymentException();
		if (deploymentException != null) {
			throw new RuntimeException(deploymentException);
		}
	}
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:17,代码来源:ReadUncommittedTestCase.java

示例2: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public void setup(final ManagementClient managementClient, final String containerId) throws Exception {
	final ServerDeploymentManager manager = ServerDeploymentManager.Factory
			.create(managementClient.getControllerClient());
	final DeploymentPlan plan = manager.newDeploymentPlan()
			.add(new File("src/test/resources/distributed/" + TEXTS_DS_XML)).andDeploy().build();
	final Future<ServerDeploymentPlanResult> future = manager.execute(plan);
	final ServerDeploymentPlanResult result = future.get(20, SECONDS);
	final ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(plan.getId());
	if (actionResult != null) {
		final Throwable deploymentException = actionResult.getDeploymentException();
		if (deploymentException != null) {
			throw new RuntimeException(deploymentException);
		}
	}
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:17,代码来源:DistributedTestCase.java

示例3: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public void setup(final ManagementClient managementClient, final String containerId) throws Exception {
	copy(new File("src/test/resources/application-users.properties").toPath(),
			new File("target/wildfly-10.1.0.Final/standalone/configuration/application-users.properties")
					.toPath(),
			REPLACE_EXISTING);
	copy(new File("src/test/resources/application-roles.properties").toPath(),
			new File("target/wildfly-10.1.0.Final/standalone/configuration/application-roles.properties")
					.toPath(),
			REPLACE_EXISTING);
	final ServerDeploymentManager manager = ServerDeploymentManager.Factory
			.create(managementClient.getControllerClient());
	final DeploymentPlan plan = manager.newDeploymentPlan().add(new File("src/test/resources/" + FORUMS_DS_XML))
			.andDeploy().build();
	final Future<ServerDeploymentPlanResult> future = manager.execute(plan);
	final ServerDeploymentPlanResult result = future.get(20, SECONDS);
	final ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(plan.getId());
	if (actionResult != null) {
		final Throwable deploymentException = actionResult.getDeploymentException();
		if (deploymentException != null) {
			throw new RuntimeException(deploymentException);
		}
	}
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:25,代码来源:ApplicationTestCase.java

示例4: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public final void setup(final ManagementClient managementClient, final String containerId) throws Exception {
    setManagementClient(managementClient);
    ModelNode address = new ModelNode();
    address.add("subsystem", "neo4j");
    address.add("neo4j", "default");
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).set(address);
    operation.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("module");
    operation.get(VALUE).set("org.neo4j.driver:test");
    ModelNode result = executeOperation(operation);
    reload();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:17,代码来源:CustomModuleTestCase.java

示例5: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public final void setup(final ManagementClient managementClient, final String containerId) throws Exception {
    setManagementClient(managementClient);
    ModelNode address = new ModelNode();
    address.add("subsystem", "orientdb");
    address.add("orient", "default");
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).set(address);
    operation.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("module");
    operation.get(VALUE).set("com.orientechnologies:test");
    ModelNode result = executeOperation(operation);
    reload();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:17,代码来源:CustomModuleTestCase.java

示例6: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public final void setup(final ManagementClient managementClient, final String containerId) throws Exception {
    setManagementClient(managementClient);
    ModelNode address = new ModelNode();
    address.add("subsystem", "cassandra");
    address.add("cassandra", "default");
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).set(address);
    operation.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("module");
    operation.get(VALUE).set("com.datastax.cassandra.driver-core:test");
    ModelNode result = executeOperation(operation);
    reload();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:17,代码来源:CustomModuleTestCase.java

示例7: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public final void setup(final ManagementClient managementClient, final String containerId) throws Exception {
    setManagementClient(managementClient);
    ModelNode address = new ModelNode();
    address.add("subsystem", "mongodb");
    address.add("mongo", "default");
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).set(address);
    operation.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("module");
    operation.get(VALUE).set("org.mongodb.driver:test");
    ModelNode result = executeOperation(operation);
    reload();
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:17,代码来源:CustomModuleTestCase.java

示例8: tearDown

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public void tearDown(ManagementClient managementClient, String containerId) throws Exception {
    ModelNode[] steps = new ModelNode[5];
    steps[0] = DMRUtils.createOpNode(ADDRESS_SUBSYSTEM_UNDERTOW_HTTPS_LISTENER, ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION);
    steps[0].get(ModelDescriptionConstants.NAME).set("verify-client");

    steps[1] = DMRUtils.createOpNode(ADDRESS_SUBSYSTEM_SECURITY_SECURITY_DOMAIN_CLIENT_CERT, ModelDescriptionConstants.REMOVE);

    steps[2] = DMRUtils.createOpNode(ADDRESS_SUBSYSTEM_SECURITY_SECURITY_DOMAIN_CERTIFICATE_TRUST_DOMAIN, ModelDescriptionConstants.REMOVE);

    steps[3] = DMRUtils.createOpNode(ADDRESS_SYSTEM_PROPERTY_TRUST_STORE, ModelDescriptionConstants.REMOVE);
    steps[4] = DMRUtils.createOpNode(ADDRESS_SYSTEM_PROPERTY_TRUST_STORE_PASSWORD, ModelDescriptionConstants.REMOVE);

    ModelNode compositeNode = DMRUtils.createCompositeNode(steps);
    managementClient.getControllerClient().execute(compositeNode);

    UserManager.removeApplicationUser(APPLICATION_USER);
    UserManager.revokeRoleFromApplicationUser(APPLICATION_USER, APPLICATION_ROLE);
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel-examples,代码行数:20,代码来源:CxfWsCdiSecureExampleTest.java

示例9: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public void setup(ManagementClient client, String unused) throws Exception {
    ModelNode op = new ModelNode();
    op.get("operation").set("add");
    op.get("address").add("subsystem", "security");
    op.get("address").add("security-domain", "netty-security-cert");
    op.get("cache-type").set("default");
    client.getControllerClient().execute(op);

    op.remove("cache-type");
    op.get("address").add("authentication", "classic");
    ModelNode loginModule = new ModelNode();
    loginModule.get("code").set("org.switchyard.security.login.CertificateLoginModule");
    loginModule.get("flag").set("required");
    loginModule.get("module-options").add("keyStoreLocation",
            new File(SRC_DIR, "users.jks").getAbsolutePath());
    loginModule.get("module-options").add("keyStorePassword", "changeit");
    loginModule.get("module-options").add("rolesProperties",
            new File(SRC_DIR, "roles.properties").getAbsolutePath());
    op.get("login-modules").add(loginModule);
    op.get("operation-headers", "allow-resource-service-restart").set("true");
    client.getControllerClient().execute(op);
    
    Thread.sleep(1000);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:26,代码来源:CamelNettyBindingQuickstartTest.java

示例10: tearDown

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@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", "picketlink-sts");
    client.getControllerClient().execute(op);

    op = new ModelNode();
    op.get("operation").set("remove");
    op.get("address").add("subsystem", "security");
    op.get("address").add("security-domain", "saml-validate-token");
    client.getControllerClient().execute(op);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:17,代码来源:PolicySecuritySamlDemoQuickstartTest.java

示例11: tearDownSSL

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
public static void tearDownSSL(ManagementClient client) throws Exception {
    // EAP
    ModelNode op = new ModelNode();
    op.get("operation").set("remove");
    op.get("address").add("subsystem", "web");
    op.get("address").add("connector", "https");
    client.getControllerClient().execute(op);

    // WildFly
    op = new ModelNode();
    op.get("operation").set("remove");
    op.get("address").add("subsystem", "undertow");
    op.get("address").add("server", "default-server");
    op.get("address").add("https-listener", "https");
    client.getControllerClient().execute(op);

    op = new ModelNode();
    op.get("operation").set("remove");
    op.get("address").add("core-service", "management");
    op.get("address").add("security-realm", "SslRealm");
    client.getControllerClient().execute(op);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:23,代码来源:ResourceDeployer.java

示例12: testDeploy

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
private static void testDeploy(final ArchiveDeployer deployer, final ManagementClient client, final String containerName) throws IOException, DeploymentException {
    if (!controller.isStarted(containerName)) {
        controller.start(containerName);
    }
    final int currentDeployments = getCurrentDeploymentCount(client);
    // Deploy both deployments
    try {
        deployer.deploy(createDeployment());
        // Read each result, we should have two results for the first op and one for the second
        final int newDeployments = getCurrentDeploymentCount(client);
        Assert.assertTrue("Expected 1 deployments found " + (newDeployments - currentDeployments) + " for container " + containerName,
                newDeployments == (1 + currentDeployments));
    } finally {
        deployer.undeploy("dep1");
        controller.stop(containerName);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-arquillian,代码行数:18,代码来源:ClientManualModeTestCase.java

示例13: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public void setup(final ManagementClient managementClient, String containerId) throws Exception {
    String contextXml = "" +
            "\t\t     <route>\n" +
            "\t\t       <from uri=\"direct:start\"/>\n" +
            "\t\t       <transform>\n" +
            "\t\t         <simple>Hello #{body}</simple>\n" +
            "\t\t       </transform>\n" +
            "\t\t     </route>\n" +
            "";

    // Add a system context
    ModelNode contextOpAdd = DMRUtils.createOpNode("subsystem=camel/context=jmx-context-1/", "add");
    contextOpAdd.get("value").set(contextXml);
    managementClient.getControllerClient().execute(DMRUtils.createCompositeNode(new ModelNode[]{contextOpAdd}));
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:17,代码来源:JMXIntegrationTest.java

示例14: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public void setup(ManagementClient managementClient, String containerId) throws Exception {
    // Set up a security domain for our tests to authenticate against
    ModelNode securityDomainOpAdd = DMRUtils.createOpNode("subsystem=security/security-domain=cxf-security-domain", "add");
    ModelNode securityDomainContent = DMRUtils.createOpNode("subsystem=security/security-domain=cxf-security-domain/authentication=classic", "add");

    ModelNode loginModules = securityDomainContent.get("login-modules");

    ModelNode userRoles = new ModelNode();
    userRoles.get("code").set("UsersRoles");
    userRoles.get("flag").set("required");

    ModelNode moduleOptions = userRoles.get("module-options");
    moduleOptions.get("usersProperties").set("cxf-users.properties");
    moduleOptions.get("rolesProperties").set("cxf-roles.properties");
    loginModules.add(userRoles);

    ModelNode result = managementClient.getControllerClient().execute(DMRUtils.createCompositeNode(new ModelNode[]{securityDomainOpAdd, securityDomainContent}));

    // Make sure the commands worked before proceeding
    Assert.assertEquals("success", result.get("outcome").asString());
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:23,代码来源:CXFWSSecureProducerIntegrationTest.java

示例15: setup

import org.jboss.as.arquillian.container.ManagementClient; //导入依赖的package包/类
@Override
public void setup(ManagementClient managementClient, String containerId) throws Exception {
    int port = AvailablePortFinder.getNextAvailable();
    AvailablePortFinder.storeServerData("rabbitmq-port", port);

    String jbossHome = System.getProperty("jboss.home.dir");

    Path workPath = Paths.get(jbossHome, "standalone", "data", "rabbitmq");
    Path configPath = Paths.get(jbossHome, "standalone", "configuration", "rabbitmq");
    Path qpidConfig = configPath.resolve("qpid-config.json");
    configPath.toFile().mkdir();

    BrokerOptions brokerOptions = new BrokerOptions();
    brokerOptions.setConfigProperty("qpid.amqp_port", String.valueOf(port));
    brokerOptions.setConfigProperty("qpid.user", RABBITMQ_USERNAME);
    brokerOptions.setConfigProperty("qpid.password", RABBITMQ_PASSWORD);
    brokerOptions.setConfigProperty("qpid.work_dir", workPath.toString());
    brokerOptions.setInitialConfigurationLocation(qpidConfig.toString());

    Files.copy(RabbitMQIntegrationTest.class.getResourceAsStream("/rabbitmq/qpid-config.json"), qpidConfig, StandardCopyOption.REPLACE_EXISTING);

    broker.startup(brokerOptions);
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:24,代码来源:RabbitMQIntegrationTest.java


注:本文中的org.jboss.as.arquillian.container.ManagementClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。