本文整理汇总了Java中org.jboss.as.subsystem.test.KernelServices.readWholeModel方法的典型用法代码示例。如果您正苦于以下问题:Java KernelServices.readWholeModel方法的具体用法?Java KernelServices.readWholeModel怎么用?Java KernelServices.readWholeModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.as.subsystem.test.KernelServices
的用法示例。
在下文中一共展示了KernelServices.readWholeModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例6: 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 {
//Parse the subsystem xml and install into the first controller
KernelServices servicesA = super.installInController(subsystemXml);
//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, OpenShiftSubsystemExtension.SUBSYSTEM_NAME)).toModelNode());
List<ModelNode> operations = super.checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList();
servicesA.shutdown();
//Install the describe options from the first controller into a second controller
KernelServices servicesB = super.installInController(operations);
ModelNode modelB = servicesB.readWholeModel();
//Make sure the models from the two controllers are identical
super.compare(modelA, modelB);
}
示例7: 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));
}
示例8: 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(SUBSYSTEM_XML);
// 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 = super.installInController(marshalled);
ModelNode modelB = servicesB.readWholeModel();
// Make sure the models from the two controllers are identical
super.compare(modelA, modelB);
}
示例9: 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 {
// Parse the subsystem xml and install into the first controller
KernelServices servicesA = super.installInController(SUBSYSTEM_XML);
// 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, ModelConstants.SUBSYSTEM_NAME)).toModelNode());
List<ModelNode> operations = super.checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList();
// Install the describe options from the first controller into a second controller
KernelServices servicesB = super.installInController(operations);
ModelNode modelB = servicesB.readWholeModel();
// Make sure the models from the two controllers are identical
super.compare(modelA, modelB);
}
示例10: 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) {
}
}
示例11: testParseAndMarshalModelWithRemoteConnectorRef1_1
import org.jboss.as.subsystem.test.KernelServices; //导入方法依赖的package包/类
@Test
public void testParseAndMarshalModelWithRemoteConnectorRef1_1() throws Exception {
//Parse the subsystem xml and install into the first controller
String subsystemXml =
"<subsystem xmlns=\"" + Namespace.JMX_1_1.getUriString() + "\">" +
"<remoting-connector/> " +
"</subsystem>";
AdditionalInitialization additionalInit = new BaseAdditionalInitialization();
KernelServices servicesA = createKernelServicesBuilder(additionalInit).setSubsystemXml(subsystemXml).build();
//Get the model and the persisted xml from the first controller
ModelNode modelA = servicesA.readWholeModel();
String marshalled = servicesA.getPersistedSubsystemXml();
servicesA.shutdown();
compareXml(null, subsystemXml, marshalled, true);
//Install the persisted xml from the first controller into a second controller
KernelServices servicesB = createKernelServicesBuilder(additionalInit).setSubsystemXml(marshalled).build();
ModelNode modelB = servicesB.readWholeModel();
//Make sure the models from the two controllers are identical
super.compare(modelA, modelB);
}
示例12: 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());
}
示例13: 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 = super.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 = super.createKernelServicesBuilder(null).setSubsystemXml(marshalled).build();
ModelNode modelB = servicesB.readWholeModel();
//Make sure the models from the two controllers are identical
super.compare(modelA, modelB);
}
示例14: 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 =
"<subsystem xmlns=\"" + DependencySubsystemExtension.NAMESPACE + "\">" +
"</subsystem>" +
"<subsystem xmlns=\"" + MainSubsystemExtension.NAMESPACE + "\">" +
"</subsystem>";
KernelServices services = createKernelServicesBuilder(new DependencyAdditionalInitialization())
.setSubsystemXml(subsystemXml)
.build();
//Read the whole model and make sure it looks as expected
ModelNode model = services.readWholeModel();
Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(DependencySubsystemExtension.SUBSYSTEM_NAME));
Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(MainSubsystemExtension.SUBSYSTEM_NAME));
Assert.assertNotNull(services.getContainer().getService(Dependency.NAME));
Assert.assertNotNull(services.getContainer().getService(MainService.NAME));
MainService mainService = (MainService)services.getContainer().getService(MainService.NAME).getValue();
Assert.assertNotNull(mainService.dependencyValue.getValue());
}
示例15: 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 =
"<subsystem xmlns=\"" + SimpleSubsystemExtension.NAMESPACE + "\">" +
"</subsystem>";
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);
}