Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Itests still not resolving the correct dependencies. Another fix.
Browse files Browse the repository at this point in the history
  - updated Abstract classes to consistently use the same properties
  - update plugin container itests to check before going to classpath.
  • Loading branch information
Simeon Pinder committed Jul 24, 2014
1 parent c5a5410 commit 8a1e9e6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
4 changes: 4 additions & 0 deletions modules/core/plugin-container-itest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
<value>org.rhq.test.testng.StdoutReporter</value>
</property>
</properties>
<systemPropertyVariables>
<rhq.version>${rhq.pom.version}</rhq.version>
<rhq-platform-plugin.version>${rhq-platform-plugin.version}</rhq-platform-plugin.version>
</systemPropertyVariables>
</configuration>
</plugin>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,15 @@ public abstract class AbstractAgentPluginTest extends Arquillian {
@Deployment(name = "platform", order = 1)
public static RhqAgentPluginArchive getPlatformPlugin() throws Exception {
MavenResolverSystem mavenDependencyResolver = Maven.resolver();
String platformPluginArtifact = "org.rhq:rhq-platform-plugin:jar:" + getPlatformPluginVersion();
//check for system property specifiers before going to classpath
String rhqPlatformPluginVersion = System.getProperty("rhq-platform-plugin.version");
//complete maven gav construction.
String platformPluginArtifact = "org.rhq:rhq-platform-plugin:jar:";
if ((rhqPlatformPluginVersion == null) || rhqPlatformPluginVersion.trim().isEmpty()) {
platformPluginArtifact += getRhqVersion();//got to classpath and MavenArtifactProperties
} else {
platformPluginArtifact += rhqPlatformPluginVersion;
}

return mavenDependencyResolver.offline().loadPomFromFile("pom.xml").resolve(platformPluginArtifact)
.withoutTransitivity().asSingle(RhqAgentPluginArchive.class);
Expand Down Expand Up @@ -645,17 +653,12 @@ private long getDefaultTimeout(ResourceType resourceType, String operationName)
private static String getRhqVersion() {
MavenArtifactProperties rhqPluginContainerPom = null;
try {
rhqPluginContainerPom = MavenArtifactProperties.getInstance("org.rhq", "rhq-parent");
} catch (MavenArtifactNotFoundException e) {
throw new RuntimeException(e);
}
return rhqPluginContainerPom.getVersion();
}

private static String getPlatformPluginVersion() {
MavenArtifactProperties rhqPluginContainerPom = null;
try {
rhqPluginContainerPom = MavenArtifactProperties.getInstance("org.rhq", "rhq-platform-plugin");
//check for system property specifiers before going to classpath
String rhqVersion = System.getProperty("rhq.version");
if ((rhqVersion != null) && !(rhqVersion.trim().isEmpty())) {
return rhqVersion;
}
rhqPluginContainerPom = MavenArtifactProperties.getInstance("org.rhq", "rhq-core-plugin-container");
} catch (MavenArtifactNotFoundException e) {
throw new RuntimeException(e);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/enterprise/server/itests-2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@
<hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
<clean.db>${clean.db}</clean.db>
<log4j.configDebug>false</log4j.configDebug>
<project.version>${project.version}</project.version>
<rhq.version>${rhq.pom.version}</rhq.version>
<rhq.skip.oracle>${skip.oracle}</rhq.skip.oracle>
<rhq.ojdbc.version>${ojdbc6.version}</rhq.ojdbc.version>
<rhq-platform-plugin.version>${rhq-platform-plugin.version}</rhq-platform-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ protected static EnterpriseArchive getBaseDeployment() {
testClassesJar.addAsResource("org/rhq/enterprise/server/plugins/ant/recipe-no-manageRootDir.xml");

// create test ear by starting with rhq.ear and thinning it
String projectVersion = System.getProperty("project.version");
String projectVersion = System.getProperty("rhq.version");
String rhqCoreClientApiVersion = System.getProperty("rhq-core-client-api.version");
if ((rhqCoreClientApiVersion == null) || rhqCoreClientApiVersion.trim().isEmpty()) {
rhqCoreClientApiVersion = projectVersion;
Expand Down

0 comments on commit 8a1e9e6

Please sign in to comment.