• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java KernelServices类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testInstallIntoController

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
/**
 * Test that the model created from the xml looks as expected
 */
@Test
public void testInstallIntoController() throws Exception {
    // Parse the subsystem xml and install into the controller
    String subsystemXml = getSubsystemXml();
    KernelServices services = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();

    // Read the whole model and make sure it looks as expected
    ModelNode model = services.readWholeModel();
    System.out.println(model);
    Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(NestSubsystemExtension.SUBSYSTEM_NAME));
    Assert.assertTrue(model.get(SUBSYSTEM, NestSubsystemExtension.SUBSYSTEM_NAME).hasDefined(
            NestSubsystemExtension.NEST_ENABLED_ATTR));
    Assert.assertTrue(model
            .get(SUBSYSTEM, NestSubsystemExtension.SUBSYSTEM_NAME, NestSubsystemExtension.NEST_ENABLED_ATTR)
            .resolve().asBoolean());

    // Sanity check to test the service was there
    NestService nest = (NestService) services.getContainer().getRequiredService(NestService.SERVICE_NAME)
            .getValue();
    Assert.assertNotNull(nest);
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:25,代码来源:SubsystemParsingTestCase.java


示例2: testParseAndMarshalModel

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
/**
 * Starts a controller with a given subsystem xml and then checks that a second controller started with the xml
 * marshalled from the first one results in the same model
 */
@Test
public void testParseAndMarshalModel() throws Exception {
    // Parse the subsystem xml and install into the first controller
    String subsystemXml = getSubsystemXml();
    KernelServices servicesA = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();

    // Get the model and the persisted xml from the first controller
    ModelNode modelA = servicesA.readWholeModel();
    String marshalled = servicesA.getPersistedSubsystemXml();

    // Install the persisted xml from the first controller into a second controller
    KernelServices servicesB = createKernelServicesBuilder(null).setSubsystemXml(marshalled).build();
    ModelNode modelB = servicesB.readWholeModel();

    // Make sure the models from the two controllers are identical
    super.compare(modelA, modelB);
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:22,代码来源:SubsystemParsingTestCase.java


示例3: testDescribeHandler

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
/**
 * Starts a controller with the given subsystem xml and then checks that a second controller started with the
 * operations from its describe action results in the same model
 */
@Test
public void testDescribeHandler() throws Exception {
    String subsystemXml = getSubsystemXml();
    KernelServices servicesA = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();

    // Get the model and the describe operations from the first controller
    ModelNode modelA = servicesA.readWholeModel();
    ModelNode describeOp = new ModelNode();
    describeOp.get(OP).set(DESCRIBE);
    describeOp.get(OP_ADDR).set(
            PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, NestSubsystemExtension.SUBSYSTEM_NAME))
                    .toModelNode());
    ModelNode executeOperation = servicesA.executeOperation(describeOp);
    List<ModelNode> operations = super.checkResultAndGetContents(executeOperation).asList();

    // Install the describe options from the first controller into a second controller
    KernelServices servicesB = createKernelServicesBuilder(null).setBootOperations(operations).build();
    ModelNode modelB = servicesB.readWholeModel();

    // Make sure the models from the two controllers are identical
    super.compare(modelA, modelB);
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:27,代码来源:SubsystemParsingTestCase.java


