use of org.jboss.as.subsystem.test.KernelServicesBuilder 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.KernelServicesBuilder in project wildfly by wildfly.
the class IDMSubsystemExampleConfigurationUnitTestCase 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.KernelServicesBuilder in project wildfly by wildfly.
the class IDMSubsystem_1_0_TransformerUnitTestCase method testRejectionExpressions.
private void testRejectionExpressions(ModelTestControllerVersion controllerVersion, String picketLinkJBossAs7Version) throws Exception {
ModelVersion oldVersion = ModelVersion.create(1, 0, 0);
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);
builder.createLegacyKernelServicesBuilder(null, controllerVersion, oldVersion).setExtensionClassName(IDMExtension.class.getName()).addMavenResourceURL("org.wildfly:wildfly-picketlink:" + controllerVersion.getMavenGavVersion()).addMavenResourceURL("org.picketlink.distribution:picketlink-jbas7:" + picketLinkJBossAs7Version).dontPersistXml();
KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(oldVersion);
Assert.assertNotNull(legacyServices);
Assert.assertTrue(mainServices.isSuccessfulBoot());
Assert.assertTrue(legacyServices.isSuccessfulBoot());
ModelNode op = createOperation(ADD, ModelElement.PARTITION_MANAGER.getName(), "test.partition", ModelElement.IDENTITY_CONFIGURATION.getName(), "test.config", ModelElement.LDAP_STORE.getName(), "ldap-store");
op.get(ModelElement.LDAP_STORE_ACTIVE_DIRECTORY.getName()).set(true);
TransformedOperation transformedOperation = mainServices.transformOperation(oldVersion, op);
Assert.assertTrue(transformedOperation.rejectOperation(null));
op = createOperation(ADD, ModelElement.PARTITION_MANAGER.getName(), "test.partition", ModelElement.IDENTITY_CONFIGURATION.getName(), "test.config", ModelElement.LDAP_STORE.getName(), "ldap-store");
op.get(ModelElement.LDAP_STORE_UNIQUE_ID_ATTRIBUTE_NAME.getName()).set("SOMEaTTRIBUTE");
transformedOperation = mainServices.transformOperation(oldVersion, op);
Assert.assertTrue(transformedOperation.rejectOperation(null));
}
use of org.jboss.as.subsystem.test.KernelServicesBuilder 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.KernelServicesBuilder in project wildfly by wildfly.
the class InvalidAttributeManagerDeclarationUnitTestCase method testSubsystem.
@Test
public void testSubsystem() 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();
assertFalse(mainServices.isSuccessfulBoot());
}
Aggregations