Skip to content

Commit

Permalink
Make subsystem-test use the legacy dependencies for its full classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
kabir committed Mar 6, 2013
1 parent e41d547 commit daaa1a7
Show file tree
Hide file tree
Showing 166 changed files with 3,199 additions and 980 deletions.
1 change: 1 addition & 0 deletions appclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
1 change: 1 addition & 0 deletions clustering/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
1 change: 1 addition & 0 deletions clustering/infinispan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.model.test.FailedOperationTransformationConfig;
import org.jboss.as.model.test.ModelTestControllerVersion;
import org.jboss.as.model.test.ModelTestUtils;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.KernelServices;
Expand Down Expand Up @@ -65,23 +66,28 @@ protected String getSubsystemXml() throws IOException {

@Test
public void testTransformer712() throws Exception {
testTransformer_1_3_0("7.1.2.Final");
testTransformer_1_3_0(ModelTestControllerVersion.V7_1_2_FINAL);
}

@Test
public void testTransformer713() throws Exception {
testTransformer_1_3_0("7.1.3.Final");
testTransformer_1_3_0(ModelTestControllerVersion.V7_1_3_FINAL);
}

private void testTransformer_1_3_0(String asVersion) throws Exception {
private void testTransformer_1_3_0(ModelTestControllerVersion controllerVersion) throws Exception {
ModelVersion version = ModelVersion.create(1, 3);
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT)
.setSubsystemXml(getSubsystemXml());
builder.createLegacyKernelServicesBuilder(null, version)
.addMavenResourceURL("org.jboss.as:jboss-as-clustering-infinispan:" + asVersion);
builder.createLegacyKernelServicesBuilder(null, controllerVersion, version)
.addMavenResourceURL("org.jboss.as:jboss-as-clustering-infinispan:" + controllerVersion.getMavenGavVersion())
//TODO storing the model triggers the weirdness mentioned in SubsystemTestDelegate.LegacyKernelServiceInitializerImpl.install()
//which is strange since it should be loading it all from the current jboss modules
//Also this works in several other tests
.dontPersistXml();

KernelServices mainServices = builder.build();
Assert.assertTrue("main services did not boot", mainServices.isSuccessfulBoot());
Assert.assertTrue(mainServices.getLegacyServices(version).isSuccessfulBoot());

checkSubsystemModelTransformation(mainServices, version);

Expand All @@ -95,22 +101,26 @@ private void testTransformer_1_3_0(String asVersion) throws Exception {

@Test
public void testRejectExpressions712() throws Exception {
testRejectExpressions_1_3_0("7.1.2.Final");
testRejectExpressions_1_3_0(ModelTestControllerVersion.V7_1_2_FINAL);
}

@Test
public void testRejectExpressions713() throws Exception {
testRejectExpressions_1_3_0("7.1.3.Final");
testRejectExpressions_1_3_0(ModelTestControllerVersion.V7_1_3_FINAL);
}

public void testRejectExpressions_1_3_0(String asVersion) throws Exception {
public void testRejectExpressions_1_3_0(ModelTestControllerVersion controllerVersion) throws Exception {
// create builder for current subsystem version
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);

// create builder for legacy subsystem version
ModelVersion version_1_3_0 = ModelVersion.create(1, 3, 0);
builder.createLegacyKernelServicesBuilder(null, version_1_3_0)
.addMavenResourceURL("org.jboss.as:jboss-as-clustering-infinispan:" + asVersion);
builder.createLegacyKernelServicesBuilder(null, controllerVersion, version_1_3_0)
.addMavenResourceURL("org.jboss.as:jboss-as-clustering-infinispan:" + controllerVersion.getMavenGavVersion())
//TODO storing the model triggers the weirdness mentioned in SubsystemTestDelegate.LegacyKernelServiceInitializerImpl.install()
//which is strange since it should be loading it all from the current jboss modules
//Also this works in several other tests
.dontPersistXml();

KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(version_1_3_0);
Expand Down
3 changes: 2 additions & 1 deletion clustering/jgroups/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -99,7 +100,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<useManifestOnlyJar>false</useManifestOnlyJar>
<parallel>false</parallel>
<argLine>-javaagent:${org.jboss.byteman:byteman:jar}=port:9091,boot:${org.jboss.byteman:byteman:jar}</argLine>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.model.test.FailedOperationTransformationConfig;
import org.jboss.as.model.test.ModelTestControllerVersion;
import org.jboss.as.model.test.ModelTestUtils;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.KernelServices;
Expand Down Expand Up @@ -61,12 +62,12 @@ protected String getSubsystemXml() throws IOException {

@Test
public void testTransformerAS712() throws Exception {
testTransformer_1_1_0("7.1.2.Final");
testTransformer_1_1_0(ModelTestControllerVersion.V7_1_2_FINAL);
}

@Test
public void testTransformerAS713() throws Exception {
testTransformer_1_1_0("7.1.3.Final");
testTransformer_1_1_0(ModelTestControllerVersion.V7_1_3_FINAL);
}

/**
Expand All @@ -80,14 +81,12 @@ public void testTransformerAS713() throws Exception {
*
* @throws Exception
*/
private void testTransformer_1_1_0(String mavenVersion) throws Exception {
private void testTransformer_1_1_0(ModelTestControllerVersion controllerVersion) throws Exception {
ModelVersion version = ModelVersion.create(1, 1, 0);
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT)
.setSubsystemXmlResource(getSubsystemXml());
builder.createLegacyKernelServicesBuilder(null, version)
.addMavenResourceURL("org.jboss.as:jboss-as-clustering-jgroups:" + mavenVersion)
.addMavenResourceURL("org.jboss.as:jboss-as-controller:" + mavenVersion)
.addParentFirstClassPattern("org.jboss.as.controller.*");
builder.createLegacyKernelServicesBuilder(null, controllerVersion, version)
.addMavenResourceURL("org.jboss.as:jboss-as-clustering-jgroups:" + controllerVersion.getMavenGavVersion());

KernelServices mainServices = builder.build();
Assert.assertTrue(mainServices.isSuccessfulBoot());
Expand Down Expand Up @@ -133,27 +132,31 @@ public void testProtocolStackPropertyResolve() throws Exception {

@Test
public void testRejectExpressionsAS712() throws Exception {
testRejectExpressions_1_1_0("org.jboss.as:jboss-as-clustering-jgroups:7.1.2.Final");
testRejectExpressions_1_1_0(ModelTestControllerVersion.V7_1_2_FINAL);
}

@Test
public void testRejectExpressionsAS713() throws Exception {
testRejectExpressions_1_1_0("org.jboss.as:jboss-as-clustering-jgroups:7.1.3.Final");
testRejectExpressions_1_1_0(ModelTestControllerVersion.V7_1_3_FINAL);
}

/**
* Tests rejection of expressions in 1.1.0 model.
*
* @throws Exception
*/
private void testRejectExpressions_1_1_0(String mavenGAV) throws Exception {
private void testRejectExpressions_1_1_0(ModelTestControllerVersion controllerVersion) throws Exception {
// create builder for current subsystem version
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);

// create builder for legacy subsystem version
ModelVersion version_1_1_0 = ModelVersion.create(1, 1, 0);
builder.createLegacyKernelServicesBuilder(null, version_1_1_0)
.addMavenResourceURL(mavenGAV);
builder.createLegacyKernelServicesBuilder(null, controllerVersion, version_1_1_0)
.addMavenResourceURL("org.jboss.as:jboss-as-clustering-jgroups:" + controllerVersion.getMavenGavVersion())
//TODO storing the model triggers the weirdness mentioned in SubsystemTestDelegate.LegacyKernelServiceInitializerImpl.install()
//which is strange since it should be loading it all from the current jboss modules
//Also this works in several other tests
.dontPersistXml();

KernelServices mainServices = builder.build();
Assert.assertTrue(mainServices.isSuccessfulBoot());
Expand Down
1 change: 1 addition & 0 deletions cmp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@

package org.jboss.as.cmp.subsystem;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.StringWriter;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;

import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.jboss.as.subsystem.test.KernelServices;
import org.jboss.dmr.ModelNode;
import org.junit.Test;

import static org.jboss.as.cmp.subsystem.CmpSubsystemModel.BLOCK_SIZE;
import static org.jboss.as.cmp.subsystem.CmpSubsystemModel.CREATE_TABLE;
import static org.jboss.as.cmp.subsystem.CmpSubsystemModel.CREATE_TABLE_DDL;
Expand All @@ -57,6 +41,16 @@
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;
import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.util.List;

import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.jboss.as.subsystem.test.KernelServices;
import org.jboss.dmr.ModelNode;
import org.junit.Test;

/**
* @author <a href="[email protected]">Kabir Khan</a>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@
import java.io.IOException;
import java.util.List;

import org.junit.Assert;

import org.jboss.as.controller.ModelVersion;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.model.test.FailedOperationTransformationConfig;
import org.jboss.as.model.test.ModelTestControllerVersion;
import org.jboss.as.model.test.ModelTestUtils;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.jboss.as.subsystem.test.KernelServices;
import org.jboss.as.subsystem.test.KernelServicesBuilder;
import org.jboss.as.subsystem.test.LegacyKernelServicesInitializer;
import org.jboss.dmr.ModelNode;
import org.junit.Assert;
import org.junit.Test;

/**
Expand Down Expand Up @@ -121,24 +120,21 @@ private void assertOperation(final ModelNode operation, final String operationNa
}

@Test
public void testTransformers7_1_2() throws Exception {
testTransformers_1_0_0("7.1.2.Final");
public void testTransformers_7_1_2() throws Exception {
testTransformers(ModelTestControllerVersion.V7_1_2_FINAL);
}

@Test
public void testTransformers7_1_3() throws Exception {
testTransformers_1_0_0("7.1.3.Final");
public void testTransformers_7_1_3() throws Exception {
testTransformers(ModelTestControllerVersion.V7_1_3_FINAL);
}


private void testTransformers_1_0_0(String asVersion) throws Exception {
private void testTransformers(ModelTestControllerVersion controllerVersion) throws Exception {
ModelVersion modelVersion = ModelVersion.create(1, 0, 0);
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT);

LegacyKernelServicesInitializer legacyInitializer = builder.createLegacyKernelServicesBuilder(null, modelVersion)
.addMavenResourceURL("org.jboss.as:jboss-as-cmp:" + asVersion)
.addMavenResourceURL("org.jboss.as:jboss-as-controller:" + asVersion)
.addParentFirstClassPattern("org.jboss.as.controller.*");
builder.createLegacyKernelServicesBuilder(null, controllerVersion, modelVersion)
.addMavenResourceURL("org.jboss.as:jboss-as-cmp:" + controllerVersion.getMavenGavVersion());

KernelServices mainServices = builder.build();
Assert.assertTrue(mainServices.isSuccessfulBoot());
Expand All @@ -153,7 +149,6 @@ private void testTransformers_1_0_0(String asVersion) throws Exception {

);
}

@Override
protected AdditionalInitialization createAdditionalInitialization() {
return AdditionalInitialization.MANAGEMENT;
Expand Down
1 change: 1 addition & 0 deletions configadmin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.jboss.as.controller.operations.common.Util;
import org.jboss.as.controller.transform.OperationTransformer.TransformedOperation;
import org.jboss.as.model.test.FailedOperationTransformationConfig;
import org.jboss.as.model.test.ModelTestControllerVersion;
import org.jboss.as.model.test.ModelTestUtils;
import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.jboss.as.subsystem.test.AdditionalInitialization;
Expand Down Expand Up @@ -131,19 +132,19 @@ public void testDescribeHandler() throws Exception {

@Test
public void testTransformersAS712() throws Exception {
testTransformers1_0_0("7.1.2.Final");
testTransformers1_0_0("7.1.2.Final", ModelTestControllerVersion.V7_1_2_FINAL);
}

@Test
public void testTransformersAS713() throws Exception {
testTransformers1_0_0("7.1.3.Final");
testTransformers1_0_0("7.1.3.Final", ModelTestControllerVersion.V7_1_3_FINAL);
}

private void testTransformers1_0_0(String mavenVersion) throws Exception {
private void testTransformers1_0_0(String mavenVersion, ModelTestControllerVersion controllerVersion) throws Exception {
ModelVersion oldVersion = ModelVersion.create(1, 0, 0);
KernelServicesBuilder builder = createKernelServicesBuilder(null)
.setSubsystemXml(SUBSYSTEM_XML_1_0_1);
builder.createLegacyKernelServicesBuilder(null, oldVersion)
builder.createLegacyKernelServicesBuilder(null, controllerVersion, oldVersion)
.setExtensionClassName(ConfigAdminExtension.class.getName())
.addMavenResourceURL("org.jboss.as:jboss-as-configadmin:" + mavenVersion);
KernelServices mainServices = builder.build();
Expand Down Expand Up @@ -173,21 +174,21 @@ private void testTransformers1_0_0(String mavenVersion) throws Exception {

@Test
public void testRejectExpressionsAS712() throws Exception {
testRejectExpressions1_0_0("org.jboss.as:jboss-as-configadmin:7.1.2.Final");
testRejectExpressions1_0_0("org.jboss.as:jboss-as-configadmin:7.1.2.Final", ModelTestControllerVersion.V7_1_2_FINAL);
}

@Test
public void testRejectExpressionsAS713() throws Exception {
testRejectExpressions1_0_0("org.jboss.as:jboss-as-configadmin:7.1.3.Final");
testRejectExpressions1_0_0("org.jboss.as:jboss-as-configadmin:7.1.3.Final", ModelTestControllerVersion.V7_1_3_FINAL);
}

private void testRejectExpressions1_0_0(String mavenGAV) throws Exception {
private void testRejectExpressions1_0_0(String mavenGAV, ModelTestControllerVersion controllerVersion) throws Exception {
// create builder for current subsystem version
KernelServicesBuilder builder = createKernelServicesBuilder(createAdditionalInitialization());

// create builder for legacy subsystem version
ModelVersion version_1_0_0 = ModelVersion.create(1, 0, 0);
builder.createLegacyKernelServicesBuilder(null, version_1_0_0)
builder.createLegacyKernelServicesBuilder(null, controllerVersion, version_1_0_0)
.addMavenResourceURL(mavenGAV)
.setExtensionClassName("org.jboss.as.configadmin.parser.ConfigAdminExtension");

Expand Down
1 change: 1 addition & 0 deletions connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-subsystem-test</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Loading

0 comments on commit daaa1a7

Please sign in to comment.