示例4: testOutputPerisitence

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testOutputPerisitence() throws Exception {
	String json = ObjectConverterUtil.convertToString(new FileReader("src/test/resources/teiid-model-json.txt"));
	ModelNode testModel = ModelNode.fromJSONString(json);
    String triggered = outputModel(testModel);

    KernelServices services = standardSubsystemTest(null, true);
    //Get the model and the persisted xml from the controller
    ModelNode model = services.readWholeModel();
    String marshalled = services.getPersistedSubsystemXml();

    //System.out.println(marshalled);
    
    Assert.assertEquals(marshalled, triggered);
    Assert.assertEquals(normalizeXML(marshalled), normalizeXML(triggered));
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:17,代码来源:TestTeiidConfiguration.java


示例5: testParseAndMarshalModel

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
/**
 * Starts a controller with a given subsystem xml and then checks that a second
 * controller started with the xml marshalled from the first one results in the same model
 */
@Test
public void testParseAndMarshalModel() throws Exception {
    //Parse the subsystem xml and install into the first controller
    KernelServices servicesA = super.installInController(subsystemXml);
    //Get the model and the persisted xml from the first controller
    ModelNode modelA = servicesA.readWholeModel();
    String marshalled = servicesA.getPersistedSubsystemXml();

    servicesA.shutdown();

    //Install the persisted xml from the first controller into a second controller
    KernelServices servicesB = super.installInController(marshalled);
    ModelNode modelB = servicesB.readWholeModel();

    //Make sure the models from the two controllers are identical
    super.compare(modelA, modelB);
}
 
开发者ID:ncdc,项目名称:jboss-openshift-metrics-module,代码行数:22,代码来源:SubsystemParsingTestCase.java


示例6: testConfiguration

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testConfiguration() throws Exception {
    final KernelServices kernelServices = boot();
    final ModelNode currentModel = getSubsystemModel(kernelServices);
    compare(currentModel, ConfigurationPersistence.getConfigurationPersistence(LogContext.getLogContext()));

    // Compare properties written out to current model
    final String dir = resolveRelativePath(kernelServices, "jboss.server.config.dir");
    Assert.assertNotNull("jboss.server.config.dir could not be resolved", dir);
    final LogContext logContext = LogContext.create();
    final ConfigurationPersistence config = ConfigurationPersistence.getOrCreateConfigurationPersistence(logContext);
    try (final FileInputStream in = new FileInputStream(new File(dir, "logging.properties"))) {
        config.configure(in);
        compare(currentModel, config);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:LoggingSubsystemTestCase.java


示例7: testPrincipalTransformerTree

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testPrincipalTransformerTree() throws Exception {
    KernelServices services = super.createKernelServicesBuilder(new TestEnvironment()).setSubsystemXmlResource("mappers-test.xml").build();
    if (!services.isSuccessfulBoot()) {
        Assert.fail(services.getBootError().toString());
    }

    ServiceName serviceName = Capabilities.PRINCIPAL_TRANSFORMER_RUNTIME_CAPABILITY.getCapabilityServiceName("tree");
    PrincipalTransformer transformer = (PrincipalTransformer) services.getContainer().getService(serviceName).getValue();
    Assert.assertNotNull(transformer);

    Assert.assertEquals("[email protected]", transformer.apply(new NamePrincipal("[email protected]")).getName()); // com to org
    Assert.assertEquals("beta", transformer.apply(new NamePrincipal("[email protected]")).getName()); // remove server part
    Assert.assertEquals("[email protected]", transformer.apply(new NamePrincipal("[email protected]")).getName()); // keep
    Assert.assertEquals(null, transformer.apply(new NamePrincipal("invalid"))); // not an e-mail address
    Assert.assertEquals(null, transformer.apply(null));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:18,代码来源:MappersTestCase.java


示例8: testInstallIntoControllerModelOnly

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
/**
 * Test that the model created from the xml looks as expected, and that the services are NOT installed
 */
@Test
public void testInstallIntoControllerModelOnly() throws Exception {
    //Parse the subsystem xml and install into the controller
    String subsystemXml =
            "<subsystem xmlns=\"" + SimpleSubsystemExtension.NAMESPACE + "\">" +
            "</subsystem>";
    KernelServices services = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT)
            .setSubsystemXml(subsystemXml)
            .build();

    //Read the whole model and make sure it looks as expected
    ModelNode model = services.readWholeModel();
    Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(SimpleSubsystemExtension.SUBSYSTEM_NAME));

    //Test that the service was not installed
    Assert.assertNull(services.getContainer().getService(SimpleService.NAME));

    //Check that all the resources were removed
    super.assertRemoveSubsystemResources(services);
    try {
        services.getContainer().getRequiredService(SimpleService.NAME);
        Assert.fail("Should not have found simple service");
    } catch (Exception expected) {
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:29,代码来源:SimpleSubsystemTestCase.java


示例9: testRuntime

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testRuntime() throws Exception {
    KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization())
            .setSubsystemXml(getSubsystemXml());
    KernelServices mainServices = builder.build();
    if (!mainServices.isSuccessfulBoot()) {
        Assert.fail(String.valueOf(mainServices.getBootError()));
    }
    ServiceController<XnioWorker> workerServiceController = (ServiceController<XnioWorker>) mainServices.getContainer().getService(IOServices.WORKER.append("default"));
    workerServiceController.setMode(ServiceController.Mode.ACTIVE);
    workerServiceController.awaitValue();
    XnioWorker worker = workerServiceController.getService().getValue();
    Assert.assertEquals(ProcessorInfo.availableProcessors() * 2, worker.getIoThreadCount());
    Assert.assertEquals(ProcessorInfo.availableProcessors() * 16, worker.getOption(Options.WORKER_TASK_MAX_THREADS).intValue());
    PathAddress addr = PathAddress.parseCLIStyleAddress("/subsystem=io/worker=default");
    ModelNode op = Util.createOperation("read-resource", addr);
    op.get("include-runtime").set(true);
    mainServices.executeOperation(op);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:IOSubsystemTestCase.java


示例10: testReadIdentity

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testReadIdentity() throws Exception {
    KernelServices services = createKernelServicesBuilder(null)
            .setSubsystemXmlResource("identity-management.xml")
            .build();
    String principalName = "plainUser";
    PathAddress realmAddress = getSecurityRealmAddress("FileSystemRealm");
    ModelNode operation = createAddIdentityOperation(realmAddress, principalName);
    ModelNode result = services.executeOperation(operation);
    assertSuccessful(result);

    operation = createReadIdentityOperation(realmAddress, principalName);
    result = services.executeOperation(operation);
    assertSuccessful(result);

    ModelNode resultNode = result.get(RESULT);

    assertEquals(principalName, resultNode.get(NAME).asString());
    assertFalse(resultNode.get(ATTRIBUTES).isDefined());
    assertFalse(resultNode.get(ROLES).isDefined());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:IdentityOperationsTestCase.java


示例11: testClearPassword

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testClearPassword() throws Exception {
    KernelServices services = createKernelServicesBuilder(null)
            .setSubsystemXmlResource("identity-management.xml")
            .build();
    String principalName = "plainUser";
    PathAddress realmAddress = getSecurityRealmAddress("FileSystemRealm");
    ModelNode operation = createAddIdentityOperation(realmAddress, principalName);
    ModelNode result = services.executeOperation(operation);
    assertSuccessful(result);

    operation = createSetPasswordOperation("default", realmAddress, principalName,
            ModifiableRealmDecorator.SetPasswordHandler.Clear.OBJECT_DEFINITION, "clearPassword", null, null, null, null, null, null);
    result = services.executeOperation(operation);
    assertSuccessful(result);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:IdentityOperationsTestCase.java


示例12: testSimpleDigestPassword

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testSimpleDigestPassword() throws Exception {
    KernelServices services = createKernelServicesBuilder(null)
            .setSubsystemXmlResource("identity-management.xml")
            .build();
    String principalName = "plainUser";
    PathAddress realmAddress = getSecurityRealmAddress("FileSystemRealm");
    ModelNode operation = createAddIdentityOperation(realmAddress, principalName);
    ModelNode result = services.executeOperation(operation);
    assertSuccessful(result);

    operation = createSetPasswordOperation("default", realmAddress, principalName,
            ModifiableRealmDecorator.SetPasswordHandler.SimpleDigest.OBJECT_DEFINITION, "simpleDigest", null, null, null, SimpleDigestPassword.ALGORITHM_SIMPLE_DIGEST_SHA_1, null, null);
    result = services.executeOperation(operation);
    assertSuccessful(result);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:IdentityOperationsTestCase.java


示例13: testSaltedSimpleDigestPassword

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testSaltedSimpleDigestPassword() throws Exception {
    KernelServices services = createKernelServicesBuilder(null)
            .setSubsystemXmlResource("identity-management.xml")
            .build();
    String principalName = "plainUser";
    PathAddress realmAddress = getSecurityRealmAddress("FileSystemRealm");
    ModelNode operation = createAddIdentityOperation(realmAddress, principalName);
    ModelNode result = services.executeOperation(operation);
    assertSuccessful(result);

    operation = createSetPasswordOperation("default", realmAddress, principalName,
            ModifiableRealmDecorator.SetPasswordHandler.SaltedSimpleDigest.OBJECT_DEFINITION, "saltedSimpleDigest", PasswordUtil.generateRandomSalt(16), null, null, SaltedSimpleDigestPassword.ALGORITHM_PASSWORD_SALT_DIGEST_SHA_256, null, null);
    result = services.executeOperation(operation);
    assertSuccessful(result);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:IdentityOperationsTestCase.java


示例14: testOutputModel

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
/**
 * Tests that we can trigger output of the model, i.e. that outputModel() works as it should
 */
@Test
public void testOutputModel() throws Exception {
    String subsystemXml =
            "<subsystem xmlns=\"" + SimpleSubsystemExtension.NAMESPACE + "\">" +
            "</subsystem>";

    ModelNode testModel = new ModelNode();
    testModel.get(SUBSYSTEM).get(SimpleSubsystemExtension.SUBSYSTEM_NAME).setEmptyObject();
    String triggered = outputModel(testModel);

    KernelServices services = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT)
            .setSubsystemXml(subsystemXml)
            .build();
    //Get the model and the persisted xml from the controller
    services.readWholeModel();
    String marshalled = services.getPersistedSubsystemXml();

    Assert.assertEquals(marshalled, triggered);
    Assert.assertEquals(normalizeXML(marshalled), normalizeXML(triggered));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:SimpleSubsystemTestCase.java


示例15: testOneTimePassword

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testOneTimePassword() throws Exception {
    KernelServices services = createKernelServicesBuilder(null)
            .setSubsystemXmlResource("identity-management.xml")
            .build();
    String principalName = "plainUser";
    PathAddress realmAddress = getSecurityRealmAddress("FileSystemRealm");
    ModelNode operation = createAddIdentityOperation(realmAddress, principalName);
    ModelNode result = services.executeOperation(operation);
    assertSuccessful(result);

    operation = createSetPasswordOperation("default", realmAddress, principalName,
            ModifiableRealmDecorator.SetPasswordHandler.OTPassword.OBJECT_DEFINITION, "pass123", null, null, "Elytron Realm", OneTimePassword.ALGORITHM_OTP_MD5, "fghi", 123);

    result = services.executeOperation(operation);
    assertSuccessful(result);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:18,代码来源:IdentityOperationsTestCase.java


示例16: testUnsetCredentials

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testUnsetCredentials() throws Exception {
    KernelServices services = createKernelServicesBuilder(null)
            .setSubsystemXmlResource("identity-management.xml")
            .build();
    String principalName = "plainUser";
    PathAddress realmAddress = getSecurityRealmAddress("FileSystemRealm");
    ModelNode operation = createAddIdentityOperation(realmAddress, principalName);
    ModelNode result = services.executeOperation(operation);
    assertSuccessful(result);

    operation = createSetPasswordOperation("default", realmAddress, principalName,
            ModifiableRealmDecorator.SetPasswordHandler.Clear.OBJECT_DEFINITION, "clearPassword", null, null, null, null, null, null);
    result = services.executeOperation(operation);
    assertSuccessful(result);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:IdentityOperationsTestCase.java


示例17: testPropertyRealm

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
@Test
public void testPropertyRealm() throws Exception {
    KernelServices services = super.createKernelServicesBuilder(new TestEnvironment()).setSubsystemXmlResource("realms-test.xml").build();
    if (!services.isSuccessfulBoot()) {
        Assert.fail(services.getBootError().toString());
    }

    ServiceName serviceName = Capabilities.SECURITY_REALM_RUNTIME_CAPABILITY.getCapabilityServiceName("HashedPropertyRealm");
    SecurityRealm securityRealm = (SecurityRealm) services.getContainer().getService(serviceName).getValue();
    testAbstractPropertyRealm(securityRealm);

    ServiceName serviceName2 = Capabilities.SECURITY_REALM_RUNTIME_CAPABILITY.getCapabilityServiceName("ClearPropertyRealm");
    SecurityRealm securityRealm2 = (SecurityRealm) services.getContainer().getService(serviceName2).getValue();
    testAbstractPropertyRealm(securityRealm2);

    RealmIdentity identity1 = securityRealm2.getRealmIdentity(fromName("user1"));
    Object[] groups = identity1.getAuthorizationIdentity().getAttributes().get("groupAttr").toArray();
    Assert.assertArrayEquals(new Object[]{"firstGroup","secondGroup"}, groups);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:RealmsTestCase.java


示例18: testOutboundConnections

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
/**
 * Tests that the outbound connections configured in the remoting subsytem are processed and services
 * are created for them
 *
 * @throws Exception
 */
@Test
public void testOutboundConnections() throws Exception {
    KernelServices services = createKernelServicesBuilder(createRuntimeAdditionalInitialization(false))
            .setSubsystemXmlResource("remoting-with-outbound-connections.xml")
            .build();

    ServiceController<?> endPointService = services.getContainer().getRequiredService(RemotingServices.SUBSYSTEM_ENDPOINT);
    assertNotNull("Endpoint service was null", endPointService);

    final String remoteOutboundConnectionName = "remote-conn1";
    ServiceName remoteOutboundConnectionServiceName = RemoteOutboundConnectionService.REMOTE_OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(remoteOutboundConnectionName);
    ServiceController<?> remoteOutboundConnectionService = services.getContainer().getRequiredService(remoteOutboundConnectionServiceName);
    assertNotNull("Remote outbound connection service for outbound connection:" + remoteOutboundConnectionName + " was null", remoteOutboundConnectionService);

    final String localOutboundConnectionName = "local-conn1";
    ServiceName localOutboundConnectionServiceName = LocalOutboundConnectionService.LOCAL_OUTBOUND_CONNECTION_BASE_SERVICE_NAME.append(localOutboundConnectionName);
    ServiceController<?> localOutboundConnectionService = services.getContainer().getRequiredService(localOutboundConnectionServiceName);
    assertNotNull("Local outbound connection service for outbound connection:" + localOutboundConnectionName + " was null", localOutboundConnectionService);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:RemotingLegacySubsystemTestCase.java


示例19: testRejectingTransformers

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
private void testRejectingTransformers(ModelTestControllerVersion controllerVersion, ModelVersion messagingVersion) throws Exception {
    //Boot up empty controllers with the resources needed for the ops coming from the xml to work
    KernelServicesBuilder builder = createKernelServicesBuilder(DEFAULT_ADDITIONAL_INITIALIZATION);
    builder.createLegacyKernelServicesBuilder(DEFAULT_ADDITIONAL_INITIALIZATION, controllerVersion, messagingVersion)
            .addMavenResourceURL(controllerVersion.getCoreMavenGroupId() + ":wildfly-remoting:" + controllerVersion.getCoreVersion())
            .dontPersistXml();

    KernelServices mainServices = builder.build();
    assertTrue(mainServices.isSuccessfulBoot());
    assertTrue(mainServices.getLegacyServices(messagingVersion).isSuccessfulBoot());

    List<ModelNode> ops = builder.parseXmlResource("remoting.xml");
    PathAddress subsystemAddress = PathAddress.pathAddress("subsystem", RemotingExtension.SUBSYSTEM_NAME);
    ModelTestUtils.checkFailedTransformedBootOperations(mainServices, messagingVersion, ops, new FailedOperationTransformationConfig()
            .addFailedAttribute(subsystemAddress.append(ConnectorResource.PATH),
                    new FailedOperationTransformationConfig.NewAttributesConfig(
                            ConnectorCommon.SASL_AUTHENTICATION_FACTORY,
                            ConnectorResource.SSL_CONTEXT
                    )
            )
            .addFailedAttribute(subsystemAddress.append(HttpConnectorResource.PATH),
                    new FailedOperationTransformationConfig.NewAttributesConfig(ConnectorCommon.SASL_AUTHENTICATION_FACTORY))
            .addFailedAttribute(subsystemAddress.append(RemoteOutboundConnectionResourceDefinition.ADDRESS),
                    new FailedOperationTransformationConfig.NewAttributesConfig(ConnectorCommon.SASL_AUTHENTICATION_FACTORY))
    );
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:RemotingSubsystemTransformersTestCase.java


示例20: testSystemProperty

import org.jboss.as.subsystem.test.KernelServices; //导入依赖的package包/类
/**
 * Test that system property got added properly
 */
@Test
public void testSystemProperty() throws Exception {
    ((OtherServicesSubsystemExtension)getMainExtension()).setAddHandler(SubsystemAddBlank.INSTANCE);

    //Parse the subsystem xml and install into the controller
    String subsystemXml =
            "<subsystem xmlns=\"" + SimpleSubsystemExtension.NAMESPACE + "\">" +
            "</subsystem>";
    KernelServices services = createKernelServicesBuilder(new SystemPropertiesInit())
            .setSubsystemXml(subsystemXml)
            .build();

    //Read the whole model and make sure it looks as expected
    ModelNode model = services.readWholeModel();
    Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(OtherServicesSubsystemExtension.SUBSYSTEM_NAME));

    Assert.assertEquals("testing123", model.require(SYSTEM_PROPERTY).require("test123").require(VALUE).asString());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:OtherServicesSubsystemTestCase.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TooManyIterationsException类代码示例发布时间:2022-05-23
下一篇:
Java Utilities类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap