本文整理汇总了Java中org.jboss.as.subsystem.test.KernelServices.getPersistedSubsystemXml方法的典型用法代码示例。如果您正苦于以下问题:Java KernelServices.getPersistedSubsystemXml方法的具体用法?Java KernelServices.getPersistedSubsystemXml怎么用?Java KernelServices.getPersistedSubsystemXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.as.subsystem.test.KernelServices
的用法示例。
在下文中一共展示了KernelServices.getPersistedSubsystemXml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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));
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例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
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);
}
示例9: testOutputModel
import org.jboss.as.subsystem.test.KernelServices; //导入方法依赖的package包/类
@Test
public void testOutputModel() 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, false);
//Get the model and the persisted xml from the controller
ModelNode model = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
Assert.assertEquals(marshalled, triggered);
Assert.assertEquals(normalizeXML(marshalled), normalizeXML(triggered));
}
示例10: testSchema
import org.jboss.as.subsystem.test.KernelServices; //导入方法依赖的package包/类
@Test
public void testSchema() throws Exception {
String subsystemXml = ObjectConverterUtil.convertToString(new FileReader("src/test/resources/teiid-sample-config.xml"));
validate(subsystemXml);
KernelServices services = standardSubsystemTest(null, false);
//Get the model and the persisted xml from the controller
ModelNode model = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
validate(marshalled);
}
示例11: testParseAndMarshalModel1_0
import org.jboss.as.subsystem.test.KernelServices; //导入方法依赖的package包/类
@Test
public void testParseAndMarshalModel1_0() throws Exception {
//Parse the subsystem xml and install into the first controller
String subsystemXml =
"<subsystem xmlns=\"" + Namespace.JMX_1_0.getUriString() + "\">" +
" <jmx-connector registry-binding=\"registry1\" server-binding=\"server1\" />" +
"</subsystem>";
String finishedSubsystemXml =
"<subsystem xmlns=\"" + Namespace.JMX_1_0.getUriString() + "\"/>";
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();
Assert.assertTrue(marshalled.contains(Namespace.CURRENT.getUriString()));
compareXml(null, finishedSubsystemXml, 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: testParseAndMarshalModel1_1WithShowModel
import org.jboss.as.subsystem.test.KernelServices; //导入方法依赖的package包/类
@Test
public void testParseAndMarshalModel1_1WithShowModel() throws Exception {
//Parse the subsystem xml and install into the first controller
String subsystemXml =
"<subsystem xmlns=\"" + Namespace.JMX_1_1.getUriString() + "\">" +
"<show-model value=\"true\"/>" +
"</subsystem>";
String finishedXml =
"<subsystem xmlns=\"" + Namespace.CURRENT.getUriString() + "\">" +
" <expose-resolved-model proper-property-format=\"false\"/>" +
"</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();
Assert.assertTrue(marshalled.contains(Namespace.CURRENT.getUriString()));
compareXml(null, finishedXml, 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);
}
示例13: testParseAndMarshalModel1_1
import org.jboss.as.subsystem.test.KernelServices; //导入方法依赖的package包/类
@Test
public void testParseAndMarshalModel1_1() throws Exception {
//Parse the subsystem xml and install into the first controller
String subsystemXml =
"<subsystem xmlns=\"" + Namespace.JMX_1_1.getUriString() + "\">" +
"<show-model value=\"true\"/>" +
"<remoting-connector/>" +
"</subsystem>";
String finishedXml =
"<subsystem xmlns=\"" + Namespace.CURRENT.getUriString() + "\">" +
" <expose-resolved-model proper-property-format=\"false\"/>" +
" <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();
Assert.assertTrue(marshalled.contains(Namespace.CURRENT.getUriString()));
compareXml(null, finishedXml, 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);
}
示例14: testParseAndMarshalModel1_2WithShowModels
import org.jboss.as.subsystem.test.KernelServices; //导入方法依赖的package包/类
@Test
public void testParseAndMarshalModel1_2WithShowModels() throws Exception {
//Parse the subsystem xml and install into the first controller
String subsystemXml =
"<subsystem xmlns=\"" + Namespace.JMX_1_2.getUriString() + "\">" +
" <expose-resolved-model domain-name=\"jboss.RESOLVED\"/>" +
" <expose-expression-model domain-name=\"jboss.EXPRESSION\"/>" +
"</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();
Assert.assertTrue(marshalled.contains(Namespace.CURRENT.getUriString()));
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);
}
示例15: testParseAndMarshalModel1_2WithShowModelsAndOldPropertyFormat
import org.jboss.as.subsystem.test.KernelServices; //导入方法依赖的package包/类
@Test
public void testParseAndMarshalModel1_2WithShowModelsAndOldPropertyFormat() throws Exception {
//Parse the subsystem xml and install into the first controller
String subsystemXml =
"<subsystem xmlns=\"" + Namespace.JMX_1_2.getUriString() + "\">" +
" <expose-resolved-model domain-name=\"jboss.RESOLVED\" proper-property-format=\"false\"/>" +
" <expose-expression-model domain-name=\"jboss.EXPRESSION\"/>" +
"</subsystem>";
AdditionalInitialization additionalInit = new BaseAdditionalInitialization();
KernelServices servicesA = createKernelServicesBuilder(additionalInit).setSubsystemXml(subsystemXml).build();
Assert.assertTrue(servicesA.isSuccessfulBoot());
//Get the model and the persisted xml from the first controller
ModelNode modelA = servicesA.readWholeModel();
Assert.assertTrue(modelA.get(SUBSYSTEM, "jmx", CommonAttributes.EXPOSE_MODEL, CommonAttributes.RESOLVED).hasDefined(CommonAttributes.PROPER_PROPERTY_FORMAT));
Assert.assertFalse(modelA.get(SUBSYSTEM, "jmx", CommonAttributes.EXPOSE_MODEL, CommonAttributes.RESOLVED, CommonAttributes.PROPER_PROPERTY_FORMAT).asBoolean());
String marshalled = servicesA.getPersistedSubsystemXml();
servicesA.shutdown();
Assert.assertTrue(marshalled.contains(Namespace.CURRENT.getUriString()));
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);
}