use of org.jboss.as.subsystem.test.KernelServices in project wildfly by wildfly.
the class ModClusterSubsystemParsingTestCase method testSSL.
@Ignore
@Test
public void testSSL() throws Exception {
if (schema != ModClusterSchema.CURRENT)
return;
KernelServicesBuilder builder = createKernelServicesBuilder(new AdditionalInitialization()).setSubsystemXml(getSubsystemXml());
KernelServices services = builder.build();
ModelNode model = services.readWholeModel();
ModelNode config = model.get(SUBSYSTEM, getMainSubsystemName()).get(MOD_CLUSTER_CONFIG, CONFIGURATION);
ModelNode ssl = config.get(SSL, CONFIGURATION);
Assert.assertEquals("/home/rhusar/client-keystore.jks", ssl.get("ca-certificate-file").resolve().asString());
Assert.assertEquals("/home/rhusar/revocations", ssl.get("ca-revocation-url").resolve().asString());
Assert.assertEquals("/home/rhusar/client-keystore.jks", ssl.get("certificate-key-file").resolve().asString());
Assert.assertEquals("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA", ssl.get("cipher-suite").resolve().asString());
Assert.assertEquals("mykeyalias", ssl.get("key-alias").resolve().asString());
Assert.assertEquals("mypassword", ssl.get("password").resolve().asString());
Assert.assertEquals("TLSv1", ssl.get("protocol").resolve().asString());
ServiceController<?> service = services.getContainer().getService(ContainerEventHandlerService.CONFIG_SERVICE_NAME);
MCMPHandlerConfiguration mcmpHandlerConfiguration = (MCMPHandlerConfiguration) service.getValue();
Assert.assertTrue(mcmpHandlerConfiguration.isSsl());
SSLConfiguration sslConfig = (SSLConfiguration) service.getValue();
Assert.assertEquals("mykeyalias", sslConfig.getSslKeyAlias());
Assert.assertEquals("mypassword", sslConfig.getSslTrustStorePassword());
Assert.assertEquals("mypassword", sslConfig.getSslKeyStorePassword());
Assert.assertEquals("/home/rhusar/client-keystore.jks", sslConfig.getSslKeyStore());
Assert.assertEquals("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA", sslConfig.getSslCiphers());
Assert.assertEquals("TLSv1", sslConfig.getSslProtocol());
Assert.assertEquals("/home/rhusar/client-keystore.jks", sslConfig.getSslTrustStore());
Assert.assertEquals("/home/rhusar/revocations", sslConfig.getSslCrlFile());
}
use of org.jboss.as.subsystem.test.KernelServices in project wildfly by wildfly.
the class ModClusterTransformersTestCase method testRejections.
private void testRejections(ModelTestControllerVersion controllerVersion) throws Exception {
String[] dependencies = getDependencies(controllerVersion);
String subsystemXml = readResource("subsystem-reject.xml");
ModClusterModel model = getModelVersion(controllerVersion);
ModelVersion modelVersion = model.getVersion();
String extensionClassName = (model.getVersion().getMajor() == 1) ? "org.jboss.as.modcluster.ModClusterExtension" : "org.wildfly.extension.mod_cluster.ModClusterExtension";
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());
builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion).addMavenResourceURL(dependencies).setExtensionClassName(extensionClassName);
KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
Assert.assertNotNull(legacyServices);
Assert.assertTrue(mainServices.isSuccessfulBoot());
Assert.assertTrue(legacyServices.isSuccessfulBoot());
ModelTestUtils.checkFailedTransformedBootOperations(mainServices, modelVersion, parse(subsystemXml), createFailedOperationConfig(modelVersion));
}
use of org.jboss.as.subsystem.test.KernelServices in project wildfly by wildfly.
the class MessagingSubsystem30TestCase method doTestRejectExpressions_1_4_0.
private void doTestRejectExpressions_1_4_0(KernelServicesBuilder builder) throws Exception {
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
KernelServices legacyServices = mainServices.getLegacyServices(VERSION_1_4_0);
assertNotNull(legacyServices);
assertTrue(legacyServices.isSuccessfulBoot());
}
use of org.jboss.as.subsystem.test.KernelServices in project wildfly by wildfly.
the class MessagingSubsystem30TestCase method doTestRejectExpressions_1_3_0.
private void doTestRejectExpressions_1_3_0(KernelServicesBuilder builder) throws Exception {
KernelServices mainServices = builder.build();
assertTrue(mainServices.isSuccessfulBoot());
KernelServices legacyServices = mainServices.getLegacyServices(VERSION_1_3_0);
assertNotNull(legacyServices);
assertTrue(legacyServices.isSuccessfulBoot());
}
use of org.jboss.as.subsystem.test.KernelServices in project wildfly by wildfly.
the class NamingSubsystemTestCase method testOnlyExternalContextAllowsCache.
@Test
public void testOnlyExternalContextAllowsCache() throws Exception {
KernelServices services = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT).build();
Assert.assertTrue(services.isSuccessfulBoot());
List<ModelNode> list = parse(ModelTestUtils.readResource(this.getClass(), "subsystem.xml"));
for (ModelNode addOp : list) {
PathAddress addr = PathAddress.pathAddress(addOp.require(ModelDescriptionConstants.OP_ADDR));
if (addr.size() == 2 && addr.getLastElement().getKey().equals(NamingSubsystemModel.BINDING) && BindingType.forName(addOp.get(NamingBindingResourceDefinition.BINDING_TYPE.getName()).asString()) != BindingType.EXTERNAL_CONTEXT) {
//Add the cache attribute and make sure it fails
addOp.get(NamingBindingResourceDefinition.CACHE.getName()).set(true);
services.executeForFailure(addOp);
//Remove the cache attribute and make sure it succeeds
addOp.remove(NamingBindingResourceDefinition.CACHE.getName());
ModelTestUtils.checkOutcome(services.executeOperation(addOp));
//Try to write the cache attribute, which should fail
ModelTestUtils.checkFailed(services.executeOperation(Util.getWriteAttributeOperation(addr, NamingBindingResourceDefinition.CACHE.getName(), new ModelNode(true))));
} else {
ModelTestUtils.checkOutcome(services.executeOperation(addOp));
}
}
for (int i = 1; i < list.size(); i++) {
}
}
Aggregations