use of org.jboss.as.subsystem.test.ControllerInitializer in project wildfly by wildfly.
the class FederationSubsystem_2_0_UnitTestCase method testRuntime.
@Test
public void testRuntime() throws Exception {
System.setProperty("jboss.server.data.dir", System.getProperty("java.io.tmpdir"));
System.setProperty("jboss.home.dir", System.getProperty("java.io.tmpdir"));
System.setProperty("jboss.server.server.dir", System.getProperty("java.io.tmpdir"));
KernelServicesBuilder builder = createKernelServicesBuilder(new AdditionalInitialization() {
@Override
protected RunningMode getRunningMode() {
return RunningMode.NORMAL;
}
@Override
protected void setupController(ControllerInitializer controllerInitializer) {
super.setupController(controllerInitializer);
controllerInitializer.addPath("jboss.server.data.dir", System.getProperty("java.io.tmpdir"), null);
}
}).setSubsystemXml(getSubsystemXml());
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
}
use of org.jboss.as.subsystem.test.ControllerInitializer in project wildfly by wildfly.
the class IDMSubsystem_2_0_UnitTestCase method testRuntime.
@Test
public void testRuntime() throws Exception {
System.setProperty("jboss.server.data.dir", System.getProperty("java.io.tmpdir"));
System.setProperty("jboss.home.dir", System.getProperty("java.io.tmpdir"));
System.setProperty("jboss.server.server.dir", System.getProperty("java.io.tmpdir"));
KernelServicesBuilder builder = createKernelServicesBuilder(new AdditionalInitialization() {
@Override
protected RunningMode getRunningMode() {
return RunningMode.NORMAL;
}
@Override
protected void setupController(ControllerInitializer controllerInitializer) {
super.setupController(controllerInitializer);
controllerInitializer.addPath("jboss.server.data.dir", System.getProperty("java.io.tmpdir"), null);
}
}).setSubsystemXml(getSubsystemXml());
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
}
use of org.jboss.as.subsystem.test.ControllerInitializer in project wildfly by wildfly.
the class IIOPSubsystemTestCase method testDescribeHandler.
@Test
public void testDescribeHandler() throws Exception {
// parse the subsystem xml and install into the first controller.
String subsystemXml = "<subsystem xmlns=\"" + Namespace.CURRENT.getUriString() + "\">" + "<orb socket-binding=\"iiop\" ssl-socket-binding=\"iiop-ssl\"/>" + "</subsystem>";
AdditionalInitialization additionalInit = new AdditionalInitialization() {
@Override
protected void setupController(ControllerInitializer controllerInitializer) {
controllerInitializer.addSocketBinding("iiop", 3528);
controllerInitializer.addSocketBinding("iiop-ssl", 3529);
}
};
KernelServices servicesA = createKernelServicesBuilder(additionalInit).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, IIOPExtension.SUBSYSTEM_NAME)).toModelNode());
List<ModelNode> operations = checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList();
servicesA.shutdown();
Assert.assertEquals(1, operations.size());
// install the describe options from the first controller into a second controller.
KernelServices servicesB = createKernelServicesBuilder(additionalInit).setBootOperations(operations).build();
ModelNode modelB = servicesB.readWholeModel();
servicesB.shutdown();
// make sure the models from the two controllers are identical.
super.compare(modelA, modelB);
}
use of org.jboss.as.subsystem.test.ControllerInitializer in project wildfly by wildfly.
the class DefaultInitialization method createControllerInitializer.
@Override
protected ControllerInitializer createControllerInitializer() {
return new ControllerInitializer() {
@Override
protected void initializeSocketBindingsOperations(List<ModelNode> ops) {
super.initializeSocketBindingsOperations(ops);
ModelNode op = new ModelNode();
op.get(OP).set(ADD);
op.get(OP_ADDR).set(PathAddress.pathAddress(PathElement.pathElement(SOCKET_BINDING_GROUP, SOCKET_BINDING_GROUP_NAME), PathElement.pathElement(SOCKET_BINDING, "advertise-socket-binding")).toModelNode());
op.get(PORT).set(8011);
op.get(MULTICAST_ADDRESS).set("224.0.1.105");
op.get(MULTICAST_PORT).set("23364");
ops.add(op);
}
};
}
Aggregations