Skip to content
Permalink
Browse files

Remove hardcoded "current" version in testsuite

  • Loading branch information...
ctomc committed Feb 13, 2013
1 parent 5acbdb5 commit 23237531bf850c44ecba5cb50151e73a4654a175
@@ -34,7 +34,16 @@

<artifactId>jboss-as-core-model-test-framework</artifactId>
<name>JBoss Application Server: Core Model Test Framework</name>

<build>
<resources>
<resource>
<directory>src/main</directory>
<filtering>true</filtering>
<targetPath>../filtered-sources</targetPath>
</resource>
</resources>
<sourceDirectory>target/filtered-sources</sourceDirectory>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -550,12 +550,13 @@ private LegacyControllerKernelServicesProxy install(AbstractKernelServicesImpl m
classLoaderBuilder.createFromFile(file);
legacyCl = classLoaderBuilder.build();
} else {
classLoaderBuilder.addMavenResourceURL("org.jboss.as:jboss-as-core-model-test-framework:7.2.0.Alpha1-SNAPSHOT");
classLoaderBuilder.addMavenResourceURL("org.jboss.as:jboss-as-model-test:7.2.0.Alpha1-SNAPSHOT");
String version = LegacyKernelServicesInitializer.VersionLocator.getCurrentVersion();
classLoaderBuilder.addMavenResourceURL("org.jboss.as:jboss-as-core-model-test-framework:"+version);
classLoaderBuilder.addMavenResourceURL("org.jboss.as:jboss-as-model-test:"+version);

if (testControllerVersion != TestControllerVersion.MASTER) {
classLoaderBuilder.addRecursiveMavenResourceURL(testControllerVersion.getLegacyControllerMavenGav());
classLoaderBuilder.addMavenResourceURL("org.jboss.as:jboss-as-core-model-test-controller-" + testControllerVersion.getTestControllerVersion() + ":" + VERSION);
classLoaderBuilder.addMavenResourceURL("org.jboss.as:jboss-as-core-model-test-controller-" + testControllerVersion.getTestControllerVersion() + ":" +version);
}
legacyCl = classLoaderBuilder.build(file);
}
@@ -26,13 +26,10 @@
import org.jboss.dmr.ModelNode;

/**
*
* @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
*/
public interface LegacyKernelServicesInitializer {

String VERSION = "7.2.0.Alpha1-SNAPSHOT";

LegacyKernelServicesInitializer initializerCreateModelResource(PathAddress parentAddress, PathElement relativeResourceAddress, ModelNode model);

/**
@@ -49,12 +46,13 @@


public enum TestControllerVersion {
MASTER ("org.jboss.as:jboss-as-host-controller:" + VERSION, null),
V7_1_2_FINAL ("org.jboss.as:jboss-as-host-controller:7.1.2.Final", "7.1.2"),
V7_1_3_FINAL ("org.jboss.as:jboss-as-host-controller:7.1.3.Final", "7.1.3");
MASTER("org.jboss.as:jboss-as-host-controller:" + VersionLocator.getCurrentVersion(), null),
V7_1_2_FINAL("org.jboss.as:jboss-as-host-controller:7.1.2.Final", "7.1.2"),
V7_1_3_FINAL("org.jboss.as:jboss-as-host-controller:7.1.3.Final", "7.1.3");

String mavenGav;
String testControllerVersion;

private TestControllerVersion(String mavenGav, String testControllerVersion) {
this.mavenGav = mavenGav;
this.testControllerVersion = testControllerVersion;
@@ -67,5 +65,20 @@ String getLegacyControllerMavenGav() {
String getTestControllerVersion() {
return testControllerVersion;
}

}

static final class VersionLocator {
private static String VERSION = "${project.version}"; //is going to be replaced by maven during build

static {
if (VERSION.contains("${")) {
VERSION = "8.0.0.Alpha1-SNAPSHOT"; //to make it work from IDE
}
}

static String getCurrentVersion() {
return VERSION;
}
}
}

0 comments on commit 2323753

Please sign in to comment.
You can’t perform that action at this time.