[rhq] 7 commits - .classpath etc/apt etc/samples modules/core modules/enterprise modules/helpers modules/integration-tests modules/jopr modules/plugins
by Jay Shaughnessy
.classpath | 2
etc/apt/pom.xml | 2
etc/samples/perspectives/sample-perspective/app/pom.xml | 2
etc/samples/perspectives/sample-perspective/perspective/pom.xml | 2
etc/samples/skeleton-plugin/pom.xml | 2
modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 7
modules/core/plugindoc/pom.xml | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 25 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotDriftDetailsView.java | 82 +++++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java | 136 ++++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java | 90 +++---
modules/enterprise/gui/webdav-war/pom.xml | 2
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java | 32 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java | 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java | 143 ++++++----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java | 61 ++--
modules/enterprise/server/plugins/alert-scriptlang/pom.xml | 2
modules/enterprise/server/plugins/alert-sms/pom.xml | 2
modules/enterprise/server/plugins/cloud/pom.xml | 2
modules/enterprise/server/plugins/drift-mongodb/pom.xml | 2
modules/enterprise/server/plugins/perspectives/policy/app/pom.xml | 2
modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml | 2
modules/enterprise/server/plugins/perspectives/policy/pom.xml | 2
modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java | 2
modules/helpers/inventory-serializer/pom.xml | 4
modules/integration-tests/mod_cluster-plugin-test/pom.xml | 2
modules/jopr/pom.xml | 2
modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml | 2
modules/plugins/hardware/pom.xml | 2
modules/plugins/iptables/pom.xml | 2
modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 3
modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml | 3
modules/plugins/jdbctrace/pom.xml | 2
modules/plugins/jira/pom.xml | 2
modules/plugins/lsof/pom.xml | 2
modules/plugins/onewire/pom.xml | 2
modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml | 6
modules/plugins/raw-config-test/pom.xml | 2
modules/plugins/services/pom.xml | 2
42 files changed, 389 insertions(+), 280 deletions(-)
New commits:
commit e7dbeafaf53877f9f1bc26c11d5157ddaf5105fb
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 13:53:41 2011 -0400
We've already upped the pom versions in every place that the release builds
actually touch. But it seems we didn't up then in the places that the
release build does not touch. Upping instances of 4.1.0-SNAPSHOT to
4.3.0-SNAPSHOT.
diff --git a/etc/apt/pom.xml b/etc/apt/pom.xml
index 65136e1..0e4ab0d 100644
--- a/etc/apt/pom.xml
+++ b/etc/apt/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/etc/samples/perspectives/sample-perspective/app/pom.xml b/etc/samples/perspectives/sample-perspective/app/pom.xml
index ced290d..1b205a9 100644
--- a/etc/samples/perspectives/sample-perspective/app/pom.xml
+++ b/etc/samples/perspectives/sample-perspective/app/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/etc/samples/perspectives/sample-perspective/perspective/pom.xml b/etc/samples/perspectives/sample-perspective/perspective/pom.xml
index 963a8ca..ce97a56 100644
--- a/etc/samples/perspectives/sample-perspective/perspective/pom.xml
+++ b/etc/samples/perspectives/sample-perspective/perspective/pom.xml
@@ -10,7 +10,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/etc/samples/skeleton-plugin/pom.xml b/etc/samples/skeleton-plugin/pom.xml
index b72c93d..0af4c89 100644
--- a/etc/samples/skeleton-plugin/pom.xml
+++ b/etc/samples/skeleton-plugin/pom.xml
@@ -15,7 +15,7 @@
<description>A template for building a custom RHQ Agent plugin</description>
<properties>
- <rhq.version>4.1.0-SNAPSHOT</rhq.version>
+ <rhq.version>4.3.0-SNAPSHOT</rhq.version>
</properties>
<dependencies>
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java
index 3148d09..e1a761f 100644
--- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java
+++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/descriptor/AgentPluginDescriptorUtil.java
@@ -389,7 +389,7 @@ public abstract class AgentPluginDescriptorUtil {
for (ValidationEvent event : validationEventCollector.getEvents()) {
// First build the message to be logged. The message will look something like this:
//
- // Validation fatal error while parsing [jopr-jboss-as-plugin-4.1.0-SNAPSHOT.jar:META-INF/rhq-plugin.xml]
+ // Validation fatal error while parsing [jopr-jboss-as-plugin-4.3.0-SNAPSHOT.jar:META-INF/rhq-plugin.xml]
// at line 221, column 94: cvc-minInclusive-valid: Value '20000' is not facet-valid with respect to
// minInclusive '30000' for type '#AnonType_defaultIntervalmetric'.
//
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index 5586534..6771f72 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml
index 77aca38..021dc70 100644
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ b/modules/enterprise/gui/webdav-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
index 7db3365..adab2c8 100644
--- a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
@@ -87,7 +87,7 @@ public class DriftServerTest extends AbstractEJB3Test {
prepareCustomServerPluginService(driftServerPluginService);
driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
- File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.1.0-SNAPSHOT.jar");
+ File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.3.0-SNAPSHOT.jar");
assertTrue("Drift server plugin JAR file not found at" + jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
FileUtils.copyFileToDirectory(jpaDriftPlugin, driftServerPluginService.masterConfig.getPluginDirectory());
@@ -179,9 +179,8 @@ public class DriftServerTest extends AbstractEJB3Test {
protected void deleteEntity(Class<?> clazz, String name, EntityManager em) {
try {
Object entity = em.createQuery(
- "select entity from " + clazz.getSimpleName() + " entity where entity.name = :name")
- .setParameter("name", name)
- .getSingleResult();
+ "select entity from " + clazz.getSimpleName() + " entity where entity.name = :name").setParameter(
+ "name", name).getSingleResult();
em.remove(entity);
} catch (NoResultException e) {
// we can ignore no results because this code will run when the db
@@ -189,18 +188,14 @@ public class DriftServerTest extends AbstractEJB3Test {
} catch (NonUniqueResultException e) {
// we will fail here to let the person running the test know that
// the database may not be in a consistent state
- fail("Purging " + name + " failed. Expected to find one instance of " + clazz.getSimpleName() +
- " but found more than one. The database may not be in a consistent state.");
+ fail("Purging " + name + " failed. Expected to find one instance of " + clazz.getSimpleName()
+ + " but found more than one. The database may not be in a consistent state.");
}
}
protected void initResourceType() {
- resourceType = new ResourceTypeBuilder().createResourceType()
- .withId(0)
- .withName(RESOURCE_TYPE_NAME)
- .withCategory(SERVER)
- .withPlugin(RESOURCE_TYPE_NAME.toLowerCase())
- .build();
+ resourceType = new ResourceTypeBuilder().createResourceType().withId(0).withName(RESOURCE_TYPE_NAME)
+ .withCategory(SERVER).withPlugin(RESOURCE_TYPE_NAME.toLowerCase()).build();
}
protected void initAgent() {
@@ -208,13 +203,8 @@ public class DriftServerTest extends AbstractEJB3Test {
}
protected void initResource() {
- resource = new ResourceBuilder().createResource()
- .withId(0)
- .withName(RESOURCE_NAME)
- .withResourceKey(RESOURCE_NAME)
- .withRandomUuid()
- .withResourceType(resourceType)
- .build();
+ resource = new ResourceBuilder().createResource().withId(0).withName(RESOURCE_NAME).withResourceKey(
+ RESOURCE_NAME).withRandomUuid().withResourceType(resourceType).build();
}
protected Subject getOverlord() {
@@ -226,8 +216,8 @@ public class DriftServerTest extends AbstractEJB3Test {
}
protected String toString(DriftDefinitionTemplate template) {
- return DriftDefinitionTemplate.class.getSimpleName() + "[id: " + template.getId() + ", name: " +
- template.getName() + "]";
+ return DriftDefinitionTemplate.class.getSimpleName() + "[id: " + template.getId() + ", name: "
+ + template.getName() + "]";
}
protected Drift findDriftByPath(List<? extends Drift> drifts, String path) {
diff --git a/modules/enterprise/server/plugins/alert-scriptlang/pom.xml b/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
index a9816b4..d76ad0a 100644
--- a/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
+++ b/modules/enterprise/server/plugins/alert-scriptlang/pom.xml
@@ -8,7 +8,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/alert-sms/pom.xml b/modules/enterprise/server/plugins/alert-sms/pom.xml
index 5b7a1c5..b34c97c 100644
--- a/modules/enterprise/server/plugins/alert-sms/pom.xml
+++ b/modules/enterprise/server/plugins/alert-sms/pom.xml
@@ -8,7 +8,7 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cloud/pom.xml b/modules/enterprise/server/plugins/cloud/pom.xml
index fcb145f..176b174 100644
--- a/modules/enterprise/server/plugins/cloud/pom.xml
+++ b/modules/enterprise/server/plugins/cloud/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/enterprise/server/plugins/drift-mongodb/pom.xml b/modules/enterprise/server/plugins/drift-mongodb/pom.xml
index 23e8981..7d14df3 100644
--- a/modules/enterprise/server/plugins/drift-mongodb/pom.xml
+++ b/modules/enterprise/server/plugins/drift-mongodb/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml b/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
index 80180de..164de34 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/app/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
index 72c885e..51d3e6c 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/perspective/pom.xml
@@ -10,7 +10,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/policy/pom.xml b/modules/enterprise/server/plugins/perspectives/policy/pom.xml
index 28788d8..618522f 100644
--- a/modules/enterprise/server/plugins/perspectives/policy/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/policy/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
index e76feab..1e3bae0 100644
--- a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
+++ b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
@@ -324,7 +324,7 @@ public abstract class ServerPluginDescriptorUtil {
for (ValidationEvent event : validationEventCollector.getEvents()) {
// First build the message to be logged. The message will look something like this:
//
- // Validation fatal error while parsing [jopr-jboss-as-plugin-4.1.0-SNAPSHOT.jar:META-INF/rhq-plugin.xml]
+ // Validation fatal error while parsing [jopr-jboss-as-plugin-4.3.0-SNAPSHOT.jar:META-INF/rhq-plugin.xml]
// at line 221, column 94: cvc-minInclusive-valid: Value '20000' is not facet-valid with respect to
// minInclusive '30000' for type '#AnonType_defaultIntervalmetric'.
//
diff --git a/modules/helpers/inventory-serializer/pom.xml b/modules/helpers/inventory-serializer/pom.xml
index b97f9fb..687296d 100644
--- a/modules/helpers/inventory-serializer/pom.xml
+++ b/modules/helpers/inventory-serializer/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>inventory-serializer</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>Inventory Serializer</name>
<description>A helper command line app to export parts of the inventory to XML</description>
diff --git a/modules/integration-tests/mod_cluster-plugin-test/pom.xml b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
index 4e29e2b..bb40916 100644
--- a/modules/integration-tests/mod_cluster-plugin-test/pom.xml
+++ b/modules/integration-tests/mod_cluster-plugin-test/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/jopr/pom.xml b/modules/jopr/pom.xml
index 10eba8f..aa8b6d2 100644
--- a/modules/jopr/pom.xml
+++ b/modules/jopr/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
index 6a63c06..305babe 100644
--- a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
+++ b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/hardware/pom.xml b/modules/plugins/hardware/pom.xml
index 0f54830..a922967 100644
--- a/modules/plugins/hardware/pom.xml
+++ b/modules/plugins/hardware/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/iptables/pom.xml b/modules/plugins/iptables/pom.xml
index 0772067..266acbc 100644
--- a/modules/plugins/iptables/pom.xml
+++ b/modules/plugins/iptables/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jdbctrace/pom.xml b/modules/plugins/jdbctrace/pom.xml
index 69d9ac3..f052dff 100644
--- a/modules/plugins/jdbctrace/pom.xml
+++ b/modules/plugins/jdbctrace/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jira/pom.xml b/modules/plugins/jira/pom.xml
index c2123dc..6e488f6 100644
--- a/modules/plugins/jira/pom.xml
+++ b/modules/plugins/jira/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/lsof/pom.xml b/modules/plugins/lsof/pom.xml
index 1c691f4..6f7439d 100644
--- a/modules/plugins/lsof/pom.xml
+++ b/modules/plugins/lsof/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/onewire/pom.xml b/modules/plugins/onewire/pom.xml
index 57b0ed0..0cf5d3a 100644
--- a/modules/plugins/onewire/pom.xml
+++ b/modules/plugins/onewire/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/raw-config-test/pom.xml b/modules/plugins/raw-config-test/pom.xml
index 666329c..5a4abc6 100644
--- a/modules/plugins/raw-config-test/pom.xml
+++ b/modules/plugins/raw-config-test/pom.xml
@@ -6,7 +6,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.plugins</groupId>
diff --git a/modules/plugins/services/pom.xml b/modules/plugins/services/pom.xml
index 3fc60b5..adf6da8 100644
--- a/modules/plugins/services/pom.xml
+++ b/modules/plugins/services/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-services-plugin</artifactId>
commit 721cb4ed7a305c331a37cad3834dcdc37aa76ed8
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 13:51:47 2011 -0400
remove webservices stuff from eclipse libs, I don't think we need it for
an eclipse build.
diff --git a/.classpath b/.classpath
index 0fe640b..195902e 100644
--- a/.classpath
+++ b/.classpath
@@ -124,7 +124,6 @@
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jaxrs/2.2.1.GA/resteasy-jaxrs-2.2.1.GA.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jettison-provider/2.2.1.GA/resteasy-jettison-provider-2.2.1.GA.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/resteasy/jaxrs-api/2.2.1.GA/jaxrs-api-2.2.1.GA.jar"/>
- <classpathentry exported="true" kind="lib" path="modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-4.1.0-SNAPSHOT/wsconsume-output"/>
<classpathentry kind="src" path="modules/common/ant-bundle/src/main/java"/>
<classpathentry kind="src" path="modules/enterprise/server/plugins/drift-mongodb/src/main/java"/>
<classpathentry kind="src" path="modules/enterprise/server/plugins/drift-mongodb/src/test/java"/>
@@ -287,6 +286,5 @@
<classpathentry kind="src" path="modules/plugins/jboss-as-7/src/test/java"/>
<classpathentry kind="src" path="modules/integration-tests/jboss-as-7-plugin-test/src/test/java"/>
<classpathentry kind="src" path="modules/integration-tests/mod_cluster-plugin-test/src/test/java"/>
- <classpathentry kind="lib" path="modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-4.1.0-SNAPSHOT/wsprovide-output"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
commit e3b6312a8bb94f417b84b72caa486ec6f775fec3
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 12:18:12 2011 -0400
Update plugins supporting drift to use better template names
- new conventions: "Template: Some Name"
- add descriptions to all plugin defined templates
diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
index 1503962..e337217 100644
--- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml
@@ -1195,7 +1195,8 @@
</configuration>
</content>
- <drift-definition name="Core Files">
+ <drift-definition name="Template: Base Files"
+ description="A template for monitoring base application server files for drift. It defines monitoring for some standard sub-directories of the HOME directory. Note, it is not recommeded to monitor all files for an application server. There are many files, and many temp files.">
<basedir>
<value-context>pluginConfiguration</value-context>
<value-name>homeDir</value-name>
diff --git a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
index 44a2ea5..d02a8c0 100644
--- a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
@@ -258,7 +258,8 @@
</configuration>
</content>
- <drift-definition name="Core Files">
+ <drift-definition name="Template: Base Files"
+ description="A template for monitoring base application server files for drift. It defines monitoring for some standard sub-directories of the HOME directory. Note, it is not recommeded to monitor all files for an application server. There are many files, and many temp files.">
<basedir>
<value-context>pluginConfiguration</value-context>
<value-name>jbossHomeDir</value-name>
diff --git a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
index 6339c74..fa07736 100644
--- a/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml
@@ -40,13 +40,13 @@
</bundle-target>
'>
<!ENTITY driftConfig '
- <drift-definition name="File System"
- description="A general purpose template for file system drift monitoring. It is expected that the base directory will be changed as the file system root is not recommended.">
+ <drift-definition name="Template: File System"
+ description="A template for monitoring the file system for drift. It is expected that definitions will set a more specific base directory as the file system root is not recommended.">
<basedir>
<value-context>fileSystem</value-context>
<value-name>/</value-name>
</basedir>
- </drift-definition>
+ </drift-definition>
'>
<!ENTITY metrics '
<metric displayName="Hostname"
commit eb021c14ddf1f673a500e237c161bf480fc74bb6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 12:12:29 2011 -0400
Rework drift metadata update for changes to plugin defined drift templates.
Now supports handling of:
- user and plugin defined templates for the type
- templates with attached definitions
- pinned templates
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index 7949af1..b44bee1 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -439,6 +439,7 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
this.packageTypes = new HashSet<PackageType>();
this.subCategories = new ArrayList<ResourceSubCategory>();
this.productVersions = new HashSet<ProductVersion>();
+ this.driftDefinitionTemplates = new HashSet<DriftDefinitionTemplate>();
this.name = name;
this.category = category;
@@ -841,6 +842,10 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
driftDefinitionTemplates.add(template);
}
+ public void setDriftDefinitionTemplates(Set<DriftDefinitionTemplate> driftDefinitionTemplates) {
+ this.driftDefinitionTemplates = driftDefinitionTemplates;
+ }
+
@Override
public boolean equals(Object obj) {
if (this == obj)
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
index 9baf7a4..4346f69 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java
@@ -44,10 +44,11 @@ import org.rhq.core.clientapi.agent.metadata.PluginMetadataManager;
import org.rhq.core.clientapi.agent.metadata.SubCategoriesMetadataParser;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.definition.ConfigurationTemplate;
import org.rhq.core.domain.criteria.ResourceCriteria;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftDefinitionComparator;
import org.rhq.core.domain.drift.DriftDefinitionTemplate;
+import org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode;
import org.rhq.core.domain.resource.ProcessScan;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceSubCategory;
@@ -450,74 +451,114 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void updateDriftMetadata(ResourceType existingType, ResourceType resourceType) {
- boolean isSame = true;
-
existingType = entityManager.find(ResourceType.class, existingType.getId());
//
- // First, we need to see if the drift definitions have changed. If the existing and new drift definitions
- // are the same, then we can skip the update and do nothing. Only if one or more drift definitions
- // are different do we have to do anything to the persisted metadata.
+ // Only if one or more drift definitions are different do we have to do anything to the persisted metadata.
//
Set<DriftDefinitionTemplate> existingDriftTemplates = existingType.getDriftDefinitionTemplates();
- Set<DriftDefinitionTemplate> newDriftTemplates = resourceType.getDriftDefinitionTemplates();
- if (existingDriftTemplates.size() != newDriftTemplates.size()) {
- isSame = false;
- } else {
- // note: the size of the sets are typically really small (usually between 0 and 3),
- // so iterating through them is fast.
-
- // look at all the configs to ensure we detect any changes to individual settings on the templates
- Set<String> existingNames = new HashSet<String>(existingDriftTemplates.size());
- Set<String> newNames = new HashSet<String>(newDriftTemplates.size());
- for (DriftDefinitionTemplate existingTemplate : existingDriftTemplates) {
- String existingName = existingTemplate.getName();
- Configuration existingConfig = existingTemplate.getConfiguration();
-
- existingNames.add(existingName); // for later
-
- for (DriftDefinitionTemplate newTemplate : newDriftTemplates) {
- String newName = newTemplate.getName();
- newNames.add(newName); // for later, do this here, not in the if-stmt below, so we can catch if new has names not in existing
- if (newName.equals(existingName)) {
- Configuration newConfig = newTemplate.getConfiguration();
- if (!existingConfig.equals(newConfig)) {
- isSame = false;
- }
- break;
+
+ // We are only concerned with the plugin defined templates, user defined templates are not affected.
+
+ Set<DriftDefinitionTemplate> existingPluginDriftTemplates = new HashSet<DriftDefinitionTemplate>(
+ existingDriftTemplates.size());
+
+ for (DriftDefinitionTemplate existingTemplate : existingDriftTemplates) {
+ if (!existingTemplate.isUserDefined()) {
+ existingPluginDriftTemplates.add(existingTemplate);
+ }
+ }
+
+ Set<DriftDefinitionTemplate> newPluginDriftTemplates = resourceType.getDriftDefinitionTemplates();
+ // note: the size of the sets are typically really small (usually between 1 and 3),
+ // so iterating through them is fast.
+
+ // look at all the configs to ensure we detect any changes to individual settings on the templates
+ Set<String> existingNames = new HashSet<String>(existingPluginDriftTemplates.size());
+ DriftDefinitionComparator dirComp = new DriftDefinitionComparator(CompareMode.ONLY_DIRECTORY_SPECIFICATIONS);
+
+ for (Iterator<DriftDefinitionTemplate> i = existingDriftTemplates.iterator(); i.hasNext();) {
+ DriftDefinitionTemplate existingTemplate = i.next();
+
+ String existingName = existingTemplate.getName();
+ DriftDefinition existingDef = existingTemplate.getTemplateDefinition();
+ Set<DriftDefinition> attachedDefs = existingTemplate.getDriftDefinitions();
+ boolean noAttachedDefs = (null == attachedDefs || attachedDefs.isEmpty());
+ boolean notPinned = !existingTemplate.isPinned();
+ boolean stillDefined = false;
+
+ // for later to determine if any existing templates are no longer defined in the plugin
+ existingNames.add(existingName);
+
+ for (DriftDefinitionTemplate newTemplate : newPluginDriftTemplates) {
+ String newName = newTemplate.getName();
+
+ // The new template existed previously. See if it has changed and if so, in what way:
+ //
+ // IF the existingTemplate
+ // has no attached defs AND
+ // is not pinned
+ // THEN we can update it with impunity
+ // ELSE IF the directories have not changed
+ // THEN we can update the base info fields only
+ // Note that in the latter case we update the template but we will not push the
+ // changes down to attached defs. This is a little odd because the template and defs can
+ // get out of sync, but we don't want a plugin change to affect existing defs in case
+ // the user has made manual changes, or wants it the way it is.
+ if (newName.equals(existingName)) {
+ stillDefined = true;
+
+ DriftDefinition newDef = newTemplate.getTemplateDefinition();
+ boolean noDirChanges = (0 == dirComp.compare(existingDef, newDef));
+
+ if ((noAttachedDefs && notPinned) || noDirChanges) {
+ existingTemplate.setTemplateDefinition(newDef);
+
+ } else {
+ // can't update directories for an existing template if pinned and/or having attached defs
+ log.error("Failed to update drift definition [" + newName + "] on type ["
+ + resourceType.getName()
+ + "]. It is not allowed to update directories on an existing template that is pinned "
+ + "or has attached definitions. It would invalidate pinned snapshots as the fileset "
+ + "would no longer map from template to definition.");
}
- }
- if (!isSame) {
break;
}
}
- if (isSame) {
- // make sure they all have the same names and no duplicate names existed
- isSame = existingNames.equals(newNames) && existingNames.size() == existingDriftTemplates.size();
+ // If the template is no longer defined then what we do depends on whether it has attached
+ // definitions. If not it can be deleted, otherwise we keep it around so the user doesn't lose
+ // anything, but set it to user-defined, in essence removing it from the plugin.
+ if (!stillDefined) {
+ if (noAttachedDefs) {
+ entityManager.remove(existingTemplate);
+ i.remove();
+
+ } else {
+ existingTemplate.setUserDefined(true);
+ log.warn("Plugin no longer defines drift template [" + existingTemplate.getName() + "] on type ["
+ + resourceType.getName()
+ + "]. This template has attached definitions. To preserve the existing definitions the "
+ + " template will not be removed but is instead being set as user-defined. The user will "
+ + " be responsible for further maintenance of this template.");
+ }
}
}
- //
- // If one or more drift definitions are different between new and existing,
- // then we need to remove the old drift definition and persist the new drift definition.
- //
+ // Now add new templates, not previously defined
+ for (DriftDefinitionTemplate newTemplate : newPluginDriftTemplates) {
+ String newName = newTemplate.getName();
- if (!isSame) {
- for (DriftDefinitionTemplate doomed : existingDriftTemplates) {
- entityManager.remove(doomed);
+ if (existingNames.contains(newName)) {
+ continue;
}
- existingType.getDriftDefinitionTemplates().clear();
- for (DriftDefinitionTemplate toPersist : newDriftTemplates) {
- entityManager.persist(toPersist);
- existingType.addDriftDefinitionTemplate(toPersist);
- }
+ newTemplate.setResourceType(existingType);
+ entityManager.persist(newTemplate);
+ existingDriftTemplates.add(newTemplate);
}
-
- return;
}
private void persistNewType(ResourceType resourceType) {
commit 36fec921afa5faaeb158d1fc3a28659831bc7bc8
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Nov 1 11:43:10 2011 -0400
Fix issue in handling of non-cached metadata types in type repo. Also,
optimize further by only querying for metadata that is not already cached
for the requested types.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
index 743c094..7949af1 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java
@@ -401,7 +401,7 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
private BundleType bundleType;
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "resourceType")
- private Set<DriftDefinitionTemplate> driftDefinitionTemplates = new HashSet<DriftDefinitionTemplate>();
+ private Set<DriftDefinitionTemplate> driftDefinitionTemplates;
// note that this is mapped to a Configuration entity, which is what it really is. However, our getter/setter
// only provides access to this via ResourceTypeBundleConfiguration to encapsulate the innards of this implementation
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
index 2b3dbb1..15d7221 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
@@ -31,7 +31,6 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.rhq.core.domain.criteria.ResourceTypeCriteria;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
@@ -58,27 +57,31 @@ public class ResourceTypeRepository {
private static ResourceTypeGWTServiceAsync resourceTypeService = GWTServiceLookup.getResourceTypeGWTService();
/**
- * The following MetadadaTypes are not cached and will always be queried from the database:<br/>
+ * The following MetadadaTypes are subject to change and are always fetched from the database:<br/>
* driftDefinitionTemplates
*
* @author Jay Shaughnessy
*/
public enum MetadataType {
children, operations, measurements, content, events, pluginConfigurationDefinition, resourceConfigurationDefinition, subCategory, parentTypes, processScans, productVersions, driftDefinitionTemplates(
- false);
+ true);
- private boolean isCachedMetadata;
+ private boolean isFetchAlways;
private MetadataType() {
- this.isCachedMetadata = true;
+ this(false);
}
- private MetadataType(boolean isCachedMetadata) {
- this.isCachedMetadata = isCachedMetadata;
+ /**
+ * @param isFetchAlways if true then the cache for this metadata will be refreshed each time it is requested.
+ * Meaning, the db will always be called because this metadata is subject to change.
+ */
+ private MetadataType(boolean isFetchAlways) {
+ this.isFetchAlways = isFetchAlways;
}
- public boolean isCachedMetadata() {
- return isCachedMetadata;
+ public boolean isFetchAlways() {
+ return isFetchAlways;
}
}
@@ -187,22 +190,17 @@ public class ResourceTypeRepository {
});
}
- public void getResourceTypes(Integer[] resourceTypeIds, EnumSet<MetadataType> metadataTypesNeeded,
+ public void getResourceTypes(Integer[] resourceTypeIds, EnumSet<MetadataType> metadataTypes,
final TypesLoadedCallback callback) {
- // note, metadataTypesNeeded == null implies EnumSet.noneOf(MetadataType.class)
- final EnumSet<MetadataType> metadataTypes;
- if (metadataTypesNeeded == null) {
- metadataTypes = EnumSet.noneOf(MetadataType.class);
- } else {
- metadataTypes = metadataTypesNeeded;
- }
-
- ResourceTypeCriteria criteria = new ResourceTypeCriteria();
+ // note, metadataTypes == null implies EnumSet.noneOf(MetadataType.class)
+ metadataTypes = (null == metadataTypes) ? EnumSet.noneOf(MetadataType.class) : metadataTypes;
final Map<Integer, ResourceType> cachedTypes = new HashMap<Integer, ResourceType>();
-
List<Integer> typesNeeded = new ArrayList<Integer>();
+ EnumSet<MetadataType> metadataTypesNeeded = EnumSet.noneOf(MetadataType.class);
+ ResourceTypeCriteria criteria = new ResourceTypeCriteria();
+
if (resourceTypeIds == null) {
//preload all
} else {
@@ -215,7 +213,24 @@ public class ResourceTypeRepository {
|| (!metadataTypes.isEmpty() && (!typeCacheLevel.containsKey(typeId) // 2.
|| !typeCacheLevel.get(typeId).containsAll(metadataTypes)))) // 3.
{
+ // add this type to the types we need to fetch
typesNeeded.add(typeId);
+
+ // make sure we fetch the metadata needed for this type
+ if (metadataTypesNeeded.size() < metadataTypes.size()) {
+ EnumSet<MetadataType> metadataTypesCached = typeCacheLevel.get(typeId);
+
+ if (metadataTypesCached == null) {
+ metadataTypesNeeded = metadataTypes;
+
+ } else {
+ for (MetadataType metadataType : metadataTypes) {
+ if (!metadataTypesCached.contains(metadataType)) {
+ metadataTypesNeeded.add(metadataType);
+ }
+ }
+ }
+ }
} else {
cachedTypes.put(typeId, typeCache.get(typeId));
}
@@ -230,7 +245,7 @@ public class ResourceTypeRepository {
criteria.addFilterIds(typesNeeded.toArray(new Integer[typesNeeded.size()]));
}
- for (MetadataType metadataType : metadataTypes) {
+ for (MetadataType metadataType : metadataTypesNeeded) {
switch (metadataType) {
case children:
criteria.fetchChildResourceTypes(true);
@@ -275,16 +290,16 @@ public class ResourceTypeRepository {
criteria.setPageControl(PageControl.getUnlimitedInstance());
- Log.info("Loading [" + typesNeeded.size() + "] types with facets=[" + metadataTypes + "]...");
+ Log.info("Loading [" + typesNeeded.size() + "] types with facets=[" + metadataTypesNeeded + "]...");
- if ((topLevelServerAndServiceTypes == null) && (metadataTypes != null)
- && metadataTypes.contains(MetadataType.children)) {
+ if ((topLevelServerAndServiceTypes == null) && (metadataTypesNeeded != null)
+ && metadataTypesNeeded.contains(MetadataType.children)) {
// Perform a one-time load of server and service types with no parent types. These types are implicitly
// children of all platform types, even though they are not included in the platform types'
// childResourceTypes field.
- loadTopLevelServerAndServiceTypes(callback, metadataTypes, criteria, cachedTypes);
+ loadTopLevelServerAndServiceTypes(callback, metadataTypesNeeded, criteria, cachedTypes);
} else {
- loadRequestedTypes(callback, metadataTypes, criteria, cachedTypes);
+ loadRequestedTypes(callback, metadataTypesNeeded, criteria, cachedTypes);
}
}
@@ -370,14 +385,7 @@ public class ResourceTypeRepository {
cachedType.setSubCategory(type.getSubCategory());
break;
case driftDefinitionTemplates:
- if (cachedType.getDriftDefinitionTemplates() != null) {
- cachedType.getDriftDefinitionTemplates().clear(); // remove any old ones hanging around
- }
- if (type.getDriftDefinitionTemplates() != null) {
- for (DriftDefinitionTemplate template : type.getDriftDefinitionTemplates()) {
- cachedType.addDriftDefinitionTemplate(template);
- }
- }
+ cachedType.setDriftDefinitionTemplates(type.getDriftDefinitionTemplates());
break;
default:
Log.error("ERROR: metadataType " + metadataType.name()
@@ -392,17 +400,17 @@ public class ResourceTypeRepository {
}
if (metadataTypes != null && !metadataTypes.isEmpty()) {
- if (typeCacheLevel.containsKey(type.getId())) {
- typeCacheLevel.get(type.getId()).addAll(metadataTypes);
- } else {
- for (MetadataType metadataType : metadataTypes) {
- if (metadataType.isCachedMetadata) {
- typeCacheLevel.put(type.getId(), EnumSet.copyOf(metadataTypes));
- }
+ EnumSet<MetadataType> cachedMetadata = typeCacheLevel.get(type.getId());
+ cachedMetadata = (null == cachedMetadata) ? EnumSet.noneOf(MetadataType.class) : cachedMetadata;
+ for (MetadataType metadataType : metadataTypes) {
+ if (!metadataType.isFetchAlways()) {
+ cachedMetadata.add(metadataType);
}
}
+ typeCacheLevel.put(type.getId(), cachedMetadata);
}
}
+
if (callback != null) {
callback.onTypesLoaded(cachedTypes);
}
commit 943c020ba2c50878efbf134def1db714d09507a3
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Oct 28 12:59:00 2011 -0400
Change DriftSnapshotView to inline drift details via another level of
expanded rows. This removes a lot of complicated navigation in the UI
(deep anchors, back button issues, lack of context). It also ends up
taking advantage of all the snapshot context already on the page, and
keeping the user in one consolidated, robust snapshot view.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index 1985cd4..d3ef464 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -528,20 +528,6 @@ public class LinkManager {
return "#Resource/" + resourceId + "/Drift/Definitions/" + driftDefId + "/Snapshot/" + version;
}
- public static String getDriftCarouselSnapshotDriftLink(int resourceId, int driftDefId, int version, String driftId) {
- if (!driftId.startsWith(StringIDTableSection.ID_PREFIX)) {
- driftId = StringIDTableSection.ID_PREFIX + driftId;
- }
-
- // TODO: for now, just make this the same as the carousel drift link. The downside is that the back button
- // will bring us back to the carousel and not the snapshot view. Eventually would like another
- // master-detail relationship here, but it's hairy to get this working.
- //
- // return "#Resource/" + resourceId + "/Drift/Definitions/" + driftDefId + "/Snapshot/" + version + "/" + driftId;
-
- return getDriftCarouselDriftLink(resourceId, driftDefId, driftId);
- }
-
public static String getDriftTemplateLink(int typeId, int templateId) {
String result = getAdminTemplatesEditLink(DriftDefinitionTemplateTypeView.VIEW_ID.getName(), typeId);
@@ -553,15 +539,4 @@ public class LinkManager {
return result + "/Snapshot";
}
-
- public static String getDriftTemplateSnapshotDriftLink(int typeId, int templateId, String driftId) {
- String result = getDriftTemplateSnapshotLink(typeId, templateId);
-
- if (!driftId.startsWith(StringIDTableSection.ID_PREFIX)) {
- driftId = StringIDTableSection.ID_PREFIX + driftId;
- }
-
- return result + "/" + driftId;
- }
-
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
index 8d7baf5..1dcf23b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDetailsView.java
@@ -88,7 +88,7 @@ public class DriftDetailsView extends LocatableVLayout {
}
- private void show(DriftDetails driftDetails) {
+ protected void show(DriftDetails driftDetails) {
for (Canvas child : getMembers()) {
removeMember(child);
child.destroy();
@@ -223,7 +223,7 @@ public class DriftDetailsView extends LocatableVLayout {
return changeSetForm;
}
- private FormItem createViewFileLink(String hash, String path, int version, DriftFileStatus status) {
+ protected FormItem createViewFileLink(String hash, String path, int version, DriftFileStatus status) {
if (status == LOADED) {
return createViewFileLink(hash, path, version);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotDriftDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotDriftDetailsView.java
new file mode 100644
index 0000000..549d43c
--- /dev/null
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotDriftDetailsView.java
@@ -0,0 +1,82 @@
+/*
+ * RHQ Management Platform
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.gui.coregui.client.drift;
+
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.FormItem;
+import com.smartgwt.client.widgets.form.fields.SpacerItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+
+import org.rhq.core.domain.drift.DriftDetails;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm;
+
+/**
+ * Similar to {@link DriftDetailsView} but omits information already present from the context of the
+ * snapshot view.
+ *
+ * @author Jay Shaughnessy
+ */
+public class DriftSnapshotDriftDetailsView extends DriftDetailsView {
+
+ public DriftSnapshotDriftDetailsView(String locatorId, String driftId) {
+ super(locatorId, driftId);
+ }
+
+ @Override
+ protected void show(DriftDetails driftDetails) {
+ for (Canvas child : getMembers()) {
+ removeMember(child);
+ child.destroy();
+ }
+
+ DynamicForm driftForm = new LocatableDynamicForm(extendLocatorId("form"));
+ //driftForm.setIsGroup(true);
+ //driftForm.setGroupTitle(MSG.view_tabs_common_drift());
+ driftForm.setWrapItemTitles(false);
+ driftForm.setNumCols(4);
+
+ SpacerItem spacer = new SpacerItem();
+
+ //StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
+ //id.setValue(driftDetails.getDrift().getId());
+
+ StaticTextItem path = new StaticTextItem("path", MSG.common_title_path());
+ path.setValue(driftDetails.getDrift().getPath());
+
+ StaticTextItem file = new StaticTextItem("File", MSG.view_tabs_common_content());
+ FormItem fileLink = null;
+
+ if (driftDetails.isBinaryFile()) {
+ file.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ fileLink = spacer;
+ driftForm.setItems(path, spacer, file, fileLink);
+
+ } else {
+ file.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
+ fileLink = createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(), driftDetails
+ .getDrift().getPath(), driftDetails.getChangeSet().getVersion(), driftDetails.getNewFileStatus());
+ driftForm.setItems(path, spacer, file, fileLink);
+ }
+
+ addMember(driftForm);
+ }
+}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
index e0996eb..e02f23e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
@@ -29,16 +29,19 @@ import com.smartgwt.client.data.DSResponse;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.rpc.RPCResponse;
import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.Autofit;
import com.smartgwt.client.types.ExpansionMode;
import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.events.DoubleClickEvent;
-import com.smartgwt.client.widgets.events.DoubleClickHandler;
-import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.HoverCustomizer;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.RecordCollapseEvent;
+import com.smartgwt.client.widgets.grid.events.RecordCollapseHandler;
+import com.smartgwt.client.widgets.grid.events.RecordExpandEvent;
+import com.smartgwt.client.widgets.grid.events.RecordExpandHandler;
import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
import org.rhq.core.domain.criteria.DriftDefinitionTemplateCriteria;
@@ -53,7 +56,6 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.ImageManager;
import org.rhq.enterprise.gui.coregui.client.LinkManager;
import org.rhq.enterprise.gui.coregui.client.components.table.AbstractTableAction;
-import org.rhq.enterprise.gui.coregui.client.components.table.StringIDTableSection;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableActionEnablement;
import org.rhq.enterprise.gui.coregui.client.components.table.TimestampCellFormatter;
@@ -63,7 +65,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/**
* A view that displays a nested table view of a snapshot. The outer table is a list of directories in the snapshot
@@ -72,8 +73,6 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
*
* @author Jay Shaughnessy
*/
-// TODO: Make this extend an abstract table so we can set up true master-detail
-//public class DriftSnapshotView extends StringIDTableSection<DriftSnapshotDataSource> {
public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
private static final String DEFAULT_TITLE = MSG.view_drift_table_snapshot();
@@ -84,7 +83,6 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
private boolean hasWriteAccess;
private String templateChangeSetId;
- private int templateResourceTypeId;
protected DriftSnapshotDataSource dataSource;
protected DriftSnapshotListGrid listGrid;
@@ -134,7 +132,7 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
@Override
protected void onDraw() {
- // Drift def snapshot view
+ // Drift def snapshot view or template pinned snapshot?
if (null != this.driftDefId) {
DriftDefinitionCriteria defCriteria = new DriftDefinitionCriteria();
defCriteria.addFilterId(driftDefId);
@@ -177,7 +175,7 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
String templateName = template.getName();
String title = MSG.view_drift_table_title_templateSnapshot(templateName);
setTitleString(title);
- templateResourceTypeId = template.getResourceType().getId();
+
DriftSnapshotView.super.onDraw();
}
});
@@ -247,6 +245,9 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
setCanExpandRecords(true);
setCanExpandMultipleRecords(true);
setExpansionMode(ExpansionMode.RELATED);
+
+ //setDefaultHeight(10);
+ //setAutoFitData(Autofit.VERTICAL);
}
@Override
@@ -258,7 +259,8 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
}
}
- public class DirectoryView extends StringIDTableSection<DirectoryView.DirectoryViewDataSource> {
+ //public class DirectoryView extends StringIDTableSection<DirectoryView.DirectoryViewDataSource> {
+ public class DirectoryView extends Table<DirectoryView.DirectoryViewDataSource> {
private String directory;
private DirectoryViewDataSource dataSource;
@@ -273,7 +275,8 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
setShowFooter(false);
setWidth100();
- setHeight(250);
+ setAutoHeight();
+ setOverflow(Overflow.VISIBLE);
setDataSource(getDataSource());
}
@@ -289,56 +292,65 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
}
@Override
+ protected LocatableListGrid createListGrid(String locatorId) {
+ return new DirectoryViewListGrid(locatorId);
+ }
+
+ @Override
protected void configureTable() {
ArrayList<ListGridField> dataSourceFields = getDataSource().getListGridFields();
getListGrid().setFields(dataSourceFields.toArray(new ListGridField[dataSourceFields.size()]));
super.configureTable();
+ }
- // TODO: when we have true detail support then we'll want to remove this.
- setListGridDoubleClickHandler(new DoubleClickHandler() {
- @Override
- public void onDoubleClick(DoubleClickEvent event) {
- ListGrid listGrid = (ListGrid) event.getSource();
- ListGridRecord[] selectedRows = listGrid.getSelection();
- if (selectedRows != null && selectedRows.length == 1) {
- String driftId = getId(selectedRows[0]);
- String link = (null == templateId) ? LinkManager.getDriftCarouselSnapshotDriftLink(resourceId,
- driftDefId, version, driftId) : LinkManager.getDriftTemplateSnapshotDriftLink(
- templateResourceTypeId, templateId, driftId);
- CoreGUI.goToView(link);
+ private class DirectoryViewListGrid extends LocatableListGrid {
- }
- }
- });
- }
+ public DirectoryViewListGrid(String locatorId) {
+ super(locatorId);
- @Override
- protected String getDetailsLinkColumnName() {
- return DriftDataSource.ATTR_CTIME;
- }
+ setCanExpandRecords(true);
+ setCanExpandMultipleRecords(true);
+ setExpansionMode(ExpansionMode.RELATED);
- @Override
- protected CellFormatter getDetailsLinkColumnCellFormatter() {
- // TODO: provide a drift detail view for the template snapshot view
- if (null == templateId) {
- return new CellFormatter() {
- public String format(Object value, ListGridRecord record, int i, int i1) {
- String driftId = getId(record);
- String link = (null == templateId) ? LinkManager.getDriftCarouselSnapshotDriftLink(resourceId,
- driftDefId, version, driftId) : LinkManager.getDriftTemplateSnapshotDriftLink(
- templateResourceTypeId, templateId, driftId);
-
- String formattedValue = TimestampCellFormatter.format(value);
- return SeleniumUtility.getLocatableHref(link, formattedValue, null);
+ setDefaultHeight(10);
+ setAutoFitData(Autofit.VERTICAL);
+
+ addRecordExpandHandler(new RecordExpandHandler() {
+
+ @Override
+ public void onRecordExpand(RecordExpandEvent event) {
+ event.getRecord().setAttribute("Expanded", true);
}
- };
- } else {
- return new CellFormatter() {
- public String format(Object value, ListGridRecord record, int i, int i1) {
- return TimestampCellFormatter.format(value);
+ });
+
+ addRecordCollapseHandler(new RecordCollapseHandler() {
+
+ @Override
+ public void onRecordCollapse(RecordCollapseEvent event) {
+ event.getRecord().setAttribute("Expanded", false);
}
- };
+ });
+
+ }
+
+ @Override
+ protected String getCellCSSText(ListGridRecord record, int rowNum, int colNum) {
+
+ if (Boolean.TRUE.equals(record.getAttributeAsBoolean("Expanded"))) {
+ return "background-color:#ffffcc;";
+ }
+
+ return super.getCellCSSText(record, rowNum, colNum);
+
+ }
+
+ @Override
+ protected Canvas getExpansionComponent(ListGridRecord record) {
+
+ String driftId = record.getAttribute(DriftDataSource.ATTR_ID);
+
+ return new DriftSnapshotDriftDetailsView(extendLocatorId(driftId), driftId);
}
}
@@ -491,11 +503,6 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
return record;
}
}
-
- @Override
- public Canvas getDetailsView(String driftId) {
- return new DriftDetailsView(extendLocatorId("Details"), driftId);
- }
}
/**
@@ -513,21 +520,4 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
return (i < 0) ? path.trim() : path.substring(++i).trim();
}
-
- // TODO: Make this extend an abstract table so we can set up true master-detail
-
- /*
- @Override
- public void renderView(ViewPath viewPath) {
- viewPath.next();
- super.renderView(viewPath);
- }
-
-
- @Override
- public Canvas getDetailsView(String driftId) {
- return new DriftDetailsView(extendLocatorId("Details"), driftId);
- }
- */
-
}
commit 21fd17d6c48ff7c8afee9213ca3cae8f6069d8ce
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Oct 28 12:55:34 2011 -0400
Log failures to reschedule EJB timers. If they don't get rescheduled bad
things can happen, server restart is probably going to be needed.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java
index 2de7bad..51ed428 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/CacheConsistencyManagerBean.java
@@ -89,7 +89,13 @@ public class CacheConsistencyManagerBean implements CacheConsistencyManagerLocal
log.error("Failed to reload server cache if needed - will try again later. Cause: " + t);
} finally {
// reschedule ourself to trigger in another 30 seconds
- timerService.createTimer(30000, TIMER_DATA);
+ try {
+ timerService.createTimer(30000, TIMER_DATA);
+ } catch (Throwable t) {
+ log
+ .error("Failed to reschedule cache reload timer! Cache reload handling will not work from this point. A server restart may be needed after issue is resolved:"
+ + t);
+ }
}
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java
index be91c65..cc8c435 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/instance/ServerManagerBean.java
@@ -119,10 +119,15 @@ public class ServerManagerBean implements ServerManagerLocal {
} catch (Throwable t) {
log.error("Failed to handle cloud heartbeat timer - will try again later. Cause: " + t);
} finally {
- // reschedule ourself to trigger in another 30 seconds
- timerService.createTimer(30000, TIMER_DATA);
+ // reschedule ourself to trigger in another 30 seconds
+ try {
+ timerService.createTimer(30000, TIMER_DATA);
+ } catch (Throwable t) {
+ log
+ .error("Failed to reschedule cloud heartbeat timer! Server status handling will not work from this point. A server restart may be needed after issue is resolved:"
+ + t);
+ }
}
-
}
public int create(Server server) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index 05d4649..44e48b5 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -60,8 +60,8 @@ import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.domain.common.ServerDetails;
-import org.rhq.core.domain.common.ServerDetails.Detail;
import org.rhq.core.domain.common.SystemConfiguration;
+import org.rhq.core.domain.common.ServerDetails.Detail;
import org.rhq.core.domain.common.composite.SystemSetting;
import org.rhq.core.domain.common.composite.SystemSettings;
import org.rhq.core.domain.configuration.definition.PropertySimpleType;
@@ -152,7 +152,13 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
log.error("Failed to reload the system config cache - will try again later. Cause: " + t);
} finally {
// reschedule ourself to trigger in another 60 seconds
- timerService.createTimer(60000L, TIMER_DATA);
+ try {
+ timerService.createTimer(60000L, TIMER_DATA);
+ } catch (Throwable t) {
+ log
+ .error("Failed to reschedule system config cache reload timer! System config cache reload handling will not work from this point. A server restart may be needed after issue is resolved:"
+ + t);
+ }
}
}
@@ -181,16 +187,16 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
@Deprecated
public Properties getSystemConfiguration(Subject subject) {
Properties copy = new Properties();
-
+
SystemSettings settings = getSystemSettings(subject);
- for(Map.Entry<SystemSetting, String> e : settings.entrySet()) {
+ for (Map.Entry<SystemSetting, String> e : settings.entrySet()) {
//transform the value back to the database format, because that's
//what this method always returned
String value = transformSystemConfigurationProperty(e.getKey(), e.getValue(), false);
-
+
copy.put(e.getKey().getInternalName(), value);
}
-
+
return copy;
}
@@ -245,19 +251,22 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
//them to "false"/"true" and store that value to database. This is a one way operation
//and therefore we need to compare the database-agnostic (i.e. "true"/"false") and
//not database specific.
- String existingValue = transformSystemConfigurationProperty(prop, existingConfig.getPropertyValue(), true);
-
+ String existingValue = transformSystemConfigurationProperty(prop, existingConfig.getPropertyValue(),
+ true);
+
if ((existingValue == null && value != null) || !existingValue.equals(value)) {
//SystemSetting#isReadOnly should be a superset of the "fReadOnly" field in the database
//but let's just be super paranoid here...
- if (prop.isReadOnly() || (existingConfig.getFreadOnly() != null && existingConfig.getFreadOnly().booleanValue())) {
+ if (prop.isReadOnly()
+ || (existingConfig.getFreadOnly() != null && existingConfig.getFreadOnly().booleanValue())) {
throw new IllegalArgumentException("The setting [" + prop.getInternalName()
- + "] is read-only - you cannot change its current value! Current value is [" + existingConfig.getPropertyValue() + "] while the new value was [" + value + "].");
+ + "] is read-only - you cannot change its current value! Current value is ["
+ + existingConfig.getPropertyValue() + "] while the new value was [" + value + "].");
}
-
+
//transform to the database-specific format
value = transformSystemConfigurationProperty(prop, value, false);
-
+
existingConfig.setPropertyValue(value);
entityManager.merge(existingConfig);
}
@@ -288,9 +297,9 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
String value = transformSystemConfigurationProperty(prop, e.getValue(), true);
e.setValue(value);
}
- }
+ }
}
-
+
private Map<String, String> getDriftServerPlugins() {
DriftServerPluginManager pluginMgr = getDriftServerPluginManager();
Map<String, String> plugins = new HashMap<String, String>();
@@ -362,9 +371,9 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
@Deprecated
public void setSystemConfiguration(Subject subject, Properties properties, boolean skipValidation) throws Exception {
Map<String, String> map = toMap(properties);
-
+
transformToSystemSettingsFormat(map);
-
+
SystemSettings settings = SystemSettings.fromMap(map);
setSystemSettings(settings, skipValidation);
@@ -374,9 +383,9 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
public void validateSystemConfiguration(Subject subject, Properties properties)
throws InvalidSystemConfigurationException {
Map<String, String> map = toMap(properties);
-
+
transformToSystemSettingsFormat(map);
-
+
SystemSettings settings = SystemSettings.fromMap(map);
for (Map.Entry<SystemSetting, String> e : settings.entrySet()) {
SystemSetting prop = e.getKey();
@@ -389,7 +398,7 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
/**
* Call this to transform a system setting to a more appropriate value.
*/
- private String transformSystemConfigurationProperty(SystemSetting prop, String value, boolean fromDb) {
+ private String transformSystemConfigurationProperty(SystemSetting prop, String value, boolean fromDb) {
if (fromDb) {
// to support Oracle (whose booleans may be 1 or 0) transform the boolean settings properly
switch (prop) {
@@ -414,13 +423,13 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
return Boolean.TRUE.toString();
}
}
- }
+ }
} else {
//toDB
//the 0,1 -> true false scenario is no problem here, because the values are stored
//as string anyway (so no conversion is done). I assume the above is a historical
//code that could be safely eliminated.
- switch(prop) {
+ switch (prop) {
case LDAP_BASED_JAAS_PROVIDER:
if (Boolean.parseBoolean(value)) {
return RHQConstants.LDAPJAASProvider;
@@ -435,7 +444,7 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
}
}
}
-
+
return value;
}
@@ -693,8 +702,7 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
public boolean isDebugModeEnabled() {
try {
Subject su = this.subjectManager.getOverlord();
- String setting = getSystemSettings(su).get(
- SystemSetting.DEBUG_MODE_ENABLED);
+ String setting = getSystemSettings(su).get(SystemSetting.DEBUG_MODE_ENABLED);
if (setting == null) {
setting = "false";
}
@@ -707,8 +715,7 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
public boolean isExperimentalFeaturesEnabled() {
try {
Subject su = this.subjectManager.getOverlord();
- String setting = getSystemSettings(su).get(
- SystemSetting.EXPERIMENTAL_FEATURES_ENABLED);
+ String setting = getSystemSettings(su).get(SystemSetting.EXPERIMENTAL_FEATURES_ENABLED);
if (setting == null) {
setting = "false";
}
@@ -733,7 +740,7 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
&& (((groupFilter != null) && groupFilter.trim().length() > 0) || ((groupMember != null) && groupMember
.trim().length() > 0));
}
-
+
@RequiredPermission(Permission.MANAGE_SETTINGS)
public ServerDetails getServerDetails(Subject subject) {
CoreServerMBean coreServerMBean = LookupUtil.getCoreServer();
12 years, 6 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/jar/pom.xml | 1 -
1 file changed, 1 deletion(-)
New commits:
commit e721ef78d7d9f0f44302113b615a2a387e44ef79
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 13:43:50 2011 -0400
no longer need to exclude drift tests in server/jar
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index c8a2707..7206726 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -610,7 +610,6 @@ Build-OS-Version=${os.version}
<excludes>
<exclude>com/**/*.java</exclude>
<exclude>org/rhq/**/performance/**/*.java</exclude>
- <exclude>**/drift/*.java</exclude>
</excludes>
<excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
<groups>${rhq.testng.includedGroups}</groups>
12 years, 6 months
[rhq] 3 commits - modules/enterprise
by John Sanda
modules/enterprise/server/itests/pom.xml | 263 ++++
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java | 146 ++
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java | 25
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java | 241 +++
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java | 603 ++++++++++
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java | 32
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java | 309 +++++
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java | 223 +++
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java | 236 +++
modules/enterprise/server/itests/src/test/resources/META-INF/ejb-jar.xml | 28
modules/enterprise/server/itests/src/test/resources/binary-blob-sample.jar |binary
modules/enterprise/server/itests/src/test/resources/default.persistence.properties | 22
modules/enterprise/server/itests/src/test/resources/ejb3-interceptors-aop.xml | 360 +++++
modules/enterprise/server/itests/src/test/resources/embedded-jboss-beans.xml | 160 ++
modules/enterprise/server/itests/src/test/resources/jboss-jms-beans.xml | 132 ++
modules/enterprise/server/itests/src/test/resources/jms-ra.rar |binary
modules/enterprise/server/itests/src/test/resources/jndi.properties | 2
modules/enterprise/server/itests/src/test/resources/log4j.xml | 74 +
modules/enterprise/server/itests/src/test/resources/login-config.xml | 72 +
modules/enterprise/server/itests/src/test/resources/rhq-mdb-beans.xml | 25
modules/enterprise/server/itests/src/test/resources/security-beans.xml | 13
modules/enterprise/server/itests/src/test/resources/test-assist-color-number.txt | 46
modules/enterprise/server/itests/src/test/resources/test-ldap.properties | 2
modules/enterprise/server/itests/src/test/resources/test-scheduler.properties | 29
modules/enterprise/server/itests/src/test/resources/testng.xml | 12
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java | 146 --
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java | 25
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java | 242 ----
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java | 600 ---------
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/InitDB.java | 32
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java | 306 -----
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java | 222 ---
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java | 235 ---
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java | 15
modules/enterprise/server/pom.xml | 1
35 files changed, 3067 insertions(+), 1812 deletions(-)
New commits:
commit 4e43b362bc67c5659c354d4d0a962ac1181702b1
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 13:35:21 2011 -0400
removing unnecessary dependencies
diff --git a/modules/enterprise/server/itests/pom.xml b/modules/enterprise/server/itests/pom.xml
index 6d871a1..f512aed 100644
--- a/modules/enterprise/server/itests/pom.xml
+++ b/modules/enterprise/server/itests/pom.xml
@@ -15,8 +15,8 @@
<description>RHQ enterprise server integration tests</description>
<scm>
- <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</connection>
- <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</developerConnection>
+ <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</connection>
+ <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</developerConnection>
</scm>
<properties>
@@ -26,42 +26,6 @@
</properties>
<dependencies>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-comm</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-common-drift</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.java-diff-utils</groupId>
- <artifactId>diffutils</artifactId>
- <version>1.2.1</version>
- </dependency>
-
<!--================ Test Deps ================-->
<!-- Note, the test deps are intentionally placed above the other scoped deps because of classpath
@@ -140,19 +104,12 @@
<!-- NOTE: The remaining test deps correspond to the classes contained in hibernate-all.jar and thirdparty-all.jar. -->
<dependency>
- <groupId>antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>2.7.7</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>jboss</groupId>
<artifactId>javassist</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
<scope>test</scope>
</dependency>
+ <!-- needed by embedded ejb container -->
<dependency>
<groupId>trove</groupId>
<artifactId>trove</artifactId>
@@ -160,6 +117,7 @@
<scope>test</scope>
</dependency>
+ <!-- needed by embedded ejb container -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
@@ -167,63 +125,8 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>net.sf.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- <version>1.8</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-jxpath</groupId>
- <artifactId>commons-jxpath</artifactId>
- <version>1.3</version>
- <scope>test</scope>
- </dependency>
-
-
<!-- 3rd Party Deps -->
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>3.2</version>
- </dependency>
-
- <!-- Required by a couple APL and Lather classes - TODO: Remove this once APL and Lather have been excised. -->
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.6.1</version>
- </dependency>
-
- <!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
- <!-- also required by EJB3 Embedded (test scope) -->
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- </dependency>
-
- <!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>1.1.4</version>
- </dependency>
-
<!-- required by RHQ server classes, as well as EJB3 Embedded -->
<dependency>
<groupId>dom4j</groupId>
@@ -233,12 +136,6 @@
</dependency>
<dependency>
- <groupId>gnu-getopt</groupId>
- <artifactId>getopt</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
-
- <dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
@@ -255,22 +152,13 @@
<dependency>
<groupId>hibernate-entitymanager</groupId>
<artifactId>hibernate-entitymanager</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>i18nlog</groupId>
- <artifactId>i18nlog</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
- <!-- The Sun javamail jar isn't available from a public repo due to licensing issues,
- so use the Geronimo one instead. -->
- <version>1.3</version>
- <scope>provided</scope> <!-- by JBossAS -->
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
</dependency>
<dependency>
@@ -281,47 +169,12 @@
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
<groupId>jboss</groupId>
<artifactId>jboss-annotations-ejb3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
<scope>provided</scope> <!-- by JBossAS -->
</dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-cache</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3x</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
<!-- includes the org.jboss.ejb3.StrictMaxPool class, which is needed by the PoolClass annotation used on some
of our SLSB's -->
<dependency>
@@ -331,40 +184,6 @@
<scope>provided</scope> <!-- by JBossAS -->
</dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-jmx</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-system</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbosssx</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbpm</artifactId>
- <version>3.1.1</version>
- </dependency>
-
<!-- for the transaction interrupt EJB3 interceptor -->
<dependency>
<groupId>org.jboss.transaction</groupId>
@@ -387,92 +206,20 @@
<scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
</dependency>
+ <!-- This is needed cglib which is in turn needed by hibernate -->
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymockclassextension</artifactId>
<version>2.2</version>
<scope>test</scope>
- <!-- somehow this is needed otherwise the hibernate stuff doesn't initialize in our tests -->
- </dependency>
-
- <dependency>
- <groupId>org.snmp4j</groupId>
- <artifactId>snmp4j</artifactId>
- <version>1.8.2</version>
</dependency>
- <!-- required by RHQ server classes, as well as EJB3 Embedded -->
- <dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4</version>
- </dependency>
-
- <!-- TODO: Why is this needed? -->
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <!--<scope>test</scope>-->
- </dependency>
-
- <dependency>
- <groupId>rss4j</groupId>
- <artifactId>rss4j</artifactId>
- <version>0.92-on.2</version>
- </dependency>
-
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>5.5.20</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>tomcat-jk</artifactId>
- <version>4.1.31</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Needed by com.jboss.jbossnetwork.apl.actions.xml.XPathProcessor; TODO: Remove once APL has been excised. -->
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.5.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.29</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- <version>2.0.1.GA</version>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.18</version>
<scope>provided</scope>
</dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-dbutils</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
</dependencies>
<build>
@@ -487,45 +234,6 @@
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
-
- <execution>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
- <!-- generate the I18N resource bundles -->
- <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask" />
-
- <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false" verify="true">
- <classpath refid="maven.runtime.classpath" />
- <classfileset dir="${project.build.outputDirectory}">
- <include name="**/ServerI18NResourceKeys.class" />
- <include name="**/AlertI18NResourceKeys.class" />
- </classfileset>
- </i18n>
-
- <!-- create our rhq-server-version.properties file that goes in our jar -->
- <tstamp>
- <format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z" />
- </tstamp>
-
- <echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
-Product-Version=${project.version}
-Module-Name=${project.name}
-Module-Version=${project.version}
-Build-Number=${buildNumber}
-Build-Date=${build.time}
-Build-Jdk-Vendor=${java.vendor}
-Build-Jdk=${java.version}
-Build-OS-Name=${os.name}
-Build-OS-Version=${os.version}
-</echo>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
<!-- in order to get JMS to work properly in embedded test container, extract jms-rs.rar classes -->
<execution>
<id>Extract JMS classes from RAR needed for JMS tests</id>
@@ -548,7 +256,6 @@ Build-OS-Version=${os.version}
<goal>run</goal>
</goals>
</execution>
-
</executions>
</plugin>
</plugins>
commit 1638bd05e17adba209a49fec0a3846a78367b35f
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 11:34:11 2011 -0400
Renaming module integration-tests to itests
diff --git a/modules/enterprise/server/integration-tests/pom.xml b/modules/enterprise/server/integration-tests/pom.xml
deleted file mode 100644
index 7c29615..0000000
--- a/modules/enterprise/server/integration-tests/pom.xml
+++ /dev/null
@@ -1,556 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
-
- <artifactId>rhq-server-integration-tests</artifactId>
-
- <name>RHQ Server Integration Tests</name>
- <description>RHQ enterprise server integration tests</description>
-
- <scm>
- <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</connection>
- <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</developerConnection>
- </scm>
-
- <properties>
- <rhq.server.datasource>java:/RHQDS</rhq.server.datasource>
- <rhq.server.ds-mapping>PostgreSQL</rhq.server.ds-mapping>
- <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-comm</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-common-drift</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.java-diff-utils</groupId>
- <artifactId>diffutils</artifactId>
- <version>1.2.1</version>
- </dependency>
-
- <!--================ Test Deps ================-->
-
- <!-- Note, the test deps are intentionally placed above the other scoped deps because of classpath
- reasons. Maven orders the [test] classpath in the order listed in the pom. We specifically
- need the embeddable-ejb3 jar above the standard ejb3 jars because we need the embeddble packages
- loaded when testing. -->
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>test-utils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.rhq.helpers</groupId>
- <artifactId>perftest-support</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant-launcher</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>jboss-ejb3-all</artifactId>
- <version>${jboss-embeddable-ejb3.version}</version>
- <scope>test</scope>
- </dependency>
-
- <!-- NOTE: The remaining test deps correspond to the classes contained in hibernate-all.jar and thirdparty-all.jar. -->
-
- <dependency>
- <groupId>antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>2.7.7</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>javassist</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- <version>1.0.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sf.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- <version>1.8</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-jxpath</groupId>
- <artifactId>commons-jxpath</artifactId>
- <version>1.3</version>
- <scope>test</scope>
- </dependency>
-
-
- <!-- 3rd Party Deps -->
-
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>3.2</version>
- </dependency>
-
- <!-- Required by a couple APL and Lather classes - TODO: Remove this once APL and Lather have been excised. -->
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.6.1</version>
- </dependency>
-
- <!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
- <!-- also required by EJB3 Embedded (test scope) -->
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- </dependency>
-
- <!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>1.1.4</version>
- </dependency>
-
- <!-- required by RHQ server classes, as well as EJB3 Embedded -->
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>1.6.1-jboss</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>gnu-getopt</groupId>
- <artifactId>getopt</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
-
- <dependency>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>hibernate-annotations</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>hibernate-entitymanager</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>i18nlog</groupId>
- <artifactId>i18nlog</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
- <!-- The Sun javamail jar isn't available from a public repo due to licensing issues,
- so use the Geronimo one instead. -->
- <version>1.3</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-annotations-ejb3</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-cache</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3x</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <!-- includes the org.jboss.ejb3.StrictMaxPool class, which is needed by the PoolClass annotation used on some
- of our SLSB's -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-jmx</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-system</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbosssx</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbpm</artifactId>
- <version>3.1.1</version>
- </dependency>
-
- <!-- for the transaction interrupt EJB3 interceptor -->
- <dependency>
- <groupId>org.jboss.transaction</groupId>
- <artifactId>jboss-jta</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>org.opensymphony.quartz</groupId>
- <artifactId>quartz</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
- </dependency>
-
- <dependency>
- <groupId>org.opensymphony.quartz</groupId>
- <artifactId>quartz-oracle</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymockclassextension</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- <!-- somehow this is needed otherwise the hibernate stuff doesn't initialize in our tests -->
- </dependency>
-
- <dependency>
- <groupId>org.snmp4j</groupId>
- <artifactId>snmp4j</artifactId>
- <version>1.8.2</version>
- </dependency>
-
- <!-- required by RHQ server classes, as well as EJB3 Embedded -->
- <dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4</version>
- </dependency>
-
- <!-- TODO: Why is this needed? -->
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <!--<scope>test</scope>-->
- </dependency>
-
- <dependency>
- <groupId>rss4j</groupId>
- <artifactId>rss4j</artifactId>
- <version>0.92-on.2</version>
- </dependency>
-
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>5.5.20</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>tomcat-jk</artifactId>
- <version>4.1.31</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Needed by com.jboss.jbossnetwork.apl.actions.xml.XPathProcessor; TODO: Remove once APL has been excised. -->
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.5.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.29</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- <version>2.0.1.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>2.3.18</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-dbutils</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- </testResources>
-
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
- <!-- generate the I18N resource bundles -->
- <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask" />
-
- <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false" verify="true">
- <classpath refid="maven.runtime.classpath" />
- <classfileset dir="${project.build.outputDirectory}">
- <include name="**/ServerI18NResourceKeys.class" />
- <include name="**/AlertI18NResourceKeys.class" />
- </classfileset>
- </i18n>
-
- <!-- create our rhq-server-version.properties file that goes in our jar -->
- <tstamp>
- <format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z" />
- </tstamp>
-
- <echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
-Product-Version=${project.version}
-Module-Name=${project.name}
-Module-Version=${project.version}
-Build-Number=${buildNumber}
-Build-Date=${build.time}
-Build-Jdk-Vendor=${java.vendor}
-Build-Jdk=${java.version}
-Build-OS-Name=${os.name}
-Build-OS-Version=${os.version}
-</echo>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <!-- in order to get JMS to work properly in embedded test container, extract jms-rs.rar classes -->
- <execution>
- <id>Extract JMS classes from RAR needed for JMS tests</id>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
- <unzip src="src/test/resources/jms-ra.rar" dest="target">
- <patternset>
- <include name="jms-ra.jar"/>
- </patternset>
- </unzip>
- <unzip src="target/jms-ra.jar" dest="target/test-classes">
- <patternset>
- <include name="org/**"/>
- </patternset>
- </unzip>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java
deleted file mode 100644
index 64c6537..0000000
--- a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.plugin.PluginKey;
-import org.rhq.core.domain.plugin.PluginStatusType;
-import org.rhq.core.domain.plugin.ServerPlugin;
-import org.rhq.core.util.MessageDigestGenerator;
-import org.rhq.enterprise.server.plugin.pc.AbstractTypeServerPluginContainer;
-import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainer;
-import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainerConfiguration;
-import org.rhq.enterprise.server.plugin.pc.ServerPluginEnvironment;
-import org.rhq.enterprise.server.plugin.pc.ServerPluginManager;
-import org.rhq.enterprise.server.plugin.pc.ServerPluginService;
-import org.rhq.enterprise.server.plugin.pc.ServerPluginType;
-import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginContainer;
-import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginManager;
-import org.rhq.enterprise.server.xmlschema.ServerPluginDescriptorMetadataParser;
-import org.rhq.enterprise.server.xmlschema.generated.serverplugin.ServerPluginDescriptorType;
-
-public class DriftServerPluginService extends ServerPluginService implements DriftServerPluginServiceMBean {
-
- public TestMasterServerPluginContainer master;
- public MasterServerPluginContainerConfiguration masterConfig;
-
- public DriftServerPluginService() {
- // build the config at constructor time so tests have it even before the PC is initialized
- File dir = new File(System.getProperty("java.io.tmpdir"), "test-server-plugins");
- this.masterConfig = new MasterServerPluginContainerConfiguration(dir, dir, dir, null);
- }
-
- @Override
- public MasterServerPluginContainer createMasterPluginContainer() {
- this.master = new TestMasterServerPluginContainer();
- this.master.initialize(this.masterConfig);
- return this.master;
- }
-
- class TestMasterServerPluginContainer extends MasterServerPluginContainer {
- @Override
- protected ClassLoader createRootServerPluginClassLoader() {
- return getClass().getClassLoader();
- }
-
- @Override
- protected Map<URL, ? extends ServerPluginDescriptorType> preloadAllPlugins() throws Exception {
- // if our test never setup any plugins, ignore it and just return an empty map
- File pluginDir = getConfiguration().getPluginDirectory();
- if (pluginDir == null || pluginDir.listFiles() == null || pluginDir.listFiles().length == 0) {
- return new HashMap<URL, ServerPluginDescriptorType>();
- } else {
- return super.preloadAllPlugins();
- }
- }
-
- @Override
- protected List<PluginKey> getDisabledPluginKeys() {
- // in the real world, the db is checked for enable flag, here we say all plugins are enabled
- return new ArrayList<PluginKey>();
- }
-
- @Override
- protected List<AbstractTypeServerPluginContainer> createPluginContainers() {
- ArrayList<AbstractTypeServerPluginContainer> pcs = new ArrayList<AbstractTypeServerPluginContainer>(1);
- DriftServerPluginContainer driftPC = new TestDriftServerPluginContainer(this);
- pcs.add(driftPC);
-
- return pcs;
- }
- }
-
- class TestDriftServerPluginContainer extends DriftServerPluginContainer {
- public TestDriftServerPluginContainer(MasterServerPluginContainer master) {
- super(master);
- }
-
- @Override
- protected ServerPluginManager createPluginManager() {
- return new TestDriftServerPluginManager(this);
- }
- }
-
- class TestDriftServerPluginManager extends DriftServerPluginManager {
- public TestDriftServerPluginManager(DriftServerPluginContainer pc) {
- super(pc);
- }
-
- @Override
- protected ServerPlugin getPlugin(ServerPluginEnvironment env) {
- try {
- Configuration pluginConfig = null;
- Configuration scheduledJobsConfig = null;
- ConfigurationDefinition configDef;
-
- ServerPluginDescriptorType pluginDescriptor = env.getPluginDescriptor();
-
- configDef = ServerPluginDescriptorMetadataParser.getPluginConfigurationDefinition(pluginDescriptor);
- if (configDef != null) {
- pluginConfig = configDef.getDefaultTemplate().createConfiguration();
- }
-
- configDef = ServerPluginDescriptorMetadataParser.getScheduledJobsDefinition(pluginDescriptor);
- if (configDef != null) {
- scheduledJobsConfig = configDef.getDefaultTemplate().createConfiguration();
- }
-
- File pluginFile = new File(env.getPluginUrl().toURI());
- ServerPlugin plugin = new ServerPlugin(0, env.getPluginKey().getPluginName(), pluginFile.getName(),
- pluginDescriptor.getDisplayName(), true, PluginStatusType.INSTALLED, pluginDescriptor
- .getDescription(), "", MessageDigestGenerator.getDigestString(pluginFile), pluginDescriptor
- .getVersion(), pluginDescriptor.getVersion(), pluginConfig, scheduledJobsConfig,
- new ServerPluginType(pluginDescriptor).stringify(), System.currentTimeMillis(), System
- .currentTimeMillis());
- return plugin;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
-}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java
deleted file mode 100644
index d38374e..0000000
--- a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
-
-public interface DriftServerPluginServiceMBean extends ServerPluginServiceManagement {
-}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
deleted file mode 100644
index 7db3365..0000000
--- a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static org.rhq.core.domain.resource.ResourceCategory.SERVER;
-import static org.rhq.enterprise.server.util.LookupUtil.getSubjectManager;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-import javax.persistence.NonUniqueResultException;
-
-import org.apache.commons.io.FileUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
-import org.rhq.core.domain.resource.Agent;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.shared.ResourceBuilder;
-import org.rhq.core.domain.shared.ResourceTypeBuilder;
-import org.rhq.enterprise.server.plugin.ServerPluginsLocal;
-import org.rhq.enterprise.server.test.AbstractEJB3Test;
-import org.rhq.enterprise.server.test.TestServerCommunicationsService;
-import org.rhq.test.TransactionCallback;
-
-@Test(groups = "drift")
-public class DriftServerTest extends AbstractEJB3Test {
-
- protected final String RESOURCE_TYPE_NAME = getClass().getSimpleName() + "_RESOURCE_TYPE";
-
- protected final String AGENT_NAME = getClass().getSimpleName() + "_AGENT";
-
- protected final String RESOURCE_NAME = getClass().getSimpleName() + "_RESOURCE";
-
- private ServerPluginsLocal serverPluginsMgr;
-
- protected DriftServerPluginService driftServerPluginService;
-
- protected TestServerCommunicationsService agentServiceContainer;
-
- protected ResourceType resourceType;
-
- protected Agent agent;
-
- protected Resource resource;
-
- @BeforeMethod
- public void initServices(Method testMethod) throws Exception {
- initDriftServer();
- initAgentServices();
-
- InitDB annotation = testMethod.getAnnotation(InitDB.class);
- if (annotation == null || annotation.value()) {
- initDB();
- }
- }
-
- private void initDriftServer() throws Exception {
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
-
- File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.1.0-SNAPSHOT.jar");
- assertTrue("Drift server plugin JAR file not found at" + jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
- FileUtils.copyFileToDirectory(jpaDriftPlugin, driftServerPluginService.masterConfig.getPluginDirectory());
-
- driftServerPluginService.startMasterPluginContainer();
-
- //serverPluginsMgr = LookupUtil.getServerPlugins();
- }
-
- private void initAgentServices() {
- agentServiceContainer = prepareForTestAgents();
- agentServiceContainer.driftService = new TestDefService();
- }
-
- @AfterMethod(inheritGroups = true)
- public void shutDownServices() throws Exception {
- shutDownDriftServer();
- shutDownAgentServices();
- }
-
- private void shutDownDriftServer() throws Exception {
- unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
- }
-
- private void shutDownAgentServices() {
- agentServiceContainer = null;
- unprepareForTestAgents();
- }
-
- @AfterClass(inheritGroups = true)
- public void cleanUpDB() throws Exception {
- purgeDB();
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- purgeDB(getEntityManager());
- }
- });
- }
-
- private void initDB() throws Exception {
- purgeDB();
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- initResourceType();
- initAgent();
- initResource();
-
- em.persist(resourceType);
- em.persist(agent);
- resource.setAgent(agent);
- em.persist(resource);
-
- initDB(em);
- }
- });
- }
-
- private void purgeDB() {
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- em.createQuery("delete from JPADrift ").executeUpdate();
- em.createQuery("delete from JPADriftChangeSet").executeUpdate();
- em.createQuery("delete from JPADriftSet").executeUpdate();
- em.createQuery("delete from JPADriftFile").executeUpdate();
- em.createQuery("delete from DriftDefinition").executeUpdate();
- em.createQuery("delete from DriftDefinitionTemplate").executeUpdate();
-
- deleteEntity(Resource.class, RESOURCE_NAME, em);
- deleteEntity(Agent.class, AGENT_NAME, em);
- deleteEntity(ResourceType.class, RESOURCE_TYPE_NAME, em);
-
- purgeDB(em);
- }
- });
- }
-
- protected void purgeDB(EntityManager em) {
- }
-
- protected void initDB(EntityManager em) {
- }
-
- protected void deleteEntity(Class<?> clazz, String name, EntityManager em) {
- try {
- Object entity = em.createQuery(
- "select entity from " + clazz.getSimpleName() + " entity where entity.name = :name")
- .setParameter("name", name)
- .getSingleResult();
- em.remove(entity);
- } catch (NoResultException e) {
- // we can ignore no results because this code will run when the db
- // is empty and we expect no results in that case
- } catch (NonUniqueResultException e) {
- // we will fail here to let the person running the test know that
- // the database may not be in a consistent state
- fail("Purging " + name + " failed. Expected to find one instance of " + clazz.getSimpleName() +
- " but found more than one. The database may not be in a consistent state.");
- }
- }
-
- protected void initResourceType() {
- resourceType = new ResourceTypeBuilder().createResourceType()
- .withId(0)
- .withName(RESOURCE_TYPE_NAME)
- .withCategory(SERVER)
- .withPlugin(RESOURCE_TYPE_NAME.toLowerCase())
- .build();
- }
-
- protected void initAgent() {
- agent = new Agent(AGENT_NAME, "localhost", 1, "", AGENT_NAME + "_TOKEN");
- }
-
- protected void initResource() {
- resource = new ResourceBuilder().createResource()
- .withId(0)
- .withName(RESOURCE_NAME)
- .withResourceKey(RESOURCE_NAME)
- .withRandomUuid()
- .withResourceType(resourceType)
- .build();
- }
-
- protected Subject getOverlord() {
- return getSubjectManager().getOverlord();
- }
-
- protected String toString(DriftDefinition def) {
- return "DriftDefinition[id: " + def.getId() + ", name: " + def.getName() + "]";
- }
-
- protected String toString(DriftDefinitionTemplate template) {
- return DriftDefinitionTemplate.class.getSimpleName() + "[id: " + template.getId() + ", name: " +
- template.getName() + "]";
- }
-
- protected Drift findDriftByPath(List<? extends Drift> drifts, String path) {
- for (Drift drift : drifts) {
- if (drift.getPath().equals(path)) {
- return drift;
- }
- }
- return null;
- }
-}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
deleted file mode 100644
index de93b74..0000000
--- a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
+++ /dev/null
@@ -1,603 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.util.Arrays.asList;
-import static org.rhq.core.domain.common.EntityContext.forResource;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.plannedChanges;
-import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
-import static org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility.SerializationType.SERIALIZATION;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
-import static org.rhq.test.AssertUtils.assertPropertiesMatch;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.ejb.EJBException;
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
-import org.rhq.core.domain.criteria.DriftDefinitionTemplateCriteria;
-import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
-import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftDefinitionComparator;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
-import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.Filter;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
-import org.rhq.test.AssertUtils;
-import org.rhq.test.TransactionCallback;
-
-public class DriftTemplateManagerBeanTest extends DriftServerTest {
-
- private DriftTemplateManagerLocal templateMgr;
-
- private DriftManagerLocal driftMgr;
-
- private List<Resource> resources = new LinkedList<Resource>();
-
- private JPADrift drift1;
- private JPADrift drift2;
- private JPADriftFile driftFile1;
- private JPADriftFile driftFile2;
-
- @BeforeClass
- public void initClass() {
- templateMgr = getDriftTemplateManager();
- driftMgr = getDriftManager();
-
- }
-
- @Override
- protected void initDB(EntityManager em) {
- agentServiceContainer.driftService = new TestDefService() {
- @Override
- public void unscheduleDriftDetection(int resourceId, DriftDefinition driftDef) {
- detach(driftDef);
- }
-
- @Override
- public void updateDriftDetection(int resourceId, DriftDefinition driftDef) {
- detach(driftDef);
- }
-
- @Override
- public void updateDriftDetection(int resourceId, DriftDefinition driftDef, DriftSnapshot driftSnapshot) {
- detach(driftDef);
- detach(driftSnapshot);
- }
-
- private void detach(Object object) {
- try {
- HibernateDetachUtility.nullOutUninitializedFields(object, SERIALIZATION);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- };
- }
-
- public void createNewTemplate() {
- final DriftDefinition definition = new DriftDefinition(new Configuration());
- definition.setName("test::createNewTemplate");
- definition.setEnabled(true);
- definition.setDriftHandlingMode(normal);
- definition.setInterval(2400L);
- definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- final DriftDefinitionTemplate newTemplate = templateMgr.createTemplate(getOverlord(), resourceType.getId(),
- true, definition);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- ResourceType updatedType = em.find(ResourceType.class, resourceType.getId());
-
- assertEquals("Failed to add new drift definition to resource type", 1, updatedType
- .getDriftDefinitionTemplates().size());
-
- DriftDefinitionTemplate expectedTemplate = new DriftDefinitionTemplate();
- expectedTemplate.setTemplateDefinition(definition);
- expectedTemplate.setUserDefined(true);
-
- assertDriftTemplateEquals("Failed to save template", expectedTemplate, newTemplate);
- assertTrue("The template should have its id set", newTemplate.getId() > 0);
- }
- });
- }
-
- public void createTemplateForNegativeUpdateTests() {
- DriftDefinition definition = new DriftDefinition(new Configuration());
- definition.setName("test::createTemplateForNegativeUpdateTests");
- definition.setEnabled(true);
- definition.setDriftHandlingMode(normal);
- definition.setInterval(2400L);
- definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- templateMgr.createTemplate(getOverlord(), resourceType.getId(), true, definition);
-
- assertNotNull("Failed to load template", loadTemplate(definition.getName()));
- }
-
- @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
- expectedExceptions = EJBException.class,
- expectedExceptionsMessageRegExp = ".*base directory.*cannot be modified")
- @InitDB(false)
- public void doNotAllowBaseDirToBeUpdated() {
- DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
- DriftDefinition definition = template.getTemplateDefinition();
- definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/TEST"));
-
- templateMgr.updateTemplate(getOverlord(), template);
- }
-
- @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
- expectedExceptions = EJBException.class,
- expectedExceptionsMessageRegExp = ".*filters.*cannot be modified")
- @InitDB(false)
- public void doNotAllowFiltersToBeUpdated() {
- DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
- DriftDefinition definition = template.getTemplateDefinition();
- definition.addExclude(new Filter("/foo/bar/TEST/conf", "*.xml"));
-
- templateMgr.updateTemplate(getOverlord(), template);
- }
-
- @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
- expectedExceptions = EJBException.class,
- expectedExceptionsMessageRegExp = ".*name.*cannot be modified")
- @InitDB(false)
- public void doNotAllowTemplateNameToBeUpdated() {
- DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
- template.setName("A new name");
-
- templateMgr.updateTemplate(getOverlord(), template);
- }
-
- public void createAndUpdateTemplate() {
- // create the template
- DriftDefinition definition = new DriftDefinition(new Configuration());
- definition.setName("test::updateTemplate");
- definition.setDescription("update template test");
- definition.setEnabled(true);
- definition.setDriftHandlingMode(normal);
- definition.setInterval(2400L);
- definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
- definition);
-
- // next create some definitions from the template
- final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
- final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
- final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
- final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
-
- driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), attachedDef1);
- driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), attachedDef2);
- driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), detachedDef1);
- driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), detachedDef2);
-
- // update the template
- final DriftDefinition newTemplateDef = template.getTemplateDefinition();
- newTemplateDef.setInterval(4800L);
- newTemplateDef.setDriftHandlingMode(plannedChanges);
- newTemplateDef.setEnabled(false);
-
- templateMgr.updateTemplate(getOverlord(), template);
-
- // verify that the tempalte has been updated
- final DriftDefinitionTemplate updatedTemplate = loadTemplate(template.getName());
- AssertUtils.assertPropertiesMatch("Failed to update template", template, updatedTemplate, "resourceType",
- "driftDefinitions", "templateDefinition");
-
- // verify that attached definitions are updated.
- for (DriftDefinition def : asList(attachedDef1, attachedDef2)) {
- DriftDefinition updatedDef = loadDefinition(def.getId());
- String msg = "Failed to propagate update to attached definition " + toString(updatedDef) + " - ";
- DriftDefinition updatedTemplateDef = updatedTemplate.getTemplateDefinition();
-
- assertEquals(msg + "enabled property not updated", updatedTemplateDef.isEnabled(),
- updatedDef.isEnabled());
- assertEquals(msg + "driftHandlingMode property not updated",
- updatedTemplateDef.getDriftHandlingMode(), updatedDef.getDriftHandlingMode());
- assertEquals(msg + "interval property not updated", updatedTemplateDef.getInterval(),
- updatedDef.getInterval());
- }
-
- // verify that the detached definitions have not been updated.
- for (DriftDefinition def : asList(detachedDef1, detachedDef2)) {
- DriftDefinition defAfterUpdate = loadDefinition(def.getId());
- String msg = "Detached definition " + toString(def) + " should not get updated - ";
-
- assertEquals(msg + "enabled property was modified", def.isEnabled(), defAfterUpdate.isEnabled());
- assertEquals(msg + "driftHandlingMode property was modified", def.getDriftHandlingMode(),
- defAfterUpdate.getDriftHandlingMode());
- assertEquals(msg + "interval property was modified", def.getInterval(), defAfterUpdate.getInterval());
- }
- }
-
-
- @SuppressWarnings("unchecked")
- public void pinTemplate() throws Exception {
- // First create the template
- final DriftDefinition templateDef = new DriftDefinition(new Configuration());
- templateDef.setName("test::pinTemplate");
- templateDef.setEnabled(true);
- templateDef.setDriftHandlingMode(normal);
- templateDef.setInterval(2400L);
- templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(),
- resourceType.getId(), true, templateDef);
-
- // next create some resource level definitions
- final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
- final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
- final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
- final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
-
- // create initial change set from which the snapshot will be generated
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
-
- driftFile1 = new JPADriftFile("a1b2c3");
- drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift1);
-
- // create change set v1
- driftFile2 = new JPADriftFile("1a2b3c");
- final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, attachedDef1);
- drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- em.persist(attachedDef1);
-
- em.persist(driftFile1);
- em.persist(driftFile2);
-
- em.persist(changeSet0);
- em.persist(driftSet);
- changeSet0.setInitialDriftSet(driftSet);
- em.merge(changeSet0);
-
- em.persist(changeSet1);
- em.persist(drift2);
-
- em.persist(attachedDef2);
- em.persist(detachedDef1);
- em.persist(detachedDef2);
- }
- });
-
- // now we pin the snapshot to the template
- templateMgr.pinTemplate(getOverlord(), template.getId(), attachedDef1.getId(), 1);
-
- // verify that the template is now pinned
- DriftDefinitionTemplate updatedTemplate = loadTemplate(template.getName());
- assertTrue("Template should be marked pinned", updatedTemplate.isPinned());
- }
-
- @Test(dependsOnMethods = "pinTemplate")
- @InitDB(false)
- public void persistChangeSetWhenTemplateGetsPinned() throws Exception {
- DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
-
- GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
- criteria.addFilterId(template.getChangeSetId());
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
-
- assertEquals("Expected to find change set for pinned template", 1, changeSets.size());
-
- JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
- List<? extends Drift> expectedDrifts = asList(
- new JPADrift(expectedChangeSet, "drift.1", FILE_ADDED, null, driftFile1),
- new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
-
- DriftChangeSet<?> actualChangeSet = changeSets.get(0);
- List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
-
- AssertUtils.assertCollectionMatchesNoOrder(
- "Expected to find drifts from change sets 1 and 2 in the template change set",
- (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
-
- // we need to compare the newDriftFile properties separately because
- // assertCollectionMatchesNoOrder compares properties via equals() and JPADriftFile
- // does not implement equals.
- assertPropertiesMatch(drift1.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(),
- "The newDriftFile property was not set correctly for " + drift1);
- assertPropertiesMatch(drift2.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(),
- "The newDriftFile property was not set correctly for " + drift1);
- }
-
- @Test(dependsOnMethods = "pinTemplate")
- @InitDB(false)
- public void updateAttachedDefinitionsWhenTemplateGetsPinned() throws Exception {
- DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
-
- // get the attached definitions
- List<DriftDefinition> attachedDefs = new LinkedList<DriftDefinition>();
- for (DriftDefinition d : template.getDriftDefinitions()) {
- if (d.isAttached() && (d.getName().equals("attachedDef1") || d.getName().equals("attachedDef2"))) {
- attachedDefs.add(d);
- }
- }
- assertEquals("Failed to get attached definitions for " + toString(template), 2, attachedDefs.size());
- assertDefinitionIsPinned(attachedDefs.get(0));
- assertDefinitionIsPinned(attachedDefs.get(1));
- }
-
- @Test(dependsOnMethods = "pinTemplate")
- @InitDB(false)
- public void doNotUpdateDetachedDefinitionsWhenTemplateGetsPinned() throws Exception {
- DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
-
- // get the detached definitions
- List<DriftDefinition> detachedDefs = new LinkedList<DriftDefinition>();
- for (DriftDefinition d : template.getDriftDefinitions()) {
- if (!d.isAttached() && (d.getName().equals("detachedDef1") || d.getName().equals("detachedDef2"))) {
- detachedDefs.add(d);
- }
- }
- assertEquals("Failed to get detached definitions for " + toString(template), 2, detachedDefs.size());
- assertDefinitionIsNotPinned(detachedDefs.get(0));
- assertDefinitionIsNotPinned(detachedDefs.get(1));
- }
-
- public void deleteTemplate() throws Exception {
- // first create the template
- final DriftDefinition templateDef = new DriftDefinition(new Configuration());
- templateDef.setName("test::pinTemplate");
- templateDef.setEnabled(true);
- templateDef.setDriftHandlingMode(normal);
- templateDef.setInterval(2400L);
- templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(),
- resourceType.getId(), true, templateDef);
-
- // next create some resource level definitions
- final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
- final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
- final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
- final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
-
- // create some change sets
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
-
- driftFile1 = new JPADriftFile("a1b2c3");
- drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet0 = new JPADriftSet();
- driftSet0.addDrift(drift1);
-
- final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 0, DRIFT, detachedDef1);
-
- driftFile2 = new JPADriftFile("1a2b3c");
- drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
-
- final JPADriftSet driftSet1 = new JPADriftSet();
- driftSet1.addDrift(drift2);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- em.persist(attachedDef1);
- em.persist(attachedDef2);
- em.persist(detachedDef1);
- em.persist(detachedDef2);
-
- em.persist(driftFile1);
- em.persist(driftFile2);
-
- em.persist(changeSet0);
- em.persist(driftSet0);
- changeSet0.setInitialDriftSet(driftSet0);
- em.merge(changeSet0);
-
- em.persist(changeSet1);
- em.persist(driftSet1);
- changeSet1.setInitialDriftSet(driftSet1);
- em.merge(changeSet1);
- }
- });
-
- // delete the template
- templateMgr.deleteTemplate(getOverlord(), template.getId());
-
- // verify that attached definitions along with their change sets have
- // been deleted
- assertNull("Change sets belonging to attached definitions should be deleted", loadChangeSet(changeSet0.getId()));
- assertNull("Attached definition " + toString(attachedDef1) + " should be deleted",
- loadDefinition(attachedDef1.getId()));
- assertNull("Attached definition " + toString(attachedDef2) + " should be deleted",
- loadDefinition(attachedDef2.getId()));
-
- // verify that detached definitions along with their change sets have not been deleted
- assertNotNull("Change sets belonging to detached definitions should not be deleted",
- loadChangeSet(changeSet1.getId()));
- assertDetachedDefinitionNotDeleted(detachedDef1.getId());
- assertDetachedDefinitionNotDeleted(detachedDef2.getId());
-
- // verify that the template itself has been deleted
- assertNull("The template " + toString(template) + " should have been deleted",
- loadTemplate(template.getName(), false));
- }
-
- private void assertDefinitionIsPinned(DriftDefinition definition) throws Exception {
- // verify that the definition is marked as pinned
- assertTrue("Expected " + toString(definition) + " to be pinned", definition.isPinned());
-
- // verify that the initial change set is generated for the definition
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(definition.getId());
- criteria.addFilterCategory(COVERAGE);
- criteria.fetchDrifts(true);
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
- assertEquals("Expected to find one change set", 1, changeSets.size());
-
- JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
- List<? extends Drift> expectedDrifts = asList(
- new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
- new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
-
- DriftChangeSet<?> actualChangeSet = changeSets.get(0);
- List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
-
- AssertUtils.assertCollectionMatchesNoOrder(
- "Expected to find drifts from change sets 1 and 2 in the template change set",
- (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
-
- // Finally make sure that there are no other change sets
- criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterStartVersion(1);
- criteria.addFilterDriftDefinitionId(definition.getId());
-
- assertEquals("There should not be any drift change sets", 0,
- driftMgr.findDriftChangeSetsByCriteria(getOverlord(), criteria).size());
- }
-
- private void assertDefinitionIsNotPinned(DriftDefinition definition) throws Exception {
- // verify that the definition is not pinned
- assertFalse("Expected " + toString(definition) + " to be unpinned", definition.isPinned());
-
- // Note that this method assumes that the definition has no change sets
- // associated with it and therefore checks that there are no change sets.
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(definition.getId());
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
- assertEquals("Did not expect to find any change sets for " + toString(definition) + ". Note that this " +
- "assertion method assumes that the definition you are testing is not supposed to have any change sets.",
- 0, changeSets.size());
- }
-
- private void assertDriftTemplateEquals(String msg, DriftDefinitionTemplate expected, DriftDefinitionTemplate actual) {
- AssertUtils
- .assertPropertiesMatch(msg + ": basic drift definition template properties do not match", expected, actual,
- "id", "resourceType", "ctime", "templateDefinition");
- assertDriftDefEquals(msg + ": template definitions do not match", expected.getTemplateDefinition(), actual
- .getTemplateDefinition());
- }
-
- private void assertDriftDefEquals(String msg, DriftDefinition expected, DriftDefinition actual) {
- DriftDefinitionComparator comparator = new DriftDefinitionComparator(
- BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
- assertEquals(msg, 0, comparator.compare(expected, actual));
- }
-
- private void assertDetachedDefinitionNotDeleted(int definitionId) {
- DriftDefinition definition = loadDefinition(definitionId);
- assertNotNull("Detached definition " + toString(definition) + " should not be deleted", definition);
- assertNull("The detached definition's template reference should be set to null when the template is deleted",
- definition.getTemplate());
- }
-
- private DriftDefinition createDefinition(DriftDefinitionTemplate template, String defName, boolean isAttached) {
- DriftDefinition def = template.createDefinition();
- def.setName(defName);
- def.setAttached(isAttached);
- def.setTemplate(template);
- def.setResource(resource);
- return def;
- }
-
- private DriftDefinitionTemplate loadTemplate(String name) {
- return loadTemplate(name, true);
- }
-
- private DriftDefinitionTemplate loadTemplate(String name, boolean verifyResultsUnique) {
- DriftDefinitionTemplateCriteria criteria = new DriftDefinitionTemplateCriteria();
- criteria.addFilterResourceTypeId(resourceType.getId());
- criteria.addFilterName(name);
- criteria.fetchDriftDefinitions(true);
-
- PageList<DriftDefinitionTemplate> templates = templateMgr.findTemplatesByCriteria(getOverlord(), criteria);
- if (verifyResultsUnique) {
- assertEquals("Expected to find one template", 1, templates.size());
- }
-
- if (templates.isEmpty()) {
- return null;
- }
- return templates.get(0);
- }
-
- private DriftDefinition loadDefinition(int definitionId) {
- DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
- criteria.addFilterId(definitionId);
- criteria.fetchConfiguration(true);
- criteria.fetchTemplate(true);
- PageList<DriftDefinition> definitions = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
-
- if (definitions.isEmpty()) {
- return null;
- }
- return definitions.get(0);
- }
-
- private DriftChangeSet<?> loadChangeSet(String id) throws Exception {
- GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
- criteria.addFilterId(id);
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
-
- if (changeSets.isEmpty()) {
- return null;
- }
- return changeSets.get(0);
- }
-
-}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java
deleted file mode 100644
index 65a6523..0000000
--- a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-@Retention(RUNTIME)
-(a)Target({ElementType.METHOD })
-public @interface InitDB {
- boolean value() default true;
-}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
deleted file mode 100644
index 4faca1b..0000000
--- a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.util.Arrays.asList;
-import static org.apache.commons.io.IOUtils.toInputStream;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
-import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
-import static org.rhq.enterprise.server.util.LookupUtil.getJPADriftServer;
-import static org.rhq.test.AssertUtils.assertPropertiesMatch;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.drift.dto.DriftChangeSetDTO;
-import org.rhq.core.domain.drift.dto.DriftDTO;
-import org.rhq.core.domain.drift.dto.DriftFileDTO;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.test.AssertUtils;
-import org.rhq.test.TransactionCallback;
-
-public class JPADriftServerBeanTest extends DriftServerTest {
-
- private JPADriftServerLocal jpaDriftServer;
-
- private final String DRIFT_FILE_1_ID = "a1b2c3d4";
-
- private final String DRIFT_FILE_2_ID = "1ab2b3c4d";
-
- private JPADriftFile driftFile1;
-
- private JPADriftFile driftFile2;
-
- @BeforeClass
- public void initTests() {
- jpaDriftServer = getJPADriftServer();
- }
-
- @BeforeMethod
- public void persistDriftFiles() throws Exception {
- driftFile1 = jpaDriftServer.persistDriftFile(new JPADriftFile(DRIFT_FILE_1_ID));
- driftFile2 = jpaDriftServer.persistDriftFile(new JPADriftFile(DRIFT_FILE_2_ID));
-
- String driftFile1Content = "drift file 1 content...";
- String driftFile2Content = "drift file 2 content...";
-
- jpaDriftServer.persistDriftFileData(driftFile1, toInputStream(driftFile1Content), driftFile1Content.length());
- jpaDriftServer.persistDriftFileData(driftFile2, toInputStream(driftFile2Content), driftFile2Content.length());
-
- driftFile1 = jpaDriftServer.getDriftFile(getOverlord(), DRIFT_FILE_1_ID);
- driftFile2 = jpaDriftServer.getDriftFile(getOverlord(), DRIFT_FILE_2_ID);
-
- assertDriftFilePersisted(driftFile1, "driftFile1", driftFile1Content);
- assertDriftFilePersisted(driftFile2, "driftFile2", driftFile2Content);
- }
-
- public void persistResourceChangeSet() {
- // first create and persist the drift definition
- final DriftDefinition driftDef = new DriftDefinition(new Configuration());
- driftDef.setName("test::persistResourceChangeSet");
- driftDef.setEnabled(true);
- driftDef.setDriftHandlingMode(normal);
- driftDef.setInterval(2400L);
- driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
- driftDef.setResource(resource);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftDef);
- }
- });
-
- // create the change set to be persisted
- DriftChangeSetDTO changeSet = new DriftChangeSetDTO();
- changeSet.setCategory(COVERAGE);
- changeSet.setVersion(1);
- changeSet.setDriftDefinitionId(driftDef.getId());
- changeSet.setResourceId(resource.getId());
- changeSet.setDriftHandlingMode(normal);
- changeSet.setCtime(System.currentTimeMillis());
-
- DriftDTO drift1 = new DriftDTO();
- drift1.setCategory(FILE_ADDED);
- drift1.setPath("drift.1");
- drift1.setChangeSet(changeSet);
- drift1.setCtime(System.currentTimeMillis());
- drift1.setNewDriftFile(toDTo(driftFile1));
-
- DriftDTO drift2 = new DriftDTO();
- drift2.setCategory(FILE_ADDED);
- drift2.setPath("drift.2");
- drift2.setChangeSet(changeSet);
- drift2.setCtime(System.currentTimeMillis());
- drift2.setNewDriftFile(toDTo(driftFile2));
-
- Set<DriftDTO> drifts = new HashSet<DriftDTO>();
- drifts.add(drift1);
- drifts.add(drift2);
- changeSet.setDrifts(drifts);
-
- String newChangeSetId = jpaDriftServer.persistChangeSet(getOverlord(), changeSet);
-
- // verify that the change set was persisted
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterId(newChangeSetId);
- criteria.fetchDrifts(true);
-
- PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
- assertEquals("Expected to find one change set", 1, changeSets.size());
-
- JPADriftChangeSet jpaChangeSet = changeSets.get(0);
- assertEquals("Expected change set to contain two drifts. This could be a result of the change set not being " +
- "persisted correctly or the criteria fetch being done incorrectly.", 2, jpaChangeSet.getDrifts().size());
-
- AssertUtils
- .assertPropertiesMatch("The change set was not persisted correctly", changeSet, jpaChangeSet, "id", "drifts",
- "class", "ctime");
-
- List<? extends Drift> expectedDrifts = asList(drift1, drift2);
- List<? extends Drift> actualDrifts = new ArrayList(jpaChangeSet.getDrifts());
-
- // We ignore the id and ctime properties because those are set by JPADriftServerBean
- // and are somewhat implmentation specific. We ignore the directory property because
- // it is really a calculated property. newDriftFile has to be compared separately
- // since it does not implement equals.
- AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not persisted correctly",
- (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "directory",
- "newDriftFile", "class");
-
- assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift1, drift1.getNewDriftFile(),
- findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(), "class", "ctime") ;
- assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift2, drift2.getNewDriftFile(),
- findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(), "class", "ctime") ;
- }
-
- public void persistTemplateChangeSet() {
- // create the change set to be persisted
- //
- // Note that we do not set the drift definition id or resource id since
- // the change set is not owned by a resource. It is owned by the
- // resource type.
- DriftChangeSetDTO changeSet = new DriftChangeSetDTO();
- changeSet.setCategory(COVERAGE);
- changeSet.setVersion(1);
- changeSet.setDriftHandlingMode(normal);
- changeSet.setCtime(System.currentTimeMillis());
-
- DriftDTO drift1 = new DriftDTO();
- drift1.setCategory(FILE_ADDED);
- drift1.setPath("drift.1");
- drift1.setChangeSet(changeSet);
- drift1.setCtime(System.currentTimeMillis());
- drift1.setNewDriftFile(toDTo(driftFile1));
-
- DriftDTO drift2 = new DriftDTO();
- drift2.setCategory(FILE_ADDED);
- drift2.setPath("drift.2");
- drift2.setChangeSet(changeSet);
- drift2.setCtime(System.currentTimeMillis());
- drift2.setNewDriftFile(toDTo(driftFile2));
-
- Set<DriftDTO> drifts = new HashSet<DriftDTO>();
- drifts.add(drift1);
- drifts.add(drift2);
- changeSet.setDrifts(drifts);
-
- String newChangeSetId = jpaDriftServer.persistChangeSet(getOverlord(), changeSet);
-
- // verify that the change set was persisted
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterId(newChangeSetId);
- criteria.fetchDrifts(true);
-
- PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
- assertEquals("Expected to find one change set", 1, changeSets.size());
-
- JPADriftChangeSet jpaChangeSet = changeSets.get(0);
- assertEquals("Expected change set to contain two drifts. This could be a result of the change set not being " +
- "persisted correctly or the criteria fetch being done incorrectly.", 2, jpaChangeSet.getDrifts().size());
-
- AssertUtils
- .assertPropertiesMatch("The change set was not persisted correctly", changeSet, jpaChangeSet, "id", "drifts",
- "class", "ctime");
-
- List<? extends Drift> expectedDrifts = asList(drift1, drift2);
- List<? extends Drift> actualDrifts = new ArrayList(jpaChangeSet.getDrifts());
-
- // We ignore the id and ctime properties because those are set by JPADriftServerBean
- // and are somewhat implmentation specific. We ignore the directory property because
- // it is really a calculated property. newDriftFile has to be compared separately
- // since it does not implement equals.
- AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not persisted correctly",
- (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "directory",
- "newDriftFile", "class");
-
- assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift1, drift1.getNewDriftFile(),
- findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(), "class", "ctime") ;
- assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift2, drift2.getNewDriftFile(),
- findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(), "class", "ctime") ;
- }
-
- public void copyChangeSet() {
- // first create the change set that will be copied
- final JPADriftChangeSet changeSet = new JPADriftChangeSet(null, 0, COVERAGE, null);
- changeSet.setDriftHandlingMode(normal);
-
- final JPADrift drift1 = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
- final JPADrift drift2 = new JPADrift(changeSet, "drift.2", FILE_ADDED, null, driftFile2);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift1);
- driftSet.addDrift(drift2);
-
- // next create the drift definition
- final DriftDefinition driftDef = new DriftDefinition(new Configuration());
- driftDef.setName("test::copyChangeSet");
- driftDef.setEnabled(true);
- driftDef.setDriftHandlingMode(normal);
- driftDef.setInterval(2400L);
- driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
- driftDef.setResource(resource);
-
- // persist the change set and drift definition
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(changeSet);
- em.persist(driftDef);
- em.persist(driftSet);
- changeSet.setInitialDriftSet(driftSet);
- em.merge(changeSet);
- }
- });
-
- jpaDriftServer.copyChangeSet(getOverlord(), changeSet.getId(), driftDef.getId(), resource.getId());
-
- // verify that the change set was created for the definition
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(driftDef.getId());
- criteria.addFilterCategory(COVERAGE);
-
- PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
-
- assertEquals("Expected to get back one change set", 1,changeSets.size());
-
- JPADriftChangeSet newChangeSet = changeSets.get(0);
- Set<JPADrift> expectedDrifts = new HashSet<JPADrift>(asList(drift1, drift2));
- Set<JPADrift> actualDrifts = newChangeSet.getDrifts();
-
- AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not copied correctly", expectedDrifts,
- actualDrifts,
- "changeSet", "newDriftFile");
- }
-
- private DriftFileDTO toDTo(JPADriftFile driftFile) {
- DriftFileDTO dto = new DriftFileDTO();
- dto.setHashId(driftFile.getHashId());
- dto.setDataSize(driftFile.getDataSize());
- dto.setStatus(driftFile.getStatus());
- return dto;
- }
-
-
- private void assertDriftFilePersisted(JPADriftFile driftFile, String name, String content) {
- assertNotNull("Failed to get " + name + " Was it persisted?", driftFile);
- assertEquals("The content for " + name + " is wrong", content, jpaDriftServer.getDriftFileBits(
- driftFile.getHashId()));
- assertEquals("The drift file status is wrong", LOADED, driftFile.getStatus());
- }
-
-}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
deleted file mode 100644
index 66afcb0..0000000
--- a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.util.Arrays.asList;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
-import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
-
-import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
-import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftDefinitionComparator;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
-import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
-import org.rhq.test.AssertUtils;
-import org.rhq.test.TransactionCallback;
-
-public class ManageDriftDefinitionsTest extends DriftServerTest {
-
- private DriftManagerLocal driftMgr;
-
- private DriftTemplateManagerLocal templateMgr;
-
- @BeforeClass
- public void initClass() throws Exception {
- driftMgr = getDriftManager();
- templateMgr = getDriftTemplateManager();
- }
-
- public void createDefinitionFromUnpinnedTemplate() {
- // first create a template
- final DriftDefinition templateDef = new DriftDefinition(new Configuration());
- templateDef.setName("test_createUnpinnedDefinition");
- templateDef.setEnabled(true);
- templateDef.setDriftHandlingMode(normal);
- templateDef.setInterval(2400L);
- templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- // persist the template
- DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), false,
- templateDef);
-
- // create and persist the definition
- DriftDefinition definition = template.createDefinition();
- definition.setTemplate(template);
- driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(resource.getId()), definition);
-
- // verify that the definition was created
- DriftDefinition newDef = loadDefinition(definition.getName());
- DriftDefinitionComparator comparator = new DriftDefinitionComparator(
- BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
-
- assertEquals("The drift definition was not persisted correctly", 0, comparator.compare(definition, newDef));
- assertEquals("The template association was not set on the definition", template, newDef.getTemplate());
- }
-
- @SuppressWarnings("unchecked")
- public void createDefinitionFromPinnedTemplate() throws Exception {
- // We first need to create a pinned template. Users can only create a pinned
- // template from a snapshot of an existing resource-level drift definition.
- // We are going to take a bit of a short cut though by directly creating
- // and persisting the pinned change set.
-
- // first create the change set
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(null, 0, COVERAGE, null);
- changeSet0.setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode.normal);
-
- final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
-
- JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
- JPADrift drift2 = new JPADrift(changeSet0, "drift.2", FILE_ADDED, null, driftFile2);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift1);
- driftSet.addDrift(drift2);
-
- // create the template
- final DriftDefinition templateDef = new DriftDefinition(new Configuration());
- templateDef.setName("test_createUnpinnedDefinition");
- templateDef.setEnabled(true);
- templateDef.setDriftHandlingMode(normal);
- templateDef.setInterval(2400L);
- templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
- templateDef.setPinned(true);
-
- final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
- templateDef);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- em.persist(driftFile1);
- em.persist(driftFile2);
- em.persist(changeSet0);
- em.persist(driftSet);
- changeSet0.setInitialDriftSet(driftSet);
- em.merge(changeSet0);
-
- // setting the change set id on the template is the last and the
- // most important step in making the template pinned
- template.setChangeSetId(changeSet0.getId());
- em.merge(template);
- }
- });
-
- // Create and persist a resource-level definition.
- final DriftDefinition definition = template.createDefinition();
- definition.setTemplate(template);
-
- final AtomicBoolean agentInvoked = new AtomicBoolean(false);
-
- agentServiceContainer.driftService = new TestDefService() {
- @Override
- public void updateDriftDetection(int resourceId, DriftDefinition driftDef, DriftSnapshot snapshot) {
- try {
- HibernateDetachUtility.nullOutUninitializedFields(driftDef,
- HibernateDetachUtility.SerializationType.SERIALIZATION);
- HibernateDetachUtility.nullOutUninitializedFields(snapshot,
- HibernateDetachUtility.SerializationType.SERIALIZATION);
- agentInvoked.set(true);
- assertNotNull("Expected snapshot drift instances collection to be non-null",
- snapshot.getDriftInstances());
- assertEquals("Expected snapshot to contain two drift entries", 2, snapshot.getDriftInstances().size());
- } catch (Exception e) {
- String msg = "Do not pass attached entites to agent since those entities are outside of " +
- "Hibernate's control. The persistence context should be flushed and cleared to ensure that " +
- "only detached objects are sent to the agent";
- throw new RuntimeException(msg, e);
- }
- }
- };
-
- driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(resource.getId()), definition);
-
- DriftDefinition newDef = loadDefinition(definition.getName());
-
- // verify that the definition is marked as pinned
- assertTrue("The drift definition should be marked as pinned", newDef.isPinned());
-
- // verify that the initial change set is generated for the definition
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(definition.getId());
- criteria.addFilterCategory(COVERAGE);
- criteria.fetchDrifts(true);
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
- assertEquals("Expected to find one change set", 1, changeSets.size());
-
- JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
- List<? extends Drift> expectedDrifts = asList(
- new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
- new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
-
- DriftChangeSet<?> actualChangeSet = changeSets.get(0);
- List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
-
- AssertUtils.assertCollectionMatchesNoOrder(
- "Expected to find drifts from change sets 1 and 2 in the template change set",
- (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
-
- // lastly verify that the agent is called
- assertTrue("Failed to send drift definition along with snapshot to agent", agentInvoked.get());
- }
-
- private DriftDefinition loadDefinition(String name) {
- DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
- criteria.addFilterResourceIds(resource.getId());
- criteria.addFilterName(name);
- criteria.fetchConfiguration(true);
- criteria.fetchResource(true);
- criteria.fetchTemplate(true);
-
- PageList<DriftDefinition> driftDefs = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
- assertEquals("Expected to find one drift definition", 1, driftDefs.size());
-
- return driftDefs.get(0);
- }
-}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
deleted file mode 100644
index e7341e4..0000000
--- a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.util.Arrays.asList;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
-import static org.rhq.test.AssertUtils.assertPropertiesMatch;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.core.server.EntitySerializer;
-import org.rhq.test.AssertUtils;
-import org.rhq.test.TransactionCallback;
-
-public class ManageSnapshotsTest extends DriftServerTest {
-
- private DriftManagerLocal driftMgr;
-
- private DriftTemplateManagerLocal templateMgr;
-
- @BeforeClass(inheritGroups = true)
- public void initClass() throws Exception {
- driftMgr = getDriftManager();
- templateMgr = getDriftTemplateManager();
- }
-
- public void pinningSnapshotShouldSetDriftDefAsPinned() {
- final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
-
- // create initial change set
- final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
-
- final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftFile1);
- em.persist(changeSet);
- em.persist(driftSet);
- changeSet.setInitialDriftSet(driftSet);
- em.merge(changeSet);
- }
- });
-
- driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 0);
- DriftDefinition updatedDriftDef = driftMgr.getDriftDefinition(getOverlord(), driftDef.getId());
-
- assertNotNull("Failed to get " + toString(driftDef), updatedDriftDef);
- assertTrue("Failed to set pinned flag of " + toString(driftDef), updatedDriftDef.isPinned());
- }
-
- @SuppressWarnings("unchecked")
- public void pinningSnapshotShouldMakeSnapshotTheInitialChangeSet() throws Exception {
- final DriftDefinition driftDef = createAndPersistDriftDef("test::makeSnapshotVersionZero");
-
- // create initial change set
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
-
- final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift1);
-
- // create change set v1
- final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
- final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, driftDef);
- final JPADrift drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftFile1);
- em.persist(driftFile2);
- em.persist(changeSet0);
- em.persist(driftSet);
- changeSet0.setInitialDriftSet(driftSet);
- em.merge(changeSet0);
- em.persist(changeSet1);
- em.persist(drift2);
- }
- });
-
- driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 1);
-
- // Verify that there is now only one change set for the drift def
- GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(driftDef.getId());
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
- assertEquals("All change sets except the change set representing the pinned snapshot should be removed",
- 1, changeSets.size());
- DriftChangeSet<?> changeSet = changeSets.get(0);
-
- assertEquals("The pinned snapshot version should be reset to zero", 0, changeSet.getVersion());
- assertEquals("The change set category is wrong", COVERAGE, changeSet.getCategory());
-
- JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, driftDef);
- List<? extends Drift> expectedDrifts = asList(
- new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
- new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
-
- List<? extends Drift> actualDrifts = new ArrayList(changeSet.getDrifts());
-
- AssertUtils.assertCollectionMatchesNoOrder(
- "Expected to find drifts from change sets 1 and 2 in the new initial change set",
- (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
-
- // we need to compare the newDriftFile properties separately because
- // assertCollectionMatchesNoOrder compares properties via equals() and JPADriftFile
- // does not implement equals.
- assertPropertiesMatch(drift1.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(),
- "The newDriftFile property was not set correctly for " + drift1);
- assertPropertiesMatch(drift2.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(),
- "The newDriftFile property was not set correctly for " + drift1);
- }
-
- public void pinningSnapshotShouldSendRequestToAgent() {
- final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
-
- // create initial change set
- final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
-
- final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftFile1);
- em.persist(changeSet);
- em.persist(driftSet);
- changeSet.setInitialDriftSet(driftSet);
- em.merge(changeSet);
- }
- });
-
- final AtomicBoolean agentInvoked = new AtomicBoolean(false);
- agentServiceContainer.driftService = new TestDefService() {
- @Override
- public void pinSnapshot(int resourceId, String configName, DriftSnapshot snapshot) {
- try {
- agentInvoked.set(true);
- // serialize the method arguments here to more closely simulate what
- // happens during the call. We cannot send hibernate-proxied objects
- // to the agent. This is an attempt to catch that.
- ObjectOutputStream stream = new ObjectOutputStream(new ByteArrayOutputStream());
- EntitySerializer.writeExternalRemote(resourceId, stream);
- EntitySerializer.writeExternalRemote(configName, stream);
- EntitySerializer.writeExternalRemote(snapshot, stream);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- };
-
- driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 0);
-
- assertTrue("Failed to send request to agent to pin snapshot", agentInvoked.get());
- }
-
- private DriftDefinition createAndPersistDriftDef(String name) {
- final DriftDefinition driftDef = new DriftDefinition(new Configuration());
- driftDef.setName(name);
- driftDef.setEnabled(true);
- driftDef.setDriftHandlingMode(normal);
- driftDef.setInterval(1800L);
- driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- driftDef.setResource(resource);
- getEntityManager().persist(driftDef);
- }
- });
-
- return driftDef;
- }
-
-}
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/META-INF/ejb-jar.xml b/modules/enterprise/server/integration-tests/src/test/resources/META-INF/ejb-jar.xml
deleted file mode 100644
index 8222948..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/META-INF/ejb-jar.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
- version="3.0">
-
- <description>RHQ</description>
- <display-name>RHQ</display-name>
-
- <assembly-descriptor>
-
- <!-- all our EJB3 SLSBs can define custom @RequiredPermissions annotations for authorization checks-->
- <interceptor-binding>
- <ejb-name>*</ejb-name>
- <interceptor-class>org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor</interceptor-class>
- </interceptor-binding>
- <interceptor-binding>
- <ejb-name>*</ejb-name>
- <interceptor-class>org.rhq.enterprise.server.common.TransactionInterruptInterceptor</interceptor-class>
- </interceptor-binding>
- <interceptor-binding>
- <ejb-name>*</ejb-name>
- <interceptor-class>org.rhq.enterprise.server.common.PerformanceMonitorInterceptor</interceptor-class>
- </interceptor-binding>
-
- </assembly-descriptor>
-
-</ejb-jar>
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/binary-blob-sample.jar b/modules/enterprise/server/integration-tests/src/test/resources/binary-blob-sample.jar
deleted file mode 100644
index 0a629ec..0000000
Binary files a/modules/enterprise/server/integration-tests/src/test/resources/binary-blob-sample.jar and /dev/null differ
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/default.persistence.properties b/modules/enterprise/server/integration-tests/src/test/resources/default.persistence.properties
deleted file mode 100644
index 8e4f317..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/default.persistence.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
-#hibernate.connection.release_mode=after_statement
-#hibernate.transaction.flush_before_completion=false
-#hibernate.transaction.auto_close_session=false
-#hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
-#hibernate.hbm2ddl.auto=create-drop
-#hibernate.hbm2ddl.auto=create
-hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
-# Clustered cache with TreeCache
-#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
-#hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
-#hibernate.dialect=org.hibernate.dialect.HSQLDialect
-hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-hibernate.bytecode.use_reflection_optimizer=false
-# I don't think this is honored, but EJB3Deployer uses it
-hibernate.bytecode.provider=javassist
-hibernate.jdbc.use_streams_for_binary=true
-hibernate.show_sql=false
-hibernate.format_sql=true
-hibernate.default_batch_fetch_size=16
-hibernate.jdbc.batch_size=20
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/ejb3-interceptors-aop.xml b/modules/enterprise/server/integration-tests/src/test/resources/ejb3-interceptors-aop.xml
deleted file mode 100644
index f30aa70..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/ejb3-interceptors-aop.xml
+++ /dev/null
@@ -1,360 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE aop PUBLIC
- "-//JBoss//DTD JBOSS AOP 1.0//EN"
- "http://www.jboss.org/aop/dtd/jboss-aop_1_0.dtd">
-
-<aop>
- <interceptor class="org.jboss.aspects.remoting.InvokeRemoteInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.aspects.security.SecurityClientInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.aspects.tx.ClientTxPropagationInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.ejb3.remoting.IsLocalInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.aspects.remoting.ClusterChooserInterceptor" scope="PER_VM"/>
-
- <interceptor class="org.jboss.aspects.tx.TxPropagationInterceptor" scope="PER_VM"/>
-
- <stack name="ServiceClientInterceptors">
- <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
- </stack>
-
- <stack name="AsynchronousStatelessSessionClientInterceptors">
- <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
- </stack>
-
- <stack name="AsynchronousStatefulSessionClientInterceptors">
- <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
- </stack>
-
- <stack name="StatelessSessionClientInterceptors">
- <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
- </stack>
-
- <stack name="StatefulSessionClientInterceptors">
- <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
- </stack>
-
- <stack name="ClusteredStatelessSessionClientInterceptors">
- <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
- </stack>
-
- <stack name="ClusteredStatefulSessionClientInterceptors">
- <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
- </stack>
-
- <interceptor class="org.jboss.ejb3.asynchronous.AsynchronousInterceptor" scope="PER_CLASS"/>
- <interceptor class="org.jboss.ejb3.ENCPropagationInterceptor" scope="PER_VM"/>
- <interceptor name="Basic Authorization" factory="org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorFactory" scope="PER_CLASS"/>
- <interceptor name="JACC Authorization" factory="org.jboss.ejb3.security.JaccAuthorizationInterceptorFactory" scope="PER_CLASS"/>
- <interceptor factory="org.jboss.ejb3.security.AuthenticationInterceptorFactory" scope="PER_CLASS"/>
- <interceptor factory="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory" scope="PER_CLASS"/>
- <interceptor class="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.ejb3.stateless.StatelessInstanceInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.ejb3.stateful.StatefulInstanceInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.ejb3.service.ServiceSingletonInterceptor" scope="PER_VM"/>
- <interceptor class="org.jboss.ejb3.cache.StatefulReplicationInterceptor" scope="PER_VM"/>
- <interceptor factory="org.jboss.ejb3.stateful.StatefulRemoveFactory" scope="PER_CLASS_JOINPOINT"/>
- <interceptor factory="org.jboss.ejb3.tx.TxInterceptorFactory" scope="PER_CLASS_JOINPOINT"/>
- <interceptor factory="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory" scope="PER_CLASS_JOINPOINT"/>
- <interceptor factory="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory" scope="PER_CLASS"/>
- <interceptor class="org.jboss.ejb3.AllowedOperationsInterceptor" scope="PER_VM"/>
- <interceptor factory="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory" scope="PER_CLASS"/>
- <interceptor class="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor" scope="PER_VM"/>
-
- <domain name="Stateless Bean">
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
- <interceptor-ref name="Basic Authorization"/>
- </bind>
- <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
- <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
- <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
- <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
- </bind>
- <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
- @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
- </annotation>
- </domain>
-
- <domain name="JACC Stateless Bean">
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
- <interceptor-ref name="JACC Authorization"/>
- </bind>
- <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
- <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
- <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
- <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
- </bind>
- <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
- @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
- </annotation>
- </domain>
-
- <domain name="Base Stateful Bean">
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
- <interceptor-ref name="Basic Authorization"/>
- </bind>
- <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
- <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
- <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
- <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
- <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
- </bind>
- <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
- <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
- </bind>
-
- <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
- <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
- </bind>
- <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
- @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
- </annotation>
- </domain>
-
- <domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
- <!-- NON Clustered cache configuration -->
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND !class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
- </annotation>
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
- </annotation>
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300)
- </annotation>
-
- <!-- Clustered cache configuration -->
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
- </annotation>
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
- </annotation>
- </domain>
-
- <domain name="JACC Stateful Bean">
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
- <interceptor-ref name="JACC Authorization"/>
- </bind>
- <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
- <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
- <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
- <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
- <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
- <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
- </bind>
- <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
- <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
- </bind>
-
- <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
- <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
- </bind>
- <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
- @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
- </annotation>
-
- <!-- NON Clustered cache configuration -->
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND !class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
- </annotation>
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
- </annotation>
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300)
- </annotation>
-
- <!-- Clustered cache configuration -->
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
- </annotation>
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class((a)org.jboss.annotation.ejb.Clustered)">
- @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
- </annotation>
- </domain>
-
- <domain name="Embedded Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
- <!-- NON Clustered cache configuration -->
- <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache)">
- @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.NoPassivationCache.class)
- </annotation>
-
- </domain>
-
- <domain name="Message Driven Bean">
- <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
- <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
- <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
- </bind>
- <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
- @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
- </annotation>
- </domain>
-
- <domain name="Consumer Bean">
- <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
- <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
- <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
- </bind>
- <bind pointcut="execution(public * *->*(..)) AND (has(* *->@org.jboss.annotation.ejb.CurrentMessage(..)) OR hasfield(* *->@org.jboss.annotation.ejb.CurrentMessage))">
- <interceptor-ref name="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
- </bind>
- <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
- @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
- </annotation>
- </domain>
-
- <domain name="Service Bean">
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
- </bind>
- <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
- <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
- <interceptor-ref name="Basic Authorization"/>
- </bind>
- <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
- <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
- <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
- </bind>
- <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
- <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
- </bind>
- </domain>
-
- <domain name="JACC Service Bean">
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
- </bind>
- <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
- <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
- <interceptor-ref name="Basic Authorization"/>
- </bind>
- <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
- <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
- </bind>
- <bind pointcut="execution(public * *->*(..))">
- <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
- <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
- <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
- </bind>
- <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
- <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
- </bind>
- </domain>
-
-
-</aop>
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/embedded-jboss-beans.xml b/modules/enterprise/server/integration-tests/src/test/resources/embedded-jboss-beans.xml
deleted file mode 100644
index 05edefa..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/embedded-jboss-beans.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
- xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
-
- <bean name="InitialContextProperties" class="java.util.Hashtable">
- <constructor>
- <parameter class="java.util.Map">
- <map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>java.naming.factory.initial</key>
- <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
- </entry>
- <entry>
- <key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming:org.jnp.interfaces</value>
- </entry>
- </map>
- </parameter>
- </constructor>
- </bean>
-
- <bean name="java:comp/Initializer" class="org.jboss.ejb3.embedded.JavaCompInitializer">
- <property name="jndiProperties">
- <inject bean="InitialContextProperties"/>
- </property>
- </bean>
-
- <bean name="XidFactory" class="org.jboss.tm.XidFactoryImpl"/>
-
- <bean name="XidFactoryMBean" class="org.jboss.ejb3.embedded.XidFactoryMBean">
- <constructor>
- <parameter class="org.jboss.tm.XidFactoryBase">
- <inject bean="XidFactory"/>
- </parameter>
- </constructor>
- </bean>
-
- <bean name="TransactionManagerInitializer" class="org.jboss.tm.TransactionManagerInitializer">
- <property name="xidFactory">
- <inject bean="XidFactory"/>
- </property>
- <property name="initialContextProperties">
- <inject bean="InitialContextProperties"/>
- </property>
- </bean>
-
- <bean name="UserTransaction" class="org.jboss.ejb3.embedded.UserTransactionImpl">
- <demand>TransactionManagerInitializer</demand>
- </bean>
-
- <bean name="UserTransactionBinding" class="org.jboss.ejb3.embedded.JndiBinder">
- <property name="jndiProperties">
- <inject bean="InitialContextProperties"/>
- </property>
- <property name="target">
- <inject bean="UserTransaction"/>
- </property>
- <property name="bindTo">UserTransaction</property>
- <property name="serializable">false</property>
- </bean>
-
-
- <bean name="TransactionManager" class="java.lang.Object">
- <constructor factoryMethod="getTransactionManager">
- <factory bean="TransactionManagerInitializer"/>
- </constructor>
- </bean>
- <bean name="CachedConnectionManager" class="org.jboss.resource.connectionmanager.CachedConnectionManagerReference">
- <property name="transactionManager">
- <inject bean="TransactionManager"/>
- </property>
- </bean>
-
- <bean name="RHQDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
- <property name="driverClass">${rhq.test.ds.driver-class}</property>
- <property name="connectionURL">${rhq.test.ds.connection-url}</property>
- <property name="userName">${rhq.test.ds.user-name}</property>
- <property name="password">${rhq.test.ds.password}</property>
- <property name="jndiName">java:/RHQDS</property>
- <property name="minSize">0</property>
- <property name="maxSize">20</property>
- <property name="blockingTimeout">3000</property>
- <property name="idleTimeout">100000</property>
- <property name="transactionManager">
- <inject bean="TransactionManager"/>
- </property>
- <property name="cachedConnectionManager">
- <inject bean="CachedConnectionManager"/>
- </property>
- <property name="initialContextProperties">
- <inject bean="InitialContextProperties"/>
- </property>
- </bean>
-
- <bean name="RHQDS" class="java.lang.Object">
- <constructor factoryMethod="getDatasource">
- <factory bean="RHQDSBootstrap"/>
- </constructor>
- </bean>
-
- <!-- needed for Quartz' no-TX data source (even though this is a local-tx, seems like Quartz is still working) -->
- <bean name="NoTxRHQDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
- <property name="driverClass">${rhq.test.ds.driver-class}</property>
- <property name="connectionURL">${rhq.test.ds.connection-url}</property>
- <property name="userName">${rhq.test.ds.user-name}</property>
- <property name="password">${rhq.test.ds.password}</property>
- <property name="jndiName">java:/NoTxRHQDS</property>
- <property name="minSize">0</property>
- <property name="maxSize">10</property>
- <property name="blockingTimeout">1000</property>
- <property name="idleTimeout">100000</property>
- <property name="transactionManager">
- <inject bean="TransactionManager"/>
- </property>
- <property name="cachedConnectionManager">
- <inject bean="CachedConnectionManager"/>
- </property>
- <property name="initialContextProperties">
- <inject bean="InitialContextProperties"/>
- </property>
- </bean>
-
- <bean name="NoTxRHQDS" class="java.lang.Object">
- <constructor factoryMethod="getDatasource">
- <factory bean="NoTxRHQDSBootstrap"/>
- </constructor>
- </bean>
-
- <bean name="DefaultDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
- <property name="driverClass">org.hsqldb.jdbcDriver</property>
- <property name="connectionURL">jdbc:hsqldb:.</property>
- <!-- <property name="connectionURL">jdbc:hsqldb:./hypersonic/localDB</property> -->
- <property name="userName">sa</property>
- <property name="jndiName">java:/DefaultDS</property>
- <property name="minSize">0</property>
- <property name="maxSize">10</property>
- <property name="blockingTimeout">1000</property>
- <property name="idleTimeout">100000</property>
- <property name="transactionManager">
- <inject bean="TransactionManager"/>
- </property>
- <property name="cachedConnectionManager">
- <inject bean="CachedConnectionManager"/>
- </property>
- <property name="initialContextProperties">
- <inject bean="InitialContextProperties"/>
- </property>
- </bean>
-
- <bean name="DefaultDS" class="java.lang.Object">
- <constructor factoryMethod="getDatasource">
- <factory bean="DefaultDSBootstrap"/>
- </constructor>
- </bean>
-
-</deployment>
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/jboss-jms-beans.xml b/modules/enterprise/server/integration-tests/src/test/resources/jboss-jms-beans.xml
deleted file mode 100644
index 287cffc..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/jboss-jms-beans.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
- xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="jboss.mq:service=JMSProviderLoader,name=JMSProvider" class="org.jboss.jms.jndi.JNDIProviderAdapter">
- <property name="factoryRef">java:/JmsXA</property>
- <property name="queueFactoryRef">java:/JmsXA</property>
- <property name="topicFactoryRef">java:/JmsXA</property>
- <property name="properties" class="java.util.Properties">
- <map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry>
- <key>java.naming.factory.initial</key>
- <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
- </entry>
- <entry>
- <key>java.naming.factory.url.pkgs</key>
- <value>org.jboss.naming:org.jnp.interfaces</value>
- </entry>
- </map>
- </property>
- </bean>
-
- <bean name="b1" class="org.jboss.ejb3.embedded.JndiBinder">
- <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
- <property name="target"><inject bean="jboss.mq:service=JMSProviderLoader,name=JMSProvider"/></property>
- <property name="bindTo">java:/DefaultJMSProvider</property>
- <property name="serializable">true</property>
- </bean>
-
- <bean name="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool" class="org.jboss.jms.asf.StdServerSessionPoolFactory">
- <property name="name">StdJMSPool</property>
- <property name="xidFactory"><inject bean="XidFactoryMBean"/></property>
- <property name="transactionManager"><inject bean="TransactionManager"/></property>
- </bean>
-
- <bean name="b2" class="org.jboss.ejb3.embedded.JndiBinder">
- <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
- <property name="target"><inject bean="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool"/></property>
- <property name="bindTo">java:/StdJMSPool</property>
- <property name="serializable">false</property>
- </bean>
-
-
- <bean name="jboss.mq:service=PersistenceManager" class="org.jboss.mq.pm.none.PersistenceManager">
- </bean>
-
- <bean name="jboss.mq:service=MessageCache" class="org.jboss.mq.kernel.MessageCache">
- <property name="persistenceManager"><inject bean="jboss.mq:service=PersistenceManager"/></property>
- <property name="highMemoryMark">50</property>
- <property name="maxMemoryMark">60</property>
- </bean>
-
- <bean name="jms-rar-WorkManager" class="org.jboss.ejb3.embedded.resource.JBossWorkManager">
- </bean>
-
- <bean name="jms-rar-DeploymentInfo" class="org.jboss.ejb3.embedded.resource.Ejb3DeploymentInfo">
- <constructor>
- <parameter class="java.lang.String">jms-ra.rar</parameter>
- <parameter class="java.lang.String">javax.jms.MessageListener</parameter>
- <parameter class="java.lang.String">org.jboss.resource.adapter.jms.inflow.JmsActivationSpec</parameter>
- </constructor>
- </bean>
-
- <bean name="jboss.jca:name='jms-ra.rar',service=RARDeployment" class="org.jboss.ejb3.embedded.resource.RARDeployment">
- <constructor>
- <parameter class="org.jboss.deployment.DeploymentInfo">
- <inject bean="jms-rar-DeploymentInfo"/>
- </parameter>
- </constructor>
- <property name="workManager"><inject bean="jms-rar-WorkManager"/></property>
- </bean>
-
- <bean name="jboss.mq:service=StateManager" class="org.jboss.mq.sm.none.NullStateManager">
- </bean>
-
- <bean name="BasicQueueParameters" class="org.jboss.mq.server.BasicQueueParameters"/>
-
- <bean name="jboss.mq:service=ThreadPool" class="org.jboss.util.threadpool.BasicThreadPool">
- <property name="name">JMSThread</property>
- <property name="threadGroupName">JBossMQ Server Threads</property>
- <!-- The max number of threads in the pool -->
- <property name="maximumPoolSize">10</property>
- <!-- The max number of tasks before the queue is full -->
- <property name="maximumQueueSize">1000</property>
- <!-- The behavior of the pool when a task is added and the queue is full.
- abort - a RuntimeException is thrown
- run - the calling thread executes the task
- wait - the calling thread blocks until the queue has room
- discard - the task is silently discarded without being run
- discardOldest - check to see if a task is about to complete and enque
- the new task if possible, else run the task in the calling thread
- -->
- <property name="blockingMode">run</property>
- </bean>
-
- <bean name="jboss.mq:service=DestinationManager" class="org.jboss.mq.server.JMSDestinationManager">
- <constructor>
- <parameter class="org.jboss.mq.server.BasicQueueParameters">
- <inject bean="BasicQueueParameters"/>
- </parameter>
- </constructor>
- <property name="persistenceManager"><inject bean="jboss.mq:service=PersistenceManager"/></property>
- <property name="messageCache"><inject bean="jboss.mq:service=MessageCache"/></property>
- <property name="stateManager"><inject bean="jboss.mq:service=StateManager"/></property>
- <property name="threadPool"><inject bean="jboss.mq:service=ThreadPool"/></property>
- <property name="threadGroup"><inject bean="jboss.mq:service=ThreadPool" property="threadGroup"/></property>
- <start method="startServer"/>
- <stop method="stopServer"/>
- </bean>
-
- <bean name="jboss.mq.destination:service=Queue,name=DLQ" class="org.jboss.mq.kernel.Queue">
- <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
- <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
- <property name="destinationName">DLQ</property>
- </bean>
-
- <bean name="jboss.mq:service=Invoker" class="org.jboss.mq.server.JMSServerInvoker">
- <property name="next"><inject bean="jboss.mq:service=DestinationManager"/></property>
- </bean>
-
- <bean name="jboss.mq:service=invocationlayer,type=JVM" class="org.jboss.mq.kernel.JVMIL">
- <property name="jmsInvoker"><inject bean="jboss.mq:service=Invoker"/></property>
- <!-- notice we actually switched - the non-xa connection factory JNDI Ref is the JNDI name our EJBs use -->
- <!-- the embedded EJB container doesn't support XA, so the connection factory our JmsXA JNDI lookup will return will be a non-XA factory -->
- <property name="connectionFactoryJNDIRef">java:/JmsXA</property>
- <property name="XAConnectionFactoryJNDIRef">java:/ConnectionFactory</property>
- <property name="pingPeriod">0</property>
- <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
- </bean>
-
-</deployment>
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/jms-ra.rar b/modules/enterprise/server/integration-tests/src/test/resources/jms-ra.rar
deleted file mode 100644
index c4807c6..0000000
Binary files a/modules/enterprise/server/integration-tests/src/test/resources/jms-ra.rar and /dev/null differ
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/jndi.properties b/modules/enterprise/server/integration-tests/src/test/resources/jndi.properties
deleted file mode 100644
index 9225cef..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/jndi.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/log4j.xml b/modules/enterprise/server/integration-tests/src/test/resources/log4j.xml
deleted file mode 100644
index bc65329..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/log4j.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml 39945 2006-01-12 02:44:07Z bill $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="WARN"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Messagen -->
- <!--
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
- -->
- <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} [%c] (%F:%M:%L) -%m%n"/>
- </layout>
- </appender>
-
- <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
- <param name="File" value="target/server-jar-test.log"/>
- <param name="Threshold" value="WARN"/>
- <param name="Append" value="false"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Messagen -->
- <!--
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
- -->
- <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} [%c] (%F:%M:%L) -%m%n"/>
- </layout>
- </appender>
-
- <!-- Hibernate logs WARNINGS frequent from this class, in test envs. -->
- <category name="org.hibernate.hql.ast.QueryTranslatorImpl">
- <priority value="ERROR"/>
- </category>
-
- <!-- hides the TIMER SERVICE IS NOT INSTALLED warning - we know embedded EJB3 container doesn't support timers -->
- <category name="org.jboss.ejb3.timerservice.jboss.JBossTimerServiceFactory">
- <priority value="ERROR"/>
- </category>
-
- <!-- hides the shutdown warnings - for some reason, the container spits out some warnings when shutting down -->
- <category name="org.jboss.kernel.plugins.dependency.StartStopLifecycleAction">
- <priority value="ERROR"/>
- </category>
-
- <!-- Hibernate SQL logs -->
- <!--
- <category name="org.hibernate.SQL">
- <priority value="DEBUG"/>
- </category>
- -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/login-config.xml b/modules/enterprise/server/integration-tests/src/test/resources/login-config.xml
deleted file mode 100644
index 645294d..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/login-config.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version='1.0'?>
-
-<!DOCTYPE policy PUBLIC
- "-//JBoss//DTD JBOSS Security Config 3.0//EN"
- "http://www.jboss.org/j2ee/dtd/security_config.dtd">
-
-<!-- The XML based JAAS login configuration read by the
-org.jboss.security.auth.login.XMLLoginConfig mbean. Add
-an application-policy element for each security domain.
-
-The outline of the application-policy is:
-<application-policy name="security-domain-name">
- <authentication>
- <login-module code="login.module1.class.name" flag="control_flag">
- <module-option name = "option1-name">option1-value</module-option>
- <module-option name = "option2-name">option2-value</module-option>
- ...
- </login-module>
-
- <login-module code="login.module2.class.name" flag="control_flag">
- ...
- </login-module>
- ...
- </authentication>
-</application-policy>
-
-$Revision: 42748 $
--->
-
-<policy>
- <!-- Used by clients within the application server VM such as
- mbeans and servlets that access EJBs.
- -->
- <application-policy name="client-login">
- <authentication>
- <login-module code="org.jboss.security.ClientLoginModule"
- flag="required">
- <!-- Any existing security context will be restored on logout -->
- <module-option name="restore-login-identity">true</module-option>
- </login-module>
- </authentication>
- </application-policy>
-
- <application-policy name = "jbossmq">
- <authentication>
- <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule" flag = "required">
- <module-option name = "unauthenticatedIdentity">guest</module-option>
- <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
- </login-module>
- </authentication>
- </application-policy>
-
- <application-policy name="other">
- <!-- A simple server login module, which can be used when the number
- of users is relatively small. It uses two properties files:
- users.properties, which holds users (key) and their password (value).
- roles.properties, which holds users (key) and a comma-separated list of
- their roles (value).
- The unauthenticatedIdentity property defines the name of the principal
- that will be used when a null username and password are presented as is
- the case for an unuathenticated web client or MDB. If you want to
- allow such users to be authenticated add the property, e.g.,
- unauthenticatedIdentity="nobody"
- -->
- <authentication>
- <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
- flag="required"/>
- </authentication>
- </application-policy>
-
-</policy>
-
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/rhq-mdb-beans.xml b/modules/enterprise/server/integration-tests/src/test/resources/rhq-mdb-beans.xml
deleted file mode 100644
index ad05b5e..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/rhq-mdb-beans.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
- xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="jboss.mq.destination:service=Queue,name=AlertConditionQueue" class="org.jboss.mq.kernel.Queue">
- <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
- <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
- <property name="destinationName">AlertConditionQueue</property>
- </bean>
-
- <bean name="jboss.mq.destination:service=Queue,name=DriftChangesetQueue" class="org.jboss.mq.kernel.Queue">
- <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
- <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
- <property name="destinationName">DriftChangesetQueue</property>
- </bean>
-
- <bean name="jboss.mq.destination:service=Queue,name=DriftFileQueue" class="org.jboss.mq.kernel.Queue">
- <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
- <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
- <property name="destinationName">DriftFileQueue</property>
- </bean>
-
-</deployment>
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/security-beans.xml b/modules/enterprise/server/integration-tests/src/test/resources/security-beans.xml
deleted file mode 100644
index 84fa819..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/security-beans.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
- xmlns="urn:jboss:bean-deployer">
-
- <bean class="org.jboss.ejb3.embedded.JaasSecurityManagerService"
- name="jboss.security:service=JaasSecurityManager">
- <property name="initialContextProperties">
- <inject bean="InitialContextProperties"/>
- </property>
- </bean>
-</deployment>
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/test-assist-color-number.txt b/modules/enterprise/server/integration-tests/src/test/resources/test-assist-color-number.txt
deleted file mode 100644
index 6ad90cc..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/test-assist-color-number.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-
-color[ number
-c
-color[
-n
-number
-r
-color[ number
-lo
-color[
-number
-number!= number!== number= number==
-be
-number
-number==
-number=="two" number=="four" number=="twenty-two" number=="twenty-four" number=="forty-two"
-number==t
-number=="two" number=="twenty-two" number=="twenty-four" number=="forty-two"
-number==fo
-number=="four" number=="twenty-four" number=="forty-two"
-color
-color[
-color[
-color[primary] color[other]
-color[p
-color[primary]
-color[o
-color[other]
-color[r
-color[primary] color[other]
-color[primary
-color[primary]
-color[primary]
-color[primary]!= color[primary]!== color[primary]= color[primary]==
-color[primary]=
-color[primary]="red" color[primary]="green" color[primary]="blue"
-color[primary]=e
-color[primary]="red" color[primary]="green" color[primary]="blue"
-color[primary]=d
-color[primary]="red"
-color[primary]=g
-color[primary]="green"
-color[primary]=b
-color[primary]="blue"
-color[primary]=r
-color[primary]="red" color[primary]="green"
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/test-ldap.properties b/modules/enterprise/server/integration-tests/src/test/resources/test-ldap.properties
deleted file mode 100644
index 3316083..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/test-ldap.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-rhq.test.ldap.url=${rhq.test.ldap.url}
-rhq.test.ldap.LDAPFactory=${rhq.test.ldap.LDAPFactory}
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/test-scheduler.properties b/modules/enterprise/server/integration-tests/src/test/resources/test-scheduler.properties
deleted file mode 100644
index 804639a..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/test-scheduler.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-# QUARTZ CONFIGURATION FOR OUR UNIT TESTS
-# our test timeout will be fast, 5 seconds
-rhq.server.operation-timeout = 5
-
-# scheduler factory config
-org.quartz.scheduler.instanceName = RHQScheduler
-org.quartz.scheduler.instanceId = AUTO
-
-# thread pool config
-org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
-org.quartz.threadPool.threadCount = 25
-org.quartz.threadPool.threadPriority = 5
-
-# database config - note the use of POSTGRES for tests
-org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
-org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
-# tests don't need this
-org.quartz.jobStore.isClustered = false
-org.quartz.jobStore.clusterCheckinInterval = 600000
-# make this a small non-zero time (in ms) so the scheduler (almost) never sleeps for more predictable test timing
-org.quartz.scheduler.idleWaitTime = 10
-org.quartz.jobStore.tablePrefix = RHQ_QRTZ_
-org.quartz.jobStore.useProperties = true
-org.quartz.jobStore.dataSource = RHQDS
-org.quartz.dataSource.RHQDS.jndiURL = java:/RHQDS
-org.quartz.dataSource.RHQDS.maxConnections = 10
-org.quartz.jobStore.nonManagedTXDataSource = NoTxRHQDS
-org.quartz.dataSource.NoTxRHQDS.jndiURL = java:/NoTxRHQDS
-org.quartz.dataSource.NoTxRHQDS.maxConnections = 10
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/testng.xml b/modules/enterprise/server/integration-tests/src/test/resources/testng.xml
deleted file mode 100644
index 1452edb..0000000
--- a/modules/enterprise/server/integration-tests/src/test/resources/testng.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-
-<suite name="EJB3 Testsuite" >
- <test name="EJB3 tests" >
- <groups>
- <run>
- <include name="integration.ejb3"/>
- </run>
- </groups>
-
- </test>
-</suite>
diff --git a/modules/enterprise/server/itests/pom.xml b/modules/enterprise/server/itests/pom.xml
new file mode 100644
index 0000000..6d871a1
--- /dev/null
+++ b/modules/enterprise/server/itests/pom.xml
@@ -0,0 +1,556 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>rhq-server-itests</artifactId>
+
+ <name>RHQ Server Integration Tests</name>
+ <description>RHQ enterprise server integration tests</description>
+
+ <scm>
+ <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</connection>
+ <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</developerConnection>
+ </scm>
+
+ <properties>
+ <rhq.server.datasource>java:/RHQDS</rhq.server.datasource>
+ <rhq.server.ds-mapping>PostgreSQL</rhq.server.ds-mapping>
+ <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-comm</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-common-drift</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.java-diff-utils</groupId>
+ <artifactId>diffutils</artifactId>
+ <version>1.2.1</version>
+ </dependency>
+
+ <!--================ Test Deps ================-->
+
+ <!-- Note, the test deps are intentionally placed above the other scoped deps because of classpath
+ reasons. Maven orders the [test] classpath in the order listed in the pom. We specifically
+ need the embeddable-ejb3 jar above the standard ejb3 jars because we need the embeddble packages
+ loaded when testing. -->
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq.helpers</groupId>
+ <artifactId>perftest-support</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant-launcher</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>jboss-ejb3-all</artifactId>
+ <version>${jboss-embeddable-ejb3.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- NOTE: The remaining test deps correspond to the classes contained in hibernate-all.jar and thirdparty-all.jar. -->
+
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>2.7.7</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>javassist</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>1.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <!-- 3rd Party Deps -->
+
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>3.2</version>
+ </dependency>
+
+ <!-- Required by a couple APL and Lather classes - TODO: Remove this once APL and Lather have been excised. -->
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.6.1</version>
+ </dependency>
+
+ <!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
+ <!-- also required by EJB3 Embedded (test scope) -->
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.1.4</version>
+ </dependency>
+
+ <!-- required by RHQ server classes, as well as EJB3 Embedded -->
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1-jboss</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>gnu-getopt</groupId>
+ <artifactId>getopt</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ </dependency>
+
+ <dependency>
+ <groupId>hibernate</groupId>
+ <artifactId>hibernate3</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>hibernate-annotations</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>hibernate-entitymanager</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
+ <!-- The Sun javamail jar isn't available from a public repo due to licensing issues,
+ so use the Geronimo one instead. -->
+ <version>1.3</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-cache</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <!-- includes the org.jboss.ejb3.StrictMaxPool class, which is needed by the PoolClass annotation used on some
+ of our SLSB's -->
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jmx</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-system</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbosssx</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>3.1.1</version>
+ </dependency>
+
+ <!-- for the transaction interrupt EJB3 interceptor -->
+ <dependency>
+ <groupId>org.jboss.transaction</groupId>
+ <artifactId>jboss-jta</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz-oracle</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ <!-- somehow this is needed otherwise the hibernate stuff doesn't initialize in our tests -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.snmp4j</groupId>
+ <artifactId>snmp4j</artifactId>
+ <version>1.8.2</version>
+ </dependency>
+
+ <!-- required by RHQ server classes, as well as EJB3 Embedded -->
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4</version>
+ </dependency>
+
+ <!-- TODO: Why is this needed? -->
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <!--<scope>test</scope>-->
+ </dependency>
+
+ <dependency>
+ <groupId>rss4j</groupId>
+ <artifactId>rss4j</artifactId>
+ <version>0.92-on.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>5.5.20</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>tomcat-jk</artifactId>
+ <version>4.1.31</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Needed by com.jboss.jbossnetwork.apl.actions.xml.XPathProcessor; TODO: Remove once APL has been excised. -->
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.5.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.29</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <version>2.0.1.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.18</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-dbutils</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <!-- generate the I18N resource bundles -->
+ <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask" />
+
+ <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false" verify="true">
+ <classpath refid="maven.runtime.classpath" />
+ <classfileset dir="${project.build.outputDirectory}">
+ <include name="**/ServerI18NResourceKeys.class" />
+ <include name="**/AlertI18NResourceKeys.class" />
+ </classfileset>
+ </i18n>
+
+ <!-- create our rhq-server-version.properties file that goes in our jar -->
+ <tstamp>
+ <format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z" />
+ </tstamp>
+
+ <echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
+Product-Version=${project.version}
+Module-Name=${project.name}
+Module-Version=${project.version}
+Build-Number=${buildNumber}
+Build-Date=${build.time}
+Build-Jdk-Vendor=${java.vendor}
+Build-Jdk=${java.version}
+Build-OS-Name=${os.name}
+Build-OS-Version=${os.version}
+</echo>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <!-- in order to get JMS to work properly in embedded test container, extract jms-rs.rar classes -->
+ <execution>
+ <id>Extract JMS classes from RAR needed for JMS tests</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <unzip src="src/test/resources/jms-ra.rar" dest="target">
+ <patternset>
+ <include name="jms-ra.jar"/>
+ </patternset>
+ </unzip>
+ <unzip src="target/jms-ra.jar" dest="target/test-classes">
+ <patternset>
+ <include name="org/**"/>
+ </patternset>
+ </unzip>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java
new file mode 100644
index 0000000..64c6537
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java
@@ -0,0 +1,146 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.plugin.PluginKey;
+import org.rhq.core.domain.plugin.PluginStatusType;
+import org.rhq.core.domain.plugin.ServerPlugin;
+import org.rhq.core.util.MessageDigestGenerator;
+import org.rhq.enterprise.server.plugin.pc.AbstractTypeServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainerConfiguration;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginEnvironment;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginManager;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginService;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginType;
+import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginManager;
+import org.rhq.enterprise.server.xmlschema.ServerPluginDescriptorMetadataParser;
+import org.rhq.enterprise.server.xmlschema.generated.serverplugin.ServerPluginDescriptorType;
+
+public class DriftServerPluginService extends ServerPluginService implements DriftServerPluginServiceMBean {
+
+ public TestMasterServerPluginContainer master;
+ public MasterServerPluginContainerConfiguration masterConfig;
+
+ public DriftServerPluginService() {
+ // build the config at constructor time so tests have it even before the PC is initialized
+ File dir = new File(System.getProperty("java.io.tmpdir"), "test-server-plugins");
+ this.masterConfig = new MasterServerPluginContainerConfiguration(dir, dir, dir, null);
+ }
+
+ @Override
+ public MasterServerPluginContainer createMasterPluginContainer() {
+ this.master = new TestMasterServerPluginContainer();
+ this.master.initialize(this.masterConfig);
+ return this.master;
+ }
+
+ class TestMasterServerPluginContainer extends MasterServerPluginContainer {
+ @Override
+ protected ClassLoader createRootServerPluginClassLoader() {
+ return getClass().getClassLoader();
+ }
+
+ @Override
+ protected Map<URL, ? extends ServerPluginDescriptorType> preloadAllPlugins() throws Exception {
+ // if our test never setup any plugins, ignore it and just return an empty map
+ File pluginDir = getConfiguration().getPluginDirectory();
+ if (pluginDir == null || pluginDir.listFiles() == null || pluginDir.listFiles().length == 0) {
+ return new HashMap<URL, ServerPluginDescriptorType>();
+ } else {
+ return super.preloadAllPlugins();
+ }
+ }
+
+ @Override
+ protected List<PluginKey> getDisabledPluginKeys() {
+ // in the real world, the db is checked for enable flag, here we say all plugins are enabled
+ return new ArrayList<PluginKey>();
+ }
+
+ @Override
+ protected List<AbstractTypeServerPluginContainer> createPluginContainers() {
+ ArrayList<AbstractTypeServerPluginContainer> pcs = new ArrayList<AbstractTypeServerPluginContainer>(1);
+ DriftServerPluginContainer driftPC = new TestDriftServerPluginContainer(this);
+ pcs.add(driftPC);
+
+ return pcs;
+ }
+ }
+
+ class TestDriftServerPluginContainer extends DriftServerPluginContainer {
+ public TestDriftServerPluginContainer(MasterServerPluginContainer master) {
+ super(master);
+ }
+
+ @Override
+ protected ServerPluginManager createPluginManager() {
+ return new TestDriftServerPluginManager(this);
+ }
+ }
+
+ class TestDriftServerPluginManager extends DriftServerPluginManager {
+ public TestDriftServerPluginManager(DriftServerPluginContainer pc) {
+ super(pc);
+ }
+
+ @Override
+ protected ServerPlugin getPlugin(ServerPluginEnvironment env) {
+ try {
+ Configuration pluginConfig = null;
+ Configuration scheduledJobsConfig = null;
+ ConfigurationDefinition configDef;
+
+ ServerPluginDescriptorType pluginDescriptor = env.getPluginDescriptor();
+
+ configDef = ServerPluginDescriptorMetadataParser.getPluginConfigurationDefinition(pluginDescriptor);
+ if (configDef != null) {
+ pluginConfig = configDef.getDefaultTemplate().createConfiguration();
+ }
+
+ configDef = ServerPluginDescriptorMetadataParser.getScheduledJobsDefinition(pluginDescriptor);
+ if (configDef != null) {
+ scheduledJobsConfig = configDef.getDefaultTemplate().createConfiguration();
+ }
+
+ File pluginFile = new File(env.getPluginUrl().toURI());
+ ServerPlugin plugin = new ServerPlugin(0, env.getPluginKey().getPluginName(), pluginFile.getName(),
+ pluginDescriptor.getDisplayName(), true, PluginStatusType.INSTALLED, pluginDescriptor
+ .getDescription(), "", MessageDigestGenerator.getDigestString(pluginFile), pluginDescriptor
+ .getVersion(), pluginDescriptor.getVersion(), pluginConfig, scheduledJobsConfig,
+ new ServerPluginType(pluginDescriptor).stringify(), System.currentTimeMillis(), System
+ .currentTimeMillis());
+ return plugin;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+}
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java
new file mode 100644
index 0000000..d38374e
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java
@@ -0,0 +1,25 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
+
+public interface DriftServerPluginServiceMBean extends ServerPluginServiceManagement {
+}
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
new file mode 100644
index 0000000..7db3365
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
@@ -0,0 +1,241 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static org.rhq.core.domain.resource.ResourceCategory.SERVER;
+import static org.rhq.enterprise.server.util.LookupUtil.getSubjectManager;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.NonUniqueResultException;
+
+import org.apache.commons.io.FileUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftDefinitionTemplate;
+import org.rhq.core.domain.resource.Agent;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.shared.ResourceBuilder;
+import org.rhq.core.domain.shared.ResourceTypeBuilder;
+import org.rhq.enterprise.server.plugin.ServerPluginsLocal;
+import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerCommunicationsService;
+import org.rhq.test.TransactionCallback;
+
+@Test(groups = "drift")
+public class DriftServerTest extends AbstractEJB3Test {
+
+ protected final String RESOURCE_TYPE_NAME = getClass().getSimpleName() + "_RESOURCE_TYPE";
+
+ protected final String AGENT_NAME = getClass().getSimpleName() + "_AGENT";
+
+ protected final String RESOURCE_NAME = getClass().getSimpleName() + "_RESOURCE";
+
+ private ServerPluginsLocal serverPluginsMgr;
+
+ protected DriftServerPluginService driftServerPluginService;
+
+ protected TestServerCommunicationsService agentServiceContainer;
+
+ protected ResourceType resourceType;
+
+ protected Agent agent;
+
+ protected Resource resource;
+
+ @BeforeMethod
+ public void initServices(Method testMethod) throws Exception {
+ initDriftServer();
+ initAgentServices();
+
+ InitDB annotation = testMethod.getAnnotation(InitDB.class);
+ if (annotation == null || annotation.value()) {
+ initDB();
+ }
+ }
+
+ private void initDriftServer() throws Exception {
+ driftServerPluginService = new DriftServerPluginService();
+ prepareCustomServerPluginService(driftServerPluginService);
+ driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
+
+ File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.1.0-SNAPSHOT.jar");
+ assertTrue("Drift server plugin JAR file not found at" + jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
+ FileUtils.copyFileToDirectory(jpaDriftPlugin, driftServerPluginService.masterConfig.getPluginDirectory());
+
+ driftServerPluginService.startMasterPluginContainer();
+
+ //serverPluginsMgr = LookupUtil.getServerPlugins();
+ }
+
+ private void initAgentServices() {
+ agentServiceContainer = prepareForTestAgents();
+ agentServiceContainer.driftService = new TestDefService();
+ }
+
+ @AfterMethod(inheritGroups = true)
+ public void shutDownServices() throws Exception {
+ shutDownDriftServer();
+ shutDownAgentServices();
+ }
+
+ private void shutDownDriftServer() throws Exception {
+ unprepareServerPluginService();
+ driftServerPluginService.stopMasterPluginContainer();
+ }
+
+ private void shutDownAgentServices() {
+ agentServiceContainer = null;
+ unprepareForTestAgents();
+ }
+
+ @AfterClass(inheritGroups = true)
+ public void cleanUpDB() throws Exception {
+ purgeDB();
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ purgeDB(getEntityManager());
+ }
+ });
+ }
+
+ private void initDB() throws Exception {
+ purgeDB();
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ initResourceType();
+ initAgent();
+ initResource();
+
+ em.persist(resourceType);
+ em.persist(agent);
+ resource.setAgent(agent);
+ em.persist(resource);
+
+ initDB(em);
+ }
+ });
+ }
+
+ private void purgeDB() {
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ em.createQuery("delete from JPADrift ").executeUpdate();
+ em.createQuery("delete from JPADriftChangeSet").executeUpdate();
+ em.createQuery("delete from JPADriftSet").executeUpdate();
+ em.createQuery("delete from JPADriftFile").executeUpdate();
+ em.createQuery("delete from DriftDefinition").executeUpdate();
+ em.createQuery("delete from DriftDefinitionTemplate").executeUpdate();
+
+ deleteEntity(Resource.class, RESOURCE_NAME, em);
+ deleteEntity(Agent.class, AGENT_NAME, em);
+ deleteEntity(ResourceType.class, RESOURCE_TYPE_NAME, em);
+
+ purgeDB(em);
+ }
+ });
+ }
+
+ protected void purgeDB(EntityManager em) {
+ }
+
+ protected void initDB(EntityManager em) {
+ }
+
+ protected void deleteEntity(Class<?> clazz, String name, EntityManager em) {
+ try {
+ Object entity = em.createQuery(
+ "select entity from " + clazz.getSimpleName() + " entity where entity.name = :name")
+ .setParameter("name", name)
+ .getSingleResult();
+ em.remove(entity);
+ } catch (NoResultException e) {
+ // we can ignore no results because this code will run when the db
+ // is empty and we expect no results in that case
+ } catch (NonUniqueResultException e) {
+ // we will fail here to let the person running the test know that
+ // the database may not be in a consistent state
+ fail("Purging " + name + " failed. Expected to find one instance of " + clazz.getSimpleName() +
+ " but found more than one. The database may not be in a consistent state.");
+ }
+ }
+
+ protected void initResourceType() {
+ resourceType = new ResourceTypeBuilder().createResourceType()
+ .withId(0)
+ .withName(RESOURCE_TYPE_NAME)
+ .withCategory(SERVER)
+ .withPlugin(RESOURCE_TYPE_NAME.toLowerCase())
+ .build();
+ }
+
+ protected void initAgent() {
+ agent = new Agent(AGENT_NAME, "localhost", 1, "", AGENT_NAME + "_TOKEN");
+ }
+
+ protected void initResource() {
+ resource = new ResourceBuilder().createResource()
+ .withId(0)
+ .withName(RESOURCE_NAME)
+ .withResourceKey(RESOURCE_NAME)
+ .withRandomUuid()
+ .withResourceType(resourceType)
+ .build();
+ }
+
+ protected Subject getOverlord() {
+ return getSubjectManager().getOverlord();
+ }
+
+ protected String toString(DriftDefinition def) {
+ return "DriftDefinition[id: " + def.getId() + ", name: " + def.getName() + "]";
+ }
+
+ protected String toString(DriftDefinitionTemplate template) {
+ return DriftDefinitionTemplate.class.getSimpleName() + "[id: " + template.getId() + ", name: " +
+ template.getName() + "]";
+ }
+
+ protected Drift findDriftByPath(List<? extends Drift> drifts, String path) {
+ for (Drift drift : drifts) {
+ if (drift.getPath().equals(path)) {
+ return drift;
+ }
+ }
+ return null;
+ }
+}
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
new file mode 100644
index 0000000..de93b74
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
@@ -0,0 +1,603 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.util.Arrays.asList;
+import static org.rhq.core.domain.common.EntityContext.forResource;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.plannedChanges;
+import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
+import static org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility.SerializationType.SERIALIZATION;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
+import static org.rhq.test.AssertUtils.assertPropertiesMatch;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.ejb.EJBException;
+import javax.persistence.EntityManager;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
+import org.rhq.core.domain.criteria.DriftDefinitionTemplateCriteria;
+import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftDefinitionComparator;
+import org.rhq.core.domain.drift.DriftDefinitionTemplate;
+import org.rhq.core.domain.drift.DriftSnapshot;
+import org.rhq.core.domain.drift.Filter;
+import org.rhq.core.domain.drift.JPADrift;
+import org.rhq.core.domain.drift.JPADriftChangeSet;
+import org.rhq.core.domain.drift.JPADriftFile;
+import org.rhq.core.domain.drift.JPADriftSet;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+
+public class DriftTemplateManagerBeanTest extends DriftServerTest {
+
+ private DriftTemplateManagerLocal templateMgr;
+
+ private DriftManagerLocal driftMgr;
+
+ private List<Resource> resources = new LinkedList<Resource>();
+
+ private JPADrift drift1;
+ private JPADrift drift2;
+ private JPADriftFile driftFile1;
+ private JPADriftFile driftFile2;
+
+ @BeforeClass
+ public void initClass() {
+ templateMgr = getDriftTemplateManager();
+ driftMgr = getDriftManager();
+
+ }
+
+ @Override
+ protected void initDB(EntityManager em) {
+ agentServiceContainer.driftService = new TestDefService() {
+ @Override
+ public void unscheduleDriftDetection(int resourceId, DriftDefinition driftDef) {
+ detach(driftDef);
+ }
+
+ @Override
+ public void updateDriftDetection(int resourceId, DriftDefinition driftDef) {
+ detach(driftDef);
+ }
+
+ @Override
+ public void updateDriftDetection(int resourceId, DriftDefinition driftDef, DriftSnapshot driftSnapshot) {
+ detach(driftDef);
+ detach(driftSnapshot);
+ }
+
+ private void detach(Object object) {
+ try {
+ HibernateDetachUtility.nullOutUninitializedFields(object, SERIALIZATION);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+
+ public void createNewTemplate() {
+ final DriftDefinition definition = new DriftDefinition(new Configuration());
+ definition.setName("test::createNewTemplate");
+ definition.setEnabled(true);
+ definition.setDriftHandlingMode(normal);
+ definition.setInterval(2400L);
+ definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ final DriftDefinitionTemplate newTemplate = templateMgr.createTemplate(getOverlord(), resourceType.getId(),
+ true, definition);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ ResourceType updatedType = em.find(ResourceType.class, resourceType.getId());
+
+ assertEquals("Failed to add new drift definition to resource type", 1, updatedType
+ .getDriftDefinitionTemplates().size());
+
+ DriftDefinitionTemplate expectedTemplate = new DriftDefinitionTemplate();
+ expectedTemplate.setTemplateDefinition(definition);
+ expectedTemplate.setUserDefined(true);
+
+ assertDriftTemplateEquals("Failed to save template", expectedTemplate, newTemplate);
+ assertTrue("The template should have its id set", newTemplate.getId() > 0);
+ }
+ });
+ }
+
+ public void createTemplateForNegativeUpdateTests() {
+ DriftDefinition definition = new DriftDefinition(new Configuration());
+ definition.setName("test::createTemplateForNegativeUpdateTests");
+ definition.setEnabled(true);
+ definition.setDriftHandlingMode(normal);
+ definition.setInterval(2400L);
+ definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ templateMgr.createTemplate(getOverlord(), resourceType.getId(), true, definition);
+
+ assertNotNull("Failed to load template", loadTemplate(definition.getName()));
+ }
+
+ @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
+ expectedExceptions = EJBException.class,
+ expectedExceptionsMessageRegExp = ".*base directory.*cannot be modified")
+ @InitDB(false)
+ public void doNotAllowBaseDirToBeUpdated() {
+ DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
+ DriftDefinition definition = template.getTemplateDefinition();
+ definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/TEST"));
+
+ templateMgr.updateTemplate(getOverlord(), template);
+ }
+
+ @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
+ expectedExceptions = EJBException.class,
+ expectedExceptionsMessageRegExp = ".*filters.*cannot be modified")
+ @InitDB(false)
+ public void doNotAllowFiltersToBeUpdated() {
+ DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
+ DriftDefinition definition = template.getTemplateDefinition();
+ definition.addExclude(new Filter("/foo/bar/TEST/conf", "*.xml"));
+
+ templateMgr.updateTemplate(getOverlord(), template);
+ }
+
+ @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
+ expectedExceptions = EJBException.class,
+ expectedExceptionsMessageRegExp = ".*name.*cannot be modified")
+ @InitDB(false)
+ public void doNotAllowTemplateNameToBeUpdated() {
+ DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
+ template.setName("A new name");
+
+ templateMgr.updateTemplate(getOverlord(), template);
+ }
+
+ public void createAndUpdateTemplate() {
+ // create the template
+ DriftDefinition definition = new DriftDefinition(new Configuration());
+ definition.setName("test::updateTemplate");
+ definition.setDescription("update template test");
+ definition.setEnabled(true);
+ definition.setDriftHandlingMode(normal);
+ definition.setInterval(2400L);
+ definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
+ definition);
+
+ // next create some definitions from the template
+ final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
+ final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
+ final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
+ final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
+
+ driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), attachedDef1);
+ driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), attachedDef2);
+ driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), detachedDef1);
+ driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), detachedDef2);
+
+ // update the template
+ final DriftDefinition newTemplateDef = template.getTemplateDefinition();
+ newTemplateDef.setInterval(4800L);
+ newTemplateDef.setDriftHandlingMode(plannedChanges);
+ newTemplateDef.setEnabled(false);
+
+ templateMgr.updateTemplate(getOverlord(), template);
+
+ // verify that the tempalte has been updated
+ final DriftDefinitionTemplate updatedTemplate = loadTemplate(template.getName());
+ AssertUtils.assertPropertiesMatch("Failed to update template", template, updatedTemplate, "resourceType",
+ "driftDefinitions", "templateDefinition");
+
+ // verify that attached definitions are updated.
+ for (DriftDefinition def : asList(attachedDef1, attachedDef2)) {
+ DriftDefinition updatedDef = loadDefinition(def.getId());
+ String msg = "Failed to propagate update to attached definition " + toString(updatedDef) + " - ";
+ DriftDefinition updatedTemplateDef = updatedTemplate.getTemplateDefinition();
+
+ assertEquals(msg + "enabled property not updated", updatedTemplateDef.isEnabled(),
+ updatedDef.isEnabled());
+ assertEquals(msg + "driftHandlingMode property not updated",
+ updatedTemplateDef.getDriftHandlingMode(), updatedDef.getDriftHandlingMode());
+ assertEquals(msg + "interval property not updated", updatedTemplateDef.getInterval(),
+ updatedDef.getInterval());
+ }
+
+ // verify that the detached definitions have not been updated.
+ for (DriftDefinition def : asList(detachedDef1, detachedDef2)) {
+ DriftDefinition defAfterUpdate = loadDefinition(def.getId());
+ String msg = "Detached definition " + toString(def) + " should not get updated - ";
+
+ assertEquals(msg + "enabled property was modified", def.isEnabled(), defAfterUpdate.isEnabled());
+ assertEquals(msg + "driftHandlingMode property was modified", def.getDriftHandlingMode(),
+ defAfterUpdate.getDriftHandlingMode());
+ assertEquals(msg + "interval property was modified", def.getInterval(), defAfterUpdate.getInterval());
+ }
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public void pinTemplate() throws Exception {
+ // First create the template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test::pinTemplate");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(),
+ resourceType.getId(), true, templateDef);
+
+ // next create some resource level definitions
+ final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
+ final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
+ final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
+ final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
+
+ // create initial change set from which the snapshot will be generated
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
+
+ driftFile1 = new JPADriftFile("a1b2c3");
+ drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift1);
+
+ // create change set v1
+ driftFile2 = new JPADriftFile("1a2b3c");
+ final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, attachedDef1);
+ drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ em.persist(attachedDef1);
+
+ em.persist(driftFile1);
+ em.persist(driftFile2);
+
+ em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
+
+ em.persist(changeSet1);
+ em.persist(drift2);
+
+ em.persist(attachedDef2);
+ em.persist(detachedDef1);
+ em.persist(detachedDef2);
+ }
+ });
+
+ // now we pin the snapshot to the template
+ templateMgr.pinTemplate(getOverlord(), template.getId(), attachedDef1.getId(), 1);
+
+ // verify that the template is now pinned
+ DriftDefinitionTemplate updatedTemplate = loadTemplate(template.getName());
+ assertTrue("Template should be marked pinned", updatedTemplate.isPinned());
+ }
+
+ @Test(dependsOnMethods = "pinTemplate")
+ @InitDB(false)
+ public void persistChangeSetWhenTemplateGetsPinned() throws Exception {
+ DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
+
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterId(template.getChangeSetId());
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+
+ assertEquals("Expected to find change set for pinned template", 1, changeSets.size());
+
+ JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
+ List<? extends Drift> expectedDrifts = asList(
+ new JPADrift(expectedChangeSet, "drift.1", FILE_ADDED, null, driftFile1),
+ new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
+
+ DriftChangeSet<?> actualChangeSet = changeSets.get(0);
+ List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
+
+ AssertUtils.assertCollectionMatchesNoOrder(
+ "Expected to find drifts from change sets 1 and 2 in the template change set",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
+
+ // we need to compare the newDriftFile properties separately because
+ // assertCollectionMatchesNoOrder compares properties via equals() and JPADriftFile
+ // does not implement equals.
+ assertPropertiesMatch(drift1.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(),
+ "The newDriftFile property was not set correctly for " + drift1);
+ assertPropertiesMatch(drift2.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(),
+ "The newDriftFile property was not set correctly for " + drift1);
+ }
+
+ @Test(dependsOnMethods = "pinTemplate")
+ @InitDB(false)
+ public void updateAttachedDefinitionsWhenTemplateGetsPinned() throws Exception {
+ DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
+
+ // get the attached definitions
+ List<DriftDefinition> attachedDefs = new LinkedList<DriftDefinition>();
+ for (DriftDefinition d : template.getDriftDefinitions()) {
+ if (d.isAttached() && (d.getName().equals("attachedDef1") || d.getName().equals("attachedDef2"))) {
+ attachedDefs.add(d);
+ }
+ }
+ assertEquals("Failed to get attached definitions for " + toString(template), 2, attachedDefs.size());
+ assertDefinitionIsPinned(attachedDefs.get(0));
+ assertDefinitionIsPinned(attachedDefs.get(1));
+ }
+
+ @Test(dependsOnMethods = "pinTemplate")
+ @InitDB(false)
+ public void doNotUpdateDetachedDefinitionsWhenTemplateGetsPinned() throws Exception {
+ DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
+
+ // get the detached definitions
+ List<DriftDefinition> detachedDefs = new LinkedList<DriftDefinition>();
+ for (DriftDefinition d : template.getDriftDefinitions()) {
+ if (!d.isAttached() && (d.getName().equals("detachedDef1") || d.getName().equals("detachedDef2"))) {
+ detachedDefs.add(d);
+ }
+ }
+ assertEquals("Failed to get detached definitions for " + toString(template), 2, detachedDefs.size());
+ assertDefinitionIsNotPinned(detachedDefs.get(0));
+ assertDefinitionIsNotPinned(detachedDefs.get(1));
+ }
+
+ public void deleteTemplate() throws Exception {
+ // first create the template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test::pinTemplate");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(),
+ resourceType.getId(), true, templateDef);
+
+ // next create some resource level definitions
+ final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
+ final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
+ final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
+ final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
+
+ // create some change sets
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
+
+ driftFile1 = new JPADriftFile("a1b2c3");
+ drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet0 = new JPADriftSet();
+ driftSet0.addDrift(drift1);
+
+ final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 0, DRIFT, detachedDef1);
+
+ driftFile2 = new JPADriftFile("1a2b3c");
+ drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
+
+ final JPADriftSet driftSet1 = new JPADriftSet();
+ driftSet1.addDrift(drift2);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ em.persist(attachedDef1);
+ em.persist(attachedDef2);
+ em.persist(detachedDef1);
+ em.persist(detachedDef2);
+
+ em.persist(driftFile1);
+ em.persist(driftFile2);
+
+ em.persist(changeSet0);
+ em.persist(driftSet0);
+ changeSet0.setInitialDriftSet(driftSet0);
+ em.merge(changeSet0);
+
+ em.persist(changeSet1);
+ em.persist(driftSet1);
+ changeSet1.setInitialDriftSet(driftSet1);
+ em.merge(changeSet1);
+ }
+ });
+
+ // delete the template
+ templateMgr.deleteTemplate(getOverlord(), template.getId());
+
+ // verify that attached definitions along with their change sets have
+ // been deleted
+ assertNull("Change sets belonging to attached definitions should be deleted", loadChangeSet(changeSet0.getId()));
+ assertNull("Attached definition " + toString(attachedDef1) + " should be deleted",
+ loadDefinition(attachedDef1.getId()));
+ assertNull("Attached definition " + toString(attachedDef2) + " should be deleted",
+ loadDefinition(attachedDef2.getId()));
+
+ // verify that detached definitions along with their change sets have not been deleted
+ assertNotNull("Change sets belonging to detached definitions should not be deleted",
+ loadChangeSet(changeSet1.getId()));
+ assertDetachedDefinitionNotDeleted(detachedDef1.getId());
+ assertDetachedDefinitionNotDeleted(detachedDef2.getId());
+
+ // verify that the template itself has been deleted
+ assertNull("The template " + toString(template) + " should have been deleted",
+ loadTemplate(template.getName(), false));
+ }
+
+ private void assertDefinitionIsPinned(DriftDefinition definition) throws Exception {
+ // verify that the definition is marked as pinned
+ assertTrue("Expected " + toString(definition) + " to be pinned", definition.isPinned());
+
+ // verify that the initial change set is generated for the definition
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(definition.getId());
+ criteria.addFilterCategory(COVERAGE);
+ criteria.fetchDrifts(true);
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+ assertEquals("Expected to find one change set", 1, changeSets.size());
+
+ JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
+ List<? extends Drift> expectedDrifts = asList(
+ new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
+ new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
+
+ DriftChangeSet<?> actualChangeSet = changeSets.get(0);
+ List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
+
+ AssertUtils.assertCollectionMatchesNoOrder(
+ "Expected to find drifts from change sets 1 and 2 in the template change set",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
+
+ // Finally make sure that there are no other change sets
+ criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterStartVersion(1);
+ criteria.addFilterDriftDefinitionId(definition.getId());
+
+ assertEquals("There should not be any drift change sets", 0,
+ driftMgr.findDriftChangeSetsByCriteria(getOverlord(), criteria).size());
+ }
+
+ private void assertDefinitionIsNotPinned(DriftDefinition definition) throws Exception {
+ // verify that the definition is not pinned
+ assertFalse("Expected " + toString(definition) + " to be unpinned", definition.isPinned());
+
+ // Note that this method assumes that the definition has no change sets
+ // associated with it and therefore checks that there are no change sets.
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(definition.getId());
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+ assertEquals("Did not expect to find any change sets for " + toString(definition) + ". Note that this " +
+ "assertion method assumes that the definition you are testing is not supposed to have any change sets.",
+ 0, changeSets.size());
+ }
+
+ private void assertDriftTemplateEquals(String msg, DriftDefinitionTemplate expected, DriftDefinitionTemplate actual) {
+ AssertUtils
+ .assertPropertiesMatch(msg + ": basic drift definition template properties do not match", expected, actual,
+ "id", "resourceType", "ctime", "templateDefinition");
+ assertDriftDefEquals(msg + ": template definitions do not match", expected.getTemplateDefinition(), actual
+ .getTemplateDefinition());
+ }
+
+ private void assertDriftDefEquals(String msg, DriftDefinition expected, DriftDefinition actual) {
+ DriftDefinitionComparator comparator = new DriftDefinitionComparator(
+ BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
+ assertEquals(msg, 0, comparator.compare(expected, actual));
+ }
+
+ private void assertDetachedDefinitionNotDeleted(int definitionId) {
+ DriftDefinition definition = loadDefinition(definitionId);
+ assertNotNull("Detached definition " + toString(definition) + " should not be deleted", definition);
+ assertNull("The detached definition's template reference should be set to null when the template is deleted",
+ definition.getTemplate());
+ }
+
+ private DriftDefinition createDefinition(DriftDefinitionTemplate template, String defName, boolean isAttached) {
+ DriftDefinition def = template.createDefinition();
+ def.setName(defName);
+ def.setAttached(isAttached);
+ def.setTemplate(template);
+ def.setResource(resource);
+ return def;
+ }
+
+ private DriftDefinitionTemplate loadTemplate(String name) {
+ return loadTemplate(name, true);
+ }
+
+ private DriftDefinitionTemplate loadTemplate(String name, boolean verifyResultsUnique) {
+ DriftDefinitionTemplateCriteria criteria = new DriftDefinitionTemplateCriteria();
+ criteria.addFilterResourceTypeId(resourceType.getId());
+ criteria.addFilterName(name);
+ criteria.fetchDriftDefinitions(true);
+
+ PageList<DriftDefinitionTemplate> templates = templateMgr.findTemplatesByCriteria(getOverlord(), criteria);
+ if (verifyResultsUnique) {
+ assertEquals("Expected to find one template", 1, templates.size());
+ }
+
+ if (templates.isEmpty()) {
+ return null;
+ }
+ return templates.get(0);
+ }
+
+ private DriftDefinition loadDefinition(int definitionId) {
+ DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
+ criteria.addFilterId(definitionId);
+ criteria.fetchConfiguration(true);
+ criteria.fetchTemplate(true);
+ PageList<DriftDefinition> definitions = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
+
+ if (definitions.isEmpty()) {
+ return null;
+ }
+ return definitions.get(0);
+ }
+
+ private DriftChangeSet<?> loadChangeSet(String id) throws Exception {
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterId(id);
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+
+ if (changeSets.isEmpty()) {
+ return null;
+ }
+ return changeSets.get(0);
+ }
+
+}
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java
new file mode 100644
index 0000000..65a6523
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java
@@ -0,0 +1,32 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Retention(RUNTIME)
+(a)Target({ElementType.METHOD })
+public @interface InitDB {
+ boolean value() default true;
+}
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
new file mode 100644
index 0000000..4faca1b
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
@@ -0,0 +1,309 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.util.Arrays.asList;
+import static org.apache.commons.io.IOUtils.toInputStream;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
+import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
+import static org.rhq.enterprise.server.util.LookupUtil.getJPADriftServer;
+import static org.rhq.test.AssertUtils.assertPropertiesMatch;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.JPADrift;
+import org.rhq.core.domain.drift.JPADriftChangeSet;
+import org.rhq.core.domain.drift.JPADriftFile;
+import org.rhq.core.domain.drift.JPADriftSet;
+import org.rhq.core.domain.drift.dto.DriftChangeSetDTO;
+import org.rhq.core.domain.drift.dto.DriftDTO;
+import org.rhq.core.domain.drift.dto.DriftFileDTO;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+
+public class JPADriftServerBeanTest extends DriftServerTest {
+
+ private JPADriftServerLocal jpaDriftServer;
+
+ private final String DRIFT_FILE_1_ID = "a1b2c3d4";
+
+ private final String DRIFT_FILE_2_ID = "1ab2b3c4d";
+
+ private JPADriftFile driftFile1;
+
+ private JPADriftFile driftFile2;
+
+ @BeforeClass
+ public void initTests() {
+ jpaDriftServer = getJPADriftServer();
+ }
+
+ @BeforeMethod
+ public void persistDriftFiles() throws Exception {
+ driftFile1 = jpaDriftServer.persistDriftFile(new JPADriftFile(DRIFT_FILE_1_ID));
+ driftFile2 = jpaDriftServer.persistDriftFile(new JPADriftFile(DRIFT_FILE_2_ID));
+
+ String driftFile1Content = "drift file 1 content...";
+ String driftFile2Content = "drift file 2 content...";
+
+ jpaDriftServer.persistDriftFileData(driftFile1, toInputStream(driftFile1Content), driftFile1Content.length());
+ jpaDriftServer.persistDriftFileData(driftFile2, toInputStream(driftFile2Content), driftFile2Content.length());
+
+ driftFile1 = jpaDriftServer.getDriftFile(getOverlord(), DRIFT_FILE_1_ID);
+ driftFile2 = jpaDriftServer.getDriftFile(getOverlord(), DRIFT_FILE_2_ID);
+
+ assertDriftFilePersisted(driftFile1, "driftFile1", driftFile1Content);
+ assertDriftFilePersisted(driftFile2, "driftFile2", driftFile2Content);
+ }
+
+ public void persistResourceChangeSet() {
+ // first create and persist the drift definition
+ final DriftDefinition driftDef = new DriftDefinition(new Configuration());
+ driftDef.setName("test::persistResourceChangeSet");
+ driftDef.setEnabled(true);
+ driftDef.setDriftHandlingMode(normal);
+ driftDef.setInterval(2400L);
+ driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+ driftDef.setResource(resource);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftDef);
+ }
+ });
+
+ // create the change set to be persisted
+ DriftChangeSetDTO changeSet = new DriftChangeSetDTO();
+ changeSet.setCategory(COVERAGE);
+ changeSet.setVersion(1);
+ changeSet.setDriftDefinitionId(driftDef.getId());
+ changeSet.setResourceId(resource.getId());
+ changeSet.setDriftHandlingMode(normal);
+ changeSet.setCtime(System.currentTimeMillis());
+
+ DriftDTO drift1 = new DriftDTO();
+ drift1.setCategory(FILE_ADDED);
+ drift1.setPath("drift.1");
+ drift1.setChangeSet(changeSet);
+ drift1.setCtime(System.currentTimeMillis());
+ drift1.setNewDriftFile(toDTo(driftFile1));
+
+ DriftDTO drift2 = new DriftDTO();
+ drift2.setCategory(FILE_ADDED);
+ drift2.setPath("drift.2");
+ drift2.setChangeSet(changeSet);
+ drift2.setCtime(System.currentTimeMillis());
+ drift2.setNewDriftFile(toDTo(driftFile2));
+
+ Set<DriftDTO> drifts = new HashSet<DriftDTO>();
+ drifts.add(drift1);
+ drifts.add(drift2);
+ changeSet.setDrifts(drifts);
+
+ String newChangeSetId = jpaDriftServer.persistChangeSet(getOverlord(), changeSet);
+
+ // verify that the change set was persisted
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterId(newChangeSetId);
+ criteria.fetchDrifts(true);
+
+ PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
+ assertEquals("Expected to find one change set", 1, changeSets.size());
+
+ JPADriftChangeSet jpaChangeSet = changeSets.get(0);
+ assertEquals("Expected change set to contain two drifts. This could be a result of the change set not being " +
+ "persisted correctly or the criteria fetch being done incorrectly.", 2, jpaChangeSet.getDrifts().size());
+
+ AssertUtils
+ .assertPropertiesMatch("The change set was not persisted correctly", changeSet, jpaChangeSet, "id", "drifts",
+ "class", "ctime");
+
+ List<? extends Drift> expectedDrifts = asList(drift1, drift2);
+ List<? extends Drift> actualDrifts = new ArrayList(jpaChangeSet.getDrifts());
+
+ // We ignore the id and ctime properties because those are set by JPADriftServerBean
+ // and are somewhat implmentation specific. We ignore the directory property because
+ // it is really a calculated property. newDriftFile has to be compared separately
+ // since it does not implement equals.
+ AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not persisted correctly",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "directory",
+ "newDriftFile", "class");
+
+ assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift1, drift1.getNewDriftFile(),
+ findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(), "class", "ctime") ;
+ assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift2, drift2.getNewDriftFile(),
+ findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(), "class", "ctime") ;
+ }
+
+ public void persistTemplateChangeSet() {
+ // create the change set to be persisted
+ //
+ // Note that we do not set the drift definition id or resource id since
+ // the change set is not owned by a resource. It is owned by the
+ // resource type.
+ DriftChangeSetDTO changeSet = new DriftChangeSetDTO();
+ changeSet.setCategory(COVERAGE);
+ changeSet.setVersion(1);
+ changeSet.setDriftHandlingMode(normal);
+ changeSet.setCtime(System.currentTimeMillis());
+
+ DriftDTO drift1 = new DriftDTO();
+ drift1.setCategory(FILE_ADDED);
+ drift1.setPath("drift.1");
+ drift1.setChangeSet(changeSet);
+ drift1.setCtime(System.currentTimeMillis());
+ drift1.setNewDriftFile(toDTo(driftFile1));
+
+ DriftDTO drift2 = new DriftDTO();
+ drift2.setCategory(FILE_ADDED);
+ drift2.setPath("drift.2");
+ drift2.setChangeSet(changeSet);
+ drift2.setCtime(System.currentTimeMillis());
+ drift2.setNewDriftFile(toDTo(driftFile2));
+
+ Set<DriftDTO> drifts = new HashSet<DriftDTO>();
+ drifts.add(drift1);
+ drifts.add(drift2);
+ changeSet.setDrifts(drifts);
+
+ String newChangeSetId = jpaDriftServer.persistChangeSet(getOverlord(), changeSet);
+
+ // verify that the change set was persisted
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterId(newChangeSetId);
+ criteria.fetchDrifts(true);
+
+ PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
+ assertEquals("Expected to find one change set", 1, changeSets.size());
+
+ JPADriftChangeSet jpaChangeSet = changeSets.get(0);
+ assertEquals("Expected change set to contain two drifts. This could be a result of the change set not being " +
+ "persisted correctly or the criteria fetch being done incorrectly.", 2, jpaChangeSet.getDrifts().size());
+
+ AssertUtils
+ .assertPropertiesMatch("The change set was not persisted correctly", changeSet, jpaChangeSet, "id", "drifts",
+ "class", "ctime");
+
+ List<? extends Drift> expectedDrifts = asList(drift1, drift2);
+ List<? extends Drift> actualDrifts = new ArrayList(jpaChangeSet.getDrifts());
+
+ // We ignore the id and ctime properties because those are set by JPADriftServerBean
+ // and are somewhat implmentation specific. We ignore the directory property because
+ // it is really a calculated property. newDriftFile has to be compared separately
+ // since it does not implement equals.
+ AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not persisted correctly",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "directory",
+ "newDriftFile", "class");
+
+ assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift1, drift1.getNewDriftFile(),
+ findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(), "class", "ctime") ;
+ assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift2, drift2.getNewDriftFile(),
+ findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(), "class", "ctime") ;
+ }
+
+ public void copyChangeSet() {
+ // first create the change set that will be copied
+ final JPADriftChangeSet changeSet = new JPADriftChangeSet(null, 0, COVERAGE, null);
+ changeSet.setDriftHandlingMode(normal);
+
+ final JPADrift drift1 = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
+ final JPADrift drift2 = new JPADrift(changeSet, "drift.2", FILE_ADDED, null, driftFile2);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift1);
+ driftSet.addDrift(drift2);
+
+ // next create the drift definition
+ final DriftDefinition driftDef = new DriftDefinition(new Configuration());
+ driftDef.setName("test::copyChangeSet");
+ driftDef.setEnabled(true);
+ driftDef.setDriftHandlingMode(normal);
+ driftDef.setInterval(2400L);
+ driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+ driftDef.setResource(resource);
+
+ // persist the change set and drift definition
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(changeSet);
+ em.persist(driftDef);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
+ }
+ });
+
+ jpaDriftServer.copyChangeSet(getOverlord(), changeSet.getId(), driftDef.getId(), resource.getId());
+
+ // verify that the change set was created for the definition
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(driftDef.getId());
+ criteria.addFilterCategory(COVERAGE);
+
+ PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
+
+ assertEquals("Expected to get back one change set", 1,changeSets.size());
+
+ JPADriftChangeSet newChangeSet = changeSets.get(0);
+ Set<JPADrift> expectedDrifts = new HashSet<JPADrift>(asList(drift1, drift2));
+ Set<JPADrift> actualDrifts = newChangeSet.getDrifts();
+
+ AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not copied correctly", expectedDrifts,
+ actualDrifts,
+ "changeSet", "newDriftFile");
+ }
+
+ private DriftFileDTO toDTo(JPADriftFile driftFile) {
+ DriftFileDTO dto = new DriftFileDTO();
+ dto.setHashId(driftFile.getHashId());
+ dto.setDataSize(driftFile.getDataSize());
+ dto.setStatus(driftFile.getStatus());
+ return dto;
+ }
+
+
+ private void assertDriftFilePersisted(JPADriftFile driftFile, String name, String content) {
+ assertNotNull("Failed to get " + name + " Was it persisted?", driftFile);
+ assertEquals("The content for " + name + " is wrong", content, jpaDriftServer.getDriftFileBits(
+ driftFile.getHashId()));
+ assertEquals("The drift file status is wrong", LOADED, driftFile.getStatus());
+ }
+
+}
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
new file mode 100644
index 0000000..66afcb0
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
@@ -0,0 +1,223 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.util.Arrays.asList;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
+import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.persistence.EntityManager;
+
+import org.testng.annotations.BeforeClass;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
+import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftConfigurationDefinition;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftDefinitionComparator;
+import org.rhq.core.domain.drift.DriftDefinitionTemplate;
+import org.rhq.core.domain.drift.DriftSnapshot;
+import org.rhq.core.domain.drift.JPADrift;
+import org.rhq.core.domain.drift.JPADriftChangeSet;
+import org.rhq.core.domain.drift.JPADriftFile;
+import org.rhq.core.domain.drift.JPADriftSet;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+
+public class ManageDriftDefinitionsTest extends DriftServerTest {
+
+ private DriftManagerLocal driftMgr;
+
+ private DriftTemplateManagerLocal templateMgr;
+
+ @BeforeClass
+ public void initClass() throws Exception {
+ driftMgr = getDriftManager();
+ templateMgr = getDriftTemplateManager();
+ }
+
+ public void createDefinitionFromUnpinnedTemplate() {
+ // first create a template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test_createUnpinnedDefinition");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ // persist the template
+ DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), false,
+ templateDef);
+
+ // create and persist the definition
+ DriftDefinition definition = template.createDefinition();
+ definition.setTemplate(template);
+ driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(resource.getId()), definition);
+
+ // verify that the definition was created
+ DriftDefinition newDef = loadDefinition(definition.getName());
+ DriftDefinitionComparator comparator = new DriftDefinitionComparator(
+ BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
+
+ assertEquals("The drift definition was not persisted correctly", 0, comparator.compare(definition, newDef));
+ assertEquals("The template association was not set on the definition", template, newDef.getTemplate());
+ }
+
+ @SuppressWarnings("unchecked")
+ public void createDefinitionFromPinnedTemplate() throws Exception {
+ // We first need to create a pinned template. Users can only create a pinned
+ // template from a snapshot of an existing resource-level drift definition.
+ // We are going to take a bit of a short cut though by directly creating
+ // and persisting the pinned change set.
+
+ // first create the change set
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(null, 0, COVERAGE, null);
+ changeSet0.setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode.normal);
+
+ final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
+ final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
+
+ JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+ JPADrift drift2 = new JPADrift(changeSet0, "drift.2", FILE_ADDED, null, driftFile2);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift1);
+ driftSet.addDrift(drift2);
+
+ // create the template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test_createUnpinnedDefinition");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+ templateDef.setPinned(true);
+
+ final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
+ templateDef);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ em.persist(driftFile1);
+ em.persist(driftFile2);
+ em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
+
+ // setting the change set id on the template is the last and the
+ // most important step in making the template pinned
+ template.setChangeSetId(changeSet0.getId());
+ em.merge(template);
+ }
+ });
+
+ // Create and persist a resource-level definition.
+ final DriftDefinition definition = template.createDefinition();
+ definition.setTemplate(template);
+
+ final AtomicBoolean agentInvoked = new AtomicBoolean(false);
+
+ agentServiceContainer.driftService = new TestDefService() {
+ @Override
+ public void updateDriftDetection(int resourceId, DriftDefinition driftDef, DriftSnapshot snapshot) {
+ try {
+ HibernateDetachUtility.nullOutUninitializedFields(driftDef,
+ HibernateDetachUtility.SerializationType.SERIALIZATION);
+ HibernateDetachUtility.nullOutUninitializedFields(snapshot,
+ HibernateDetachUtility.SerializationType.SERIALIZATION);
+ agentInvoked.set(true);
+ assertNotNull("Expected snapshot drift instances collection to be non-null",
+ snapshot.getDriftInstances());
+ assertEquals("Expected snapshot to contain two drift entries", 2, snapshot.getDriftInstances().size());
+ } catch (Exception e) {
+ String msg = "Do not pass attached entites to agent since those entities are outside of " +
+ "Hibernate's control. The persistence context should be flushed and cleared to ensure that " +
+ "only detached objects are sent to the agent";
+ throw new RuntimeException(msg, e);
+ }
+ }
+ };
+
+ driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(resource.getId()), definition);
+
+ DriftDefinition newDef = loadDefinition(definition.getName());
+
+ // verify that the definition is marked as pinned
+ assertTrue("The drift definition should be marked as pinned", newDef.isPinned());
+
+ // verify that the initial change set is generated for the definition
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(definition.getId());
+ criteria.addFilterCategory(COVERAGE);
+ criteria.fetchDrifts(true);
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+ assertEquals("Expected to find one change set", 1, changeSets.size());
+
+ JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
+ List<? extends Drift> expectedDrifts = asList(
+ new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
+ new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
+
+ DriftChangeSet<?> actualChangeSet = changeSets.get(0);
+ List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
+
+ AssertUtils.assertCollectionMatchesNoOrder(
+ "Expected to find drifts from change sets 1 and 2 in the template change set",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
+
+ // lastly verify that the agent is called
+ assertTrue("Failed to send drift definition along with snapshot to agent", agentInvoked.get());
+ }
+
+ private DriftDefinition loadDefinition(String name) {
+ DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
+ criteria.addFilterResourceIds(resource.getId());
+ criteria.addFilterName(name);
+ criteria.fetchConfiguration(true);
+ criteria.fetchResource(true);
+ criteria.fetchTemplate(true);
+
+ PageList<DriftDefinition> driftDefs = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
+ assertEquals("Expected to find one drift definition", 1, driftDefs.size());
+
+ return driftDefs.get(0);
+ }
+}
diff --git a/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
new file mode 100644
index 0000000..e7341e4
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
@@ -0,0 +1,236 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.util.Arrays.asList;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
+import static org.rhq.test.AssertUtils.assertPropertiesMatch;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.persistence.EntityManager;
+
+import org.testng.annotations.BeforeClass;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftSnapshot;
+import org.rhq.core.domain.drift.JPADrift;
+import org.rhq.core.domain.drift.JPADriftChangeSet;
+import org.rhq.core.domain.drift.JPADriftFile;
+import org.rhq.core.domain.drift.JPADriftSet;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.core.server.EntitySerializer;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+
+public class ManageSnapshotsTest extends DriftServerTest {
+
+ private DriftManagerLocal driftMgr;
+
+ private DriftTemplateManagerLocal templateMgr;
+
+ @BeforeClass(inheritGroups = true)
+ public void initClass() throws Exception {
+ driftMgr = getDriftManager();
+ templateMgr = getDriftTemplateManager();
+ }
+
+ public void pinningSnapshotShouldSetDriftDefAsPinned() {
+ final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
+
+ // create initial change set
+ final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
+ final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
+ JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftFile1);
+ em.persist(changeSet);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
+ }
+ });
+
+ driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 0);
+ DriftDefinition updatedDriftDef = driftMgr.getDriftDefinition(getOverlord(), driftDef.getId());
+
+ assertNotNull("Failed to get " + toString(driftDef), updatedDriftDef);
+ assertTrue("Failed to set pinned flag of " + toString(driftDef), updatedDriftDef.isPinned());
+ }
+
+ @SuppressWarnings("unchecked")
+ public void pinningSnapshotShouldMakeSnapshotTheInitialChangeSet() throws Exception {
+ final DriftDefinition driftDef = createAndPersistDriftDef("test::makeSnapshotVersionZero");
+
+ // create initial change set
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
+ final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
+ JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift1);
+
+ // create change set v1
+ final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
+ final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, driftDef);
+ final JPADrift drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftFile1);
+ em.persist(driftFile2);
+ em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
+ em.persist(changeSet1);
+ em.persist(drift2);
+ }
+ });
+
+ driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 1);
+
+ // Verify that there is now only one change set for the drift def
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(driftDef.getId());
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+ assertEquals("All change sets except the change set representing the pinned snapshot should be removed",
+ 1, changeSets.size());
+ DriftChangeSet<?> changeSet = changeSets.get(0);
+
+ assertEquals("The pinned snapshot version should be reset to zero", 0, changeSet.getVersion());
+ assertEquals("The change set category is wrong", COVERAGE, changeSet.getCategory());
+
+ JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, driftDef);
+ List<? extends Drift> expectedDrifts = asList(
+ new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
+ new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
+
+ List<? extends Drift> actualDrifts = new ArrayList(changeSet.getDrifts());
+
+ AssertUtils.assertCollectionMatchesNoOrder(
+ "Expected to find drifts from change sets 1 and 2 in the new initial change set",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
+
+ // we need to compare the newDriftFile properties separately because
+ // assertCollectionMatchesNoOrder compares properties via equals() and JPADriftFile
+ // does not implement equals.
+ assertPropertiesMatch(drift1.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(),
+ "The newDriftFile property was not set correctly for " + drift1);
+ assertPropertiesMatch(drift2.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(),
+ "The newDriftFile property was not set correctly for " + drift1);
+ }
+
+ public void pinningSnapshotShouldSendRequestToAgent() {
+ final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
+
+ // create initial change set
+ final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
+ final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
+ JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftFile1);
+ em.persist(changeSet);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
+ }
+ });
+
+ final AtomicBoolean agentInvoked = new AtomicBoolean(false);
+ agentServiceContainer.driftService = new TestDefService() {
+ @Override
+ public void pinSnapshot(int resourceId, String configName, DriftSnapshot snapshot) {
+ try {
+ agentInvoked.set(true);
+ // serialize the method arguments here to more closely simulate what
+ // happens during the call. We cannot send hibernate-proxied objects
+ // to the agent. This is an attempt to catch that.
+ ObjectOutputStream stream = new ObjectOutputStream(new ByteArrayOutputStream());
+ EntitySerializer.writeExternalRemote(resourceId, stream);
+ EntitySerializer.writeExternalRemote(configName, stream);
+ EntitySerializer.writeExternalRemote(snapshot, stream);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+
+ driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 0);
+
+ assertTrue("Failed to send request to agent to pin snapshot", agentInvoked.get());
+ }
+
+ private DriftDefinition createAndPersistDriftDef(String name) {
+ final DriftDefinition driftDef = new DriftDefinition(new Configuration());
+ driftDef.setName(name);
+ driftDef.setEnabled(true);
+ driftDef.setDriftHandlingMode(normal);
+ driftDef.setInterval(1800L);
+ driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ driftDef.setResource(resource);
+ getEntityManager().persist(driftDef);
+ }
+ });
+
+ return driftDef;
+ }
+
+}
diff --git a/modules/enterprise/server/itests/src/test/resources/META-INF/ejb-jar.xml b/modules/enterprise/server/itests/src/test/resources/META-INF/ejb-jar.xml
new file mode 100644
index 0000000..8222948
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/META-INF/ejb-jar.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <description>RHQ</description>
+ <display-name>RHQ</display-name>
+
+ <assembly-descriptor>
+
+ <!-- all our EJB3 SLSBs can define custom @RequiredPermissions annotations for authorization checks-->
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor</interceptor-class>
+ </interceptor-binding>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.rhq.enterprise.server.common.TransactionInterruptInterceptor</interceptor-class>
+ </interceptor-binding>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.rhq.enterprise.server.common.PerformanceMonitorInterceptor</interceptor-class>
+ </interceptor-binding>
+
+ </assembly-descriptor>
+
+</ejb-jar>
diff --git a/modules/enterprise/server/itests/src/test/resources/binary-blob-sample.jar b/modules/enterprise/server/itests/src/test/resources/binary-blob-sample.jar
new file mode 100644
index 0000000..0a629ec
Binary files /dev/null and b/modules/enterprise/server/itests/src/test/resources/binary-blob-sample.jar differ
diff --git a/modules/enterprise/server/itests/src/test/resources/default.persistence.properties b/modules/enterprise/server/itests/src/test/resources/default.persistence.properties
new file mode 100644
index 0000000..8e4f317
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/default.persistence.properties
@@ -0,0 +1,22 @@
+hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
+#hibernate.connection.release_mode=after_statement
+#hibernate.transaction.flush_before_completion=false
+#hibernate.transaction.auto_close_session=false
+#hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
+#hibernate.hbm2ddl.auto=create-drop
+#hibernate.hbm2ddl.auto=create
+hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
+# Clustered cache with TreeCache
+#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
+#hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
+#hibernate.dialect=org.hibernate.dialect.HSQLDialect
+hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+hibernate.bytecode.use_reflection_optimizer=false
+# I don't think this is honored, but EJB3Deployer uses it
+hibernate.bytecode.provider=javassist
+hibernate.jdbc.use_streams_for_binary=true
+hibernate.show_sql=false
+hibernate.format_sql=true
+hibernate.default_batch_fetch_size=16
+hibernate.jdbc.batch_size=20
diff --git a/modules/enterprise/server/itests/src/test/resources/ejb3-interceptors-aop.xml b/modules/enterprise/server/itests/src/test/resources/ejb3-interceptors-aop.xml
new file mode 100644
index 0000000..f30aa70
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/ejb3-interceptors-aop.xml
@@ -0,0 +1,360 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+ "-//JBoss//DTD JBOSS AOP 1.0//EN"
+ "http://www.jboss.org/aop/dtd/jboss-aop_1_0.dtd">
+
+<aop>
+ <interceptor class="org.jboss.aspects.remoting.InvokeRemoteInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.security.SecurityClientInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.tx.ClientTxPropagationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.remoting.IsLocalInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.remoting.ClusterChooserInterceptor" scope="PER_VM"/>
+
+ <interceptor class="org.jboss.aspects.tx.TxPropagationInterceptor" scope="PER_VM"/>
+
+ <stack name="ServiceClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="AsynchronousStatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="AsynchronousStatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="StatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="StatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="ClusteredStatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="ClusteredStatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <interceptor class="org.jboss.ejb3.asynchronous.AsynchronousInterceptor" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.ENCPropagationInterceptor" scope="PER_VM"/>
+ <interceptor name="Basic Authorization" factory="org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor name="JACC Authorization" factory="org.jboss.ejb3.security.JaccAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor factory="org.jboss.ejb3.security.AuthenticationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor factory="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateless.StatelessInstanceInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateful.StatefulInstanceInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.service.ServiceSingletonInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.cache.StatefulReplicationInterceptor" scope="PER_VM"/>
+ <interceptor factory="org.jboss.ejb3.stateful.StatefulRemoveFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.tx.TxInterceptorFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.AllowedOperationsInterceptor" scope="PER_VM"/>
+ <interceptor factory="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor" scope="PER_VM"/>
+
+ <domain name="Stateless Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Stateless Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="JACC Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Base Stateful Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+
+ <!-- Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Stateful Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="JACC Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+
+ <!-- Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+ </domain>
+
+ <domain name="Embedded Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.NoPassivationCache.class)
+ </annotation>
+
+ </domain>
+
+ <domain name="Message Driven Bean">
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Consumer Bean">
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND (has(* *->@org.jboss.annotation.ejb.CurrentMessage(..)) OR hasfield(* *->@org.jboss.annotation.ejb.CurrentMessage))">
+ <interceptor-ref name="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Service Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ </bind>
+ <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ </domain>
+
+ <domain name="JACC Service Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ </bind>
+ <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ </domain>
+
+
+</aop>
\ No newline at end of file
diff --git a/modules/enterprise/server/itests/src/test/resources/embedded-jboss-beans.xml b/modules/enterprise/server/itests/src/test/resources/embedded-jboss-beans.xml
new file mode 100644
index 0000000..05edefa
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/embedded-jboss-beans.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
+
+ <bean name="InitialContextProperties" class="java.util.Hashtable">
+ <constructor>
+ <parameter class="java.util.Map">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming:org.jnp.interfaces</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="java:comp/Initializer" class="org.jboss.ejb3.embedded.JavaCompInitializer">
+ <property name="jndiProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="XidFactory" class="org.jboss.tm.XidFactoryImpl"/>
+
+ <bean name="XidFactoryMBean" class="org.jboss.ejb3.embedded.XidFactoryMBean">
+ <constructor>
+ <parameter class="org.jboss.tm.XidFactoryBase">
+ <inject bean="XidFactory"/>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TransactionManagerInitializer" class="org.jboss.tm.TransactionManagerInitializer">
+ <property name="xidFactory">
+ <inject bean="XidFactory"/>
+ </property>
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="UserTransaction" class="org.jboss.ejb3.embedded.UserTransactionImpl">
+ <demand>TransactionManagerInitializer</demand>
+ </bean>
+
+ <bean name="UserTransactionBinding" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ <property name="target">
+ <inject bean="UserTransaction"/>
+ </property>
+ <property name="bindTo">UserTransaction</property>
+ <property name="serializable">false</property>
+ </bean>
+
+
+ <bean name="TransactionManager" class="java.lang.Object">
+ <constructor factoryMethod="getTransactionManager">
+ <factory bean="TransactionManagerInitializer"/>
+ </constructor>
+ </bean>
+ <bean name="CachedConnectionManager" class="org.jboss.resource.connectionmanager.CachedConnectionManagerReference">
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ </bean>
+
+ <bean name="RHQDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
+ <property name="driverClass">${rhq.test.ds.driver-class}</property>
+ <property name="connectionURL">${rhq.test.ds.connection-url}</property>
+ <property name="userName">${rhq.test.ds.user-name}</property>
+ <property name="password">${rhq.test.ds.password}</property>
+ <property name="jndiName">java:/RHQDS</property>
+ <property name="minSize">0</property>
+ <property name="maxSize">20</property>
+ <property name="blockingTimeout">3000</property>
+ <property name="idleTimeout">100000</property>
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ <property name="cachedConnectionManager">
+ <inject bean="CachedConnectionManager"/>
+ </property>
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="RHQDS" class="java.lang.Object">
+ <constructor factoryMethod="getDatasource">
+ <factory bean="RHQDSBootstrap"/>
+ </constructor>
+ </bean>
+
+ <!-- needed for Quartz' no-TX data source (even though this is a local-tx, seems like Quartz is still working) -->
+ <bean name="NoTxRHQDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
+ <property name="driverClass">${rhq.test.ds.driver-class}</property>
+ <property name="connectionURL">${rhq.test.ds.connection-url}</property>
+ <property name="userName">${rhq.test.ds.user-name}</property>
+ <property name="password">${rhq.test.ds.password}</property>
+ <property name="jndiName">java:/NoTxRHQDS</property>
+ <property name="minSize">0</property>
+ <property name="maxSize">10</property>
+ <property name="blockingTimeout">1000</property>
+ <property name="idleTimeout">100000</property>
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ <property name="cachedConnectionManager">
+ <inject bean="CachedConnectionManager"/>
+ </property>
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="NoTxRHQDS" class="java.lang.Object">
+ <constructor factoryMethod="getDatasource">
+ <factory bean="NoTxRHQDSBootstrap"/>
+ </constructor>
+ </bean>
+
+ <bean name="DefaultDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
+ <property name="driverClass">org.hsqldb.jdbcDriver</property>
+ <property name="connectionURL">jdbc:hsqldb:.</property>
+ <!-- <property name="connectionURL">jdbc:hsqldb:./hypersonic/localDB</property> -->
+ <property name="userName">sa</property>
+ <property name="jndiName">java:/DefaultDS</property>
+ <property name="minSize">0</property>
+ <property name="maxSize">10</property>
+ <property name="blockingTimeout">1000</property>
+ <property name="idleTimeout">100000</property>
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ <property name="cachedConnectionManager">
+ <inject bean="CachedConnectionManager"/>
+ </property>
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="DefaultDS" class="java.lang.Object">
+ <constructor factoryMethod="getDatasource">
+ <factory bean="DefaultDSBootstrap"/>
+ </constructor>
+ </bean>
+
+</deployment>
\ No newline at end of file
diff --git a/modules/enterprise/server/itests/src/test/resources/jboss-jms-beans.xml b/modules/enterprise/server/itests/src/test/resources/jboss-jms-beans.xml
new file mode 100644
index 0000000..287cffc
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/jboss-jms-beans.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="jboss.mq:service=JMSProviderLoader,name=JMSProvider" class="org.jboss.jms.jndi.JNDIProviderAdapter">
+ <property name="factoryRef">java:/JmsXA</property>
+ <property name="queueFactoryRef">java:/JmsXA</property>
+ <property name="topicFactoryRef">java:/JmsXA</property>
+ <property name="properties" class="java.util.Properties">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming:org.jnp.interfaces</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="b1" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="jboss.mq:service=JMSProviderLoader,name=JMSProvider"/></property>
+ <property name="bindTo">java:/DefaultJMSProvider</property>
+ <property name="serializable">true</property>
+ </bean>
+
+ <bean name="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool" class="org.jboss.jms.asf.StdServerSessionPoolFactory">
+ <property name="name">StdJMSPool</property>
+ <property name="xidFactory"><inject bean="XidFactoryMBean"/></property>
+ <property name="transactionManager"><inject bean="TransactionManager"/></property>
+ </bean>
+
+ <bean name="b2" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool"/></property>
+ <property name="bindTo">java:/StdJMSPool</property>
+ <property name="serializable">false</property>
+ </bean>
+
+
+ <bean name="jboss.mq:service=PersistenceManager" class="org.jboss.mq.pm.none.PersistenceManager">
+ </bean>
+
+ <bean name="jboss.mq:service=MessageCache" class="org.jboss.mq.kernel.MessageCache">
+ <property name="persistenceManager"><inject bean="jboss.mq:service=PersistenceManager"/></property>
+ <property name="highMemoryMark">50</property>
+ <property name="maxMemoryMark">60</property>
+ </bean>
+
+ <bean name="jms-rar-WorkManager" class="org.jboss.ejb3.embedded.resource.JBossWorkManager">
+ </bean>
+
+ <bean name="jms-rar-DeploymentInfo" class="org.jboss.ejb3.embedded.resource.Ejb3DeploymentInfo">
+ <constructor>
+ <parameter class="java.lang.String">jms-ra.rar</parameter>
+ <parameter class="java.lang.String">javax.jms.MessageListener</parameter>
+ <parameter class="java.lang.String">org.jboss.resource.adapter.jms.inflow.JmsActivationSpec</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="jboss.jca:name='jms-ra.rar',service=RARDeployment" class="org.jboss.ejb3.embedded.resource.RARDeployment">
+ <constructor>
+ <parameter class="org.jboss.deployment.DeploymentInfo">
+ <inject bean="jms-rar-DeploymentInfo"/>
+ </parameter>
+ </constructor>
+ <property name="workManager"><inject bean="jms-rar-WorkManager"/></property>
+ </bean>
+
+ <bean name="jboss.mq:service=StateManager" class="org.jboss.mq.sm.none.NullStateManager">
+ </bean>
+
+ <bean name="BasicQueueParameters" class="org.jboss.mq.server.BasicQueueParameters"/>
+
+ <bean name="jboss.mq:service=ThreadPool" class="org.jboss.util.threadpool.BasicThreadPool">
+ <property name="name">JMSThread</property>
+ <property name="threadGroupName">JBossMQ Server Threads</property>
+ <!-- The max number of threads in the pool -->
+ <property name="maximumPoolSize">10</property>
+ <!-- The max number of tasks before the queue is full -->
+ <property name="maximumQueueSize">1000</property>
+ <!-- The behavior of the pool when a task is added and the queue is full.
+ abort - a RuntimeException is thrown
+ run - the calling thread executes the task
+ wait - the calling thread blocks until the queue has room
+ discard - the task is silently discarded without being run
+ discardOldest - check to see if a task is about to complete and enque
+ the new task if possible, else run the task in the calling thread
+ -->
+ <property name="blockingMode">run</property>
+ </bean>
+
+ <bean name="jboss.mq:service=DestinationManager" class="org.jboss.mq.server.JMSDestinationManager">
+ <constructor>
+ <parameter class="org.jboss.mq.server.BasicQueueParameters">
+ <inject bean="BasicQueueParameters"/>
+ </parameter>
+ </constructor>
+ <property name="persistenceManager"><inject bean="jboss.mq:service=PersistenceManager"/></property>
+ <property name="messageCache"><inject bean="jboss.mq:service=MessageCache"/></property>
+ <property name="stateManager"><inject bean="jboss.mq:service=StateManager"/></property>
+ <property name="threadPool"><inject bean="jboss.mq:service=ThreadPool"/></property>
+ <property name="threadGroup"><inject bean="jboss.mq:service=ThreadPool" property="threadGroup"/></property>
+ <start method="startServer"/>
+ <stop method="stopServer"/>
+ </bean>
+
+ <bean name="jboss.mq.destination:service=Queue,name=DLQ" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">DLQ</property>
+ </bean>
+
+ <bean name="jboss.mq:service=Invoker" class="org.jboss.mq.server.JMSServerInvoker">
+ <property name="next"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ </bean>
+
+ <bean name="jboss.mq:service=invocationlayer,type=JVM" class="org.jboss.mq.kernel.JVMIL">
+ <property name="jmsInvoker"><inject bean="jboss.mq:service=Invoker"/></property>
+ <!-- notice we actually switched - the non-xa connection factory JNDI Ref is the JNDI name our EJBs use -->
+ <!-- the embedded EJB container doesn't support XA, so the connection factory our JmsXA JNDI lookup will return will be a non-XA factory -->
+ <property name="connectionFactoryJNDIRef">java:/JmsXA</property>
+ <property name="XAConnectionFactoryJNDIRef">java:/ConnectionFactory</property>
+ <property name="pingPeriod">0</property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ </bean>
+
+</deployment>
diff --git a/modules/enterprise/server/itests/src/test/resources/jms-ra.rar b/modules/enterprise/server/itests/src/test/resources/jms-ra.rar
new file mode 100644
index 0000000..c4807c6
Binary files /dev/null and b/modules/enterprise/server/itests/src/test/resources/jms-ra.rar differ
diff --git a/modules/enterprise/server/itests/src/test/resources/jndi.properties b/modules/enterprise/server/itests/src/test/resources/jndi.properties
new file mode 100644
index 0000000..9225cef
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/jndi.properties
@@ -0,0 +1,2 @@
+java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
diff --git a/modules/enterprise/server/itests/src/test/resources/log4j.xml b/modules/enterprise/server/itests/src/test/resources/log4j.xml
new file mode 100644
index 0000000..bc65329
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/log4j.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 39945 2006-01-12 02:44:07Z bill $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="WARN"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Messagen -->
+ <!--
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ -->
+ <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} [%c] (%F:%M:%L) -%m%n"/>
+ </layout>
+ </appender>
+
+ <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="target/server-jar-test.log"/>
+ <param name="Threshold" value="WARN"/>
+ <param name="Append" value="false"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Messagen -->
+ <!--
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ -->
+ <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} [%c] (%F:%M:%L) -%m%n"/>
+ </layout>
+ </appender>
+
+ <!-- Hibernate logs WARNINGS frequent from this class, in test envs. -->
+ <category name="org.hibernate.hql.ast.QueryTranslatorImpl">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- hides the TIMER SERVICE IS NOT INSTALLED warning - we know embedded EJB3 container doesn't support timers -->
+ <category name="org.jboss.ejb3.timerservice.jboss.JBossTimerServiceFactory">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- hides the shutdown warnings - for some reason, the container spits out some warnings when shutting down -->
+ <category name="org.jboss.kernel.plugins.dependency.StartStopLifecycleAction">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- Hibernate SQL logs -->
+ <!--
+ <category name="org.hibernate.SQL">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
diff --git a/modules/enterprise/server/itests/src/test/resources/login-config.xml b/modules/enterprise/server/itests/src/test/resources/login-config.xml
new file mode 100644
index 0000000..645294d
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/login-config.xml
@@ -0,0 +1,72 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE policy PUBLIC
+ "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The XML based JAAS login configuration read by the
+org.jboss.security.auth.login.XMLLoginConfig mbean. Add
+an application-policy element for each security domain.
+
+The outline of the application-policy is:
+<application-policy name="security-domain-name">
+ <authentication>
+ <login-module code="login.module1.class.name" flag="control_flag">
+ <module-option name = "option1-name">option1-value</module-option>
+ <module-option name = "option2-name">option2-value</module-option>
+ ...
+ </login-module>
+
+ <login-module code="login.module2.class.name" flag="control_flag">
+ ...
+ </login-module>
+ ...
+ </authentication>
+</application-policy>
+
+$Revision: 42748 $
+-->
+
+<policy>
+ <!-- Used by clients within the application server VM such as
+ mbeans and servlets that access EJBs.
+ -->
+ <application-policy name="client-login">
+ <authentication>
+ <login-module code="org.jboss.security.ClientLoginModule"
+ flag="required">
+ <!-- Any existing security context will be restored on logout -->
+ <module-option name="restore-login-identity">true</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name = "jbossmq">
+ <authentication>
+ <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule" flag = "required">
+ <module-option name = "unauthenticatedIdentity">guest</module-option>
+ <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name="other">
+ <!-- A simple server login module, which can be used when the number
+ of users is relatively small. It uses two properties files:
+ users.properties, which holds users (key) and their password (value).
+ roles.properties, which holds users (key) and a comma-separated list of
+ their roles (value).
+ The unauthenticatedIdentity property defines the name of the principal
+ that will be used when a null username and password are presented as is
+ the case for an unuathenticated web client or MDB. If you want to
+ allow such users to be authenticated add the property, e.g.,
+ unauthenticatedIdentity="nobody"
+ -->
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag="required"/>
+ </authentication>
+ </application-policy>
+
+</policy>
+
diff --git a/modules/enterprise/server/itests/src/test/resources/rhq-mdb-beans.xml b/modules/enterprise/server/itests/src/test/resources/rhq-mdb-beans.xml
new file mode 100644
index 0000000..ad05b5e
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/rhq-mdb-beans.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="jboss.mq.destination:service=Queue,name=AlertConditionQueue" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">AlertConditionQueue</property>
+ </bean>
+
+ <bean name="jboss.mq.destination:service=Queue,name=DriftChangesetQueue" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">DriftChangesetQueue</property>
+ </bean>
+
+ <bean name="jboss.mq.destination:service=Queue,name=DriftFileQueue" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">DriftFileQueue</property>
+ </bean>
+
+</deployment>
\ No newline at end of file
diff --git a/modules/enterprise/server/itests/src/test/resources/security-beans.xml b/modules/enterprise/server/itests/src/test/resources/security-beans.xml
new file mode 100644
index 0000000..84fa819
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/security-beans.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <bean class="org.jboss.ejb3.embedded.JaasSecurityManagerService"
+ name="jboss.security:service=JaasSecurityManager">
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+</deployment>
diff --git a/modules/enterprise/server/itests/src/test/resources/test-assist-color-number.txt b/modules/enterprise/server/itests/src/test/resources/test-assist-color-number.txt
new file mode 100644
index 0000000..6ad90cc
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/test-assist-color-number.txt
@@ -0,0 +1,46 @@
+
+color[ number
+c
+color[
+n
+number
+r
+color[ number
+lo
+color[
+number
+number!= number!== number= number==
+be
+number
+number==
+number=="two" number=="four" number=="twenty-two" number=="twenty-four" number=="forty-two"
+number==t
+number=="two" number=="twenty-two" number=="twenty-four" number=="forty-two"
+number==fo
+number=="four" number=="twenty-four" number=="forty-two"
+color
+color[
+color[
+color[primary] color[other]
+color[p
+color[primary]
+color[o
+color[other]
+color[r
+color[primary] color[other]
+color[primary
+color[primary]
+color[primary]
+color[primary]!= color[primary]!== color[primary]= color[primary]==
+color[primary]=
+color[primary]="red" color[primary]="green" color[primary]="blue"
+color[primary]=e
+color[primary]="red" color[primary]="green" color[primary]="blue"
+color[primary]=d
+color[primary]="red"
+color[primary]=g
+color[primary]="green"
+color[primary]=b
+color[primary]="blue"
+color[primary]=r
+color[primary]="red" color[primary]="green"
\ No newline at end of file
diff --git a/modules/enterprise/server/itests/src/test/resources/test-ldap.properties b/modules/enterprise/server/itests/src/test/resources/test-ldap.properties
new file mode 100644
index 0000000..3316083
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/test-ldap.properties
@@ -0,0 +1,2 @@
+rhq.test.ldap.url=${rhq.test.ldap.url}
+rhq.test.ldap.LDAPFactory=${rhq.test.ldap.LDAPFactory}
\ No newline at end of file
diff --git a/modules/enterprise/server/itests/src/test/resources/test-scheduler.properties b/modules/enterprise/server/itests/src/test/resources/test-scheduler.properties
new file mode 100644
index 0000000..804639a
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/test-scheduler.properties
@@ -0,0 +1,29 @@
+# QUARTZ CONFIGURATION FOR OUR UNIT TESTS
+# our test timeout will be fast, 5 seconds
+rhq.server.operation-timeout = 5
+
+# scheduler factory config
+org.quartz.scheduler.instanceName = RHQScheduler
+org.quartz.scheduler.instanceId = AUTO
+
+# thread pool config
+org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
+org.quartz.threadPool.threadCount = 25
+org.quartz.threadPool.threadPriority = 5
+
+# database config - note the use of POSTGRES for tests
+org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
+org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
+# tests don't need this
+org.quartz.jobStore.isClustered = false
+org.quartz.jobStore.clusterCheckinInterval = 600000
+# make this a small non-zero time (in ms) so the scheduler (almost) never sleeps for more predictable test timing
+org.quartz.scheduler.idleWaitTime = 10
+org.quartz.jobStore.tablePrefix = RHQ_QRTZ_
+org.quartz.jobStore.useProperties = true
+org.quartz.jobStore.dataSource = RHQDS
+org.quartz.dataSource.RHQDS.jndiURL = java:/RHQDS
+org.quartz.dataSource.RHQDS.maxConnections = 10
+org.quartz.jobStore.nonManagedTXDataSource = NoTxRHQDS
+org.quartz.dataSource.NoTxRHQDS.jndiURL = java:/NoTxRHQDS
+org.quartz.dataSource.NoTxRHQDS.maxConnections = 10
\ No newline at end of file
diff --git a/modules/enterprise/server/itests/src/test/resources/testng.xml b/modules/enterprise/server/itests/src/test/resources/testng.xml
new file mode 100644
index 0000000..1452edb
--- /dev/null
+++ b/modules/enterprise/server/itests/src/test/resources/testng.xml
@@ -0,0 +1,12 @@
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+
+<suite name="EJB3 Testsuite" >
+ <test name="EJB3 tests" >
+ <groups>
+ <run>
+ <include name="integration.ejb3"/>
+ </run>
+ </groups>
+
+ </test>
+</suite>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 8c6f797..2c9ef76 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -40,7 +40,7 @@
<module>ear</module>
<module>safe-invoker</module>
<module>client-api</module>
- <module>integration-tests</module>
+ <module>itests</module>
</modules>
</profile>
@@ -58,23 +58,6 @@
</modules>
</profile>
- <profile>
- <id>integration-tests</id>
- <activation>
- <property>
- <name>rhq.itests</name>
- </property>
- </activation>
- <modules>
- <module>xml-schemas</module>
- <module>jar</module>
- <module>sars</module>
- <module>plugins</module>
- <module>client-api</module>
- <module>integration-tests</module>
- </modules>
- </profile>
-
</profiles>
</project>
commit 3d65de7f6089ad5e693987f1443eae52e9824413
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 11:23:30 2011 -0400
Initial commit for integration-tests module
The server/integration-tests module was born out of the need to resolve
a dependency issue for drift tests. There were drift tests in server/jar
that depended on having a drift server plugin installed, but the server
plugins are not built until after server/jar is built.
This commit moves tests over to the integrations-tests module which is
built after server/jar and the plugins, thus resolving the dependency
issue.
server/jar now produces a test jar artifact so that integration-tests
has access to AbstractEJB3Test. A better, longer term solution would be
to extract AbstractEJB3Test out into a common module since it is
duplicated in core/domain as well. I don't have time for that right now
though.
diff --git a/modules/enterprise/server/integration-tests/pom.xml b/modules/enterprise/server/integration-tests/pom.xml
new file mode 100644
index 0000000..7c29615
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/pom.xml
@@ -0,0 +1,556 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>rhq-server-integration-tests</artifactId>
+
+ <name>RHQ Server Integration Tests</name>
+ <description>RHQ enterprise server integration tests</description>
+
+ <scm>
+ <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</connection>
+ <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/server/...</developerConnection>
+ </scm>
+
+ <properties>
+ <rhq.server.datasource>java:/RHQDS</rhq.server.datasource>
+ <rhq.server.ds-mapping>PostgreSQL</rhq.server.ds-mapping>
+ <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-comm</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-common-drift</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.java-diff-utils</groupId>
+ <artifactId>diffutils</artifactId>
+ <version>1.2.1</version>
+ </dependency>
+
+ <!--================ Test Deps ================-->
+
+ <!-- Note, the test deps are intentionally placed above the other scoped deps because of classpath
+ reasons. Maven orders the [test] classpath in the order listed in the pom. We specifically
+ need the embeddable-ejb3 jar above the standard ejb3 jars because we need the embeddble packages
+ loaded when testing. -->
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq.helpers</groupId>
+ <artifactId>perftest-support</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant-launcher</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>jboss-ejb3-all</artifactId>
+ <version>${jboss-embeddable-ejb3.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- NOTE: The remaining test deps correspond to the classes contained in hibernate-all.jar and thirdparty-all.jar. -->
+
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>2.7.7</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>javassist</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>1.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <!-- 3rd Party Deps -->
+
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>3.2</version>
+ </dependency>
+
+ <!-- Required by a couple APL and Lather classes - TODO: Remove this once APL and Lather have been excised. -->
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.6.1</version>
+ </dependency>
+
+ <!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
+ <!-- also required by EJB3 Embedded (test scope) -->
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.1.4</version>
+ </dependency>
+
+ <!-- required by RHQ server classes, as well as EJB3 Embedded -->
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1-jboss</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>gnu-getopt</groupId>
+ <artifactId>getopt</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ </dependency>
+
+ <dependency>
+ <groupId>hibernate</groupId>
+ <artifactId>hibernate3</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>hibernate-annotations</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>hibernate-entitymanager</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
+ <!-- The Sun javamail jar isn't available from a public repo due to licensing issues,
+ so use the Geronimo one instead. -->
+ <version>1.3</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-cache</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <!-- includes the org.jboss.ejb3.StrictMaxPool class, which is needed by the PoolClass annotation used on some
+ of our SLSB's -->
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jmx</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-system</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbosssx</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>3.1.1</version>
+ </dependency>
+
+ <!-- for the transaction interrupt EJB3 interceptor -->
+ <dependency>
+ <groupId>org.jboss.transaction</groupId>
+ <artifactId>jboss-jta</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz-oracle</artifactId>
+ <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+ <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ <!-- somehow this is needed otherwise the hibernate stuff doesn't initialize in our tests -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.snmp4j</groupId>
+ <artifactId>snmp4j</artifactId>
+ <version>1.8.2</version>
+ </dependency>
+
+ <!-- required by RHQ server classes, as well as EJB3 Embedded -->
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4</version>
+ </dependency>
+
+ <!-- TODO: Why is this needed? -->
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <!--<scope>test</scope>-->
+ </dependency>
+
+ <dependency>
+ <groupId>rss4j</groupId>
+ <artifactId>rss4j</artifactId>
+ <version>0.92-on.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>5.5.20</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>tomcat-jk</artifactId>
+ <version>4.1.31</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Needed by com.jboss.jbossnetwork.apl.actions.xml.XPathProcessor; TODO: Remove once APL has been excised. -->
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.5.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.29</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <version>2.0.1.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.18</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-dbutils</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <!-- generate the I18N resource bundles -->
+ <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask" />
+
+ <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false" verify="true">
+ <classpath refid="maven.runtime.classpath" />
+ <classfileset dir="${project.build.outputDirectory}">
+ <include name="**/ServerI18NResourceKeys.class" />
+ <include name="**/AlertI18NResourceKeys.class" />
+ </classfileset>
+ </i18n>
+
+ <!-- create our rhq-server-version.properties file that goes in our jar -->
+ <tstamp>
+ <format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z" />
+ </tstamp>
+
+ <echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
+Product-Version=${project.version}
+Module-Name=${project.name}
+Module-Version=${project.version}
+Build-Number=${buildNumber}
+Build-Date=${build.time}
+Build-Jdk-Vendor=${java.vendor}
+Build-Jdk=${java.version}
+Build-OS-Name=${os.name}
+Build-OS-Version=${os.version}
+</echo>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <!-- in order to get JMS to work properly in embedded test container, extract jms-rs.rar classes -->
+ <execution>
+ <id>Extract JMS classes from RAR needed for JMS tests</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <unzip src="src/test/resources/jms-ra.rar" dest="target">
+ <patternset>
+ <include name="jms-ra.jar"/>
+ </patternset>
+ </unzip>
+ <unzip src="target/jms-ra.jar" dest="target/test-classes">
+ <patternset>
+ <include name="org/**"/>
+ </patternset>
+ </unzip>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java
new file mode 100644
index 0000000..64c6537
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java
@@ -0,0 +1,146 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.plugin.PluginKey;
+import org.rhq.core.domain.plugin.PluginStatusType;
+import org.rhq.core.domain.plugin.ServerPlugin;
+import org.rhq.core.util.MessageDigestGenerator;
+import org.rhq.enterprise.server.plugin.pc.AbstractTypeServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainerConfiguration;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginEnvironment;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginManager;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginService;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginType;
+import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginManager;
+import org.rhq.enterprise.server.xmlschema.ServerPluginDescriptorMetadataParser;
+import org.rhq.enterprise.server.xmlschema.generated.serverplugin.ServerPluginDescriptorType;
+
+public class DriftServerPluginService extends ServerPluginService implements DriftServerPluginServiceMBean {
+
+ public TestMasterServerPluginContainer master;
+ public MasterServerPluginContainerConfiguration masterConfig;
+
+ public DriftServerPluginService() {
+ // build the config at constructor time so tests have it even before the PC is initialized
+ File dir = new File(System.getProperty("java.io.tmpdir"), "test-server-plugins");
+ this.masterConfig = new MasterServerPluginContainerConfiguration(dir, dir, dir, null);
+ }
+
+ @Override
+ public MasterServerPluginContainer createMasterPluginContainer() {
+ this.master = new TestMasterServerPluginContainer();
+ this.master.initialize(this.masterConfig);
+ return this.master;
+ }
+
+ class TestMasterServerPluginContainer extends MasterServerPluginContainer {
+ @Override
+ protected ClassLoader createRootServerPluginClassLoader() {
+ return getClass().getClassLoader();
+ }
+
+ @Override
+ protected Map<URL, ? extends ServerPluginDescriptorType> preloadAllPlugins() throws Exception {
+ // if our test never setup any plugins, ignore it and just return an empty map
+ File pluginDir = getConfiguration().getPluginDirectory();
+ if (pluginDir == null || pluginDir.listFiles() == null || pluginDir.listFiles().length == 0) {
+ return new HashMap<URL, ServerPluginDescriptorType>();
+ } else {
+ return super.preloadAllPlugins();
+ }
+ }
+
+ @Override
+ protected List<PluginKey> getDisabledPluginKeys() {
+ // in the real world, the db is checked for enable flag, here we say all plugins are enabled
+ return new ArrayList<PluginKey>();
+ }
+
+ @Override
+ protected List<AbstractTypeServerPluginContainer> createPluginContainers() {
+ ArrayList<AbstractTypeServerPluginContainer> pcs = new ArrayList<AbstractTypeServerPluginContainer>(1);
+ DriftServerPluginContainer driftPC = new TestDriftServerPluginContainer(this);
+ pcs.add(driftPC);
+
+ return pcs;
+ }
+ }
+
+ class TestDriftServerPluginContainer extends DriftServerPluginContainer {
+ public TestDriftServerPluginContainer(MasterServerPluginContainer master) {
+ super(master);
+ }
+
+ @Override
+ protected ServerPluginManager createPluginManager() {
+ return new TestDriftServerPluginManager(this);
+ }
+ }
+
+ class TestDriftServerPluginManager extends DriftServerPluginManager {
+ public TestDriftServerPluginManager(DriftServerPluginContainer pc) {
+ super(pc);
+ }
+
+ @Override
+ protected ServerPlugin getPlugin(ServerPluginEnvironment env) {
+ try {
+ Configuration pluginConfig = null;
+ Configuration scheduledJobsConfig = null;
+ ConfigurationDefinition configDef;
+
+ ServerPluginDescriptorType pluginDescriptor = env.getPluginDescriptor();
+
+ configDef = ServerPluginDescriptorMetadataParser.getPluginConfigurationDefinition(pluginDescriptor);
+ if (configDef != null) {
+ pluginConfig = configDef.getDefaultTemplate().createConfiguration();
+ }
+
+ configDef = ServerPluginDescriptorMetadataParser.getScheduledJobsDefinition(pluginDescriptor);
+ if (configDef != null) {
+ scheduledJobsConfig = configDef.getDefaultTemplate().createConfiguration();
+ }
+
+ File pluginFile = new File(env.getPluginUrl().toURI());
+ ServerPlugin plugin = new ServerPlugin(0, env.getPluginKey().getPluginName(), pluginFile.getName(),
+ pluginDescriptor.getDisplayName(), true, PluginStatusType.INSTALLED, pluginDescriptor
+ .getDescription(), "", MessageDigestGenerator.getDigestString(pluginFile), pluginDescriptor
+ .getVersion(), pluginDescriptor.getVersion(), pluginConfig, scheduledJobsConfig,
+ new ServerPluginType(pluginDescriptor).stringify(), System.currentTimeMillis(), System
+ .currentTimeMillis());
+ return plugin;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java
new file mode 100644
index 0000000..d38374e
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java
@@ -0,0 +1,25 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
+
+public interface DriftServerPluginServiceMBean extends ServerPluginServiceManagement {
+}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
new file mode 100644
index 0000000..7db3365
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
@@ -0,0 +1,241 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static org.rhq.core.domain.resource.ResourceCategory.SERVER;
+import static org.rhq.enterprise.server.util.LookupUtil.getSubjectManager;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.NonUniqueResultException;
+
+import org.apache.commons.io.FileUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftDefinitionTemplate;
+import org.rhq.core.domain.resource.Agent;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.shared.ResourceBuilder;
+import org.rhq.core.domain.shared.ResourceTypeBuilder;
+import org.rhq.enterprise.server.plugin.ServerPluginsLocal;
+import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerCommunicationsService;
+import org.rhq.test.TransactionCallback;
+
+@Test(groups = "drift")
+public class DriftServerTest extends AbstractEJB3Test {
+
+ protected final String RESOURCE_TYPE_NAME = getClass().getSimpleName() + "_RESOURCE_TYPE";
+
+ protected final String AGENT_NAME = getClass().getSimpleName() + "_AGENT";
+
+ protected final String RESOURCE_NAME = getClass().getSimpleName() + "_RESOURCE";
+
+ private ServerPluginsLocal serverPluginsMgr;
+
+ protected DriftServerPluginService driftServerPluginService;
+
+ protected TestServerCommunicationsService agentServiceContainer;
+
+ protected ResourceType resourceType;
+
+ protected Agent agent;
+
+ protected Resource resource;
+
+ @BeforeMethod
+ public void initServices(Method testMethod) throws Exception {
+ initDriftServer();
+ initAgentServices();
+
+ InitDB annotation = testMethod.getAnnotation(InitDB.class);
+ if (annotation == null || annotation.value()) {
+ initDB();
+ }
+ }
+
+ private void initDriftServer() throws Exception {
+ driftServerPluginService = new DriftServerPluginService();
+ prepareCustomServerPluginService(driftServerPluginService);
+ driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
+
+ File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.1.0-SNAPSHOT.jar");
+ assertTrue("Drift server plugin JAR file not found at" + jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
+ FileUtils.copyFileToDirectory(jpaDriftPlugin, driftServerPluginService.masterConfig.getPluginDirectory());
+
+ driftServerPluginService.startMasterPluginContainer();
+
+ //serverPluginsMgr = LookupUtil.getServerPlugins();
+ }
+
+ private void initAgentServices() {
+ agentServiceContainer = prepareForTestAgents();
+ agentServiceContainer.driftService = new TestDefService();
+ }
+
+ @AfterMethod(inheritGroups = true)
+ public void shutDownServices() throws Exception {
+ shutDownDriftServer();
+ shutDownAgentServices();
+ }
+
+ private void shutDownDriftServer() throws Exception {
+ unprepareServerPluginService();
+ driftServerPluginService.stopMasterPluginContainer();
+ }
+
+ private void shutDownAgentServices() {
+ agentServiceContainer = null;
+ unprepareForTestAgents();
+ }
+
+ @AfterClass(inheritGroups = true)
+ public void cleanUpDB() throws Exception {
+ purgeDB();
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ purgeDB(getEntityManager());
+ }
+ });
+ }
+
+ private void initDB() throws Exception {
+ purgeDB();
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ initResourceType();
+ initAgent();
+ initResource();
+
+ em.persist(resourceType);
+ em.persist(agent);
+ resource.setAgent(agent);
+ em.persist(resource);
+
+ initDB(em);
+ }
+ });
+ }
+
+ private void purgeDB() {
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ em.createQuery("delete from JPADrift ").executeUpdate();
+ em.createQuery("delete from JPADriftChangeSet").executeUpdate();
+ em.createQuery("delete from JPADriftSet").executeUpdate();
+ em.createQuery("delete from JPADriftFile").executeUpdate();
+ em.createQuery("delete from DriftDefinition").executeUpdate();
+ em.createQuery("delete from DriftDefinitionTemplate").executeUpdate();
+
+ deleteEntity(Resource.class, RESOURCE_NAME, em);
+ deleteEntity(Agent.class, AGENT_NAME, em);
+ deleteEntity(ResourceType.class, RESOURCE_TYPE_NAME, em);
+
+ purgeDB(em);
+ }
+ });
+ }
+
+ protected void purgeDB(EntityManager em) {
+ }
+
+ protected void initDB(EntityManager em) {
+ }
+
+ protected void deleteEntity(Class<?> clazz, String name, EntityManager em) {
+ try {
+ Object entity = em.createQuery(
+ "select entity from " + clazz.getSimpleName() + " entity where entity.name = :name")
+ .setParameter("name", name)
+ .getSingleResult();
+ em.remove(entity);
+ } catch (NoResultException e) {
+ // we can ignore no results because this code will run when the db
+ // is empty and we expect no results in that case
+ } catch (NonUniqueResultException e) {
+ // we will fail here to let the person running the test know that
+ // the database may not be in a consistent state
+ fail("Purging " + name + " failed. Expected to find one instance of " + clazz.getSimpleName() +
+ " but found more than one. The database may not be in a consistent state.");
+ }
+ }
+
+ protected void initResourceType() {
+ resourceType = new ResourceTypeBuilder().createResourceType()
+ .withId(0)
+ .withName(RESOURCE_TYPE_NAME)
+ .withCategory(SERVER)
+ .withPlugin(RESOURCE_TYPE_NAME.toLowerCase())
+ .build();
+ }
+
+ protected void initAgent() {
+ agent = new Agent(AGENT_NAME, "localhost", 1, "", AGENT_NAME + "_TOKEN");
+ }
+
+ protected void initResource() {
+ resource = new ResourceBuilder().createResource()
+ .withId(0)
+ .withName(RESOURCE_NAME)
+ .withResourceKey(RESOURCE_NAME)
+ .withRandomUuid()
+ .withResourceType(resourceType)
+ .build();
+ }
+
+ protected Subject getOverlord() {
+ return getSubjectManager().getOverlord();
+ }
+
+ protected String toString(DriftDefinition def) {
+ return "DriftDefinition[id: " + def.getId() + ", name: " + def.getName() + "]";
+ }
+
+ protected String toString(DriftDefinitionTemplate template) {
+ return DriftDefinitionTemplate.class.getSimpleName() + "[id: " + template.getId() + ", name: " +
+ template.getName() + "]";
+ }
+
+ protected Drift findDriftByPath(List<? extends Drift> drifts, String path) {
+ for (Drift drift : drifts) {
+ if (drift.getPath().equals(path)) {
+ return drift;
+ }
+ }
+ return null;
+ }
+}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
new file mode 100644
index 0000000..de93b74
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
@@ -0,0 +1,603 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.util.Arrays.asList;
+import static org.rhq.core.domain.common.EntityContext.forResource;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.plannedChanges;
+import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
+import static org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility.SerializationType.SERIALIZATION;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
+import static org.rhq.test.AssertUtils.assertPropertiesMatch;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.ejb.EJBException;
+import javax.persistence.EntityManager;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
+import org.rhq.core.domain.criteria.DriftDefinitionTemplateCriteria;
+import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftDefinitionComparator;
+import org.rhq.core.domain.drift.DriftDefinitionTemplate;
+import org.rhq.core.domain.drift.DriftSnapshot;
+import org.rhq.core.domain.drift.Filter;
+import org.rhq.core.domain.drift.JPADrift;
+import org.rhq.core.domain.drift.JPADriftChangeSet;
+import org.rhq.core.domain.drift.JPADriftFile;
+import org.rhq.core.domain.drift.JPADriftSet;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+
+public class DriftTemplateManagerBeanTest extends DriftServerTest {
+
+ private DriftTemplateManagerLocal templateMgr;
+
+ private DriftManagerLocal driftMgr;
+
+ private List<Resource> resources = new LinkedList<Resource>();
+
+ private JPADrift drift1;
+ private JPADrift drift2;
+ private JPADriftFile driftFile1;
+ private JPADriftFile driftFile2;
+
+ @BeforeClass
+ public void initClass() {
+ templateMgr = getDriftTemplateManager();
+ driftMgr = getDriftManager();
+
+ }
+
+ @Override
+ protected void initDB(EntityManager em) {
+ agentServiceContainer.driftService = new TestDefService() {
+ @Override
+ public void unscheduleDriftDetection(int resourceId, DriftDefinition driftDef) {
+ detach(driftDef);
+ }
+
+ @Override
+ public void updateDriftDetection(int resourceId, DriftDefinition driftDef) {
+ detach(driftDef);
+ }
+
+ @Override
+ public void updateDriftDetection(int resourceId, DriftDefinition driftDef, DriftSnapshot driftSnapshot) {
+ detach(driftDef);
+ detach(driftSnapshot);
+ }
+
+ private void detach(Object object) {
+ try {
+ HibernateDetachUtility.nullOutUninitializedFields(object, SERIALIZATION);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+
+ public void createNewTemplate() {
+ final DriftDefinition definition = new DriftDefinition(new Configuration());
+ definition.setName("test::createNewTemplate");
+ definition.setEnabled(true);
+ definition.setDriftHandlingMode(normal);
+ definition.setInterval(2400L);
+ definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ final DriftDefinitionTemplate newTemplate = templateMgr.createTemplate(getOverlord(), resourceType.getId(),
+ true, definition);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ ResourceType updatedType = em.find(ResourceType.class, resourceType.getId());
+
+ assertEquals("Failed to add new drift definition to resource type", 1, updatedType
+ .getDriftDefinitionTemplates().size());
+
+ DriftDefinitionTemplate expectedTemplate = new DriftDefinitionTemplate();
+ expectedTemplate.setTemplateDefinition(definition);
+ expectedTemplate.setUserDefined(true);
+
+ assertDriftTemplateEquals("Failed to save template", expectedTemplate, newTemplate);
+ assertTrue("The template should have its id set", newTemplate.getId() > 0);
+ }
+ });
+ }
+
+ public void createTemplateForNegativeUpdateTests() {
+ DriftDefinition definition = new DriftDefinition(new Configuration());
+ definition.setName("test::createTemplateForNegativeUpdateTests");
+ definition.setEnabled(true);
+ definition.setDriftHandlingMode(normal);
+ definition.setInterval(2400L);
+ definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ templateMgr.createTemplate(getOverlord(), resourceType.getId(), true, definition);
+
+ assertNotNull("Failed to load template", loadTemplate(definition.getName()));
+ }
+
+ @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
+ expectedExceptions = EJBException.class,
+ expectedExceptionsMessageRegExp = ".*base directory.*cannot be modified")
+ @InitDB(false)
+ public void doNotAllowBaseDirToBeUpdated() {
+ DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
+ DriftDefinition definition = template.getTemplateDefinition();
+ definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/TEST"));
+
+ templateMgr.updateTemplate(getOverlord(), template);
+ }
+
+ @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
+ expectedExceptions = EJBException.class,
+ expectedExceptionsMessageRegExp = ".*filters.*cannot be modified")
+ @InitDB(false)
+ public void doNotAllowFiltersToBeUpdated() {
+ DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
+ DriftDefinition definition = template.getTemplateDefinition();
+ definition.addExclude(new Filter("/foo/bar/TEST/conf", "*.xml"));
+
+ templateMgr.updateTemplate(getOverlord(), template);
+ }
+
+ @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
+ expectedExceptions = EJBException.class,
+ expectedExceptionsMessageRegExp = ".*name.*cannot be modified")
+ @InitDB(false)
+ public void doNotAllowTemplateNameToBeUpdated() {
+ DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
+ template.setName("A new name");
+
+ templateMgr.updateTemplate(getOverlord(), template);
+ }
+
+ public void createAndUpdateTemplate() {
+ // create the template
+ DriftDefinition definition = new DriftDefinition(new Configuration());
+ definition.setName("test::updateTemplate");
+ definition.setDescription("update template test");
+ definition.setEnabled(true);
+ definition.setDriftHandlingMode(normal);
+ definition.setInterval(2400L);
+ definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
+ definition);
+
+ // next create some definitions from the template
+ final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
+ final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
+ final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
+ final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
+
+ driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), attachedDef1);
+ driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), attachedDef2);
+ driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), detachedDef1);
+ driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), detachedDef2);
+
+ // update the template
+ final DriftDefinition newTemplateDef = template.getTemplateDefinition();
+ newTemplateDef.setInterval(4800L);
+ newTemplateDef.setDriftHandlingMode(plannedChanges);
+ newTemplateDef.setEnabled(false);
+
+ templateMgr.updateTemplate(getOverlord(), template);
+
+ // verify that the tempalte has been updated
+ final DriftDefinitionTemplate updatedTemplate = loadTemplate(template.getName());
+ AssertUtils.assertPropertiesMatch("Failed to update template", template, updatedTemplate, "resourceType",
+ "driftDefinitions", "templateDefinition");
+
+ // verify that attached definitions are updated.
+ for (DriftDefinition def : asList(attachedDef1, attachedDef2)) {
+ DriftDefinition updatedDef = loadDefinition(def.getId());
+ String msg = "Failed to propagate update to attached definition " + toString(updatedDef) + " - ";
+ DriftDefinition updatedTemplateDef = updatedTemplate.getTemplateDefinition();
+
+ assertEquals(msg + "enabled property not updated", updatedTemplateDef.isEnabled(),
+ updatedDef.isEnabled());
+ assertEquals(msg + "driftHandlingMode property not updated",
+ updatedTemplateDef.getDriftHandlingMode(), updatedDef.getDriftHandlingMode());
+ assertEquals(msg + "interval property not updated", updatedTemplateDef.getInterval(),
+ updatedDef.getInterval());
+ }
+
+ // verify that the detached definitions have not been updated.
+ for (DriftDefinition def : asList(detachedDef1, detachedDef2)) {
+ DriftDefinition defAfterUpdate = loadDefinition(def.getId());
+ String msg = "Detached definition " + toString(def) + " should not get updated - ";
+
+ assertEquals(msg + "enabled property was modified", def.isEnabled(), defAfterUpdate.isEnabled());
+ assertEquals(msg + "driftHandlingMode property was modified", def.getDriftHandlingMode(),
+ defAfterUpdate.getDriftHandlingMode());
+ assertEquals(msg + "interval property was modified", def.getInterval(), defAfterUpdate.getInterval());
+ }
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public void pinTemplate() throws Exception {
+ // First create the template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test::pinTemplate");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(),
+ resourceType.getId(), true, templateDef);
+
+ // next create some resource level definitions
+ final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
+ final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
+ final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
+ final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
+
+ // create initial change set from which the snapshot will be generated
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
+
+ driftFile1 = new JPADriftFile("a1b2c3");
+ drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift1);
+
+ // create change set v1
+ driftFile2 = new JPADriftFile("1a2b3c");
+ final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, attachedDef1);
+ drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ em.persist(attachedDef1);
+
+ em.persist(driftFile1);
+ em.persist(driftFile2);
+
+ em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
+
+ em.persist(changeSet1);
+ em.persist(drift2);
+
+ em.persist(attachedDef2);
+ em.persist(detachedDef1);
+ em.persist(detachedDef2);
+ }
+ });
+
+ // now we pin the snapshot to the template
+ templateMgr.pinTemplate(getOverlord(), template.getId(), attachedDef1.getId(), 1);
+
+ // verify that the template is now pinned
+ DriftDefinitionTemplate updatedTemplate = loadTemplate(template.getName());
+ assertTrue("Template should be marked pinned", updatedTemplate.isPinned());
+ }
+
+ @Test(dependsOnMethods = "pinTemplate")
+ @InitDB(false)
+ public void persistChangeSetWhenTemplateGetsPinned() throws Exception {
+ DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
+
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterId(template.getChangeSetId());
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+
+ assertEquals("Expected to find change set for pinned template", 1, changeSets.size());
+
+ JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
+ List<? extends Drift> expectedDrifts = asList(
+ new JPADrift(expectedChangeSet, "drift.1", FILE_ADDED, null, driftFile1),
+ new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
+
+ DriftChangeSet<?> actualChangeSet = changeSets.get(0);
+ List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
+
+ AssertUtils.assertCollectionMatchesNoOrder(
+ "Expected to find drifts from change sets 1 and 2 in the template change set",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
+
+ // we need to compare the newDriftFile properties separately because
+ // assertCollectionMatchesNoOrder compares properties via equals() and JPADriftFile
+ // does not implement equals.
+ assertPropertiesMatch(drift1.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(),
+ "The newDriftFile property was not set correctly for " + drift1);
+ assertPropertiesMatch(drift2.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(),
+ "The newDriftFile property was not set correctly for " + drift1);
+ }
+
+ @Test(dependsOnMethods = "pinTemplate")
+ @InitDB(false)
+ public void updateAttachedDefinitionsWhenTemplateGetsPinned() throws Exception {
+ DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
+
+ // get the attached definitions
+ List<DriftDefinition> attachedDefs = new LinkedList<DriftDefinition>();
+ for (DriftDefinition d : template.getDriftDefinitions()) {
+ if (d.isAttached() && (d.getName().equals("attachedDef1") || d.getName().equals("attachedDef2"))) {
+ attachedDefs.add(d);
+ }
+ }
+ assertEquals("Failed to get attached definitions for " + toString(template), 2, attachedDefs.size());
+ assertDefinitionIsPinned(attachedDefs.get(0));
+ assertDefinitionIsPinned(attachedDefs.get(1));
+ }
+
+ @Test(dependsOnMethods = "pinTemplate")
+ @InitDB(false)
+ public void doNotUpdateDetachedDefinitionsWhenTemplateGetsPinned() throws Exception {
+ DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
+
+ // get the detached definitions
+ List<DriftDefinition> detachedDefs = new LinkedList<DriftDefinition>();
+ for (DriftDefinition d : template.getDriftDefinitions()) {
+ if (!d.isAttached() && (d.getName().equals("detachedDef1") || d.getName().equals("detachedDef2"))) {
+ detachedDefs.add(d);
+ }
+ }
+ assertEquals("Failed to get detached definitions for " + toString(template), 2, detachedDefs.size());
+ assertDefinitionIsNotPinned(detachedDefs.get(0));
+ assertDefinitionIsNotPinned(detachedDefs.get(1));
+ }
+
+ public void deleteTemplate() throws Exception {
+ // first create the template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test::pinTemplate");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(),
+ resourceType.getId(), true, templateDef);
+
+ // next create some resource level definitions
+ final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
+ final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
+ final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
+ final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
+
+ // create some change sets
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
+
+ driftFile1 = new JPADriftFile("a1b2c3");
+ drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet0 = new JPADriftSet();
+ driftSet0.addDrift(drift1);
+
+ final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 0, DRIFT, detachedDef1);
+
+ driftFile2 = new JPADriftFile("1a2b3c");
+ drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
+
+ final JPADriftSet driftSet1 = new JPADriftSet();
+ driftSet1.addDrift(drift2);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ em.persist(attachedDef1);
+ em.persist(attachedDef2);
+ em.persist(detachedDef1);
+ em.persist(detachedDef2);
+
+ em.persist(driftFile1);
+ em.persist(driftFile2);
+
+ em.persist(changeSet0);
+ em.persist(driftSet0);
+ changeSet0.setInitialDriftSet(driftSet0);
+ em.merge(changeSet0);
+
+ em.persist(changeSet1);
+ em.persist(driftSet1);
+ changeSet1.setInitialDriftSet(driftSet1);
+ em.merge(changeSet1);
+ }
+ });
+
+ // delete the template
+ templateMgr.deleteTemplate(getOverlord(), template.getId());
+
+ // verify that attached definitions along with their change sets have
+ // been deleted
+ assertNull("Change sets belonging to attached definitions should be deleted", loadChangeSet(changeSet0.getId()));
+ assertNull("Attached definition " + toString(attachedDef1) + " should be deleted",
+ loadDefinition(attachedDef1.getId()));
+ assertNull("Attached definition " + toString(attachedDef2) + " should be deleted",
+ loadDefinition(attachedDef2.getId()));
+
+ // verify that detached definitions along with their change sets have not been deleted
+ assertNotNull("Change sets belonging to detached definitions should not be deleted",
+ loadChangeSet(changeSet1.getId()));
+ assertDetachedDefinitionNotDeleted(detachedDef1.getId());
+ assertDetachedDefinitionNotDeleted(detachedDef2.getId());
+
+ // verify that the template itself has been deleted
+ assertNull("The template " + toString(template) + " should have been deleted",
+ loadTemplate(template.getName(), false));
+ }
+
+ private void assertDefinitionIsPinned(DriftDefinition definition) throws Exception {
+ // verify that the definition is marked as pinned
+ assertTrue("Expected " + toString(definition) + " to be pinned", definition.isPinned());
+
+ // verify that the initial change set is generated for the definition
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(definition.getId());
+ criteria.addFilterCategory(COVERAGE);
+ criteria.fetchDrifts(true);
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+ assertEquals("Expected to find one change set", 1, changeSets.size());
+
+ JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
+ List<? extends Drift> expectedDrifts = asList(
+ new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
+ new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
+
+ DriftChangeSet<?> actualChangeSet = changeSets.get(0);
+ List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
+
+ AssertUtils.assertCollectionMatchesNoOrder(
+ "Expected to find drifts from change sets 1 and 2 in the template change set",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
+
+ // Finally make sure that there are no other change sets
+ criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterStartVersion(1);
+ criteria.addFilterDriftDefinitionId(definition.getId());
+
+ assertEquals("There should not be any drift change sets", 0,
+ driftMgr.findDriftChangeSetsByCriteria(getOverlord(), criteria).size());
+ }
+
+ private void assertDefinitionIsNotPinned(DriftDefinition definition) throws Exception {
+ // verify that the definition is not pinned
+ assertFalse("Expected " + toString(definition) + " to be unpinned", definition.isPinned());
+
+ // Note that this method assumes that the definition has no change sets
+ // associated with it and therefore checks that there are no change sets.
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(definition.getId());
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+ assertEquals("Did not expect to find any change sets for " + toString(definition) + ". Note that this " +
+ "assertion method assumes that the definition you are testing is not supposed to have any change sets.",
+ 0, changeSets.size());
+ }
+
+ private void assertDriftTemplateEquals(String msg, DriftDefinitionTemplate expected, DriftDefinitionTemplate actual) {
+ AssertUtils
+ .assertPropertiesMatch(msg + ": basic drift definition template properties do not match", expected, actual,
+ "id", "resourceType", "ctime", "templateDefinition");
+ assertDriftDefEquals(msg + ": template definitions do not match", expected.getTemplateDefinition(), actual
+ .getTemplateDefinition());
+ }
+
+ private void assertDriftDefEquals(String msg, DriftDefinition expected, DriftDefinition actual) {
+ DriftDefinitionComparator comparator = new DriftDefinitionComparator(
+ BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
+ assertEquals(msg, 0, comparator.compare(expected, actual));
+ }
+
+ private void assertDetachedDefinitionNotDeleted(int definitionId) {
+ DriftDefinition definition = loadDefinition(definitionId);
+ assertNotNull("Detached definition " + toString(definition) + " should not be deleted", definition);
+ assertNull("The detached definition's template reference should be set to null when the template is deleted",
+ definition.getTemplate());
+ }
+
+ private DriftDefinition createDefinition(DriftDefinitionTemplate template, String defName, boolean isAttached) {
+ DriftDefinition def = template.createDefinition();
+ def.setName(defName);
+ def.setAttached(isAttached);
+ def.setTemplate(template);
+ def.setResource(resource);
+ return def;
+ }
+
+ private DriftDefinitionTemplate loadTemplate(String name) {
+ return loadTemplate(name, true);
+ }
+
+ private DriftDefinitionTemplate loadTemplate(String name, boolean verifyResultsUnique) {
+ DriftDefinitionTemplateCriteria criteria = new DriftDefinitionTemplateCriteria();
+ criteria.addFilterResourceTypeId(resourceType.getId());
+ criteria.addFilterName(name);
+ criteria.fetchDriftDefinitions(true);
+
+ PageList<DriftDefinitionTemplate> templates = templateMgr.findTemplatesByCriteria(getOverlord(), criteria);
+ if (verifyResultsUnique) {
+ assertEquals("Expected to find one template", 1, templates.size());
+ }
+
+ if (templates.isEmpty()) {
+ return null;
+ }
+ return templates.get(0);
+ }
+
+ private DriftDefinition loadDefinition(int definitionId) {
+ DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
+ criteria.addFilterId(definitionId);
+ criteria.fetchConfiguration(true);
+ criteria.fetchTemplate(true);
+ PageList<DriftDefinition> definitions = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
+
+ if (definitions.isEmpty()) {
+ return null;
+ }
+ return definitions.get(0);
+ }
+
+ private DriftChangeSet<?> loadChangeSet(String id) throws Exception {
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterId(id);
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+
+ if (changeSets.isEmpty()) {
+ return null;
+ }
+ return changeSets.get(0);
+ }
+
+}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java
new file mode 100644
index 0000000..65a6523
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/InitDB.java
@@ -0,0 +1,32 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Retention(RUNTIME)
+(a)Target({ElementType.METHOD })
+public @interface InitDB {
+ boolean value() default true;
+}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
new file mode 100644
index 0000000..4faca1b
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
@@ -0,0 +1,309 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.util.Arrays.asList;
+import static org.apache.commons.io.IOUtils.toInputStream;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
+import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
+import static org.rhq.enterprise.server.util.LookupUtil.getJPADriftServer;
+import static org.rhq.test.AssertUtils.assertPropertiesMatch;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.BeforeMethod;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.JPADrift;
+import org.rhq.core.domain.drift.JPADriftChangeSet;
+import org.rhq.core.domain.drift.JPADriftFile;
+import org.rhq.core.domain.drift.JPADriftSet;
+import org.rhq.core.domain.drift.dto.DriftChangeSetDTO;
+import org.rhq.core.domain.drift.dto.DriftDTO;
+import org.rhq.core.domain.drift.dto.DriftFileDTO;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+
+public class JPADriftServerBeanTest extends DriftServerTest {
+
+ private JPADriftServerLocal jpaDriftServer;
+
+ private final String DRIFT_FILE_1_ID = "a1b2c3d4";
+
+ private final String DRIFT_FILE_2_ID = "1ab2b3c4d";
+
+ private JPADriftFile driftFile1;
+
+ private JPADriftFile driftFile2;
+
+ @BeforeClass
+ public void initTests() {
+ jpaDriftServer = getJPADriftServer();
+ }
+
+ @BeforeMethod
+ public void persistDriftFiles() throws Exception {
+ driftFile1 = jpaDriftServer.persistDriftFile(new JPADriftFile(DRIFT_FILE_1_ID));
+ driftFile2 = jpaDriftServer.persistDriftFile(new JPADriftFile(DRIFT_FILE_2_ID));
+
+ String driftFile1Content = "drift file 1 content...";
+ String driftFile2Content = "drift file 2 content...";
+
+ jpaDriftServer.persistDriftFileData(driftFile1, toInputStream(driftFile1Content), driftFile1Content.length());
+ jpaDriftServer.persistDriftFileData(driftFile2, toInputStream(driftFile2Content), driftFile2Content.length());
+
+ driftFile1 = jpaDriftServer.getDriftFile(getOverlord(), DRIFT_FILE_1_ID);
+ driftFile2 = jpaDriftServer.getDriftFile(getOverlord(), DRIFT_FILE_2_ID);
+
+ assertDriftFilePersisted(driftFile1, "driftFile1", driftFile1Content);
+ assertDriftFilePersisted(driftFile2, "driftFile2", driftFile2Content);
+ }
+
+ public void persistResourceChangeSet() {
+ // first create and persist the drift definition
+ final DriftDefinition driftDef = new DriftDefinition(new Configuration());
+ driftDef.setName("test::persistResourceChangeSet");
+ driftDef.setEnabled(true);
+ driftDef.setDriftHandlingMode(normal);
+ driftDef.setInterval(2400L);
+ driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+ driftDef.setResource(resource);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftDef);
+ }
+ });
+
+ // create the change set to be persisted
+ DriftChangeSetDTO changeSet = new DriftChangeSetDTO();
+ changeSet.setCategory(COVERAGE);
+ changeSet.setVersion(1);
+ changeSet.setDriftDefinitionId(driftDef.getId());
+ changeSet.setResourceId(resource.getId());
+ changeSet.setDriftHandlingMode(normal);
+ changeSet.setCtime(System.currentTimeMillis());
+
+ DriftDTO drift1 = new DriftDTO();
+ drift1.setCategory(FILE_ADDED);
+ drift1.setPath("drift.1");
+ drift1.setChangeSet(changeSet);
+ drift1.setCtime(System.currentTimeMillis());
+ drift1.setNewDriftFile(toDTo(driftFile1));
+
+ DriftDTO drift2 = new DriftDTO();
+ drift2.setCategory(FILE_ADDED);
+ drift2.setPath("drift.2");
+ drift2.setChangeSet(changeSet);
+ drift2.setCtime(System.currentTimeMillis());
+ drift2.setNewDriftFile(toDTo(driftFile2));
+
+ Set<DriftDTO> drifts = new HashSet<DriftDTO>();
+ drifts.add(drift1);
+ drifts.add(drift2);
+ changeSet.setDrifts(drifts);
+
+ String newChangeSetId = jpaDriftServer.persistChangeSet(getOverlord(), changeSet);
+
+ // verify that the change set was persisted
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterId(newChangeSetId);
+ criteria.fetchDrifts(true);
+
+ PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
+ assertEquals("Expected to find one change set", 1, changeSets.size());
+
+ JPADriftChangeSet jpaChangeSet = changeSets.get(0);
+ assertEquals("Expected change set to contain two drifts. This could be a result of the change set not being " +
+ "persisted correctly or the criteria fetch being done incorrectly.", 2, jpaChangeSet.getDrifts().size());
+
+ AssertUtils
+ .assertPropertiesMatch("The change set was not persisted correctly", changeSet, jpaChangeSet, "id", "drifts",
+ "class", "ctime");
+
+ List<? extends Drift> expectedDrifts = asList(drift1, drift2);
+ List<? extends Drift> actualDrifts = new ArrayList(jpaChangeSet.getDrifts());
+
+ // We ignore the id and ctime properties because those are set by JPADriftServerBean
+ // and are somewhat implmentation specific. We ignore the directory property because
+ // it is really a calculated property. newDriftFile has to be compared separately
+ // since it does not implement equals.
+ AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not persisted correctly",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "directory",
+ "newDriftFile", "class");
+
+ assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift1, drift1.getNewDriftFile(),
+ findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(), "class", "ctime") ;
+ assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift2, drift2.getNewDriftFile(),
+ findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(), "class", "ctime") ;
+ }
+
+ public void persistTemplateChangeSet() {
+ // create the change set to be persisted
+ //
+ // Note that we do not set the drift definition id or resource id since
+ // the change set is not owned by a resource. It is owned by the
+ // resource type.
+ DriftChangeSetDTO changeSet = new DriftChangeSetDTO();
+ changeSet.setCategory(COVERAGE);
+ changeSet.setVersion(1);
+ changeSet.setDriftHandlingMode(normal);
+ changeSet.setCtime(System.currentTimeMillis());
+
+ DriftDTO drift1 = new DriftDTO();
+ drift1.setCategory(FILE_ADDED);
+ drift1.setPath("drift.1");
+ drift1.setChangeSet(changeSet);
+ drift1.setCtime(System.currentTimeMillis());
+ drift1.setNewDriftFile(toDTo(driftFile1));
+
+ DriftDTO drift2 = new DriftDTO();
+ drift2.setCategory(FILE_ADDED);
+ drift2.setPath("drift.2");
+ drift2.setChangeSet(changeSet);
+ drift2.setCtime(System.currentTimeMillis());
+ drift2.setNewDriftFile(toDTo(driftFile2));
+
+ Set<DriftDTO> drifts = new HashSet<DriftDTO>();
+ drifts.add(drift1);
+ drifts.add(drift2);
+ changeSet.setDrifts(drifts);
+
+ String newChangeSetId = jpaDriftServer.persistChangeSet(getOverlord(), changeSet);
+
+ // verify that the change set was persisted
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterId(newChangeSetId);
+ criteria.fetchDrifts(true);
+
+ PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
+ assertEquals("Expected to find one change set", 1, changeSets.size());
+
+ JPADriftChangeSet jpaChangeSet = changeSets.get(0);
+ assertEquals("Expected change set to contain two drifts. This could be a result of the change set not being " +
+ "persisted correctly or the criteria fetch being done incorrectly.", 2, jpaChangeSet.getDrifts().size());
+
+ AssertUtils
+ .assertPropertiesMatch("The change set was not persisted correctly", changeSet, jpaChangeSet, "id", "drifts",
+ "class", "ctime");
+
+ List<? extends Drift> expectedDrifts = asList(drift1, drift2);
+ List<? extends Drift> actualDrifts = new ArrayList(jpaChangeSet.getDrifts());
+
+ // We ignore the id and ctime properties because those are set by JPADriftServerBean
+ // and are somewhat implmentation specific. We ignore the directory property because
+ // it is really a calculated property. newDriftFile has to be compared separately
+ // since it does not implement equals.
+ AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not persisted correctly",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "directory",
+ "newDriftFile", "class");
+
+ assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift1, drift1.getNewDriftFile(),
+ findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(), "class", "ctime") ;
+ assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift2, drift2.getNewDriftFile(),
+ findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(), "class", "ctime") ;
+ }
+
+ public void copyChangeSet() {
+ // first create the change set that will be copied
+ final JPADriftChangeSet changeSet = new JPADriftChangeSet(null, 0, COVERAGE, null);
+ changeSet.setDriftHandlingMode(normal);
+
+ final JPADrift drift1 = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
+ final JPADrift drift2 = new JPADrift(changeSet, "drift.2", FILE_ADDED, null, driftFile2);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift1);
+ driftSet.addDrift(drift2);
+
+ // next create the drift definition
+ final DriftDefinition driftDef = new DriftDefinition(new Configuration());
+ driftDef.setName("test::copyChangeSet");
+ driftDef.setEnabled(true);
+ driftDef.setDriftHandlingMode(normal);
+ driftDef.setInterval(2400L);
+ driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+ driftDef.setResource(resource);
+
+ // persist the change set and drift definition
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(changeSet);
+ em.persist(driftDef);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
+ }
+ });
+
+ jpaDriftServer.copyChangeSet(getOverlord(), changeSet.getId(), driftDef.getId(), resource.getId());
+
+ // verify that the change set was created for the definition
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(driftDef.getId());
+ criteria.addFilterCategory(COVERAGE);
+
+ PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
+
+ assertEquals("Expected to get back one change set", 1,changeSets.size());
+
+ JPADriftChangeSet newChangeSet = changeSets.get(0);
+ Set<JPADrift> expectedDrifts = new HashSet<JPADrift>(asList(drift1, drift2));
+ Set<JPADrift> actualDrifts = newChangeSet.getDrifts();
+
+ AssertUtils.assertCollectionMatchesNoOrder("The change set drifts were not copied correctly", expectedDrifts,
+ actualDrifts,
+ "changeSet", "newDriftFile");
+ }
+
+ private DriftFileDTO toDTo(JPADriftFile driftFile) {
+ DriftFileDTO dto = new DriftFileDTO();
+ dto.setHashId(driftFile.getHashId());
+ dto.setDataSize(driftFile.getDataSize());
+ dto.setStatus(driftFile.getStatus());
+ return dto;
+ }
+
+
+ private void assertDriftFilePersisted(JPADriftFile driftFile, String name, String content) {
+ assertNotNull("Failed to get " + name + " Was it persisted?", driftFile);
+ assertEquals("The content for " + name + " is wrong", content, jpaDriftServer.getDriftFileBits(
+ driftFile.getHashId()));
+ assertEquals("The drift file status is wrong", LOADED, driftFile.getStatus());
+ }
+
+}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
new file mode 100644
index 0000000..66afcb0
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
@@ -0,0 +1,223 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.util.Arrays.asList;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
+import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.persistence.EntityManager;
+
+import org.testng.annotations.BeforeClass;
+
+import org.rhq.core.domain.common.EntityContext;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
+import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftConfigurationDefinition;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftDefinitionComparator;
+import org.rhq.core.domain.drift.DriftDefinitionTemplate;
+import org.rhq.core.domain.drift.DriftSnapshot;
+import org.rhq.core.domain.drift.JPADrift;
+import org.rhq.core.domain.drift.JPADriftChangeSet;
+import org.rhq.core.domain.drift.JPADriftFile;
+import org.rhq.core.domain.drift.JPADriftSet;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+
+public class ManageDriftDefinitionsTest extends DriftServerTest {
+
+ private DriftManagerLocal driftMgr;
+
+ private DriftTemplateManagerLocal templateMgr;
+
+ @BeforeClass
+ public void initClass() throws Exception {
+ driftMgr = getDriftManager();
+ templateMgr = getDriftTemplateManager();
+ }
+
+ public void createDefinitionFromUnpinnedTemplate() {
+ // first create a template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test_createUnpinnedDefinition");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ // persist the template
+ DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), false,
+ templateDef);
+
+ // create and persist the definition
+ DriftDefinition definition = template.createDefinition();
+ definition.setTemplate(template);
+ driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(resource.getId()), definition);
+
+ // verify that the definition was created
+ DriftDefinition newDef = loadDefinition(definition.getName());
+ DriftDefinitionComparator comparator = new DriftDefinitionComparator(
+ BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
+
+ assertEquals("The drift definition was not persisted correctly", 0, comparator.compare(definition, newDef));
+ assertEquals("The template association was not set on the definition", template, newDef.getTemplate());
+ }
+
+ @SuppressWarnings("unchecked")
+ public void createDefinitionFromPinnedTemplate() throws Exception {
+ // We first need to create a pinned template. Users can only create a pinned
+ // template from a snapshot of an existing resource-level drift definition.
+ // We are going to take a bit of a short cut though by directly creating
+ // and persisting the pinned change set.
+
+ // first create the change set
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(null, 0, COVERAGE, null);
+ changeSet0.setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode.normal);
+
+ final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
+ final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
+
+ JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+ JPADrift drift2 = new JPADrift(changeSet0, "drift.2", FILE_ADDED, null, driftFile2);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift1);
+ driftSet.addDrift(drift2);
+
+ // create the template
+ final DriftDefinition templateDef = new DriftDefinition(new Configuration());
+ templateDef.setName("test_createUnpinnedDefinition");
+ templateDef.setEnabled(true);
+ templateDef.setDriftHandlingMode(normal);
+ templateDef.setInterval(2400L);
+ templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+ templateDef.setPinned(true);
+
+ final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
+ templateDef);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+
+ em.persist(driftFile1);
+ em.persist(driftFile2);
+ em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
+
+ // setting the change set id on the template is the last and the
+ // most important step in making the template pinned
+ template.setChangeSetId(changeSet0.getId());
+ em.merge(template);
+ }
+ });
+
+ // Create and persist a resource-level definition.
+ final DriftDefinition definition = template.createDefinition();
+ definition.setTemplate(template);
+
+ final AtomicBoolean agentInvoked = new AtomicBoolean(false);
+
+ agentServiceContainer.driftService = new TestDefService() {
+ @Override
+ public void updateDriftDetection(int resourceId, DriftDefinition driftDef, DriftSnapshot snapshot) {
+ try {
+ HibernateDetachUtility.nullOutUninitializedFields(driftDef,
+ HibernateDetachUtility.SerializationType.SERIALIZATION);
+ HibernateDetachUtility.nullOutUninitializedFields(snapshot,
+ HibernateDetachUtility.SerializationType.SERIALIZATION);
+ agentInvoked.set(true);
+ assertNotNull("Expected snapshot drift instances collection to be non-null",
+ snapshot.getDriftInstances());
+ assertEquals("Expected snapshot to contain two drift entries", 2, snapshot.getDriftInstances().size());
+ } catch (Exception e) {
+ String msg = "Do not pass attached entites to agent since those entities are outside of " +
+ "Hibernate's control. The persistence context should be flushed and cleared to ensure that " +
+ "only detached objects are sent to the agent";
+ throw new RuntimeException(msg, e);
+ }
+ }
+ };
+
+ driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(resource.getId()), definition);
+
+ DriftDefinition newDef = loadDefinition(definition.getName());
+
+ // verify that the definition is marked as pinned
+ assertTrue("The drift definition should be marked as pinned", newDef.isPinned());
+
+ // verify that the initial change set is generated for the definition
+ JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(definition.getId());
+ criteria.addFilterCategory(COVERAGE);
+ criteria.fetchDrifts(true);
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+ assertEquals("Expected to find one change set", 1, changeSets.size());
+
+ JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
+ List<? extends Drift> expectedDrifts = asList(
+ new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
+ new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
+
+ DriftChangeSet<?> actualChangeSet = changeSets.get(0);
+ List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
+
+ AssertUtils.assertCollectionMatchesNoOrder(
+ "Expected to find drifts from change sets 1 and 2 in the template change set",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
+
+ // lastly verify that the agent is called
+ assertTrue("Failed to send drift definition along with snapshot to agent", agentInvoked.get());
+ }
+
+ private DriftDefinition loadDefinition(String name) {
+ DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
+ criteria.addFilterResourceIds(resource.getId());
+ criteria.addFilterName(name);
+ criteria.fetchConfiguration(true);
+ criteria.fetchResource(true);
+ criteria.fetchTemplate(true);
+
+ PageList<DriftDefinition> driftDefs = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
+ assertEquals("Expected to find one drift definition", 1, driftDefs.size());
+
+ return driftDefs.get(0);
+ }
+}
diff --git a/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
new file mode 100644
index 0000000..e7341e4
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
@@ -0,0 +1,236 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.drift;
+
+import static java.util.Arrays.asList;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
+import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
+import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
+import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
+import static org.rhq.test.AssertUtils.assertPropertiesMatch;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.persistence.EntityManager;
+
+import org.testng.annotations.BeforeClass;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
+import org.rhq.core.domain.drift.Drift;
+import org.rhq.core.domain.drift.DriftChangeSet;
+import org.rhq.core.domain.drift.DriftDefinition;
+import org.rhq.core.domain.drift.DriftSnapshot;
+import org.rhq.core.domain.drift.JPADrift;
+import org.rhq.core.domain.drift.JPADriftChangeSet;
+import org.rhq.core.domain.drift.JPADriftFile;
+import org.rhq.core.domain.drift.JPADriftSet;
+import org.rhq.core.domain.util.PageList;
+import org.rhq.core.server.EntitySerializer;
+import org.rhq.test.AssertUtils;
+import org.rhq.test.TransactionCallback;
+
+public class ManageSnapshotsTest extends DriftServerTest {
+
+ private DriftManagerLocal driftMgr;
+
+ private DriftTemplateManagerLocal templateMgr;
+
+ @BeforeClass(inheritGroups = true)
+ public void initClass() throws Exception {
+ driftMgr = getDriftManager();
+ templateMgr = getDriftTemplateManager();
+ }
+
+ public void pinningSnapshotShouldSetDriftDefAsPinned() {
+ final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
+
+ // create initial change set
+ final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
+ final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
+ JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftFile1);
+ em.persist(changeSet);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
+ }
+ });
+
+ driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 0);
+ DriftDefinition updatedDriftDef = driftMgr.getDriftDefinition(getOverlord(), driftDef.getId());
+
+ assertNotNull("Failed to get " + toString(driftDef), updatedDriftDef);
+ assertTrue("Failed to set pinned flag of " + toString(driftDef), updatedDriftDef.isPinned());
+ }
+
+ @SuppressWarnings("unchecked")
+ public void pinningSnapshotShouldMakeSnapshotTheInitialChangeSet() throws Exception {
+ final DriftDefinition driftDef = createAndPersistDriftDef("test::makeSnapshotVersionZero");
+
+ // create initial change set
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
+ final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
+ JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift1);
+
+ // create change set v1
+ final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
+ final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, driftDef);
+ final JPADrift drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftFile1);
+ em.persist(driftFile2);
+ em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
+ em.persist(changeSet1);
+ em.persist(drift2);
+ }
+ });
+
+ driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 1);
+
+ // Verify that there is now only one change set for the drift def
+ GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
+ criteria.addFilterDriftDefinitionId(driftDef.getId());
+
+ PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
+ criteria);
+ assertEquals("All change sets except the change set representing the pinned snapshot should be removed",
+ 1, changeSets.size());
+ DriftChangeSet<?> changeSet = changeSets.get(0);
+
+ assertEquals("The pinned snapshot version should be reset to zero", 0, changeSet.getVersion());
+ assertEquals("The change set category is wrong", COVERAGE, changeSet.getCategory());
+
+ JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, driftDef);
+ List<? extends Drift> expectedDrifts = asList(
+ new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
+ new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
+
+ List<? extends Drift> actualDrifts = new ArrayList(changeSet.getDrifts());
+
+ AssertUtils.assertCollectionMatchesNoOrder(
+ "Expected to find drifts from change sets 1 and 2 in the new initial change set",
+ (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
+
+ // we need to compare the newDriftFile properties separately because
+ // assertCollectionMatchesNoOrder compares properties via equals() and JPADriftFile
+ // does not implement equals.
+ assertPropertiesMatch(drift1.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(),
+ "The newDriftFile property was not set correctly for " + drift1);
+ assertPropertiesMatch(drift2.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(),
+ "The newDriftFile property was not set correctly for " + drift1);
+ }
+
+ public void pinningSnapshotShouldSendRequestToAgent() {
+ final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
+
+ // create initial change set
+ final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
+ final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
+ JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
+
+ final JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(drift);
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ EntityManager em = getEntityManager();
+ em.persist(driftFile1);
+ em.persist(changeSet);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
+ }
+ });
+
+ final AtomicBoolean agentInvoked = new AtomicBoolean(false);
+ agentServiceContainer.driftService = new TestDefService() {
+ @Override
+ public void pinSnapshot(int resourceId, String configName, DriftSnapshot snapshot) {
+ try {
+ agentInvoked.set(true);
+ // serialize the method arguments here to more closely simulate what
+ // happens during the call. We cannot send hibernate-proxied objects
+ // to the agent. This is an attempt to catch that.
+ ObjectOutputStream stream = new ObjectOutputStream(new ByteArrayOutputStream());
+ EntitySerializer.writeExternalRemote(resourceId, stream);
+ EntitySerializer.writeExternalRemote(configName, stream);
+ EntitySerializer.writeExternalRemote(snapshot, stream);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+
+ driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 0);
+
+ assertTrue("Failed to send request to agent to pin snapshot", agentInvoked.get());
+ }
+
+ private DriftDefinition createAndPersistDriftDef(String name) {
+ final DriftDefinition driftDef = new DriftDefinition(new Configuration());
+ driftDef.setName(name);
+ driftDef.setEnabled(true);
+ driftDef.setDriftHandlingMode(normal);
+ driftDef.setInterval(1800L);
+ driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
+
+ executeInTransaction(new TransactionCallback() {
+ @Override
+ public void execute() throws Exception {
+ driftDef.setResource(resource);
+ getEntityManager().persist(driftDef);
+ }
+ });
+
+ return driftDef;
+ }
+
+}
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/META-INF/ejb-jar.xml b/modules/enterprise/server/integration-tests/src/test/resources/META-INF/ejb-jar.xml
new file mode 100644
index 0000000..8222948
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/META-INF/ejb-jar.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <description>RHQ</description>
+ <display-name>RHQ</display-name>
+
+ <assembly-descriptor>
+
+ <!-- all our EJB3 SLSBs can define custom @RequiredPermissions annotations for authorization checks-->
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor</interceptor-class>
+ </interceptor-binding>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.rhq.enterprise.server.common.TransactionInterruptInterceptor</interceptor-class>
+ </interceptor-binding>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.rhq.enterprise.server.common.PerformanceMonitorInterceptor</interceptor-class>
+ </interceptor-binding>
+
+ </assembly-descriptor>
+
+</ejb-jar>
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/binary-blob-sample.jar b/modules/enterprise/server/integration-tests/src/test/resources/binary-blob-sample.jar
new file mode 100644
index 0000000..0a629ec
Binary files /dev/null and b/modules/enterprise/server/integration-tests/src/test/resources/binary-blob-sample.jar differ
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/default.persistence.properties b/modules/enterprise/server/integration-tests/src/test/resources/default.persistence.properties
new file mode 100644
index 0000000..8e4f317
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/default.persistence.properties
@@ -0,0 +1,22 @@
+hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
+#hibernate.connection.release_mode=after_statement
+#hibernate.transaction.flush_before_completion=false
+#hibernate.transaction.auto_close_session=false
+#hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
+#hibernate.hbm2ddl.auto=create-drop
+#hibernate.hbm2ddl.auto=create
+hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
+# Clustered cache with TreeCache
+#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
+#hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
+#hibernate.dialect=org.hibernate.dialect.HSQLDialect
+hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+hibernate.bytecode.use_reflection_optimizer=false
+# I don't think this is honored, but EJB3Deployer uses it
+hibernate.bytecode.provider=javassist
+hibernate.jdbc.use_streams_for_binary=true
+hibernate.show_sql=false
+hibernate.format_sql=true
+hibernate.default_batch_fetch_size=16
+hibernate.jdbc.batch_size=20
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/ejb3-interceptors-aop.xml b/modules/enterprise/server/integration-tests/src/test/resources/ejb3-interceptors-aop.xml
new file mode 100644
index 0000000..f30aa70
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/ejb3-interceptors-aop.xml
@@ -0,0 +1,360 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+ "-//JBoss//DTD JBOSS AOP 1.0//EN"
+ "http://www.jboss.org/aop/dtd/jboss-aop_1_0.dtd">
+
+<aop>
+ <interceptor class="org.jboss.aspects.remoting.InvokeRemoteInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.security.SecurityClientInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.tx.ClientTxPropagationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.remoting.IsLocalInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.remoting.ClusterChooserInterceptor" scope="PER_VM"/>
+
+ <interceptor class="org.jboss.aspects.tx.TxPropagationInterceptor" scope="PER_VM"/>
+
+ <stack name="ServiceClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="AsynchronousStatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="AsynchronousStatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="StatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="StatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="ClusteredStatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="ClusteredStatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <interceptor class="org.jboss.ejb3.asynchronous.AsynchronousInterceptor" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.ENCPropagationInterceptor" scope="PER_VM"/>
+ <interceptor name="Basic Authorization" factory="org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor name="JACC Authorization" factory="org.jboss.ejb3.security.JaccAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor factory="org.jboss.ejb3.security.AuthenticationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor factory="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateless.StatelessInstanceInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateful.StatefulInstanceInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.service.ServiceSingletonInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.cache.StatefulReplicationInterceptor" scope="PER_VM"/>
+ <interceptor factory="org.jboss.ejb3.stateful.StatefulRemoveFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.tx.TxInterceptorFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.AllowedOperationsInterceptor" scope="PER_VM"/>
+ <interceptor factory="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor" scope="PER_VM"/>
+
+ <domain name="Stateless Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Stateless Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="JACC Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Base Stateful Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+
+ <!-- Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Stateful Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="JACC Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+
+ <!-- Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache) AND class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
+ </annotation>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class((a)org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+ </domain>
+
+ <domain name="Embedded Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.NoPassivationCache.class)
+ </annotation>
+
+ </domain>
+
+ <domain name="Message Driven Bean">
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Consumer Bean">
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND (has(* *->@org.jboss.annotation.ejb.CurrentMessage(..)) OR hasfield(* *->@org.jboss.annotation.ejb.CurrentMessage))">
+ <interceptor-ref name="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class((a)org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Service Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ </bind>
+ <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ </domain>
+
+ <domain name="JACC Service Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ </bind>
+ <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ </domain>
+
+
+</aop>
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/embedded-jboss-beans.xml b/modules/enterprise/server/integration-tests/src/test/resources/embedded-jboss-beans.xml
new file mode 100644
index 0000000..05edefa
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/embedded-jboss-beans.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
+
+ <bean name="InitialContextProperties" class="java.util.Hashtable">
+ <constructor>
+ <parameter class="java.util.Map">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming:org.jnp.interfaces</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="java:comp/Initializer" class="org.jboss.ejb3.embedded.JavaCompInitializer">
+ <property name="jndiProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="XidFactory" class="org.jboss.tm.XidFactoryImpl"/>
+
+ <bean name="XidFactoryMBean" class="org.jboss.ejb3.embedded.XidFactoryMBean">
+ <constructor>
+ <parameter class="org.jboss.tm.XidFactoryBase">
+ <inject bean="XidFactory"/>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TransactionManagerInitializer" class="org.jboss.tm.TransactionManagerInitializer">
+ <property name="xidFactory">
+ <inject bean="XidFactory"/>
+ </property>
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="UserTransaction" class="org.jboss.ejb3.embedded.UserTransactionImpl">
+ <demand>TransactionManagerInitializer</demand>
+ </bean>
+
+ <bean name="UserTransactionBinding" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ <property name="target">
+ <inject bean="UserTransaction"/>
+ </property>
+ <property name="bindTo">UserTransaction</property>
+ <property name="serializable">false</property>
+ </bean>
+
+
+ <bean name="TransactionManager" class="java.lang.Object">
+ <constructor factoryMethod="getTransactionManager">
+ <factory bean="TransactionManagerInitializer"/>
+ </constructor>
+ </bean>
+ <bean name="CachedConnectionManager" class="org.jboss.resource.connectionmanager.CachedConnectionManagerReference">
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ </bean>
+
+ <bean name="RHQDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
+ <property name="driverClass">${rhq.test.ds.driver-class}</property>
+ <property name="connectionURL">${rhq.test.ds.connection-url}</property>
+ <property name="userName">${rhq.test.ds.user-name}</property>
+ <property name="password">${rhq.test.ds.password}</property>
+ <property name="jndiName">java:/RHQDS</property>
+ <property name="minSize">0</property>
+ <property name="maxSize">20</property>
+ <property name="blockingTimeout">3000</property>
+ <property name="idleTimeout">100000</property>
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ <property name="cachedConnectionManager">
+ <inject bean="CachedConnectionManager"/>
+ </property>
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="RHQDS" class="java.lang.Object">
+ <constructor factoryMethod="getDatasource">
+ <factory bean="RHQDSBootstrap"/>
+ </constructor>
+ </bean>
+
+ <!-- needed for Quartz' no-TX data source (even though this is a local-tx, seems like Quartz is still working) -->
+ <bean name="NoTxRHQDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
+ <property name="driverClass">${rhq.test.ds.driver-class}</property>
+ <property name="connectionURL">${rhq.test.ds.connection-url}</property>
+ <property name="userName">${rhq.test.ds.user-name}</property>
+ <property name="password">${rhq.test.ds.password}</property>
+ <property name="jndiName">java:/NoTxRHQDS</property>
+ <property name="minSize">0</property>
+ <property name="maxSize">10</property>
+ <property name="blockingTimeout">1000</property>
+ <property name="idleTimeout">100000</property>
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ <property name="cachedConnectionManager">
+ <inject bean="CachedConnectionManager"/>
+ </property>
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="NoTxRHQDS" class="java.lang.Object">
+ <constructor factoryMethod="getDatasource">
+ <factory bean="NoTxRHQDSBootstrap"/>
+ </constructor>
+ </bean>
+
+ <bean name="DefaultDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
+ <property name="driverClass">org.hsqldb.jdbcDriver</property>
+ <property name="connectionURL">jdbc:hsqldb:.</property>
+ <!-- <property name="connectionURL">jdbc:hsqldb:./hypersonic/localDB</property> -->
+ <property name="userName">sa</property>
+ <property name="jndiName">java:/DefaultDS</property>
+ <property name="minSize">0</property>
+ <property name="maxSize">10</property>
+ <property name="blockingTimeout">1000</property>
+ <property name="idleTimeout">100000</property>
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ <property name="cachedConnectionManager">
+ <inject bean="CachedConnectionManager"/>
+ </property>
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+
+ <bean name="DefaultDS" class="java.lang.Object">
+ <constructor factoryMethod="getDatasource">
+ <factory bean="DefaultDSBootstrap"/>
+ </constructor>
+ </bean>
+
+</deployment>
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/jboss-jms-beans.xml b/modules/enterprise/server/integration-tests/src/test/resources/jboss-jms-beans.xml
new file mode 100644
index 0000000..287cffc
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/jboss-jms-beans.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="jboss.mq:service=JMSProviderLoader,name=JMSProvider" class="org.jboss.jms.jndi.JNDIProviderAdapter">
+ <property name="factoryRef">java:/JmsXA</property>
+ <property name="queueFactoryRef">java:/JmsXA</property>
+ <property name="topicFactoryRef">java:/JmsXA</property>
+ <property name="properties" class="java.util.Properties">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming:org.jnp.interfaces</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="b1" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="jboss.mq:service=JMSProviderLoader,name=JMSProvider"/></property>
+ <property name="bindTo">java:/DefaultJMSProvider</property>
+ <property name="serializable">true</property>
+ </bean>
+
+ <bean name="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool" class="org.jboss.jms.asf.StdServerSessionPoolFactory">
+ <property name="name">StdJMSPool</property>
+ <property name="xidFactory"><inject bean="XidFactoryMBean"/></property>
+ <property name="transactionManager"><inject bean="TransactionManager"/></property>
+ </bean>
+
+ <bean name="b2" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool"/></property>
+ <property name="bindTo">java:/StdJMSPool</property>
+ <property name="serializable">false</property>
+ </bean>
+
+
+ <bean name="jboss.mq:service=PersistenceManager" class="org.jboss.mq.pm.none.PersistenceManager">
+ </bean>
+
+ <bean name="jboss.mq:service=MessageCache" class="org.jboss.mq.kernel.MessageCache">
+ <property name="persistenceManager"><inject bean="jboss.mq:service=PersistenceManager"/></property>
+ <property name="highMemoryMark">50</property>
+ <property name="maxMemoryMark">60</property>
+ </bean>
+
+ <bean name="jms-rar-WorkManager" class="org.jboss.ejb3.embedded.resource.JBossWorkManager">
+ </bean>
+
+ <bean name="jms-rar-DeploymentInfo" class="org.jboss.ejb3.embedded.resource.Ejb3DeploymentInfo">
+ <constructor>
+ <parameter class="java.lang.String">jms-ra.rar</parameter>
+ <parameter class="java.lang.String">javax.jms.MessageListener</parameter>
+ <parameter class="java.lang.String">org.jboss.resource.adapter.jms.inflow.JmsActivationSpec</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="jboss.jca:name='jms-ra.rar',service=RARDeployment" class="org.jboss.ejb3.embedded.resource.RARDeployment">
+ <constructor>
+ <parameter class="org.jboss.deployment.DeploymentInfo">
+ <inject bean="jms-rar-DeploymentInfo"/>
+ </parameter>
+ </constructor>
+ <property name="workManager"><inject bean="jms-rar-WorkManager"/></property>
+ </bean>
+
+ <bean name="jboss.mq:service=StateManager" class="org.jboss.mq.sm.none.NullStateManager">
+ </bean>
+
+ <bean name="BasicQueueParameters" class="org.jboss.mq.server.BasicQueueParameters"/>
+
+ <bean name="jboss.mq:service=ThreadPool" class="org.jboss.util.threadpool.BasicThreadPool">
+ <property name="name">JMSThread</property>
+ <property name="threadGroupName">JBossMQ Server Threads</property>
+ <!-- The max number of threads in the pool -->
+ <property name="maximumPoolSize">10</property>
+ <!-- The max number of tasks before the queue is full -->
+ <property name="maximumQueueSize">1000</property>
+ <!-- The behavior of the pool when a task is added and the queue is full.
+ abort - a RuntimeException is thrown
+ run - the calling thread executes the task
+ wait - the calling thread blocks until the queue has room
+ discard - the task is silently discarded without being run
+ discardOldest - check to see if a task is about to complete and enque
+ the new task if possible, else run the task in the calling thread
+ -->
+ <property name="blockingMode">run</property>
+ </bean>
+
+ <bean name="jboss.mq:service=DestinationManager" class="org.jboss.mq.server.JMSDestinationManager">
+ <constructor>
+ <parameter class="org.jboss.mq.server.BasicQueueParameters">
+ <inject bean="BasicQueueParameters"/>
+ </parameter>
+ </constructor>
+ <property name="persistenceManager"><inject bean="jboss.mq:service=PersistenceManager"/></property>
+ <property name="messageCache"><inject bean="jboss.mq:service=MessageCache"/></property>
+ <property name="stateManager"><inject bean="jboss.mq:service=StateManager"/></property>
+ <property name="threadPool"><inject bean="jboss.mq:service=ThreadPool"/></property>
+ <property name="threadGroup"><inject bean="jboss.mq:service=ThreadPool" property="threadGroup"/></property>
+ <start method="startServer"/>
+ <stop method="stopServer"/>
+ </bean>
+
+ <bean name="jboss.mq.destination:service=Queue,name=DLQ" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">DLQ</property>
+ </bean>
+
+ <bean name="jboss.mq:service=Invoker" class="org.jboss.mq.server.JMSServerInvoker">
+ <property name="next"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ </bean>
+
+ <bean name="jboss.mq:service=invocationlayer,type=JVM" class="org.jboss.mq.kernel.JVMIL">
+ <property name="jmsInvoker"><inject bean="jboss.mq:service=Invoker"/></property>
+ <!-- notice we actually switched - the non-xa connection factory JNDI Ref is the JNDI name our EJBs use -->
+ <!-- the embedded EJB container doesn't support XA, so the connection factory our JmsXA JNDI lookup will return will be a non-XA factory -->
+ <property name="connectionFactoryJNDIRef">java:/JmsXA</property>
+ <property name="XAConnectionFactoryJNDIRef">java:/ConnectionFactory</property>
+ <property name="pingPeriod">0</property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ </bean>
+
+</deployment>
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/jms-ra.rar b/modules/enterprise/server/integration-tests/src/test/resources/jms-ra.rar
new file mode 100644
index 0000000..c4807c6
Binary files /dev/null and b/modules/enterprise/server/integration-tests/src/test/resources/jms-ra.rar differ
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/jndi.properties b/modules/enterprise/server/integration-tests/src/test/resources/jndi.properties
new file mode 100644
index 0000000..9225cef
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/jndi.properties
@@ -0,0 +1,2 @@
+java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/log4j.xml b/modules/enterprise/server/integration-tests/src/test/resources/log4j.xml
new file mode 100644
index 0000000..bc65329
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/log4j.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 39945 2006-01-12 02:44:07Z bill $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="WARN"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Messagen -->
+ <!--
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ -->
+ <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} [%c] (%F:%M:%L) -%m%n"/>
+ </layout>
+ </appender>
+
+ <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="target/server-jar-test.log"/>
+ <param name="Threshold" value="WARN"/>
+ <param name="Append" value="false"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Messagen -->
+ <!--
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ -->
+ <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} [%c] (%F:%M:%L) -%m%n"/>
+ </layout>
+ </appender>
+
+ <!-- Hibernate logs WARNINGS frequent from this class, in test envs. -->
+ <category name="org.hibernate.hql.ast.QueryTranslatorImpl">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- hides the TIMER SERVICE IS NOT INSTALLED warning - we know embedded EJB3 container doesn't support timers -->
+ <category name="org.jboss.ejb3.timerservice.jboss.JBossTimerServiceFactory">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- hides the shutdown warnings - for some reason, the container spits out some warnings when shutting down -->
+ <category name="org.jboss.kernel.plugins.dependency.StartStopLifecycleAction">
+ <priority value="ERROR"/>
+ </category>
+
+ <!-- Hibernate SQL logs -->
+ <!--
+ <category name="org.hibernate.SQL">
+ <priority value="DEBUG"/>
+ </category>
+ -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/login-config.xml b/modules/enterprise/server/integration-tests/src/test/resources/login-config.xml
new file mode 100644
index 0000000..645294d
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/login-config.xml
@@ -0,0 +1,72 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE policy PUBLIC
+ "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The XML based JAAS login configuration read by the
+org.jboss.security.auth.login.XMLLoginConfig mbean. Add
+an application-policy element for each security domain.
+
+The outline of the application-policy is:
+<application-policy name="security-domain-name">
+ <authentication>
+ <login-module code="login.module1.class.name" flag="control_flag">
+ <module-option name = "option1-name">option1-value</module-option>
+ <module-option name = "option2-name">option2-value</module-option>
+ ...
+ </login-module>
+
+ <login-module code="login.module2.class.name" flag="control_flag">
+ ...
+ </login-module>
+ ...
+ </authentication>
+</application-policy>
+
+$Revision: 42748 $
+-->
+
+<policy>
+ <!-- Used by clients within the application server VM such as
+ mbeans and servlets that access EJBs.
+ -->
+ <application-policy name="client-login">
+ <authentication>
+ <login-module code="org.jboss.security.ClientLoginModule"
+ flag="required">
+ <!-- Any existing security context will be restored on logout -->
+ <module-option name="restore-login-identity">true</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name = "jbossmq">
+ <authentication>
+ <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule" flag = "required">
+ <module-option name = "unauthenticatedIdentity">guest</module-option>
+ <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name="other">
+ <!-- A simple server login module, which can be used when the number
+ of users is relatively small. It uses two properties files:
+ users.properties, which holds users (key) and their password (value).
+ roles.properties, which holds users (key) and a comma-separated list of
+ their roles (value).
+ The unauthenticatedIdentity property defines the name of the principal
+ that will be used when a null username and password are presented as is
+ the case for an unuathenticated web client or MDB. If you want to
+ allow such users to be authenticated add the property, e.g.,
+ unauthenticatedIdentity="nobody"
+ -->
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag="required"/>
+ </authentication>
+ </application-policy>
+
+</policy>
+
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/rhq-mdb-beans.xml b/modules/enterprise/server/integration-tests/src/test/resources/rhq-mdb-beans.xml
new file mode 100644
index 0000000..ad05b5e
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/rhq-mdb-beans.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="jboss.mq.destination:service=Queue,name=AlertConditionQueue" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">AlertConditionQueue</property>
+ </bean>
+
+ <bean name="jboss.mq.destination:service=Queue,name=DriftChangesetQueue" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">DriftChangesetQueue</property>
+ </bean>
+
+ <bean name="jboss.mq.destination:service=Queue,name=DriftFileQueue" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">DriftFileQueue</property>
+ </bean>
+
+</deployment>
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/security-beans.xml b/modules/enterprise/server/integration-tests/src/test/resources/security-beans.xml
new file mode 100644
index 0000000..84fa819
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/security-beans.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <bean class="org.jboss.ejb3.embedded.JaasSecurityManagerService"
+ name="jboss.security:service=JaasSecurityManager">
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+</deployment>
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/test-assist-color-number.txt b/modules/enterprise/server/integration-tests/src/test/resources/test-assist-color-number.txt
new file mode 100644
index 0000000..6ad90cc
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/test-assist-color-number.txt
@@ -0,0 +1,46 @@
+
+color[ number
+c
+color[
+n
+number
+r
+color[ number
+lo
+color[
+number
+number!= number!== number= number==
+be
+number
+number==
+number=="two" number=="four" number=="twenty-two" number=="twenty-four" number=="forty-two"
+number==t
+number=="two" number=="twenty-two" number=="twenty-four" number=="forty-two"
+number==fo
+number=="four" number=="twenty-four" number=="forty-two"
+color
+color[
+color[
+color[primary] color[other]
+color[p
+color[primary]
+color[o
+color[other]
+color[r
+color[primary] color[other]
+color[primary
+color[primary]
+color[primary]
+color[primary]!= color[primary]!== color[primary]= color[primary]==
+color[primary]=
+color[primary]="red" color[primary]="green" color[primary]="blue"
+color[primary]=e
+color[primary]="red" color[primary]="green" color[primary]="blue"
+color[primary]=d
+color[primary]="red"
+color[primary]=g
+color[primary]="green"
+color[primary]=b
+color[primary]="blue"
+color[primary]=r
+color[primary]="red" color[primary]="green"
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/test-ldap.properties b/modules/enterprise/server/integration-tests/src/test/resources/test-ldap.properties
new file mode 100644
index 0000000..3316083
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/test-ldap.properties
@@ -0,0 +1,2 @@
+rhq.test.ldap.url=${rhq.test.ldap.url}
+rhq.test.ldap.LDAPFactory=${rhq.test.ldap.LDAPFactory}
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/test-scheduler.properties b/modules/enterprise/server/integration-tests/src/test/resources/test-scheduler.properties
new file mode 100644
index 0000000..804639a
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/test-scheduler.properties
@@ -0,0 +1,29 @@
+# QUARTZ CONFIGURATION FOR OUR UNIT TESTS
+# our test timeout will be fast, 5 seconds
+rhq.server.operation-timeout = 5
+
+# scheduler factory config
+org.quartz.scheduler.instanceName = RHQScheduler
+org.quartz.scheduler.instanceId = AUTO
+
+# thread pool config
+org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
+org.quartz.threadPool.threadCount = 25
+org.quartz.threadPool.threadPriority = 5
+
+# database config - note the use of POSTGRES for tests
+org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreCMT
+org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
+# tests don't need this
+org.quartz.jobStore.isClustered = false
+org.quartz.jobStore.clusterCheckinInterval = 600000
+# make this a small non-zero time (in ms) so the scheduler (almost) never sleeps for more predictable test timing
+org.quartz.scheduler.idleWaitTime = 10
+org.quartz.jobStore.tablePrefix = RHQ_QRTZ_
+org.quartz.jobStore.useProperties = true
+org.quartz.jobStore.dataSource = RHQDS
+org.quartz.dataSource.RHQDS.jndiURL = java:/RHQDS
+org.quartz.dataSource.RHQDS.maxConnections = 10
+org.quartz.jobStore.nonManagedTXDataSource = NoTxRHQDS
+org.quartz.dataSource.NoTxRHQDS.jndiURL = java:/NoTxRHQDS
+org.quartz.dataSource.NoTxRHQDS.maxConnections = 10
\ No newline at end of file
diff --git a/modules/enterprise/server/integration-tests/src/test/resources/testng.xml b/modules/enterprise/server/integration-tests/src/test/resources/testng.xml
new file mode 100644
index 0000000..1452edb
--- /dev/null
+++ b/modules/enterprise/server/integration-tests/src/test/resources/testng.xml
@@ -0,0 +1,12 @@
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+
+<suite name="EJB3 Testsuite" >
+ <test name="EJB3 tests" >
+ <groups>
+ <run>
+ <include name="integration.ejb3"/>
+ </run>
+ </groups>
+
+ </test>
+</suite>
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java
deleted file mode 100644
index 64c6537..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginService.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.plugin.PluginKey;
-import org.rhq.core.domain.plugin.PluginStatusType;
-import org.rhq.core.domain.plugin.ServerPlugin;
-import org.rhq.core.util.MessageDigestGenerator;
-import org.rhq.enterprise.server.plugin.pc.AbstractTypeServerPluginContainer;
-import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainer;
-import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainerConfiguration;
-import org.rhq.enterprise.server.plugin.pc.ServerPluginEnvironment;
-import org.rhq.enterprise.server.plugin.pc.ServerPluginManager;
-import org.rhq.enterprise.server.plugin.pc.ServerPluginService;
-import org.rhq.enterprise.server.plugin.pc.ServerPluginType;
-import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginContainer;
-import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginManager;
-import org.rhq.enterprise.server.xmlschema.ServerPluginDescriptorMetadataParser;
-import org.rhq.enterprise.server.xmlschema.generated.serverplugin.ServerPluginDescriptorType;
-
-public class DriftServerPluginService extends ServerPluginService implements DriftServerPluginServiceMBean {
-
- public TestMasterServerPluginContainer master;
- public MasterServerPluginContainerConfiguration masterConfig;
-
- public DriftServerPluginService() {
- // build the config at constructor time so tests have it even before the PC is initialized
- File dir = new File(System.getProperty("java.io.tmpdir"), "test-server-plugins");
- this.masterConfig = new MasterServerPluginContainerConfiguration(dir, dir, dir, null);
- }
-
- @Override
- public MasterServerPluginContainer createMasterPluginContainer() {
- this.master = new TestMasterServerPluginContainer();
- this.master.initialize(this.masterConfig);
- return this.master;
- }
-
- class TestMasterServerPluginContainer extends MasterServerPluginContainer {
- @Override
- protected ClassLoader createRootServerPluginClassLoader() {
- return getClass().getClassLoader();
- }
-
- @Override
- protected Map<URL, ? extends ServerPluginDescriptorType> preloadAllPlugins() throws Exception {
- // if our test never setup any plugins, ignore it and just return an empty map
- File pluginDir = getConfiguration().getPluginDirectory();
- if (pluginDir == null || pluginDir.listFiles() == null || pluginDir.listFiles().length == 0) {
- return new HashMap<URL, ServerPluginDescriptorType>();
- } else {
- return super.preloadAllPlugins();
- }
- }
-
- @Override
- protected List<PluginKey> getDisabledPluginKeys() {
- // in the real world, the db is checked for enable flag, here we say all plugins are enabled
- return new ArrayList<PluginKey>();
- }
-
- @Override
- protected List<AbstractTypeServerPluginContainer> createPluginContainers() {
- ArrayList<AbstractTypeServerPluginContainer> pcs = new ArrayList<AbstractTypeServerPluginContainer>(1);
- DriftServerPluginContainer driftPC = new TestDriftServerPluginContainer(this);
- pcs.add(driftPC);
-
- return pcs;
- }
- }
-
- class TestDriftServerPluginContainer extends DriftServerPluginContainer {
- public TestDriftServerPluginContainer(MasterServerPluginContainer master) {
- super(master);
- }
-
- @Override
- protected ServerPluginManager createPluginManager() {
- return new TestDriftServerPluginManager(this);
- }
- }
-
- class TestDriftServerPluginManager extends DriftServerPluginManager {
- public TestDriftServerPluginManager(DriftServerPluginContainer pc) {
- super(pc);
- }
-
- @Override
- protected ServerPlugin getPlugin(ServerPluginEnvironment env) {
- try {
- Configuration pluginConfig = null;
- Configuration scheduledJobsConfig = null;
- ConfigurationDefinition configDef;
-
- ServerPluginDescriptorType pluginDescriptor = env.getPluginDescriptor();
-
- configDef = ServerPluginDescriptorMetadataParser.getPluginConfigurationDefinition(pluginDescriptor);
- if (configDef != null) {
- pluginConfig = configDef.getDefaultTemplate().createConfiguration();
- }
-
- configDef = ServerPluginDescriptorMetadataParser.getScheduledJobsDefinition(pluginDescriptor);
- if (configDef != null) {
- scheduledJobsConfig = configDef.getDefaultTemplate().createConfiguration();
- }
-
- File pluginFile = new File(env.getPluginUrl().toURI());
- ServerPlugin plugin = new ServerPlugin(0, env.getPluginKey().getPluginName(), pluginFile.getName(),
- pluginDescriptor.getDisplayName(), true, PluginStatusType.INSTALLED, pluginDescriptor
- .getDescription(), "", MessageDigestGenerator.getDigestString(pluginFile), pluginDescriptor
- .getVersion(), pluginDescriptor.getVersion(), pluginConfig, scheduledJobsConfig,
- new ServerPluginType(pluginDescriptor).stringify(), System.currentTimeMillis(), System
- .currentTimeMillis());
- return plugin;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
-}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java
deleted file mode 100644
index d38374e..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerPluginServiceMBean.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
-
-public interface DriftServerPluginServiceMBean extends ServerPluginServiceManagement {
-}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
deleted file mode 100644
index 3843f38..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static org.rhq.core.domain.resource.ResourceCategory.SERVER;
-import static org.rhq.enterprise.server.util.LookupUtil.getSubjectManager;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-import javax.persistence.NonUniqueResultException;
-
-import org.apache.commons.io.FileUtils;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
-import org.rhq.core.domain.resource.Agent;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.shared.ResourceBuilder;
-import org.rhq.core.domain.shared.ResourceTypeBuilder;
-import org.rhq.enterprise.server.plugin.ServerPluginsLocal;
-import org.rhq.enterprise.server.test.AbstractEJB3Test;
-import org.rhq.enterprise.server.test.TestServerCommunicationsService;
-import org.rhq.enterprise.server.util.LookupUtil;
-import org.rhq.test.TransactionCallback;
-
-@Test(groups = "drift")
-public class DriftServerTest extends AbstractEJB3Test {
-
- protected final String RESOURCE_TYPE_NAME = getClass().getSimpleName() + "_RESOURCE_TYPE";
-
- protected final String AGENT_NAME = getClass().getSimpleName() + "_AGENT";
-
- protected final String RESOURCE_NAME = getClass().getSimpleName() + "_RESOURCE";
-
- private ServerPluginsLocal serverPluginsMgr;
-
- protected DriftServerPluginService driftServerPluginService;
-
- protected TestServerCommunicationsService agentServiceContainer;
-
- protected ResourceType resourceType;
-
- protected Agent agent;
-
- protected Resource resource;
-
- @BeforeMethod
- public void initServices(Method testMethod) throws Exception {
- initDriftServer();
- initAgentServices();
-
- InitDB annotation = testMethod.getAnnotation(InitDB.class);
- if (annotation == null || annotation.value()) {
- initDB();
- }
- }
-
- private void initDriftServer() throws Exception {
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
-
- File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.1.0-SNAPSHOT.jar");
- assertTrue("Drift server plugin JAR file not found at" + jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
- FileUtils.copyFileToDirectory(jpaDriftPlugin, driftServerPluginService.masterConfig.getPluginDirectory());
-
- driftServerPluginService.startMasterPluginContainer();
-
- serverPluginsMgr = LookupUtil.getServerPlugins();
- }
-
- private void initAgentServices() {
- agentServiceContainer = prepareForTestAgents();
- agentServiceContainer.driftService = new TestDefService();
- }
-
- @AfterMethod(inheritGroups = true)
- public void shutDownServices() throws Exception {
- shutDownDriftServer();
- shutDownAgentServices();
- }
-
- private void shutDownDriftServer() throws Exception {
- unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
- }
-
- private void shutDownAgentServices() {
- agentServiceContainer = null;
- unprepareForTestAgents();
- }
-
- @AfterClass(inheritGroups = true)
- public void cleanUpDB() throws Exception {
- purgeDB();
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- purgeDB(getEntityManager());
- }
- });
- }
-
- private void initDB() throws Exception {
- purgeDB();
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- initResourceType();
- initAgent();
- initResource();
-
- em.persist(resourceType);
- em.persist(agent);
- resource.setAgent(agent);
- em.persist(resource);
-
- initDB(em);
- }
- });
- }
-
- private void purgeDB() {
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- em.createQuery("delete from JPADrift ").executeUpdate();
- em.createQuery("delete from JPADriftChangeSet").executeUpdate();
- em.createQuery("delete from JPADriftSet").executeUpdate();
- em.createQuery("delete from JPADriftFile").executeUpdate();
- em.createQuery("delete from DriftDefinition").executeUpdate();
- em.createQuery("delete from DriftDefinitionTemplate").executeUpdate();
-
- deleteEntity(Resource.class, RESOURCE_NAME, em);
- deleteEntity(Agent.class, AGENT_NAME, em);
- deleteEntity(ResourceType.class, RESOURCE_TYPE_NAME, em);
-
- purgeDB(em);
- }
- });
- }
-
- protected void purgeDB(EntityManager em) {
- }
-
- protected void initDB(EntityManager em) {
- }
-
- protected void deleteEntity(Class<?> clazz, String name, EntityManager em) {
- try {
- Object entity = em.createQuery(
- "select entity from " + clazz.getSimpleName() + " entity where entity.name = :name")
- .setParameter("name", name)
- .getSingleResult();
- em.remove(entity);
- } catch (NoResultException e) {
- // we can ignore no results because this code will run when the db
- // is empty and we expect no results in that case
- } catch (NonUniqueResultException e) {
- // we will fail here to let the person running the test know that
- // the database may not be in a consistent state
- fail("Purging " + name + " failed. Expected to find one instance of " + clazz.getSimpleName() +
- " but found more than one. The database may not be in a consistent state.");
- }
- }
-
- protected void initResourceType() {
- resourceType = new ResourceTypeBuilder().createResourceType()
- .withId(0)
- .withName(RESOURCE_TYPE_NAME)
- .withCategory(SERVER)
- .withPlugin(RESOURCE_TYPE_NAME.toLowerCase())
- .build();
- }
-
- protected void initAgent() {
- agent = new Agent(AGENT_NAME, "localhost", 1, "", AGENT_NAME + "_TOKEN");
- }
-
- protected void initResource() {
- resource = new ResourceBuilder().createResource()
- .withId(0)
- .withName(RESOURCE_NAME)
- .withResourceKey(RESOURCE_NAME)
- .withRandomUuid()
- .withResourceType(resourceType)
- .build();
- }
-
- protected Subject getOverlord() {
- return getSubjectManager().getOverlord();
- }
-
- protected String toString(DriftDefinition def) {
- return "DriftDefinition[id: " + def.getId() + ", name: " + def.getName() + "]";
- }
-
- protected String toString(DriftDefinitionTemplate template) {
- return DriftDefinitionTemplate.class.getSimpleName() + "[id: " + template.getId() + ", name: " +
- template.getName() + "]";
- }
-
- protected Drift findDriftByPath(List<? extends Drift> drifts, String path) {
- for (Drift drift : drifts) {
- if (drift.getPath().equals(path)) {
- return drift;
- }
- }
- return null;
- }
-}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
deleted file mode 100644
index 125dfb3..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
+++ /dev/null
@@ -1,600 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.util.Arrays.asList;
-import static org.rhq.core.domain.common.EntityContext.forResource;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.plannedChanges;
-import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
-import static org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility.SerializationType.SERIALIZATION;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
-import static org.rhq.test.AssertUtils.assertCollectionMatchesNoOrder;
-import static org.rhq.test.AssertUtils.assertPropertiesMatch;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.ejb.EJBException;
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
-import org.rhq.core.domain.criteria.DriftDefinitionTemplateCriteria;
-import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
-import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftDefinitionComparator;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
-import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.Filter;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
-import org.rhq.test.TransactionCallback;
-
-public class DriftTemplateManagerBeanTest extends DriftServerTest {
-
- private DriftTemplateManagerLocal templateMgr;
-
- private DriftManagerLocal driftMgr;
-
- private List<Resource> resources = new LinkedList<Resource>();
-
- private JPADrift drift1;
- private JPADrift drift2;
- private JPADriftFile driftFile1;
- private JPADriftFile driftFile2;
-
- @BeforeClass
- public void initClass() {
- templateMgr = getDriftTemplateManager();
- driftMgr = getDriftManager();
-
- }
-
- @Override
- protected void initDB(EntityManager em) {
- agentServiceContainer.driftService = new TestDefService() {
- @Override
- public void unscheduleDriftDetection(int resourceId, DriftDefinition driftDef) {
- detach(driftDef);
- }
-
- @Override
- public void updateDriftDetection(int resourceId, DriftDefinition driftDef) {
- detach(driftDef);
- }
-
- @Override
- public void updateDriftDetection(int resourceId, DriftDefinition driftDef, DriftSnapshot driftSnapshot) {
- detach(driftDef);
- detach(driftSnapshot);
- }
-
- private void detach(Object object) {
- try {
- HibernateDetachUtility.nullOutUninitializedFields(object, SERIALIZATION);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- };
- }
-
- public void createNewTemplate() {
- final DriftDefinition definition = new DriftDefinition(new Configuration());
- definition.setName("test::createNewTemplate");
- definition.setEnabled(true);
- definition.setDriftHandlingMode(normal);
- definition.setInterval(2400L);
- definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- final DriftDefinitionTemplate newTemplate = templateMgr.createTemplate(getOverlord(), resourceType.getId(),
- true, definition);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- ResourceType updatedType = em.find(ResourceType.class, resourceType.getId());
-
- assertEquals("Failed to add new drift definition to resource type", 1, updatedType
- .getDriftDefinitionTemplates().size());
-
- DriftDefinitionTemplate expectedTemplate = new DriftDefinitionTemplate();
- expectedTemplate.setTemplateDefinition(definition);
- expectedTemplate.setUserDefined(true);
-
- assertDriftTemplateEquals("Failed to save template", expectedTemplate, newTemplate);
- assertTrue("The template should have its id set", newTemplate.getId() > 0);
- }
- });
- }
-
- public void createTemplateForNegativeUpdateTests() {
- DriftDefinition definition = new DriftDefinition(new Configuration());
- definition.setName("test::createTemplateForNegativeUpdateTests");
- definition.setEnabled(true);
- definition.setDriftHandlingMode(normal);
- definition.setInterval(2400L);
- definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- templateMgr.createTemplate(getOverlord(), resourceType.getId(), true, definition);
-
- assertNotNull("Failed to load template", loadTemplate(definition.getName()));
- }
-
- @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
- expectedExceptions = EJBException.class,
- expectedExceptionsMessageRegExp = ".*base directory.*cannot be modified")
- @InitDB(false)
- public void doNotAllowBaseDirToBeUpdated() {
- DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
- DriftDefinition definition = template.getTemplateDefinition();
- definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/TEST"));
-
- templateMgr.updateTemplate(getOverlord(), template);
- }
-
- @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
- expectedExceptions = EJBException.class,
- expectedExceptionsMessageRegExp = ".*filters.*cannot be modified")
- @InitDB(false)
- public void doNotAllowFiltersToBeUpdated() {
- DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
- DriftDefinition definition = template.getTemplateDefinition();
- definition.addExclude(new Filter("/foo/bar/TEST/conf", "*.xml"));
-
- templateMgr.updateTemplate(getOverlord(), template);
- }
-
- @Test(dependsOnMethods = "createTemplateForNegativeUpdateTests",
- expectedExceptions = EJBException.class,
- expectedExceptionsMessageRegExp = ".*name.*cannot be modified")
- @InitDB(false)
- public void doNotAllowTemplateNameToBeUpdated() {
- DriftDefinitionTemplate template = loadTemplate("test::createTemplateForNegativeUpdateTests");
- template.setName("A new name");
-
- templateMgr.updateTemplate(getOverlord(), template);
- }
-
- public void createAndUpdateTemplate() {
- // create the template
- DriftDefinition definition = new DriftDefinition(new Configuration());
- definition.setName("test::updateTemplate");
- definition.setDescription("update template test");
- definition.setEnabled(true);
- definition.setDriftHandlingMode(normal);
- definition.setInterval(2400L);
- definition.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
- definition);
-
- // next create some definitions from the template
- final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
- final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
- final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
- final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
-
- driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), attachedDef1);
- driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), attachedDef2);
- driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), detachedDef1);
- driftMgr.updateDriftDefinition(getOverlord(), forResource(resource.getId()), detachedDef2);
-
- // update the template
- final DriftDefinition newTemplateDef = template.getTemplateDefinition();
- newTemplateDef.setInterval(4800L);
- newTemplateDef.setDriftHandlingMode(plannedChanges);
- newTemplateDef.setEnabled(false);
-
- templateMgr.updateTemplate(getOverlord(), template);
-
- // verify that the tempalte has been updated
- final DriftDefinitionTemplate updatedTemplate = loadTemplate(template.getName());
- assertPropertiesMatch("Failed to update template", template, updatedTemplate, "resourceType",
- "driftDefinitions", "templateDefinition");
-
- // verify that attached definitions are updated.
- for (DriftDefinition def : asList(attachedDef1, attachedDef2)) {
- DriftDefinition updatedDef = loadDefinition(def.getId());
- String msg = "Failed to propagate update to attached definition " + toString(updatedDef) + " - ";
- DriftDefinition updatedTemplateDef = updatedTemplate.getTemplateDefinition();
-
- assertEquals(msg + "enabled property not updated", updatedTemplateDef.isEnabled(),
- updatedDef.isEnabled());
- assertEquals(msg + "driftHandlingMode property not updated",
- updatedTemplateDef.getDriftHandlingMode(), updatedDef.getDriftHandlingMode());
- assertEquals(msg + "interval property not updated", updatedTemplateDef.getInterval(),
- updatedDef.getInterval());
- }
-
- // verify that the detached definitions have not been updated.
- for (DriftDefinition def : asList(detachedDef1, detachedDef2)) {
- DriftDefinition defAfterUpdate = loadDefinition(def.getId());
- String msg = "Detached definition " + toString(def) + " should not get updated - ";
-
- assertEquals(msg + "enabled property was modified", def.isEnabled(), defAfterUpdate.isEnabled());
- assertEquals(msg + "driftHandlingMode property was modified", def.getDriftHandlingMode(),
- defAfterUpdate.getDriftHandlingMode());
- assertEquals(msg + "interval property was modified", def.getInterval(), defAfterUpdate.getInterval());
- }
- }
-
-
- @SuppressWarnings("unchecked")
- public void pinTemplate() throws Exception {
- // First create the template
- final DriftDefinition templateDef = new DriftDefinition(new Configuration());
- templateDef.setName("test::pinTemplate");
- templateDef.setEnabled(true);
- templateDef.setDriftHandlingMode(normal);
- templateDef.setInterval(2400L);
- templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(),
- resourceType.getId(), true, templateDef);
-
- // next create some resource level definitions
- final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
- final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
- final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
- final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
-
- // create initial change set from which the snapshot will be generated
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
-
- driftFile1 = new JPADriftFile("a1b2c3");
- drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift1);
-
- // create change set v1
- driftFile2 = new JPADriftFile("1a2b3c");
- final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, attachedDef1);
- drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- em.persist(attachedDef1);
-
- em.persist(driftFile1);
- em.persist(driftFile2);
-
- em.persist(changeSet0);
- em.persist(driftSet);
- changeSet0.setInitialDriftSet(driftSet);
- em.merge(changeSet0);
-
- em.persist(changeSet1);
- em.persist(drift2);
-
- em.persist(attachedDef2);
- em.persist(detachedDef1);
- em.persist(detachedDef2);
- }
- });
-
- // now we pin the snapshot to the template
- templateMgr.pinTemplate(getOverlord(), template.getId(), attachedDef1.getId(), 1);
-
- // verify that the template is now pinned
- DriftDefinitionTemplate updatedTemplate = loadTemplate(template.getName());
- assertTrue("Template should be marked pinned", updatedTemplate.isPinned());
- }
-
- @Test(dependsOnMethods = "pinTemplate")
- @InitDB(false)
- public void persistChangeSetWhenTemplateGetsPinned() throws Exception {
- DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
-
- GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
- criteria.addFilterId(template.getChangeSetId());
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
-
- assertEquals("Expected to find change set for pinned template", 1, changeSets.size());
-
- JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
- List<? extends Drift> expectedDrifts = asList(
- new JPADrift(expectedChangeSet, "drift.1", FILE_ADDED, null, driftFile1),
- new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
-
- DriftChangeSet<?> actualChangeSet = changeSets.get(0);
- List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
-
- assertCollectionMatchesNoOrder("Expected to find drifts from change sets 1 and 2 in the template change set",
- (List<Drift>)expectedDrifts, (List<Drift>)actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
-
- // we need to compare the newDriftFile properties separately because
- // assertCollectionMatchesNoOrder compares properties via equals() and JPADriftFile
- // does not implement equals.
- assertPropertiesMatch(drift1.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(),
- "The newDriftFile property was not set correctly for " + drift1);
- assertPropertiesMatch(drift2.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(),
- "The newDriftFile property was not set correctly for " + drift1);
- }
-
- @Test(dependsOnMethods = "pinTemplate")
- @InitDB(false)
- public void updateAttachedDefinitionsWhenTemplateGetsPinned() throws Exception {
- DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
-
- // get the attached definitions
- List<DriftDefinition> attachedDefs = new LinkedList<DriftDefinition>();
- for (DriftDefinition d : template.getDriftDefinitions()) {
- if (d.isAttached() && (d.getName().equals("attachedDef1") || d.getName().equals("attachedDef2"))) {
- attachedDefs.add(d);
- }
- }
- assertEquals("Failed to get attached definitions for " + toString(template), 2, attachedDefs.size());
- assertDefinitionIsPinned(attachedDefs.get(0));
- assertDefinitionIsPinned(attachedDefs.get(1));
- }
-
- @Test(dependsOnMethods = "pinTemplate")
- @InitDB(false)
- public void doNotUpdateDetachedDefinitionsWhenTemplateGetsPinned() throws Exception {
- DriftDefinitionTemplate template = loadTemplate("test::pinTemplate");
-
- // get the detached definitions
- List<DriftDefinition> detachedDefs = new LinkedList<DriftDefinition>();
- for (DriftDefinition d : template.getDriftDefinitions()) {
- if (!d.isAttached() && (d.getName().equals("detachedDef1") || d.getName().equals("detachedDef2"))) {
- detachedDefs.add(d);
- }
- }
- assertEquals("Failed to get detached definitions for " + toString(template), 2, detachedDefs.size());
- assertDefinitionIsNotPinned(detachedDefs.get(0));
- assertDefinitionIsNotPinned(detachedDefs.get(1));
- }
-
- public void deleteTemplate() throws Exception {
- // first create the template
- final DriftDefinition templateDef = new DriftDefinition(new Configuration());
- templateDef.setName("test::pinTemplate");
- templateDef.setEnabled(true);
- templateDef.setDriftHandlingMode(normal);
- templateDef.setInterval(2400L);
- templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(),
- resourceType.getId(), true, templateDef);
-
- // next create some resource level definitions
- final DriftDefinition attachedDef1 = createDefinition(template, "attachedDef1", true);
- final DriftDefinition attachedDef2 = createDefinition(template, "attachedDef2", true);
- final DriftDefinition detachedDef1 = createDefinition(template, "detachedDef1", false);
- final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
-
- // create some change sets
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
-
- driftFile1 = new JPADriftFile("a1b2c3");
- drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet0 = new JPADriftSet();
- driftSet0.addDrift(drift1);
-
- final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 0, DRIFT, detachedDef1);
-
- driftFile2 = new JPADriftFile("1a2b3c");
- drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
-
- final JPADriftSet driftSet1 = new JPADriftSet();
- driftSet1.addDrift(drift2);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- em.persist(attachedDef1);
- em.persist(attachedDef2);
- em.persist(detachedDef1);
- em.persist(detachedDef2);
-
- em.persist(driftFile1);
- em.persist(driftFile2);
-
- em.persist(changeSet0);
- em.persist(driftSet0);
- changeSet0.setInitialDriftSet(driftSet0);
- em.merge(changeSet0);
-
- em.persist(changeSet1);
- em.persist(driftSet1);
- changeSet1.setInitialDriftSet(driftSet1);
- em.merge(changeSet1);
- }
- });
-
- // delete the template
- templateMgr.deleteTemplate(getOverlord(), template.getId());
-
- // verify that attached definitions along with their change sets have
- // been deleted
- assertNull("Change sets belonging to attached definitions should be deleted", loadChangeSet(changeSet0.getId()));
- assertNull("Attached definition " + toString(attachedDef1) + " should be deleted",
- loadDefinition(attachedDef1.getId()));
- assertNull("Attached definition " + toString(attachedDef2) + " should be deleted",
- loadDefinition(attachedDef2.getId()));
-
- // verify that detached definitions along with their change sets have not been deleted
- assertNotNull("Change sets belonging to detached definitions should not be deleted",
- loadChangeSet(changeSet1.getId()));
- assertDetachedDefinitionNotDeleted(detachedDef1.getId());
- assertDetachedDefinitionNotDeleted(detachedDef2.getId());
-
- // verify that the template itself has been deleted
- assertNull("The template " + toString(template) + " should have been deleted",
- loadTemplate(template.getName(), false));
- }
-
- private void assertDefinitionIsPinned(DriftDefinition definition) throws Exception {
- // verify that the definition is marked as pinned
- assertTrue("Expected " + toString(definition) + " to be pinned", definition.isPinned());
-
- // verify that the initial change set is generated for the definition
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(definition.getId());
- criteria.addFilterCategory(COVERAGE);
- criteria.fetchDrifts(true);
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
- assertEquals("Expected to find one change set", 1, changeSets.size());
-
- JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
- List<? extends Drift> expectedDrifts = asList(
- new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
- new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
-
- DriftChangeSet<?> actualChangeSet = changeSets.get(0);
- List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
-
- assertCollectionMatchesNoOrder("Expected to find drifts from change sets 1 and 2 in the template change set",
- (List<Drift>)expectedDrifts, (List<Drift>)actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
-
- // Finally make sure that there are no other change sets
- criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterStartVersion(1);
- criteria.addFilterDriftDefinitionId(definition.getId());
-
- assertEquals("There should not be any drift change sets", 0,
- driftMgr.findDriftChangeSetsByCriteria(getOverlord(), criteria).size());
- }
-
- private void assertDefinitionIsNotPinned(DriftDefinition definition) throws Exception {
- // verify that the definition is not pinned
- assertFalse("Expected " + toString(definition) + " to be unpinned", definition.isPinned());
-
- // Note that this method assumes that the definition has no change sets
- // associated with it and therefore checks that there are no change sets.
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(definition.getId());
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
- assertEquals("Did not expect to find any change sets for " + toString(definition) + ". Note that this " +
- "assertion method assumes that the definition you are testing is not supposed to have any change sets.",
- 0, changeSets.size());
- }
-
- private void assertDriftTemplateEquals(String msg, DriftDefinitionTemplate expected, DriftDefinitionTemplate actual) {
- assertPropertiesMatch(msg + ": basic drift definition template properties do not match", expected, actual,
- "id", "resourceType", "ctime", "templateDefinition");
- assertDriftDefEquals(msg + ": template definitions do not match", expected.getTemplateDefinition(), actual
- .getTemplateDefinition());
- }
-
- private void assertDriftDefEquals(String msg, DriftDefinition expected, DriftDefinition actual) {
- DriftDefinitionComparator comparator = new DriftDefinitionComparator(
- BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
- assertEquals(msg, 0, comparator.compare(expected, actual));
- }
-
- private void assertDetachedDefinitionNotDeleted(int definitionId) {
- DriftDefinition definition = loadDefinition(definitionId);
- assertNotNull("Detached definition " + toString(definition) + " should not be deleted", definition);
- assertNull("The detached definition's template reference should be set to null when the template is deleted",
- definition.getTemplate());
- }
-
- private DriftDefinition createDefinition(DriftDefinitionTemplate template, String defName, boolean isAttached) {
- DriftDefinition def = template.createDefinition();
- def.setName(defName);
- def.setAttached(isAttached);
- def.setTemplate(template);
- def.setResource(resource);
- return def;
- }
-
- private DriftDefinitionTemplate loadTemplate(String name) {
- return loadTemplate(name, true);
- }
-
- private DriftDefinitionTemplate loadTemplate(String name, boolean verifyResultsUnique) {
- DriftDefinitionTemplateCriteria criteria = new DriftDefinitionTemplateCriteria();
- criteria.addFilterResourceTypeId(resourceType.getId());
- criteria.addFilterName(name);
- criteria.fetchDriftDefinitions(true);
-
- PageList<DriftDefinitionTemplate> templates = templateMgr.findTemplatesByCriteria(getOverlord(), criteria);
- if (verifyResultsUnique) {
- assertEquals("Expected to find one template", 1, templates.size());
- }
-
- if (templates.isEmpty()) {
- return null;
- }
- return templates.get(0);
- }
-
- private DriftDefinition loadDefinition(int definitionId) {
- DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
- criteria.addFilterId(definitionId);
- criteria.fetchConfiguration(true);
- criteria.fetchTemplate(true);
- PageList<DriftDefinition> definitions = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
-
- if (definitions.isEmpty()) {
- return null;
- }
- return definitions.get(0);
- }
-
- private DriftChangeSet<?> loadChangeSet(String id) throws Exception {
- GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
- criteria.addFilterId(id);
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
-
- if (changeSets.isEmpty()) {
- return null;
- }
- return changeSets.get(0);
- }
-
-}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/InitDB.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/InitDB.java
deleted file mode 100644
index 65a6523..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/InitDB.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-@Retention(RUNTIME)
-(a)Target({ElementType.METHOD })
-public @interface InitDB {
- boolean value() default true;
-}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
deleted file mode 100644
index 2b3b33a..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.util.Arrays.asList;
-import static org.apache.commons.io.IOUtils.toInputStream;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
-import static org.rhq.core.domain.drift.DriftFileStatus.LOADED;
-import static org.rhq.enterprise.server.util.LookupUtil.getJPADriftServer;
-import static org.rhq.test.AssertUtils.assertCollectionMatchesNoOrder;
-import static org.rhq.test.AssertUtils.assertPropertiesMatch;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.drift.dto.DriftChangeSetDTO;
-import org.rhq.core.domain.drift.dto.DriftDTO;
-import org.rhq.core.domain.drift.dto.DriftFileDTO;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.test.TransactionCallback;
-
-public class JPADriftServerBeanTest extends DriftServerTest {
-
- private JPADriftServerLocal jpaDriftServer;
-
- private final String DRIFT_FILE_1_ID = "a1b2c3d4";
-
- private final String DRIFT_FILE_2_ID = "1ab2b3c4d";
-
- private JPADriftFile driftFile1;
-
- private JPADriftFile driftFile2;
-
- @BeforeClass
- public void initTests() {
- jpaDriftServer = getJPADriftServer();
- }
-
- @BeforeMethod
- public void persistDriftFiles() throws Exception {
- driftFile1 = jpaDriftServer.persistDriftFile(new JPADriftFile(DRIFT_FILE_1_ID));
- driftFile2 = jpaDriftServer.persistDriftFile(new JPADriftFile(DRIFT_FILE_2_ID));
-
- String driftFile1Content = "drift file 1 content...";
- String driftFile2Content = "drift file 2 content...";
-
- jpaDriftServer.persistDriftFileData(driftFile1, toInputStream(driftFile1Content), driftFile1Content.length());
- jpaDriftServer.persistDriftFileData(driftFile2, toInputStream(driftFile2Content), driftFile2Content.length());
-
- driftFile1 = jpaDriftServer.getDriftFile(getOverlord(), DRIFT_FILE_1_ID);
- driftFile2 = jpaDriftServer.getDriftFile(getOverlord(), DRIFT_FILE_2_ID);
-
- assertDriftFilePersisted(driftFile1, "driftFile1", driftFile1Content);
- assertDriftFilePersisted(driftFile2, "driftFile2", driftFile2Content);
- }
-
- public void persistResourceChangeSet() {
- // first create and persist the drift definition
- final DriftDefinition driftDef = new DriftDefinition(new Configuration());
- driftDef.setName("test::persistResourceChangeSet");
- driftDef.setEnabled(true);
- driftDef.setDriftHandlingMode(normal);
- driftDef.setInterval(2400L);
- driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
- driftDef.setResource(resource);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftDef);
- }
- });
-
- // create the change set to be persisted
- DriftChangeSetDTO changeSet = new DriftChangeSetDTO();
- changeSet.setCategory(COVERAGE);
- changeSet.setVersion(1);
- changeSet.setDriftDefinitionId(driftDef.getId());
- changeSet.setResourceId(resource.getId());
- changeSet.setDriftHandlingMode(normal);
- changeSet.setCtime(System.currentTimeMillis());
-
- DriftDTO drift1 = new DriftDTO();
- drift1.setCategory(FILE_ADDED);
- drift1.setPath("drift.1");
- drift1.setChangeSet(changeSet);
- drift1.setCtime(System.currentTimeMillis());
- drift1.setNewDriftFile(toDTo(driftFile1));
-
- DriftDTO drift2 = new DriftDTO();
- drift2.setCategory(FILE_ADDED);
- drift2.setPath("drift.2");
- drift2.setChangeSet(changeSet);
- drift2.setCtime(System.currentTimeMillis());
- drift2.setNewDriftFile(toDTo(driftFile2));
-
- Set<DriftDTO> drifts = new HashSet<DriftDTO>();
- drifts.add(drift1);
- drifts.add(drift2);
- changeSet.setDrifts(drifts);
-
- String newChangeSetId = jpaDriftServer.persistChangeSet(getOverlord(), changeSet);
-
- // verify that the change set was persisted
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterId(newChangeSetId);
- criteria.fetchDrifts(true);
-
- PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
- assertEquals("Expected to find one change set", 1, changeSets.size());
-
- JPADriftChangeSet jpaChangeSet = changeSets.get(0);
- assertEquals("Expected change set to contain two drifts. This could be a result of the change set not being " +
- "persisted correctly or the criteria fetch being done incorrectly.", 2, jpaChangeSet.getDrifts().size());
-
- assertPropertiesMatch("The change set was not persisted correctly", changeSet, jpaChangeSet, "id", "drifts",
- "class", "ctime");
-
- List<? extends Drift> expectedDrifts = asList(drift1, drift2);
- List<? extends Drift> actualDrifts = new ArrayList(jpaChangeSet.getDrifts());
-
- // We ignore the id and ctime properties because those are set by JPADriftServerBean
- // and are somewhat implmentation specific. We ignore the directory property because
- // it is really a calculated property. newDriftFile has to be compared separately
- // since it does not implement equals.
- assertCollectionMatchesNoOrder("The change set drifts were not persisted correctly",
- (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "directory",
- "newDriftFile", "class");
-
- assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift1, drift1.getNewDriftFile(),
- findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(), "class", "ctime") ;
- assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift2, drift2.getNewDriftFile(),
- findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(), "class", "ctime") ;
- }
-
- public void persistTemplateChangeSet() {
- // create the change set to be persisted
- //
- // Note that we do not set the drift definition id or resource id since
- // the change set is not owned by a resource. It is owned by the
- // resource type.
- DriftChangeSetDTO changeSet = new DriftChangeSetDTO();
- changeSet.setCategory(COVERAGE);
- changeSet.setVersion(1);
- changeSet.setDriftHandlingMode(normal);
- changeSet.setCtime(System.currentTimeMillis());
-
- DriftDTO drift1 = new DriftDTO();
- drift1.setCategory(FILE_ADDED);
- drift1.setPath("drift.1");
- drift1.setChangeSet(changeSet);
- drift1.setCtime(System.currentTimeMillis());
- drift1.setNewDriftFile(toDTo(driftFile1));
-
- DriftDTO drift2 = new DriftDTO();
- drift2.setCategory(FILE_ADDED);
- drift2.setPath("drift.2");
- drift2.setChangeSet(changeSet);
- drift2.setCtime(System.currentTimeMillis());
- drift2.setNewDriftFile(toDTo(driftFile2));
-
- Set<DriftDTO> drifts = new HashSet<DriftDTO>();
- drifts.add(drift1);
- drifts.add(drift2);
- changeSet.setDrifts(drifts);
-
- String newChangeSetId = jpaDriftServer.persistChangeSet(getOverlord(), changeSet);
-
- // verify that the change set was persisted
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterId(newChangeSetId);
- criteria.fetchDrifts(true);
-
- PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
- assertEquals("Expected to find one change set", 1, changeSets.size());
-
- JPADriftChangeSet jpaChangeSet = changeSets.get(0);
- assertEquals("Expected change set to contain two drifts. This could be a result of the change set not being " +
- "persisted correctly or the criteria fetch being done incorrectly.", 2, jpaChangeSet.getDrifts().size());
-
- assertPropertiesMatch("The change set was not persisted correctly", changeSet, jpaChangeSet, "id", "drifts",
- "class", "ctime");
-
- List<? extends Drift> expectedDrifts = asList(drift1, drift2);
- List<? extends Drift> actualDrifts = new ArrayList(jpaChangeSet.getDrifts());
-
- // We ignore the id and ctime properties because those are set by JPADriftServerBean
- // and are somewhat implmentation specific. We ignore the directory property because
- // it is really a calculated property. newDriftFile has to be compared separately
- // since it does not implement equals.
- assertCollectionMatchesNoOrder("The change set drifts were not persisted correctly",
- (List<Drift>) expectedDrifts, (List<Drift>) actualDrifts, "id", "ctime", "changeSet", "directory",
- "newDriftFile", "class");
-
- assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift1, drift1.getNewDriftFile(),
- findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(), "class", "ctime") ;
- assertPropertiesMatch("The newDriftFile property was not set correctly for " + drift2, drift2.getNewDriftFile(),
- findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(), "class", "ctime") ;
- }
-
- public void copyChangeSet() {
- // first create the change set that will be copied
- final JPADriftChangeSet changeSet = new JPADriftChangeSet(null, 0, COVERAGE, null);
- changeSet.setDriftHandlingMode(normal);
-
- final JPADrift drift1 = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
- final JPADrift drift2 = new JPADrift(changeSet, "drift.2", FILE_ADDED, null, driftFile2);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift1);
- driftSet.addDrift(drift2);
-
- // next create the drift definition
- final DriftDefinition driftDef = new DriftDefinition(new Configuration());
- driftDef.setName("test::copyChangeSet");
- driftDef.setEnabled(true);
- driftDef.setDriftHandlingMode(normal);
- driftDef.setInterval(2400L);
- driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
- driftDef.setResource(resource);
-
- // persist the change set and drift definition
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(changeSet);
- em.persist(driftDef);
- em.persist(driftSet);
- changeSet.setInitialDriftSet(driftSet);
- em.merge(changeSet);
- }
- });
-
- jpaDriftServer.copyChangeSet(getOverlord(), changeSet.getId(), driftDef.getId(), resource.getId());
-
- // verify that the change set was created for the definition
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(driftDef.getId());
- criteria.addFilterCategory(COVERAGE);
-
- PageList<JPADriftChangeSet> changeSets = jpaDriftServer.findDriftChangeSetsByCriteria(getOverlord(), criteria);
-
- assertEquals("Expected to get back one change set", 1,changeSets.size());
-
- JPADriftChangeSet newChangeSet = changeSets.get(0);
- Set<JPADrift> expectedDrifts = new HashSet<JPADrift>(asList(drift1, drift2));
- Set<JPADrift> actualDrifts = newChangeSet.getDrifts();
-
- assertCollectionMatchesNoOrder("The change set drifts were not copied correctly", expectedDrifts, actualDrifts,
- "changeSet", "newDriftFile");
- }
-
- private DriftFileDTO toDTo(JPADriftFile driftFile) {
- DriftFileDTO dto = new DriftFileDTO();
- dto.setHashId(driftFile.getHashId());
- dto.setDataSize(driftFile.getDataSize());
- dto.setStatus(driftFile.getStatus());
- return dto;
- }
-
-
- private void assertDriftFilePersisted(JPADriftFile driftFile, String name, String content) {
- assertNotNull("Failed to get " + name + " Was it persisted?", driftFile);
- assertEquals("The content for " + name + " is wrong", content, jpaDriftServer.getDriftFileBits(
- driftFile.getHashId()));
- assertEquals("The drift file status is wrong", LOADED, driftFile.getStatus());
- }
-
-}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
deleted file mode 100644
index 1353293..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.util.Arrays.asList;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
-import static org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode.BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
-import static org.rhq.test.AssertUtils.assertCollectionMatchesNoOrder;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
-
-import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
-import org.rhq.core.domain.criteria.JPADriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftDefinitionComparator;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
-import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
-import org.rhq.test.TransactionCallback;
-
-public class ManageDriftDefinitionsTest extends DriftServerTest {
-
- private DriftManagerLocal driftMgr;
-
- private DriftTemplateManagerLocal templateMgr;
-
- @BeforeClass
- public void initClass() throws Exception {
- driftMgr = getDriftManager();
- templateMgr = getDriftTemplateManager();
- }
-
- public void createDefinitionFromUnpinnedTemplate() {
- // first create a template
- final DriftDefinition templateDef = new DriftDefinition(new Configuration());
- templateDef.setName("test_createUnpinnedDefinition");
- templateDef.setEnabled(true);
- templateDef.setDriftHandlingMode(normal);
- templateDef.setInterval(2400L);
- templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- // persist the template
- DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), false,
- templateDef);
-
- // create and persist the definition
- DriftDefinition definition = template.createDefinition();
- definition.setTemplate(template);
- driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(resource.getId()), definition);
-
- // verify that the definition was created
- DriftDefinition newDef = loadDefinition(definition.getName());
- DriftDefinitionComparator comparator = new DriftDefinitionComparator(
- BOTH_BASE_INFO_AND_DIRECTORY_SPECIFICATIONS);
-
- assertEquals("The drift definition was not persisted correctly", 0, comparator.compare(definition, newDef));
- assertEquals("The template association was not set on the definition", template, newDef.getTemplate());
- }
-
- @SuppressWarnings("unchecked")
- public void createDefinitionFromPinnedTemplate() throws Exception {
- // We first need to create a pinned template. Users can only create a pinned
- // template from a snapshot of an existing resource-level drift definition.
- // We are going to take a bit of a short cut though by directly creating
- // and persisting the pinned change set.
-
- // first create the change set
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(null, 0, COVERAGE, null);
- changeSet0.setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode.normal);
-
- final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
-
- JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
- JPADrift drift2 = new JPADrift(changeSet0, "drift.2", FILE_ADDED, null, driftFile2);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift1);
- driftSet.addDrift(drift2);
-
- // create the template
- final DriftDefinition templateDef = new DriftDefinition(new Configuration());
- templateDef.setName("test_createUnpinnedDefinition");
- templateDef.setEnabled(true);
- templateDef.setDriftHandlingMode(normal);
- templateDef.setInterval(2400L);
- templateDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
- templateDef.setPinned(true);
-
- final DriftDefinitionTemplate template = templateMgr.createTemplate(getOverlord(), resourceType.getId(), true,
- templateDef);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
-
- em.persist(driftFile1);
- em.persist(driftFile2);
- em.persist(changeSet0);
- em.persist(driftSet);
- changeSet0.setInitialDriftSet(driftSet);
- em.merge(changeSet0);
-
- // setting the change set id on the template is the last and the
- // most important step in making the template pinned
- template.setChangeSetId(changeSet0.getId());
- em.merge(template);
- }
- });
-
- // Create and persist a resource-level definition.
- final DriftDefinition definition = template.createDefinition();
- definition.setTemplate(template);
-
- final AtomicBoolean agentInvoked = new AtomicBoolean(false);
-
- agentServiceContainer.driftService = new TestDefService() {
- @Override
- public void updateDriftDetection(int resourceId, DriftDefinition driftDef, DriftSnapshot snapshot) {
- try {
- HibernateDetachUtility.nullOutUninitializedFields(driftDef,
- HibernateDetachUtility.SerializationType.SERIALIZATION);
- HibernateDetachUtility.nullOutUninitializedFields(snapshot,
- HibernateDetachUtility.SerializationType.SERIALIZATION);
- agentInvoked.set(true);
- assertNotNull("Expected snapshot drift instances collection to be non-null",
- snapshot.getDriftInstances());
- assertEquals("Expected snapshot to contain two drift entries", 2, snapshot.getDriftInstances().size());
- } catch (Exception e) {
- String msg = "Do not pass attached entites to agent since those entities are outside of " +
- "Hibernate's control. The persistence context should be flushed and cleared to ensure that " +
- "only detached objects are sent to the agent";
- throw new RuntimeException(msg, e);
- }
- }
- };
-
- driftMgr.updateDriftDefinition(getOverlord(), EntityContext.forResource(resource.getId()), definition);
-
- DriftDefinition newDef = loadDefinition(definition.getName());
-
- // verify that the definition is marked as pinned
- assertTrue("The drift definition should be marked as pinned", newDef.isPinned());
-
- // verify that the initial change set is generated for the definition
- JPADriftChangeSetCriteria criteria = new JPADriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(definition.getId());
- criteria.addFilterCategory(COVERAGE);
- criteria.fetchDrifts(true);
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
- assertEquals("Expected to find one change set", 1, changeSets.size());
-
- JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, null);
- List<? extends Drift> expectedDrifts = asList(
- new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
- new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
-
- DriftChangeSet<?> actualChangeSet = changeSets.get(0);
- List<? extends Drift> actualDrifts = new ArrayList(actualChangeSet.getDrifts());
-
- assertCollectionMatchesNoOrder("Expected to find drifts from change sets 1 and 2 in the template change set",
- (List<Drift>)expectedDrifts, (List<Drift>)actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
-
- // lastly verify that the agent is called
- assertTrue("Failed to send drift definition along with snapshot to agent", agentInvoked.get());
- }
-
- private DriftDefinition loadDefinition(String name) {
- DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
- criteria.addFilterResourceIds(resource.getId());
- criteria.addFilterName(name);
- criteria.fetchConfiguration(true);
- criteria.fetchResource(true);
- criteria.fetchTemplate(true);
-
- PageList<DriftDefinition> driftDefs = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
- assertEquals("Expected to find one drift definition", 1, driftDefs.size());
-
- return driftDefs.get(0);
- }
-}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
deleted file mode 100644
index 190df2f..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.enterprise.server.drift;
-
-import static java.util.Arrays.asList;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.COVERAGE;
-import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.BaseDirValueContext.fileSystem;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftManager;
-import static org.rhq.enterprise.server.util.LookupUtil.getDriftTemplateManager;
-import static org.rhq.test.AssertUtils.assertCollectionMatchesNoOrder;
-import static org.rhq.test.AssertUtils.assertPropertiesMatch;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.persistence.EntityManager;
-
-import org.testng.annotations.BeforeClass;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
-import org.rhq.core.domain.drift.Drift;
-import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.JPADrift;
-import org.rhq.core.domain.drift.JPADriftChangeSet;
-import org.rhq.core.domain.drift.JPADriftFile;
-import org.rhq.core.domain.drift.JPADriftSet;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.core.server.EntitySerializer;
-import org.rhq.test.TransactionCallback;
-
-public class ManageSnapshotsTest extends DriftServerTest {
-
- private DriftManagerLocal driftMgr;
-
- private DriftTemplateManagerLocal templateMgr;
-
- @BeforeClass(inheritGroups = true)
- public void initClass() throws Exception {
- driftMgr = getDriftManager();
- templateMgr = getDriftTemplateManager();
- }
-
- public void pinningSnapshotShouldSetDriftDefAsPinned() {
- final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
-
- // create initial change set
- final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
-
- final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftFile1);
- em.persist(changeSet);
- em.persist(driftSet);
- changeSet.setInitialDriftSet(driftSet);
- em.merge(changeSet);
- }
- });
-
- driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 0);
- DriftDefinition updatedDriftDef = driftMgr.getDriftDefinition(getOverlord(), driftDef.getId());
-
- assertNotNull("Failed to get " + toString(driftDef), updatedDriftDef);
- assertTrue("Failed to set pinned flag of " + toString(driftDef), updatedDriftDef.isPinned());
- }
-
- @SuppressWarnings("unchecked")
- public void pinningSnapshotShouldMakeSnapshotTheInitialChangeSet() throws Exception {
- final DriftDefinition driftDef = createAndPersistDriftDef("test::makeSnapshotVersionZero");
-
- // create initial change set
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
-
- final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift1);
-
- // create change set v1
- final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
- final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, driftDef);
- final JPADrift drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftFile1);
- em.persist(driftFile2);
- em.persist(changeSet0);
- em.persist(driftSet);
- changeSet0.setInitialDriftSet(driftSet);
- em.merge(changeSet0);
- em.persist(changeSet1);
- em.persist(drift2);
- }
- });
-
- driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 1);
-
- // Verify that there is now only one change set for the drift def
- GenericDriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
- criteria.addFilterDriftDefinitionId(driftDef.getId());
-
- PageList<? extends DriftChangeSet<?>> changeSets = driftMgr.findDriftChangeSetsByCriteria(getOverlord(),
- criteria);
- assertEquals("All change sets except the change set representing the pinned snapshot should be removed",
- 1, changeSets.size());
- DriftChangeSet<?> changeSet = changeSets.get(0);
-
- assertEquals("The pinned snapshot version should be reset to zero", 0, changeSet.getVersion());
- assertEquals("The change set category is wrong", COVERAGE, changeSet.getCategory());
-
- JPADriftChangeSet expectedChangeSet = new JPADriftChangeSet(resource, 1, COVERAGE, driftDef);
- List<? extends Drift> expectedDrifts = asList(
- new JPADrift(expectedChangeSet, drift1.getPath(), FILE_ADDED, null, driftFile1),
- new JPADrift(expectedChangeSet, drift2.getPath(), FILE_ADDED, null, driftFile2));
-
- List<? extends Drift> actualDrifts = new ArrayList(changeSet.getDrifts());
-
- assertCollectionMatchesNoOrder("Expected to find drifts from change sets 1 and 2 in the new initial change set",
- (List<Drift>)expectedDrifts, (List<Drift>)actualDrifts, "id", "ctime", "changeSet", "newDriftFile");
-
- // we need to compare the newDriftFile properties separately because
- // assertCollectionMatchesNoOrder compares properties via equals() and JPADriftFile
- // does not implement equals.
- assertPropertiesMatch(drift1.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.1").getNewDriftFile(),
- "The newDriftFile property was not set correctly for " + drift1);
- assertPropertiesMatch(drift2.getNewDriftFile(), findDriftByPath(actualDrifts, "drift.2").getNewDriftFile(),
- "The newDriftFile property was not set correctly for " + drift1);
- }
-
- public void pinningSnapshotShouldSendRequestToAgent() {
- final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
-
- // create initial change set
- final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
-
- final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
-
- final JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift);
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- EntityManager em = getEntityManager();
- em.persist(driftFile1);
- em.persist(changeSet);
- em.persist(driftSet);
- changeSet.setInitialDriftSet(driftSet);
- em.merge(changeSet);
- }
- });
-
- final AtomicBoolean agentInvoked = new AtomicBoolean(false);
- agentServiceContainer.driftService = new TestDefService() {
- @Override
- public void pinSnapshot(int resourceId, String configName, DriftSnapshot snapshot) {
- try {
- agentInvoked.set(true);
- // serialize the method arguments here to more closely simulate what
- // happens during the call. We cannot send hibernate-proxied objects
- // to the agent. This is an attempt to catch that.
- ObjectOutputStream stream = new ObjectOutputStream(new ByteArrayOutputStream());
- EntitySerializer.writeExternalRemote(resourceId, stream);
- EntitySerializer.writeExternalRemote(configName, stream);
- EntitySerializer.writeExternalRemote(snapshot, stream);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- };
-
- driftMgr.pinSnapshot(getOverlord(), driftDef.getId(), 0);
-
- assertTrue("Failed to send request to agent to pin snapshot", agentInvoked.get());
- }
-
- private DriftDefinition createAndPersistDriftDef(String name) {
- final DriftDefinition driftDef = new DriftDefinition(new Configuration());
- driftDef.setName(name);
- driftDef.setEnabled(true);
- driftDef.setDriftHandlingMode(normal);
- driftDef.setInterval(1800L);
- driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
-
- executeInTransaction(new TransactionCallback() {
- @Override
- public void execute() throws Exception {
- driftDef.setResource(resource);
- getEntityManager().persist(driftDef);
- }
- });
-
- return driftDef;
- }
-
-}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
index d84fa88..45bda40 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
@@ -18,6 +18,10 @@
*/
package org.rhq.enterprise.server.test;
+import static org.rhq.test.JPAUtils.clearDB;
+import static org.rhq.test.JPAUtils.lookupEntityManager;
+import static org.rhq.test.JPAUtils.lookupTransactionManager;
+
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Hashtable;
@@ -59,10 +63,6 @@ import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.test.JPAUtils;
import org.rhq.test.TransactionCallback;
-import static org.rhq.test.JPAUtils.clearDB;
-import static org.rhq.test.JPAUtils.lookupEntityManager;
-import static org.rhq.test.JPAUtils.lookupTransactionManager;
-
/**
* This is the abstract test base for server jar tests.
*
@@ -91,6 +91,13 @@ public abstract class AbstractEJB3Test extends AssertJUnit {
//@BeforeSuite(groups = {"integration.ejb3","PERF"}) // TODO investigate again
@BeforeSuite(alwaysRun = true)
public static void startupEmbeddedJboss() throws Exception {
+ // The embeddedDeployment property needs to be set for running tests
+ // with the embedded container. It is set in the surefire configuration
+ // in pom.xml but setting here makes it easier to run tests directly
+ // from your IDE.
+ //
+ // jsanda
+ System.setProperty("embeddedDeployment", "true");
// Setting content location to the tmp dir
System.setProperty(ContentSourceManagerBean.FILESYSTEM_PROPERTY, System.getProperty("java.io.tmpdir"));
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index fed4410..8c6f797 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -40,6 +40,7 @@
<module>ear</module>
<module>safe-invoker</module>
<module>client-api</module>
+ <module>integration-tests</module>
</modules>
</profile>
@@ -57,6 +58,23 @@
</modules>
</profile>
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>rhq.itests</name>
+ </property>
+ </activation>
+ <modules>
+ <module>xml-schemas</module>
+ <module>jar</module>
+ <module>sars</module>
+ <module>plugins</module>
+ <module>client-api</module>
+ <module>integration-tests</module>
+ </modules>
+ </profile>
+
</profiles>
</project>
12 years, 6 months
[rhq] Branch 'feature/metric-tweek' - modules/plugins
by mazz
modules/plugins/hardware/src/main/resources/META-INF/rhq-plugin.xml | 12 +++++-----
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 9fa33415c608293bcc8a6275b572a08095875b46
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Nov 1 12:19:35 2011 -0400
[BZ 741331] no metrics on by default in hardware plugin
diff --git a/modules/plugins/hardware/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/hardware/src/main/resources/META-INF/rhq-plugin.xml
index e195a69..de4d75f 100644
--- a/modules/plugins/hardware/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/hardware/src/main/resources/META-INF/rhq-plugin.xml
@@ -41,12 +41,12 @@
<metric property="Raw_Read_Error_Rate" displayType="summary"/>
<metric property="Reallocated_Sector_Ct" displayType="summary"/>
<metric property="Power_On_Hours" units="hours" displayType="summary"/>
- <metric property="Start_Stop_Count" defaultOn="true"/>
- <metric property="Power_Cycle_Count" defaultOn="true"/>
- <metric property="High_Fly_Writes" defaultOn="true"/>
- <metric property="Load_Cycle_Count" defaultOn="true"/>
- <metric property="Hardware_ECC_Recovered" defaultOn="true"/>
- <metric property="Power-Off_Retract_Count" defaultOn="true"/>
+ <metric property="Start_Stop_Count" />
+ <metric property="Power_Cycle_Count" />
+ <metric property="High_Fly_Writes" />
+ <metric property="Load_Cycle_Count" />
+ <metric property="Hardware_ECC_Recovered" />
+ <metric property="Power-Off_Retract_Count" />
</server>
12 years, 6 months
[rhq] Branch 'release_jon3.x' - 5 commits - modules/integration-tests modules/plugins
by lkrejci
modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java | 9
modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java | 3
modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java | 4
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java | 16
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java | 17
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java | 9
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java | 40 -
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java | 125 ++-
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java | 38 -
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java | 8
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java | 121 ++-
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java | 341 +++++-----
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java | 30
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java | 13
14 files changed, 511 insertions(+), 263 deletions(-)
New commits:
commit 9e46e174f9c47c49cdfdbbcedc0aafbcfe1c56fa
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Nov 1 16:54:22 2011 +0100
BZ 698474 - Work around the limitations in PIQL so that we don't try to
discover the parent NT service httpd process.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
index 4fc441c..2a913f9 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
@@ -249,7 +249,9 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
for (ProcessScanResult process : processes) {
try {
DiscoveredResourceDetails apache = discoverSingleProcess(discoveryContext, process);
- discoveredResources.add(apache);
+ if (apache != null) {
+ discoveredResources.add(apache);
+ }
} catch (DiscoveryFailureException e) {
log.warn("Discovery of Apache process [" + process.getProcessInfo() + "] failed: " + e.getMessage());
} catch (Exception e) {
@@ -272,6 +274,11 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
*/
private DiscoveredResourceDetails discoverSingleProcess(ResourceDiscoveryContext<PlatformComponent> discoveryContext,
ProcessScanResult process) throws DiscoveryFailureException, Exception {
+
+ if (isWindowsServiceRootInstance(process)) {
+ return null;
+ }
+
File executablePath = getExecutableAbsolutePath(process);
log.debug("Apache executable path: " + executablePath);
@@ -362,7 +369,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
public ResourceUpgradeReport upgrade(ResourceUpgradeContext<PlatformComponent> context) {
String inventoriedResourceKey = context.getResourceKey();
-
+
//check if the inventoried resource has the old format of the resource key.
//the old format was "server-root", while the new format
//is "server-root||httpd-conf". Checking for "||" in the resource key is therefore
@@ -527,7 +534,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
return new File(serverConfigFile);
}
- private String getCommandLineOption(String[] cmdLine, String option) {
+ private static String getCommandLineOption(String[] cmdLine, String option) {
String root = null;
for (int i = 1; i < cmdLine.length; i++) {
String arg = cmdLine[i];
@@ -818,4 +825,25 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
default: throw new IllegalStateException("Unknown HttpdAddressUtility instance.");
}
}
+
+ /**
+ * We need this because of PIQL limitations.
+ *
+ * On *nixes we need to match all "root" httpd processes (i.e. with ppid of 1) but on windows
+ * we need to match all child httpd processes (i.e. processes that are spawned from the "root"
+ * httpd process).
+ *
+ * The *nix requirement causes the root httpd process be matched on Windows
+ * as well, which is undesirable but there is no way of telling PIQL
+ * "don't do this on windows" or "match only processes that DO NOT have a -k argument
+ * at all or that have it with a value different from runservice".
+ *
+ * @param process
+ * @return true if the process represents the root httpd instance if run as a windows service
+ */
+ private static boolean isWindowsServiceRootInstance(ProcessScanResult process) {
+ String kArg = getCommandLineOption(process.getProcessInfo().getCommandLine(), "-k");
+
+ return kArg != null && kArg.equalsIgnoreCase("runservice");
+ }
}
commit 4f157acecc7a902bf9ff431c8031314652fdff1f
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Nov 1 16:40:23 2011 +0100
BZ 697585 - A better warning message if an absolute path of httpd
executable can't be established + a little bit of paranoia when trying
to figure out the absolute path.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
index 9b559cb..4fc441c 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
@@ -89,6 +89,10 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
public DiscoveryFailureException(String message) {
super(message);
}
+
+ public DiscoveryFailureException(String message, Throwable cause) {
+ super(message, cause);
+ }
}
public static final Map<String, String> MODULE_SOURCE_FILE_TO_MODULE_NAME_20;
@@ -268,17 +272,9 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
*/
private DiscoveredResourceDetails discoverSingleProcess(ResourceDiscoveryContext<PlatformComponent> discoveryContext,
ProcessScanResult process) throws DiscoveryFailureException, Exception {
- //String executablePath = process.getProcessInfo().getName();
- String executableName = getExecutableName(process);
- File executablePath = OsProcessUtility.getProcExe(process.getProcessInfo().getPid(), executableName);
- if (executablePath == null) {
- throw new DiscoveryFailureException("Executable path could not be determined.");
- }
- if (!executablePath.isAbsolute()) {
- throw new DiscoveryFailureException("Executable path (" + executablePath + ") is not absolute."
- + "Please restart Apache specifying an absolute path for the executable.");
- }
+ File executablePath = getExecutableAbsolutePath(process);
log.debug("Apache executable path: " + executablePath);
+
ApacheBinaryInfo binaryInfo;
try {
binaryInfo = ApacheBinaryInfo
@@ -563,6 +559,44 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
return executableName;
}
+ private static File getExecutableAbsolutePath(ProcessScanResult process) throws DiscoveryFailureException {
+ //String executablePath = process.getProcessInfo().getName();
+ String executableName = getExecutableName(process);
+ File executablePath = OsProcessUtility.getProcExe(process.getProcessInfo().getPid(), executableName);
+ if (executablePath == null) {
+ throw new DiscoveryFailureException("Executable path could not be determined.");
+ }
+ if (!executablePath.isAbsolute()) {
+ //try to figure out the full path... this might fail due to lack of privs
+ //if the agent is running as a different user than the httpd process
+ String errorMessage = "Executable path (" + executablePath + ") is not absolute. "
+ + "Please restart Apache specifying an absolute path for the executable or "
+ + "make sure that the user running the RHQ agent is able to access the commandline parameters of the " + executableName + " process.";
+ Throwable cause = null;
+ boolean success = false;
+
+ //the OsProcessUtility.getProcExe does an excelent job at figuring the full path and I never saw it fail
+ //when the agent process has enough privs to get at the info at all. Nevertheless, let's be paranoid
+ //and try yet another method..
+ try {
+ String cwd = process.getProcessInfo().getCurrentWorkingDirectory();
+ if (cwd != null) {
+ executablePath = new File(cwd, executablePath.getPath());
+
+ success = executablePath.isAbsolute() && executablePath.isFile();
+ }
+ } catch (Exception e) {
+ cause = e;
+ }
+
+ if (!success) {
+ throw new DiscoveryFailureException(errorMessage, cause);
+ }
+ }
+
+ return executablePath;
+ }
+
private static void validateServerRootAndServerConfigFile(Configuration pluginConfig) {
String serverRoot = pluginConfig.getSimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SERVER_ROOT)
.getStringValue();
commit 761e4c3202da7faabf9a6a1226a6769496d5dac9
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Oct 31 13:26:22 2011 +0100
BZ 717787 - Making sure augeas is only ever used if the apache resource
is allowed to do so.
Improved the confusing error message when augeas was not enabled that
stated that apache version is not supported or augeas is not available,
when in fact neither could be true.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java
index e828818..f8ebd79 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java
@@ -70,6 +70,10 @@ public class ApacheDirectoryComponent implements ResourceComponent<ApacheVirtual
}
public Configuration loadResourceConfiguration() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ApacheVirtualHostServiceComponent parentVirtualHost = resourceContext.getParentResourceComponent();
AugeasComponent comp = getAugeas();
@@ -87,7 +91,12 @@ public class ApacheDirectoryComponent implements ResourceComponent<ApacheVirtual
}
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
-
+ if (!isAugeasEnabled()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ return;
+ }
+
AugeasComponent comp = getAugeas();
AugeasTree tree = null;
try {
@@ -115,7 +124,12 @@ public class ApacheDirectoryComponent implements ResourceComponent<ApacheVirtual
}
public void deleteResource() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ApacheVirtualHostServiceComponent parentVirtualHost = resourceContext.getParentResourceComponent();
+
AugeasComponent comp = getAugeas();
try {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java
index bd6b4ee..8554038 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java
@@ -65,6 +65,10 @@ public class ApacheIfModuleComponent implements ResourceComponent<ApacheVirtualH
}
public Configuration loadResourceConfiguration() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
AugeasComponent comp = null;
try {
comp = parentComponent.getAugeas();
@@ -81,6 +85,12 @@ public class ApacheIfModuleComponent implements ResourceComponent<ApacheVirtualH
}
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ if (!isAugeasEnabled()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ return;
+ }
+
AugeasComponent comp = null;
AugeasTree tree = null;
try {
@@ -118,13 +128,6 @@ public class ApacheIfModuleComponent implements ResourceComponent<ApacheVirtualH
return directory;
}
- public void copy(AugeasNode a, AugeasNode b) {
- for (AugeasNode nd : a.getChildNodes()) {
- AugeasNode tempNode = tree.createNode(b, nd.getLabel(), nd.getValue(), nd.getSeq());
- copy(nd, tempNode);
- }
- }
-
public boolean isAugeasEnabled() {
return parentComponent.isAugeasEnabled();
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java
index dedcb3c..c97c28c 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java
@@ -63,6 +63,10 @@ public class ApacheIfModuleDirectoryComponent implements ResourceComponent<Apach
}
public Configuration loadResourceConfiguration() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ConfigurationDefinition resourceConfigDef = context.getResourceType().getResourceConfigurationDefinition();
AugeasComponent comp = parentComponent.getAugeas();
AugeasTree tree = null;
@@ -78,6 +82,11 @@ public class ApacheIfModuleDirectoryComponent implements ResourceComponent<Apach
}
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ if (!isAugeasEnabled()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
AugeasComponent comp = parentComponent.getAugeas();
AugeasTree tree = null;
try {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
index 04484ce..84f0c99 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
@@ -103,7 +103,10 @@ import org.rhq.rhqtransform.AugeasRHQComponent;
public class ApacheServerComponent implements AugeasRHQComponent, ResourceComponent<PlatformComponent>,
MeasurementFacet, OperationFacet, ConfigurationFacet, CreateChildResourceFacet {
- public static final String CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE = "Configuration is supported only for Apache version 2 and up using Augeas. You either have an old version of Apache or Augeas is not installed.";
+ public static final String CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE =
+ "Configuration and child resource creation/deletion support for Apache is optional. "
+ + "If you switched it on by enabling Augeas support in the connection settings of the Apache server resource and still get this message, "
+ + "it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform.";
private final Log log = LogFactory.getLog(this.getClass());
@@ -338,7 +341,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public Configuration loadResourceConfiguration() throws Exception {
if (!isAugeasEnabled())
- throw new RuntimeException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ throw new IllegalStateException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
AugeasComponent comp = getAugeas();
try {
@@ -359,6 +362,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
if (!isAugeasEnabled()) {
report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
return;
}
@@ -422,9 +426,10 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public CreateResourceReport createResource(CreateResourceReport report) {
if (!isAugeasEnabled()) {
report.setStatus(CreateResourceStatus.FAILURE);
- report.setErrorMessage("Resources can be created only when augeas is enabled.");
+ report.setErrorMessage(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
return report;
}
+
if (ApacheVirtualHostServiceComponent.RESOURCE_TYPE_NAME.equals(report.getResourceType().getName())) {
Configuration vhostResourceConfig = report.getResourceConfiguration();
ConfigurationDefinition vhostResourceConfigDef = report.getResourceType()
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
index 6ec95da..5dd9192 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
@@ -154,9 +154,11 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
}
public Configuration loadResourceConfiguration() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ApacheServerComponent parent = resourceContext.getParentResourceComponent();
- if (!parent.isAugeasEnabled())
- throw new Exception(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
AugeasComponent comp = getAugeas();
try {
@@ -172,6 +174,12 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
}
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ if (!isAugeasEnabled()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ return;
+ }
+
AugeasComponent comp = getAugeas();
AugeasTree tree = null;
try {
@@ -188,10 +196,14 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
finishConfigurationUpdate(report);
} catch (Exception e) {
- if (tree != null)
- log.error("Augeas failed to save configuration " + tree.summarizeAugeasError());
- else
+ if (tree != null) {
+ String message = "Augeas failed to save configuration " + tree.summarizeAugeasError();
+ report.setErrorMessage(message);
+ log.error(message);
+ } else {
+ report.setErrorMessageFromThrowable(e);
log.error("Augeas failed to save configuration", e);
+ }
report.setStatus(ConfigurationUpdateStatus.FAILURE);
} finally {
comp.close();
@@ -199,9 +211,11 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
}
public void deleteResource() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ApacheServerComponent parent = resourceContext.getParentResourceComponent();
- if (!parent.isAugeasEnabled())
- throw new Exception(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
if (MAIN_SERVER_RESOURCE_KEY.equals(resourceContext.getResourceKey())) {
throw new IllegalArgumentException(
@@ -276,9 +290,10 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
public CreateResourceReport createResource(CreateResourceReport report) {
if (!isAugeasEnabled()) {
report.setStatus(CreateResourceStatus.FAILURE);
- report.setErrorMessage("Resources can be created only when augeas is enabled.");
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
return report;
}
+
ResourceType resourceType = report.getResourceType();
AugeasComponent comp = null;
try {
commit 7a80ae5be67c7ecb5cc68886e130b6baf8553639
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Nov 1 16:56:44 2011 +0100
BZ 687992 - A final touch on making the apache config file parsing
correct. The parser now keeps track of the "current" ServerRoot
(which is defaulted to the value hardcoded in the binary at the start and
then updated each time a ServerRoot directive is encountered during the
config file parsing).
Also made some minor refactoring to consolidate and reuse the runtime
configuration extracting routines.
A final update is to use the runtime configuration to figure out
the paths of the httpd executable as well as control script path (before
we used the full config and so could potentially get wrong results if
ServerRoot was hidden in some conditional blocks).
The runtime config is now also used when figuring out the sample address of
a virtual host during its creation.
diff --git a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java
index 36ef655..b1abcbe 100644
--- a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java
+++ b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java
@@ -44,6 +44,8 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.pc.ServerServices;
import org.rhq.core.pc.upgrade.FakeServerInventory;
+import org.rhq.core.system.SystemInfoFactory;
+import org.rhq.plugins.apache.ApacheServerDiscoveryComponent;
import org.rhq.plugins.apache.ApacheVirtualHostServiceComponent;
import org.rhq.plugins.apache.ApacheVirtualHostServiceDiscoveryComponent;
import org.rhq.plugins.apache.parser.ApacheConfigReader;
@@ -51,6 +53,7 @@ import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
import org.rhq.plugins.apache.parser.ApacheParser;
import org.rhq.plugins.apache.parser.ApacheParserImpl;
import org.rhq.plugins.apache.upgrade.UpgradeTestBase;
+import org.rhq.plugins.apache.util.ApacheBinaryInfo;
import org.rhq.plugins.apache.util.ApacheDeploymentUtil;
import org.rhq.plugins.apache.util.ApacheExecutionUtil;
import org.rhq.plugins.apache.util.HttpdAddressUtility;
@@ -149,10 +152,8 @@ public class ApacheTestSetup {
}
//ok, now try to find the ping URL. The best thing is to actually invoke
- //the same code the apache server discovery does.
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, serverRootDir.getAbsolutePath());
- ApacheConfigReader.buildTree(confFilePath, parser);
+ //the same code the apache server discovery does.
+ ApacheDirectiveTree tree = ApacheServerDiscoveryComponent.parseRuntimeConfiguration(confFilePath, null, ApacheBinaryInfo.getInfo(exePath, SystemInfoFactory.createSystemInfo()));
//XXX this hardcodes apache2 as the only option we have...
HttpdAddressUtility.Address addrToUse = HttpdAddressUtility.APACHE_2_x.getMainServerSampleAddress(tree, null, -1);
diff --git a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java
index f86b095..c8952c1 100644
--- a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java
+++ b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java
@@ -207,8 +207,7 @@ public class UpgradeTestBase extends PluginContainerTest {
protected void defineRHQ3ResourceKeys(ApacheTestConfiguration testConfig, ApacheTestSetup setup) throws Exception {
setup.withApacheSetup().init();
ApacheServerComponent component = setup.withApacheSetup().getExecutionUtil().getServerComponent();
- ApacheDirectiveTree config = component.loadParser();
- config = RuntimeApacheConfiguration.extract(config, component.getCurrentProcessInfo(), component.getCurrentBinaryInfo(), component.getModuleNames(), false);
+ ApacheDirectiveTree config = component.parseRuntimeConfiguration(false);
DeploymentConfig deployConfig = setup.getDeploymentConfig();
diff --git a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java
index 8dc55ca..ee03318 100644
--- a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java
+++ b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java
@@ -149,9 +149,7 @@ public class ApacheExecutionUtil {
}
public ApacheDirectiveTree getRuntimeConfiguration() {
- ApacheDirectiveTree config = serverComponent.loadParser();
- return RuntimeApacheConfiguration.extract(config, resourceContext.getNativeProcess(), new ApacheBinaryInfo(
- exePath), serverComponent.getModuleNames(), true);
+ return serverComponent.parseRuntimeConfiguration(true);
}
public ApacheServerComponent getServerComponent() {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
index d180fe6..04484ce 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
@@ -81,11 +81,8 @@ import org.rhq.plugins.apache.augeas.ApacheAugeasNode;
import org.rhq.plugins.apache.augeas.AugeasConfigurationApache;
import org.rhq.plugins.apache.augeas.AugeasTreeBuilderApache;
import org.rhq.plugins.apache.mapping.ApacheAugeasMapping;
-import org.rhq.plugins.apache.parser.ApacheConfigReader;
import org.rhq.plugins.apache.parser.ApacheDirective;
import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
-import org.rhq.plugins.apache.parser.ApacheParser;
-import org.rhq.plugins.apache.parser.ApacheParserImpl;
import org.rhq.plugins.apache.util.ApacheBinaryInfo;
import org.rhq.plugins.apache.util.ConfigurationTimestamp;
import org.rhq.plugins.apache.util.HttpdAddressUtility;
@@ -403,6 +400,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public AugeasComponent getAugeas() throws AugeasTreeException {
return new AugeasComponent() {
+ @Override
public AugeasConfiguration initConfiguration() {
File tempDir = resourceContext.getDataDirectory();
if (!tempDir.exists())
@@ -412,6 +410,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
return config;
}
+ @Override
public AugeasTreeBuilder initTreeBuilder() {
AugeasTreeBuilderApache builder = new AugeasTreeBuilderApache();
return builder;
@@ -445,10 +444,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
String[] vhostDefs = vhostDef.split(" ");
HttpdAddressUtility.Address addr;
try {
- ApacheDirectiveTree parserTree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(parserTree, getServerRoot().getAbsolutePath());
-
- ApacheConfigReader.buildTree(getHttpdConfFile().getAbsolutePath(), parser);
+ ApacheDirectiveTree parserTree = parseRuntimeConfiguration(true);
Pattern virtualHostPattern = Pattern.compile(".+:([\\d]+|\\*)");
Matcher matcher = virtualHostPattern.matcher(vhostDefs[0]);
@@ -632,7 +628,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
} else {
String serverRoot = null;
- ApacheDirectiveTree tree = loadParser();
+ ApacheDirectiveTree tree = parseRuntimeConfiguration(true);
List<ApacheDirective> directives = tree.search("/ServerRoot");
if (!directives.isEmpty())
if (!directives.get(0).getValues().isEmpty())
@@ -700,7 +696,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
// First try server root as base
String serverRoot = null;
try {
- ApacheDirectiveTree tree = loadParser();
+ ApacheDirectiveTree tree = parseRuntimeConfiguration(true);
List<ApacheDirective> directives = tree.search("/ServerRoot");
if (!directives.isEmpty())
if (!directives.get(0).getValues().isEmpty())
@@ -962,13 +958,18 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
}
}
- public ApacheDirectiveTree loadParser() {
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, getServerRoot().getAbsolutePath());
- ApacheConfigReader.buildTree(getHttpdConfFile().getAbsolutePath(), parser);
- return tree;
+ public ApacheDirectiveTree parseFullConfiguration() {
+ String httpdConfPath = getHttpdConfFile().getAbsolutePath();
+ return ApacheServerDiscoveryComponent.parseFullConfiguration(httpdConfPath, binaryInfo.getRoot());
}
+ public ApacheDirectiveTree parseRuntimeConfiguration(boolean suppressUnknownModuleWarnings) {
+ String httpdConfPath = getHttpdConfFile().getAbsolutePath();
+ ProcessInfo processInfo = resourceContext.getNativeProcess();
+
+ return ApacheServerDiscoveryComponent.parseRuntimeConfiguration(httpdConfPath, processInfo, binaryInfo, getModuleNames(), suppressUnknownModuleWarnings);
+ }
+
public boolean isAugeasEnabled() {
Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
index 565fd3c..9b559cb 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
@@ -321,10 +321,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
pluginConfig.put(new PropertyList(ApacheServerComponent.PLUGIN_CONFIG_CUSTOM_MODULE_NAMES));
- ApacheDirectiveTree serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot);
-
- //extract the runtime configuration out of declared config
- serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getDefaultModuleNames(binaryInfo.getVersion()), true);
+ ApacheDirectiveTree serverConfig = parseRuntimeConfiguration(serverConfigFile.getAbsolutePath(), process.getProcessInfo(), binaryInfo);
String serverUrl = null;
String vhostsGlobInclude = null;
@@ -334,11 +331,8 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
if (!serverRoots.isEmpty()) {
serverRoot = AugeasNodeValueUtil.unescape(serverRoots.get(0).getValuesAsString());
serverRootProp.setValue(serverRoot);
- //reparse the configuration with the new ServerRoot
- serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot);
- serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getDefaultModuleNames(binaryInfo.getVersion()), true);
}
-
+
serverUrl = getUrl(serverConfig, binaryInfo.getVersion());
vhostsGlobInclude = scanForGlobInclude(serverConfig);
@@ -597,14 +591,35 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
}
}
- public static ApacheDirectiveTree loadParser(String path, String serverRoot) {
-
+ public static ApacheDirectiveTree parseFullConfiguration(String path, String serverRoot) {
ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, serverRoot);
+ ApacheParser parser = new ApacheParserImpl(tree, serverRoot, null);
ApacheConfigReader.buildTree(path, parser);
return tree;
}
+ public static ApacheDirectiveTree parseRuntimeConfiguration(String path, ProcessInfo processInfo,
+ ApacheBinaryInfo binaryInfo) {
+
+ String httpdVersion = binaryInfo.getVersion();
+ Map<String, String> defaultModuleNames = getDefaultModuleNames(httpdVersion);
+
+ return parseRuntimeConfiguration(path, processInfo, binaryInfo, defaultModuleNames, true);
+ }
+
+ public static ApacheDirectiveTree parseRuntimeConfiguration(String path, ProcessInfo processInfo, ApacheBinaryInfo binaryInfo, Map<String, String> moduleNames, boolean suppressUnknownModuleWarnings) {
+ String defaultServerRoot = binaryInfo.getRoot();
+
+ RuntimeApacheConfiguration.NodeInspector insp =
+ RuntimeApacheConfiguration.getNodeInspector(processInfo, binaryInfo,
+ moduleNames, suppressUnknownModuleWarnings);
+
+ ApacheDirectiveTree tree = new ApacheDirectiveTree();
+ ApacheParser parser = new ApacheParserImpl(tree, defaultServerRoot, insp);
+ ApacheConfigReader.buildTree(path, parser);
+ return tree;
+ }
+
public static String scanForGlobInclude(ApacheDirectiveTree tree) {
try {
List<ApacheDirective> includes = tree.search("/Include");
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
index c83c665..6ec95da 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
@@ -528,8 +528,7 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
//only look for the vhost entry if the vhost we're looking for isn't the main server
if (!MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) {
- ApacheDirectiveTree tree = parent.loadParser();
- tree = RuntimeApacheConfiguration.extract(tree, parent.getCurrentProcessInfo(), parent.getCurrentBinaryInfo(), parent.getModuleNames(), false);
+ ApacheDirectiveTree tree = parent.parseRuntimeConfiguration(false);
//find the vhost entry the resource key represents
List<ApacheDirective> vhosts = tree.search("/<VirtualHost");
@@ -603,10 +602,6 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
return resourceContext.getResourceType().getChildResourceTypes().iterator().next();
}
- public ApacheDirectiveTree loadParser() throws Exception {
- return resourceContext.getParentResourceComponent().loadParser();
- }
-
public boolean isAugeasEnabled() {
ApacheServerComponent parent = resourceContext.getParentResourceComponent();
return parent.isAugeasEnabled();
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
index e2c68f3..daf27fd 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
@@ -81,9 +81,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
Set<DiscoveredResourceDetails> discoveredResources = new LinkedHashSet<DiscoveredResourceDetails>();
ApacheServerComponent serverComponent = context.getParentResourceComponent();
- ApacheDirectiveTree tree = serverComponent.loadParser();
-
- tree = RuntimeApacheConfiguration.extract(tree, serverComponent.getCurrentProcessInfo(), serverComponent.getCurrentBinaryInfo(), serverComponent.getModuleNames(), false);
+ ApacheDirectiveTree tree = serverComponent.parseRuntimeConfiguration(false);
//first define the root server as one virtual host
discoverMainServer(context, tree, discoveredResources);
@@ -164,9 +162,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
ApacheServerComponent serverComponent = inventoriedResource.getParentResourceComponent();
- ApacheDirectiveTree tree = serverComponent.loadParser();
- tree = RuntimeApacheConfiguration.extract(tree, serverComponent.getCurrentProcessInfo(),
- serverComponent.getCurrentBinaryInfo(), serverComponent.getModuleNames(), false);
+ ApacheDirectiveTree tree = serverComponent.parseRuntimeConfiguration(false);
List<VHostSpec> vhosts = VHostSpec.detect(tree);
VirtualHostLegacyResourceKeyUtil legacyResourceKeyUtil = new VirtualHostLegacyResourceKeyUtil(serverComponent, tree);
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
index f563ccd..bba00bf 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
@@ -22,26 +22,43 @@ import java.io.File;
import java.util.List;
import org.rhq.augeas.util.Glob;
+import org.rhq.plugins.apache.util.AugeasNodeValueUtil;
+import org.rhq.plugins.apache.util.RuntimeApacheConfiguration;
/**
*
* @author Filip Drabek
+ * @author Lukas Krejci
*/
public class ApacheParserImpl implements ApacheParser {
private final static String INCLUDE_DIRECTIVE = "Include";
+ private static final String SERVER_ROOT_DIRECTIVE = "ServerRoot";
private final ApacheDirectiveTree tree;
private ApacheDirectiveStack stack;
private String serverRootPath;
-
- public ApacheParserImpl(ApacheDirectiveTree tree, String serverRootPath) {
+ private RuntimeApacheConfiguration.NodeInspector nodeInspector;
+
+ /**
+ *
+ * @param tree the tree that this parser will fill in
+ * @param initialServerRootPath the initial server root path as detected by other means
+ * @param nodeInspector the node inspector to determine the runtime configuration or null, if full configuration tree is needed
+ */
+ public ApacheParserImpl(ApacheDirectiveTree tree, String initialServerRootPath, RuntimeApacheConfiguration.NodeInspector nodeInspector) {
stack = new ApacheDirectiveStack();
- this.serverRootPath = serverRootPath;
+ this.serverRootPath = initialServerRootPath;
this.tree = tree;
stack.addDirective(this.tree.getRootNode());
+ this.nodeInspector = nodeInspector;
}
public void addDirective(ApacheDirective directive) throws Exception {
+ if (stack.getLastDirective() == null) {
+ //we're ignoring until the end of an ignored nested directive
+ return;
+ }
+
if (directive.getName().equals(INCLUDE_DIRECTIVE)) {
List<File> files = getIncludeFiles(directive.getValuesAsString());
for (File fl : files) {
@@ -49,7 +66,15 @@ public class ApacheParserImpl implements ApacheParser {
ApacheConfigReader.searchFile(fl.getAbsolutePath(), this);
}
}
+ } else if (directive.getName().equals(SERVER_ROOT_DIRECTIVE)) {
+ this.serverRootPath = AugeasNodeValueUtil.unescape(directive.getValuesAsString());
}
+
+ if (nodeInspector != null) {
+ //let the inspector process this directive in case it sees something of interest
+ nodeInspector.inspect(directive.getName(), directive.getValues(), directive.getValuesAsString());
+ }
+
directive.setParentNode(stack.getLastDirective());
stack.getLastDirective().addChildDirective(directive);
}
@@ -59,9 +84,45 @@ public class ApacheParserImpl implements ApacheParser {
}
public void startNestedDirective(ApacheDirective directive) {
- directive.setParentNode(stack.getLastDirective());
- stack.getLastDirective().addChildDirective(directive);
- stack.addDirective(directive);
+ if (nodeInspector != null) {
+ //now we have a node inspector so the tree construction is driven by it - we actually leave out the conditional
+ //directives and replace them with their contents (if they are to be applied of course)...
+
+ RuntimeApacheConfiguration.NodeInspectionResult res = nodeInspector.inspect(directive.getName(), directive.getValues(), directive.getValuesAsString());
+ if (res == null || (res.nodeIsConditional && !res.shouldRecurseIntoConditionalNode)) {
+ //ok, this node should be ignored, mark that fact with a null parent
+ stack.addDirective(null);
+ } else if (res.nodeIsConditional && res.shouldRecurseIntoConditionalNode) {
+ //this is a little tricky..
+ //we need to leave out this directive, because it is conditional and we should be replacing it with its contents
+ //but also we need to keep the stack balanced (i.e. we're going down a nested directive, so we ought to put something
+ //on the stack). By duplicating the last known directive on the stack we actually achieve both of the goals - the
+ //stack remains balanced and the child nodes get added to the parent of this directive (i.e. in the end it is going to
+ //look like we've replaced the directive with its child directives).
+ stack.addDirective(stack.getLastDirective());
+ } else {
+ //ok, a "normal" (non-conditional) nested node
+ //we might be inside an ignored nested directive, so leave all the weaving stuff
+ //out in that case...
+ if (stack.getLastDirective() != null) {
+ directive.setParentNode(stack.getLastDirective());
+ stack.getLastDirective().addChildDirective(directive);
+ }
+ stack.addDirective(directive);
+ }
+ } else {
+ //there is no node inspector, so we have no "guidance" on the tree construction.
+ //Just include all the nested structures so that a full configuration tree is built
+ //with all the directives.
+
+ //we might be inside an ignored nested directive, so leave all the weaving stuff
+ //out in that case...
+ if (stack.getLastDirective() != null) {
+ directive.setParentNode(stack.getLastDirective());
+ stack.getLastDirective().addChildDirective(directive);
+ }
+ stack.addDirective(directive);
+ }
}
private List<File> getIncludeFiles(String foundInclude) {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
index 1f00aec..f8a0bdb 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
@@ -59,6 +59,185 @@ public class RuntimeApacheConfiguration {
}
/**
+ * A result of a node inspection using {@link NodeInspector}
+ *
+ *
+ * @author Lukas Krejci
+ */
+ public static class NodeInspectionResult {
+ public boolean nodeIsConditional;
+ public boolean shouldRecurseIntoConditionalNode;
+ }
+
+ /**
+ * Node inspector is used to determine how to proceed with the parsing of the configuration file.
+ *
+ *
+ * @author Lukas Krejci
+ */
+ public static class NodeInspector {
+ private TransformState state;
+
+ private NodeInspector(TransformState state) {
+ this.state = state;
+ }
+
+ /**
+ * Inspects a node.
+ *
+ * @param currentNodeName the name of the node
+ * @param allValues the list of all values specified on the node
+ * @param valueAsString the original value as a string (from which the list of values was somehow produced)
+ * @return the inspection result or null if there was some unexpected event (which has been logged)
+ */
+ public NodeInspectionResult inspect(String currentNodeName, List<String> allValues, String valueAsString) {
+ NodeInspectionResult result = new NodeInspectionResult();
+
+ result.shouldRecurseIntoConditionalNode = true;
+
+ if (currentNodeName.equalsIgnoreCase("LoadModule")) {
+ state.loadedModules.add(allValues.get(0));
+ result.nodeIsConditional = false;
+ } else if (currentNodeName.equalsIgnoreCase("<IfModule")) {
+ String moduleFile = valueAsString;
+ boolean negate = false;
+ if (moduleFile.startsWith("!")) {
+ negate = true;
+ moduleFile = moduleFile.substring(1);
+ }
+
+ boolean moduleLoaded = false;
+
+ switch (isModuleLoaded(moduleFile, state.loadedModules, state.moduleNames, state.moduleFiles)) {
+ case LOADED:
+ moduleLoaded = true;
+ break;
+ case NOT_LOADED:
+ moduleLoaded = false;
+ break;
+ case UNKNOWN:
+ if (state.suppressUnknownModuleWarnings && LOGGED_UNKNOWN_MODULES.contains(moduleFile)) {
+ LOG.debug("Encountered unknown module name in an IfModule directive: " + moduleFile);
+ } else {
+ LOG.warn("Encountered unknown module name in an IfModule directive: "
+ + moduleFile + ". If you are using Apache 2.1 or later, you can try changing the module identifier from the source file to "
+ + "the actual module name as used in the LoadModule directive to get rid of this warning.");
+ }
+ LOGGED_UNKNOWN_MODULES.add(moduleFile);
+ return null;
+ }
+
+ result.shouldRecurseIntoConditionalNode = moduleLoaded != negate;
+
+ result.nodeIsConditional = true;
+ } else if (currentNodeName.equalsIgnoreCase("<IfDefine")) {
+ String define = valueAsString;
+ boolean negate = false;
+ if (define.startsWith("!")) {
+ negate = true;
+ define = define.substring(1);
+ }
+
+ boolean isDefined = state.defines.contains(define);
+
+ result.shouldRecurseIntoConditionalNode = isDefined != negate;
+
+ result.nodeIsConditional = true;
+ } else if (currentNodeName.equalsIgnoreCase("<IfVersion")) {
+ //<IfVersion [[!]operator] version> ... </IfVersion>
+ //operator: =, ==, >, >=, <, <=, ~
+ //version major[.minor[.patch]] or /regex/
+ //if operator is ~, the version is assumed regex
+ //if operator is omitted, = is assumed
+
+ if (isModuleLoaded("mod_version.c", state.loadedModules, state.moduleNames, state.moduleFiles) != ModuleLoadedState.LOADED) {
+ LOG.debug("mod_version not loaded and IfVersion directive encountered. Skipping it.");
+ return null;
+ }
+
+ List<String> values = allValues;
+ String operator = null;
+ String version = null;
+ boolean negate = false;
+ boolean regex = false;
+
+ if (values.size() == 0) {
+ LOG.warn("Invalid IfVersion directive.");
+ return null;
+ }
+
+ if (values.size() == 1) {
+ operator = "=";
+ version = values.get(0);
+ } else if (values.size() == 2) {
+ operator = values.get(0);
+ version = values.get(1);
+ } else {
+ LOG.warn("Too many arguments to a IfVersion directive: " + values);
+ return null;
+ }
+
+ if (operator == null || version == null) {
+ LOG.warn("Invalid IfVersion with parameters: " + values);
+ return null;
+ }
+
+ if (operator.charAt(0) == '!') {
+ negate = true;
+ operator = operator.substring(1);
+ }
+
+ if ("==".equals(operator)) {
+ operator = "=";
+ }
+
+ if (version.charAt(0) == '/') {
+ if ("=".equals(operator) || "~".equals(operator)) {
+ regex = true;
+ version = version.substring(1, version.length() - 1);
+ } else {
+ LOG.warn("Unsupported operator " + operator
+ + " with regex version comparison in IfVersion directive.");
+ return null;
+ }
+ }
+
+ OSGiVersionComparator comp = new OSGiVersionComparator();
+
+ boolean hasVersion = false;
+ if ("=".equals(operator)) {
+ if (regex) {
+ hasVersion = Pattern.matches(version, state.httpdVersion);
+ } else {
+ hasVersion = comp.compare(version, state.httpdVersion) == 0;
+ }
+ } else if ("~".equals(operator)) {
+ hasVersion = Pattern.matches(version, state.httpdVersion);
+ } else if (">".equals(operator)) {
+ hasVersion = comp.compare(state.httpdVersion, version) > 0;
+ } else if (">=".equals(operator)) {
+ hasVersion = comp.compare(state.httpdVersion, version) >= 0;
+ } else if ("<".equals(operator)) {
+ hasVersion = comp.compare(state.httpdVersion, version) < 0;
+ } else if ("<=".equals(operator)) {
+ hasVersion = comp.compare(state.httpdVersion, version) <= 0;
+ } else {
+ LOG.warn("Unknown operator " + operator + " in an IfVersion directive.");
+ return null;
+ }
+
+ result.shouldRecurseIntoConditionalNode = hasVersion != negate;
+
+ result.nodeIsConditional = true;
+ } else {
+ result.nodeIsConditional = false;
+ }
+
+ return result;
+ }
+ }
+
+ /**
* This is a node visitor interface to be implemented by the users of the
* {@link RuntimeApacheConfiguration#walkRuntimeConfig(ApacheAugeasTree, ProcessInfo, ApacheBinaryInfo, Map)}
* or {@link RuntimeApacheConfiguration#walkRuntimeConfig(ApacheDirectiveTree, ProcessInfo, ApacheBinaryInfo, Map)}
@@ -244,6 +423,11 @@ public class RuntimeApacheConfiguration {
}
}
+ public static NodeInspector getNodeInspector(ProcessInfo httpdProcessInfo, ApacheBinaryInfo httpdBinaryInfo, Map<String, String> moduleNames, boolean suppressUnknownModuleWarnings) {
+ return new NodeInspector(new TransformState(httpdProcessInfo, httpdBinaryInfo,
+ moduleNames, suppressUnknownModuleWarnings));
+ }
+
/**
* Given the apache configuration and information about the parameters httpd was executed
* with this method provides the directive tree that corresponds to the actual
@@ -263,7 +447,7 @@ public class RuntimeApacheConfiguration {
public static ApacheDirectiveTree extract(ApacheDirectiveTree tree, ProcessInfo httpdProcessInfo,
ApacheBinaryInfo httpdBinaryInfo, Map<String, String> moduleNames, boolean suppressUnknownModuleWarnings) {
ApacheDirectiveTree ret = tree.clone();
- transform(new TransformingWalker(), ret.getRootNode(), new TransformState(httpdProcessInfo, httpdBinaryInfo,
+ transform(new TransformingWalker(), ret.getRootNode(), getNodeInspector(httpdProcessInfo, httpdBinaryInfo,
moduleNames, suppressUnknownModuleWarnings));
return ret;
@@ -303,7 +487,7 @@ public class RuntimeApacheConfiguration {
}
};
- transform(walker, tree.getRootNode(), new TransformState(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings));
+ transform(walker, tree.getRootNode(), getNodeInspector(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings));
}
public static void walkRuntimeConfig(final NodeVisitor<AugeasNode> visitor, AugeasTree tree,
@@ -350,10 +534,10 @@ public class RuntimeApacheConfiguration {
return node.getLabel();
}
};
- transform(walker, tree.getRootNode(), new TransformState(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings));
+ transform(walker, tree.getRootNode(), getNodeInspector(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings));
}
- private static <T> void transform(TreeWalker<T> walker, T parentNode, TransformState state) {
+ private static <T> void transform(TreeWalker<T> walker, T parentNode, NodeInspector inspector) {
if (walker.getChildren(parentNode).isEmpty()) {
return;
}
@@ -361,148 +545,17 @@ public class RuntimeApacheConfiguration {
walker.onBeforeChildrenScan(parentNode);
for (T node : walker.getChildren(parentNode)) {
- boolean recurseFurther = true;
-
- if (walker.getName(node).equalsIgnoreCase("LoadModule")) {
- state.loadedModules.add(walker.getValues(node).get(0));
+ NodeInspectionResult result = inspector.inspect(walker.getName(node), walker.getValues(node), walker.getValue(node));
+ if (result == null) {
+ continue;
+ }
+ if (!result.nodeIsConditional) {
walker.visitOrdinaryNode(node);
- } else if (walker.getName(node).equalsIgnoreCase("<IfModule")) {
- String moduleFile = walker.getValue(node);
- boolean negate = false;
- if (moduleFile.startsWith("!")) {
- negate = true;
- moduleFile = moduleFile.substring(1);
- }
-
- boolean result = false;
-
- switch (isModuleLoaded(moduleFile, state.loadedModules, state.moduleNames, state.moduleFiles)) {
- case LOADED:
- result = true;
- break;
- case NOT_LOADED:
- result = false;
- break;
- case UNKNOWN:
- if (state.suppressUnknownModuleWarnings && LOGGED_UNKNOWN_MODULES.contains(moduleFile)) {
- LOG.debug("Encountered unknown module name in an IfModule directive: " + moduleFile);
- } else {
- LOG.warn("Encountered unknown module name in an IfModule directive: "
- + moduleFile + ". If you are using Apache 2.1 or later, you can try changing the module identifier from the source file to "
- + "the actual module name as used in the LoadModule directive to get rid of this warning.");
- }
- LOGGED_UNKNOWN_MODULES.add(moduleFile);
- continue;
- }
-
- recurseFurther = result != negate;
-
- walker.visitConditionalNode(node, recurseFurther);
- } else if (walker.getName(node).equalsIgnoreCase("<IfDefine")) {
- String define = walker.getValue(node);
- boolean negate = false;
- if (define.startsWith("!")) {
- negate = true;
- define = define.substring(1);
- }
-
- boolean result = state.defines.contains(define);
-
- recurseFurther = result != negate;
-
- walker.visitConditionalNode(node, recurseFurther);
- } else if (walker.getName(node).equalsIgnoreCase("<IfVersion")) {
- //<IfVersion [[!]operator] version> ... </IfVersion>
- //operator: =, ==, >, >=, <, <=, ~
- //version major[.minor[.patch]] or /regex/
- //if operator is ~, the version is assumed regex
- //if operator is omitted, = is assumed
-
- if (isModuleLoaded("mod_version.c", state.loadedModules, state.moduleNames, state.moduleFiles) != ModuleLoadedState.LOADED) {
- LOG.debug("mod_version not loaded and IfVersion directive encountered. Skipping it.");
- continue;
- }
-
- List<String> values = walker.getValues(node);
- String operator = null;
- String version = null;
- boolean negate = false;
- boolean regex = false;
-
- if (values.size() == 0) {
- LOG.warn("Invalid IfVersion directive.");
- continue;
- }
-
- if (values.size() == 1) {
- operator = "=";
- version = values.get(0);
- } else if (values.size() == 2) {
- operator = values.get(0);
- version = values.get(1);
- } else {
- LOG.warn("Too many arguments to a IfVersion directive: " + values);
- continue;
- }
-
- if (operator == null || version == null) {
- LOG.warn("Invalid IfVersion with parameters: " + values);
- continue;
- }
-
- if (operator.charAt(0) == '!') {
- negate = true;
- operator = operator.substring(1);
- }
-
- if ("==".equals(operator)) {
- operator = "=";
- }
-
- if (version.charAt(0) == '/') {
- if ("=".equals(operator) || "~".equals(operator)) {
- regex = true;
- version = version.substring(1, version.length() - 1);
- } else {
- LOG.warn("Unsupported operator " + operator
- + " with regex version comparison in IfVersion directive.");
- continue;
- }
- }
-
- OSGiVersionComparator comp = new OSGiVersionComparator();
-
- boolean result = false;
- if ("=".equals(operator)) {
- if (regex) {
- result = Pattern.matches(version, state.httpdVersion);
- } else {
- result = comp.compare(version, state.httpdVersion) == 0;
- }
- } else if ("~".equals(operator)) {
- result = Pattern.matches(version, state.httpdVersion);
- } else if (">".equals(operator)) {
- result = comp.compare(state.httpdVersion, version) > 0;
- } else if (">=".equals(operator)) {
- result = comp.compare(state.httpdVersion, version) >= 0;
- } else if ("<".equals(operator)) {
- result = comp.compare(state.httpdVersion, version) < 0;
- } else if ("<=".equals(operator)) {
- result = comp.compare(state.httpdVersion, version) <= 0;
- } else {
- LOG.warn("Unknown operator " + operator + " in an IfVersion directive.");
- continue;
- }
-
- recurseFurther = result != negate;
-
- walker.visitConditionalNode(node, recurseFurther);
} else {
- walker.visitOrdinaryNode(node);
- }
-
- if (recurseFurther) {
- transform(walker, node, state);
+ walker.visitConditionalNode(node, result.shouldRecurseIntoConditionalNode);
+ if (result.shouldRecurseIntoConditionalNode) {
+ transform(walker, node, inspector);
+ }
}
}
walker.onAfterChildrenScan(parentNode);
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java
index 4a15b40..74f4e81 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java
@@ -94,15 +94,14 @@ public class RuntimeConfigurationTest {
public void testConditionalInclusion() {
MockApacheBinaryInfo binfo = new MockApacheBinaryInfo();
binfo.setVersion("2.2.17");
+ binfo.setRoot(new File(tmpDir, "runtime-config/conditional").getAbsolutePath());
MockProcessInfo pinfo = new MockProcessInfo();
- pinfo.setCommandLine(new String[] {"blahblah", "-D", "DEFINED"});
-
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, new File(tmpDir, "runtime-config/conditional").getAbsolutePath());
- ApacheConfigReader.buildTree(new File(tmpDir, "runtime-config/conditional/httpd.conf").getAbsolutePath(), parser);
-
- tree = RuntimeApacheConfiguration.extract(tree, pinfo, binfo, ApacheServerDiscoveryComponent.MODULE_SOURCE_FILE_TO_MODULE_NAME_20, false);
-
+ pinfo.setCommandLine(new String[] { "blahblah", "-D", "DEFINED" });
+
+ ApacheDirectiveTree tree =
+ ApacheServerDiscoveryComponent.parseRuntimeConfiguration(new File(tmpDir,
+ "runtime-config/conditional/httpd.conf").getAbsolutePath(), pinfo, binfo);
+
List<VhostSpec> vhosts = VhostSpec.detect(tree);
List<VhostSpec> expectedVhosts = new ArrayList<VhostSpec>();
@@ -124,15 +123,14 @@ public class RuntimeConfigurationTest {
public void testInclusionOrder() {
MockApacheBinaryInfo binfo = new MockApacheBinaryInfo();
binfo.setVersion("2.2.17");
+ binfo.setRoot(new File(tmpDir, "runtime-config/incl-order").getAbsolutePath());
MockProcessInfo pinfo = new MockProcessInfo();
- pinfo.setCommandLine(new String[] {"blahblah"});
-
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, new File(tmpDir, "runtime-config/incl-order").getAbsolutePath());
- ApacheConfigReader.buildTree(new File(tmpDir, "runtime-config/incl-order/httpd.conf").getAbsolutePath(), parser);
-
- tree = RuntimeApacheConfiguration.extract(tree, pinfo, binfo, ApacheServerDiscoveryComponent.MODULE_SOURCE_FILE_TO_MODULE_NAME_20, false);
-
+ pinfo.setCommandLine(new String[] { "blahblah" });
+
+ ApacheDirectiveTree tree =
+ ApacheServerDiscoveryComponent.parseRuntimeConfiguration(new File(tmpDir,
+ "runtime-config/incl-order/httpd.conf").getAbsolutePath(), pinfo, binfo);
+
List<ApacheDirective> listens = tree.search("/Listen");
assertEquals(listens.size(), 3, "There should be 3 listen directives");
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java
index 19fdb67..fd825c1 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java
@@ -101,13 +101,14 @@ public class SnmpMappingTest {
public void testVhostNames() {
MockApacheBinaryInfo binfo = new MockApacheBinaryInfo();
binfo.setVersion("2.2.17");
+ binfo.setRoot(new File(tmpDir, "snmp-mapping").getAbsolutePath());
MockProcessInfo pinfo = new MockProcessInfo();
- pinfo.setCommandLine(new String[] {"blahblah"});
-
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, new File(tmpDir, "snmp-mapping").getAbsolutePath());
- ApacheConfigReader.buildTree(new File(tmpDir, "snmp-mapping/httpd.conf").getAbsolutePath(), parser);
-
+ pinfo.setCommandLine(new String[] { "blahblah" });
+
+ ApacheDirectiveTree tree =
+ ApacheServerDiscoveryComponent.parseRuntimeConfiguration(
+ new File(tmpDir, "snmp-mapping/httpd.conf").getAbsolutePath(), pinfo, binfo);
+
HttpdAddressUtility addrUtil = HttpdAddressUtility.get("2.2.17");
List<ApacheDirective> vhosts = tree.search("/<VirtualHost");
List<String> snmpNames = new ArrayList<String>(vhosts.size() + 1);
commit 38daab95271e3bd733e8b7909a3cf9c6607408ed
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Oct 26 16:11:16 2011 +0200
Formatting
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
index 8b68052..f563ccd 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
@@ -1,3 +1,21 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
package org.rhq.plugins.apache.parser;
import java.io.File;
@@ -5,24 +23,28 @@ import java.util.List;
import org.rhq.augeas.util.Glob;
-public class ApacheParserImpl implements ApacheParser{
+/**
+ *
+ * @author Filip Drabek
+ */
+public class ApacheParserImpl implements ApacheParser {
private final static String INCLUDE_DIRECTIVE = "Include";
private final ApacheDirectiveTree tree;
private ApacheDirectiveStack stack;
private String serverRootPath;
- public ApacheParserImpl(ApacheDirectiveTree tree,String serverRootPath){
- stack = new ApacheDirectiveStack();
- this.serverRootPath = serverRootPath;
- this.tree = tree;
- stack.addDirective(this.tree.getRootNode());
+ public ApacheParserImpl(ApacheDirectiveTree tree, String serverRootPath) {
+ stack = new ApacheDirectiveStack();
+ this.serverRootPath = serverRootPath;
+ this.tree = tree;
+ stack.addDirective(this.tree.getRootNode());
}
-
- public void addDirective(ApacheDirective directive) throws Exception{
- if (directive.getName().equals(INCLUDE_DIRECTIVE)){
+
+ public void addDirective(ApacheDirective directive) throws Exception {
+ if (directive.getName().equals(INCLUDE_DIRECTIVE)) {
List<File> files = getIncludeFiles(directive.getValuesAsString());
- for (File fl : files){
+ for (File fl : files) {
if (fl.exists() && fl.isFile()) {
ApacheConfigReader.searchFile(fl.getAbsolutePath(), this);
}
@@ -32,20 +54,20 @@ public class ApacheParserImpl implements ApacheParser{
stack.getLastDirective().addChildDirective(directive);
}
- public void endNestedDirective(ApacheDirective directive) {
- stack.removeLastDirective();
+ public void endNestedDirective(ApacheDirective directive) {
+ stack.removeLastDirective();
}
public void startNestedDirective(ApacheDirective directive) {
- directive.setParentNode(stack.getLastDirective());
- stack.getLastDirective().addChildDirective(directive);
- stack.addDirective(directive);
+ directive.setParentNode(stack.getLastDirective());
+ stack.getLastDirective().addChildDirective(directive);
+ stack.addDirective(directive);
}
- private List<File> getIncludeFiles(String foundInclude) {
- File check = new File(foundInclude);
+ private List<File> getIncludeFiles(String foundInclude) {
+ File check = new File(foundInclude);
File root = new File(check.isAbsolute() ? Glob.rootPortion(foundInclude) : serverRootPath);
-
+
return Glob.match(root, foundInclude, Glob.ALPHABETICAL_COMPARATOR);
}
}
12 years, 6 months
[rhq] 5 commits - modules/integration-tests modules/plugins
by lkrejci
modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java | 9
modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java | 3
modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java | 4
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java | 16
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java | 17
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java | 9
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java | 40 -
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java | 125 ++-
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java | 38 -
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java | 8
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java | 121 ++-
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java | 341 +++++-----
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java | 30
modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java | 13
14 files changed, 511 insertions(+), 263 deletions(-)
New commits:
commit 00872f6afdfcb1347da10559bcd22cb017b68a18
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Nov 1 16:54:22 2011 +0100
BZ 698474 - Work around the limitations in PIQL so that we don't try to
discover the parent NT service httpd process.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
index 4fc441c..2a913f9 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
@@ -249,7 +249,9 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
for (ProcessScanResult process : processes) {
try {
DiscoveredResourceDetails apache = discoverSingleProcess(discoveryContext, process);
- discoveredResources.add(apache);
+ if (apache != null) {
+ discoveredResources.add(apache);
+ }
} catch (DiscoveryFailureException e) {
log.warn("Discovery of Apache process [" + process.getProcessInfo() + "] failed: " + e.getMessage());
} catch (Exception e) {
@@ -272,6 +274,11 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
*/
private DiscoveredResourceDetails discoverSingleProcess(ResourceDiscoveryContext<PlatformComponent> discoveryContext,
ProcessScanResult process) throws DiscoveryFailureException, Exception {
+
+ if (isWindowsServiceRootInstance(process)) {
+ return null;
+ }
+
File executablePath = getExecutableAbsolutePath(process);
log.debug("Apache executable path: " + executablePath);
@@ -362,7 +369,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
public ResourceUpgradeReport upgrade(ResourceUpgradeContext<PlatformComponent> context) {
String inventoriedResourceKey = context.getResourceKey();
-
+
//check if the inventoried resource has the old format of the resource key.
//the old format was "server-root", while the new format
//is "server-root||httpd-conf". Checking for "||" in the resource key is therefore
@@ -527,7 +534,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
return new File(serverConfigFile);
}
- private String getCommandLineOption(String[] cmdLine, String option) {
+ private static String getCommandLineOption(String[] cmdLine, String option) {
String root = null;
for (int i = 1; i < cmdLine.length; i++) {
String arg = cmdLine[i];
@@ -818,4 +825,25 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
default: throw new IllegalStateException("Unknown HttpdAddressUtility instance.");
}
}
+
+ /**
+ * We need this because of PIQL limitations.
+ *
+ * On *nixes we need to match all "root" httpd processes (i.e. with ppid of 1) but on windows
+ * we need to match all child httpd processes (i.e. processes that are spawned from the "root"
+ * httpd process).
+ *
+ * The *nix requirement causes the root httpd process be matched on Windows
+ * as well, which is undesirable but there is no way of telling PIQL
+ * "don't do this on windows" or "match only processes that DO NOT have a -k argument
+ * at all or that have it with a value different from runservice".
+ *
+ * @param process
+ * @return true if the process represents the root httpd instance if run as a windows service
+ */
+ private static boolean isWindowsServiceRootInstance(ProcessScanResult process) {
+ String kArg = getCommandLineOption(process.getProcessInfo().getCommandLine(), "-k");
+
+ return kArg != null && kArg.equalsIgnoreCase("runservice");
+ }
}
commit a88a1fe19b338d09f593bd6ebeaa5313bf7264e7
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Nov 1 16:40:23 2011 +0100
BZ 697585 - A better warning message if an absolute path of httpd
executable can't be established + a little bit of paranoia when trying
to figure out the absolute path.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
index 9b559cb..4fc441c 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
@@ -89,6 +89,10 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
public DiscoveryFailureException(String message) {
super(message);
}
+
+ public DiscoveryFailureException(String message, Throwable cause) {
+ super(message, cause);
+ }
}
public static final Map<String, String> MODULE_SOURCE_FILE_TO_MODULE_NAME_20;
@@ -268,17 +272,9 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
*/
private DiscoveredResourceDetails discoverSingleProcess(ResourceDiscoveryContext<PlatformComponent> discoveryContext,
ProcessScanResult process) throws DiscoveryFailureException, Exception {
- //String executablePath = process.getProcessInfo().getName();
- String executableName = getExecutableName(process);
- File executablePath = OsProcessUtility.getProcExe(process.getProcessInfo().getPid(), executableName);
- if (executablePath == null) {
- throw new DiscoveryFailureException("Executable path could not be determined.");
- }
- if (!executablePath.isAbsolute()) {
- throw new DiscoveryFailureException("Executable path (" + executablePath + ") is not absolute."
- + "Please restart Apache specifying an absolute path for the executable.");
- }
+ File executablePath = getExecutableAbsolutePath(process);
log.debug("Apache executable path: " + executablePath);
+
ApacheBinaryInfo binaryInfo;
try {
binaryInfo = ApacheBinaryInfo
@@ -563,6 +559,44 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
return executableName;
}
+ private static File getExecutableAbsolutePath(ProcessScanResult process) throws DiscoveryFailureException {
+ //String executablePath = process.getProcessInfo().getName();
+ String executableName = getExecutableName(process);
+ File executablePath = OsProcessUtility.getProcExe(process.getProcessInfo().getPid(), executableName);
+ if (executablePath == null) {
+ throw new DiscoveryFailureException("Executable path could not be determined.");
+ }
+ if (!executablePath.isAbsolute()) {
+ //try to figure out the full path... this might fail due to lack of privs
+ //if the agent is running as a different user than the httpd process
+ String errorMessage = "Executable path (" + executablePath + ") is not absolute. "
+ + "Please restart Apache specifying an absolute path for the executable or "
+ + "make sure that the user running the RHQ agent is able to access the commandline parameters of the " + executableName + " process.";
+ Throwable cause = null;
+ boolean success = false;
+
+ //the OsProcessUtility.getProcExe does an excelent job at figuring the full path and I never saw it fail
+ //when the agent process has enough privs to get at the info at all. Nevertheless, let's be paranoid
+ //and try yet another method..
+ try {
+ String cwd = process.getProcessInfo().getCurrentWorkingDirectory();
+ if (cwd != null) {
+ executablePath = new File(cwd, executablePath.getPath());
+
+ success = executablePath.isAbsolute() && executablePath.isFile();
+ }
+ } catch (Exception e) {
+ cause = e;
+ }
+
+ if (!success) {
+ throw new DiscoveryFailureException(errorMessage, cause);
+ }
+ }
+
+ return executablePath;
+ }
+
private static void validateServerRootAndServerConfigFile(Configuration pluginConfig) {
String serverRoot = pluginConfig.getSimple(ApacheServerComponent.PLUGIN_CONFIG_PROP_SERVER_ROOT)
.getStringValue();
commit 6f1004a715406241dea681a6a8f6e7d9b5c280f0
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Oct 31 13:26:22 2011 +0100
BZ 717787 - Making sure augeas is only ever used if the apache resource
is allowed to do so.
Improved the confusing error message when augeas was not enabled that
stated that apache version is not supported or augeas is not available,
when in fact neither could be true.
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java
index e828818..f8ebd79 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheDirectoryComponent.java
@@ -70,6 +70,10 @@ public class ApacheDirectoryComponent implements ResourceComponent<ApacheVirtual
}
public Configuration loadResourceConfiguration() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ApacheVirtualHostServiceComponent parentVirtualHost = resourceContext.getParentResourceComponent();
AugeasComponent comp = getAugeas();
@@ -87,7 +91,12 @@ public class ApacheDirectoryComponent implements ResourceComponent<ApacheVirtual
}
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
-
+ if (!isAugeasEnabled()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ return;
+ }
+
AugeasComponent comp = getAugeas();
AugeasTree tree = null;
try {
@@ -115,7 +124,12 @@ public class ApacheDirectoryComponent implements ResourceComponent<ApacheVirtual
}
public void deleteResource() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ApacheVirtualHostServiceComponent parentVirtualHost = resourceContext.getParentResourceComponent();
+
AugeasComponent comp = getAugeas();
try {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java
index bd6b4ee..8554038 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleComponent.java
@@ -65,6 +65,10 @@ public class ApacheIfModuleComponent implements ResourceComponent<ApacheVirtualH
}
public Configuration loadResourceConfiguration() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
AugeasComponent comp = null;
try {
comp = parentComponent.getAugeas();
@@ -81,6 +85,12 @@ public class ApacheIfModuleComponent implements ResourceComponent<ApacheVirtualH
}
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ if (!isAugeasEnabled()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ return;
+ }
+
AugeasComponent comp = null;
AugeasTree tree = null;
try {
@@ -118,13 +128,6 @@ public class ApacheIfModuleComponent implements ResourceComponent<ApacheVirtualH
return directory;
}
- public void copy(AugeasNode a, AugeasNode b) {
- for (AugeasNode nd : a.getChildNodes()) {
- AugeasNode tempNode = tree.createNode(b, nd.getLabel(), nd.getValue(), nd.getSeq());
- copy(nd, tempNode);
- }
- }
-
public boolean isAugeasEnabled() {
return parentComponent.isAugeasEnabled();
}
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java
index dedcb3c..c97c28c 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheIfModuleDirectoryComponent.java
@@ -63,6 +63,10 @@ public class ApacheIfModuleDirectoryComponent implements ResourceComponent<Apach
}
public Configuration loadResourceConfiguration() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ConfigurationDefinition resourceConfigDef = context.getResourceType().getResourceConfigurationDefinition();
AugeasComponent comp = parentComponent.getAugeas();
AugeasTree tree = null;
@@ -78,6 +82,11 @@ public class ApacheIfModuleDirectoryComponent implements ResourceComponent<Apach
}
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ if (!isAugeasEnabled()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
AugeasComponent comp = parentComponent.getAugeas();
AugeasTree tree = null;
try {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
index 04484ce..84f0c99 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
@@ -103,7 +103,10 @@ import org.rhq.rhqtransform.AugeasRHQComponent;
public class ApacheServerComponent implements AugeasRHQComponent, ResourceComponent<PlatformComponent>,
MeasurementFacet, OperationFacet, ConfigurationFacet, CreateChildResourceFacet {
- public static final String CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE = "Configuration is supported only for Apache version 2 and up using Augeas. You either have an old version of Apache or Augeas is not installed.";
+ public static final String CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE =
+ "Configuration and child resource creation/deletion support for Apache is optional. "
+ + "If you switched it on by enabling Augeas support in the connection settings of the Apache server resource and still get this message, "
+ + "it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform.";
private final Log log = LogFactory.getLog(this.getClass());
@@ -338,7 +341,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public Configuration loadResourceConfiguration() throws Exception {
if (!isAugeasEnabled())
- throw new RuntimeException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ throw new IllegalStateException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
AugeasComponent comp = getAugeas();
try {
@@ -359,6 +362,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
if (!isAugeasEnabled()) {
report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
return;
}
@@ -422,9 +426,10 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public CreateResourceReport createResource(CreateResourceReport report) {
if (!isAugeasEnabled()) {
report.setStatus(CreateResourceStatus.FAILURE);
- report.setErrorMessage("Resources can be created only when augeas is enabled.");
+ report.setErrorMessage(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
return report;
}
+
if (ApacheVirtualHostServiceComponent.RESOURCE_TYPE_NAME.equals(report.getResourceType().getName())) {
Configuration vhostResourceConfig = report.getResourceConfiguration();
ConfigurationDefinition vhostResourceConfigDef = report.getResourceType()
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
index 6ec95da..5dd9192 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
@@ -154,9 +154,11 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
}
public Configuration loadResourceConfiguration() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ApacheServerComponent parent = resourceContext.getParentResourceComponent();
- if (!parent.isAugeasEnabled())
- throw new Exception(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
AugeasComponent comp = getAugeas();
try {
@@ -172,6 +174,12 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
}
public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ if (!isAugeasEnabled()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ return;
+ }
+
AugeasComponent comp = getAugeas();
AugeasTree tree = null;
try {
@@ -188,10 +196,14 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
finishConfigurationUpdate(report);
} catch (Exception e) {
- if (tree != null)
- log.error("Augeas failed to save configuration " + tree.summarizeAugeasError());
- else
+ if (tree != null) {
+ String message = "Augeas failed to save configuration " + tree.summarizeAugeasError();
+ report.setErrorMessage(message);
+ log.error(message);
+ } else {
+ report.setErrorMessageFromThrowable(e);
log.error("Augeas failed to save configuration", e);
+ }
report.setStatus(ConfigurationUpdateStatus.FAILURE);
} finally {
comp.close();
@@ -199,9 +211,11 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
}
public void deleteResource() throws Exception {
+ if (!isAugeasEnabled()) {
+ throw new IllegalStateException(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ }
+
ApacheServerComponent parent = resourceContext.getParentResourceComponent();
- if (!parent.isAugeasEnabled())
- throw new Exception(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
if (MAIN_SERVER_RESOURCE_KEY.equals(resourceContext.getResourceKey())) {
throw new IllegalArgumentException(
@@ -276,9 +290,10 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
public CreateResourceReport createResource(CreateResourceReport report) {
if (!isAugeasEnabled()) {
report.setStatus(CreateResourceStatus.FAILURE);
- report.setErrorMessage("Resources can be created only when augeas is enabled.");
+ report.setErrorMessage(ApacheServerComponent.CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
return report;
}
+
ResourceType resourceType = report.getResourceType();
AugeasComponent comp = null;
try {
commit fbf5af6b6d8250534e88ce7d3ed8e8548dfd9176
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Nov 1 16:56:44 2011 +0100
BZ 687992 - A final touch on making the apache config file parsing
correct. The parser now keeps track of the "current" ServerRoot
(which is defaulted to the value hardcoded in the binary at the start and
then updated each time a ServerRoot directive is encountered during the
config file parsing).
Also made some minor refactoring to consolidate and reuse the runtime
configuration extracting routines.
A final update is to use the runtime configuration to figure out
the paths of the httpd executable as well as control script path (before
we used the full config and so could potentially get wrong results if
ServerRoot was hidden in some conditional blocks).
The runtime config is now also used when figuring out the sample address of
a virtual host during its creation.
diff --git a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java
index 36ef655..b1abcbe 100644
--- a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java
+++ b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/setup/ApacheTestSetup.java
@@ -44,6 +44,8 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceError;
import org.rhq.core.pc.ServerServices;
import org.rhq.core.pc.upgrade.FakeServerInventory;
+import org.rhq.core.system.SystemInfoFactory;
+import org.rhq.plugins.apache.ApacheServerDiscoveryComponent;
import org.rhq.plugins.apache.ApacheVirtualHostServiceComponent;
import org.rhq.plugins.apache.ApacheVirtualHostServiceDiscoveryComponent;
import org.rhq.plugins.apache.parser.ApacheConfigReader;
@@ -51,6 +53,7 @@ import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
import org.rhq.plugins.apache.parser.ApacheParser;
import org.rhq.plugins.apache.parser.ApacheParserImpl;
import org.rhq.plugins.apache.upgrade.UpgradeTestBase;
+import org.rhq.plugins.apache.util.ApacheBinaryInfo;
import org.rhq.plugins.apache.util.ApacheDeploymentUtil;
import org.rhq.plugins.apache.util.ApacheExecutionUtil;
import org.rhq.plugins.apache.util.HttpdAddressUtility;
@@ -149,10 +152,8 @@ public class ApacheTestSetup {
}
//ok, now try to find the ping URL. The best thing is to actually invoke
- //the same code the apache server discovery does.
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, serverRootDir.getAbsolutePath());
- ApacheConfigReader.buildTree(confFilePath, parser);
+ //the same code the apache server discovery does.
+ ApacheDirectiveTree tree = ApacheServerDiscoveryComponent.parseRuntimeConfiguration(confFilePath, null, ApacheBinaryInfo.getInfo(exePath, SystemInfoFactory.createSystemInfo()));
//XXX this hardcodes apache2 as the only option we have...
HttpdAddressUtility.Address addrToUse = HttpdAddressUtility.APACHE_2_x.getMainServerSampleAddress(tree, null, -1);
diff --git a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java
index f86b095..c8952c1 100644
--- a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java
+++ b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/upgrade/UpgradeTestBase.java
@@ -207,8 +207,7 @@ public class UpgradeTestBase extends PluginContainerTest {
protected void defineRHQ3ResourceKeys(ApacheTestConfiguration testConfig, ApacheTestSetup setup) throws Exception {
setup.withApacheSetup().init();
ApacheServerComponent component = setup.withApacheSetup().getExecutionUtil().getServerComponent();
- ApacheDirectiveTree config = component.loadParser();
- config = RuntimeApacheConfiguration.extract(config, component.getCurrentProcessInfo(), component.getCurrentBinaryInfo(), component.getModuleNames(), false);
+ ApacheDirectiveTree config = component.parseRuntimeConfiguration(false);
DeploymentConfig deployConfig = setup.getDeploymentConfig();
diff --git a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java
index 8dc55ca..ee03318 100644
--- a/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java
+++ b/modules/integration-tests/apache-plugin-test/src/test/java/org/rhq/plugins/apache/util/ApacheExecutionUtil.java
@@ -149,9 +149,7 @@ public class ApacheExecutionUtil {
}
public ApacheDirectiveTree getRuntimeConfiguration() {
- ApacheDirectiveTree config = serverComponent.loadParser();
- return RuntimeApacheConfiguration.extract(config, resourceContext.getNativeProcess(), new ApacheBinaryInfo(
- exePath), serverComponent.getModuleNames(), true);
+ return serverComponent.parseRuntimeConfiguration(true);
}
public ApacheServerComponent getServerComponent() {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
index d180fe6..04484ce 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
@@ -81,11 +81,8 @@ import org.rhq.plugins.apache.augeas.ApacheAugeasNode;
import org.rhq.plugins.apache.augeas.AugeasConfigurationApache;
import org.rhq.plugins.apache.augeas.AugeasTreeBuilderApache;
import org.rhq.plugins.apache.mapping.ApacheAugeasMapping;
-import org.rhq.plugins.apache.parser.ApacheConfigReader;
import org.rhq.plugins.apache.parser.ApacheDirective;
import org.rhq.plugins.apache.parser.ApacheDirectiveTree;
-import org.rhq.plugins.apache.parser.ApacheParser;
-import org.rhq.plugins.apache.parser.ApacheParserImpl;
import org.rhq.plugins.apache.util.ApacheBinaryInfo;
import org.rhq.plugins.apache.util.ConfigurationTimestamp;
import org.rhq.plugins.apache.util.HttpdAddressUtility;
@@ -403,6 +400,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public AugeasComponent getAugeas() throws AugeasTreeException {
return new AugeasComponent() {
+ @Override
public AugeasConfiguration initConfiguration() {
File tempDir = resourceContext.getDataDirectory();
if (!tempDir.exists())
@@ -412,6 +410,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
return config;
}
+ @Override
public AugeasTreeBuilder initTreeBuilder() {
AugeasTreeBuilderApache builder = new AugeasTreeBuilderApache();
return builder;
@@ -445,10 +444,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
String[] vhostDefs = vhostDef.split(" ");
HttpdAddressUtility.Address addr;
try {
- ApacheDirectiveTree parserTree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(parserTree, getServerRoot().getAbsolutePath());
-
- ApacheConfigReader.buildTree(getHttpdConfFile().getAbsolutePath(), parser);
+ ApacheDirectiveTree parserTree = parseRuntimeConfiguration(true);
Pattern virtualHostPattern = Pattern.compile(".+:([\\d]+|\\*)");
Matcher matcher = virtualHostPattern.matcher(vhostDefs[0]);
@@ -632,7 +628,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
} else {
String serverRoot = null;
- ApacheDirectiveTree tree = loadParser();
+ ApacheDirectiveTree tree = parseRuntimeConfiguration(true);
List<ApacheDirective> directives = tree.search("/ServerRoot");
if (!directives.isEmpty())
if (!directives.get(0).getValues().isEmpty())
@@ -700,7 +696,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
// First try server root as base
String serverRoot = null;
try {
- ApacheDirectiveTree tree = loadParser();
+ ApacheDirectiveTree tree = parseRuntimeConfiguration(true);
List<ApacheDirective> directives = tree.search("/ServerRoot");
if (!directives.isEmpty())
if (!directives.get(0).getValues().isEmpty())
@@ -962,13 +958,18 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
}
}
- public ApacheDirectiveTree loadParser() {
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, getServerRoot().getAbsolutePath());
- ApacheConfigReader.buildTree(getHttpdConfFile().getAbsolutePath(), parser);
- return tree;
+ public ApacheDirectiveTree parseFullConfiguration() {
+ String httpdConfPath = getHttpdConfFile().getAbsolutePath();
+ return ApacheServerDiscoveryComponent.parseFullConfiguration(httpdConfPath, binaryInfo.getRoot());
}
+ public ApacheDirectiveTree parseRuntimeConfiguration(boolean suppressUnknownModuleWarnings) {
+ String httpdConfPath = getHttpdConfFile().getAbsolutePath();
+ ProcessInfo processInfo = resourceContext.getNativeProcess();
+
+ return ApacheServerDiscoveryComponent.parseRuntimeConfiguration(httpdConfPath, processInfo, binaryInfo, getModuleNames(), suppressUnknownModuleWarnings);
+ }
+
public boolean isAugeasEnabled() {
Configuration pluginConfig = this.resourceContext.getPluginConfiguration();
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
index 565fd3c..9b559cb 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerDiscoveryComponent.java
@@ -321,10 +321,7 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
pluginConfig.put(new PropertyList(ApacheServerComponent.PLUGIN_CONFIG_CUSTOM_MODULE_NAMES));
- ApacheDirectiveTree serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot);
-
- //extract the runtime configuration out of declared config
- serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getDefaultModuleNames(binaryInfo.getVersion()), true);
+ ApacheDirectiveTree serverConfig = parseRuntimeConfiguration(serverConfigFile.getAbsolutePath(), process.getProcessInfo(), binaryInfo);
String serverUrl = null;
String vhostsGlobInclude = null;
@@ -334,11 +331,8 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
if (!serverRoots.isEmpty()) {
serverRoot = AugeasNodeValueUtil.unescape(serverRoots.get(0).getValuesAsString());
serverRootProp.setValue(serverRoot);
- //reparse the configuration with the new ServerRoot
- serverConfig = loadParser(serverConfigFile.getAbsolutePath(), serverRoot);
- serverConfig = RuntimeApacheConfiguration.extract(serverConfig, process.getProcessInfo(), binaryInfo, getDefaultModuleNames(binaryInfo.getVersion()), true);
}
-
+
serverUrl = getUrl(serverConfig, binaryInfo.getVersion());
vhostsGlobInclude = scanForGlobInclude(serverConfig);
@@ -597,14 +591,35 @@ public class ApacheServerDiscoveryComponent implements ResourceDiscoveryComponen
}
}
- public static ApacheDirectiveTree loadParser(String path, String serverRoot) {
-
+ public static ApacheDirectiveTree parseFullConfiguration(String path, String serverRoot) {
ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, serverRoot);
+ ApacheParser parser = new ApacheParserImpl(tree, serverRoot, null);
ApacheConfigReader.buildTree(path, parser);
return tree;
}
+ public static ApacheDirectiveTree parseRuntimeConfiguration(String path, ProcessInfo processInfo,
+ ApacheBinaryInfo binaryInfo) {
+
+ String httpdVersion = binaryInfo.getVersion();
+ Map<String, String> defaultModuleNames = getDefaultModuleNames(httpdVersion);
+
+ return parseRuntimeConfiguration(path, processInfo, binaryInfo, defaultModuleNames, true);
+ }
+
+ public static ApacheDirectiveTree parseRuntimeConfiguration(String path, ProcessInfo processInfo, ApacheBinaryInfo binaryInfo, Map<String, String> moduleNames, boolean suppressUnknownModuleWarnings) {
+ String defaultServerRoot = binaryInfo.getRoot();
+
+ RuntimeApacheConfiguration.NodeInspector insp =
+ RuntimeApacheConfiguration.getNodeInspector(processInfo, binaryInfo,
+ moduleNames, suppressUnknownModuleWarnings);
+
+ ApacheDirectiveTree tree = new ApacheDirectiveTree();
+ ApacheParser parser = new ApacheParserImpl(tree, defaultServerRoot, insp);
+ ApacheConfigReader.buildTree(path, parser);
+ return tree;
+ }
+
public static String scanForGlobInclude(ApacheDirectiveTree tree) {
try {
List<ApacheDirective> includes = tree.search("/Include");
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
index c83c665..6ec95da 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceComponent.java
@@ -528,8 +528,7 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
//only look for the vhost entry if the vhost we're looking for isn't the main server
if (!MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) {
- ApacheDirectiveTree tree = parent.loadParser();
- tree = RuntimeApacheConfiguration.extract(tree, parent.getCurrentProcessInfo(), parent.getCurrentBinaryInfo(), parent.getModuleNames(), false);
+ ApacheDirectiveTree tree = parent.parseRuntimeConfiguration(false);
//find the vhost entry the resource key represents
List<ApacheDirective> vhosts = tree.search("/<VirtualHost");
@@ -603,10 +602,6 @@ public class ApacheVirtualHostServiceComponent implements ResourceComponent<Apac
return resourceContext.getResourceType().getChildResourceTypes().iterator().next();
}
- public ApacheDirectiveTree loadParser() throws Exception {
- return resourceContext.getParentResourceComponent().loadParser();
- }
-
public boolean isAugeasEnabled() {
ApacheServerComponent parent = resourceContext.getParentResourceComponent();
return parent.isAugeasEnabled();
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
index e2c68f3..daf27fd 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheVirtualHostServiceDiscoveryComponent.java
@@ -81,9 +81,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
Set<DiscoveredResourceDetails> discoveredResources = new LinkedHashSet<DiscoveredResourceDetails>();
ApacheServerComponent serverComponent = context.getParentResourceComponent();
- ApacheDirectiveTree tree = serverComponent.loadParser();
-
- tree = RuntimeApacheConfiguration.extract(tree, serverComponent.getCurrentProcessInfo(), serverComponent.getCurrentBinaryInfo(), serverComponent.getModuleNames(), false);
+ ApacheDirectiveTree tree = serverComponent.parseRuntimeConfiguration(false);
//first define the root server as one virtual host
discoverMainServer(context, tree, discoveredResources);
@@ -164,9 +162,7 @@ public class ApacheVirtualHostServiceDiscoveryComponent implements ResourceDisco
ApacheServerComponent serverComponent = inventoriedResource.getParentResourceComponent();
- ApacheDirectiveTree tree = serverComponent.loadParser();
- tree = RuntimeApacheConfiguration.extract(tree, serverComponent.getCurrentProcessInfo(),
- serverComponent.getCurrentBinaryInfo(), serverComponent.getModuleNames(), false);
+ ApacheDirectiveTree tree = serverComponent.parseRuntimeConfiguration(false);
List<VHostSpec> vhosts = VHostSpec.detect(tree);
VirtualHostLegacyResourceKeyUtil legacyResourceKeyUtil = new VirtualHostLegacyResourceKeyUtil(serverComponent, tree);
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
index f563ccd..bba00bf 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
@@ -22,26 +22,43 @@ import java.io.File;
import java.util.List;
import org.rhq.augeas.util.Glob;
+import org.rhq.plugins.apache.util.AugeasNodeValueUtil;
+import org.rhq.plugins.apache.util.RuntimeApacheConfiguration;
/**
*
* @author Filip Drabek
+ * @author Lukas Krejci
*/
public class ApacheParserImpl implements ApacheParser {
private final static String INCLUDE_DIRECTIVE = "Include";
+ private static final String SERVER_ROOT_DIRECTIVE = "ServerRoot";
private final ApacheDirectiveTree tree;
private ApacheDirectiveStack stack;
private String serverRootPath;
-
- public ApacheParserImpl(ApacheDirectiveTree tree, String serverRootPath) {
+ private RuntimeApacheConfiguration.NodeInspector nodeInspector;
+
+ /**
+ *
+ * @param tree the tree that this parser will fill in
+ * @param initialServerRootPath the initial server root path as detected by other means
+ * @param nodeInspector the node inspector to determine the runtime configuration or null, if full configuration tree is needed
+ */
+ public ApacheParserImpl(ApacheDirectiveTree tree, String initialServerRootPath, RuntimeApacheConfiguration.NodeInspector nodeInspector) {
stack = new ApacheDirectiveStack();
- this.serverRootPath = serverRootPath;
+ this.serverRootPath = initialServerRootPath;
this.tree = tree;
stack.addDirective(this.tree.getRootNode());
+ this.nodeInspector = nodeInspector;
}
public void addDirective(ApacheDirective directive) throws Exception {
+ if (stack.getLastDirective() == null) {
+ //we're ignoring until the end of an ignored nested directive
+ return;
+ }
+
if (directive.getName().equals(INCLUDE_DIRECTIVE)) {
List<File> files = getIncludeFiles(directive.getValuesAsString());
for (File fl : files) {
@@ -49,7 +66,15 @@ public class ApacheParserImpl implements ApacheParser {
ApacheConfigReader.searchFile(fl.getAbsolutePath(), this);
}
}
+ } else if (directive.getName().equals(SERVER_ROOT_DIRECTIVE)) {
+ this.serverRootPath = AugeasNodeValueUtil.unescape(directive.getValuesAsString());
}
+
+ if (nodeInspector != null) {
+ //let the inspector process this directive in case it sees something of interest
+ nodeInspector.inspect(directive.getName(), directive.getValues(), directive.getValuesAsString());
+ }
+
directive.setParentNode(stack.getLastDirective());
stack.getLastDirective().addChildDirective(directive);
}
@@ -59,9 +84,45 @@ public class ApacheParserImpl implements ApacheParser {
}
public void startNestedDirective(ApacheDirective directive) {
- directive.setParentNode(stack.getLastDirective());
- stack.getLastDirective().addChildDirective(directive);
- stack.addDirective(directive);
+ if (nodeInspector != null) {
+ //now we have a node inspector so the tree construction is driven by it - we actually leave out the conditional
+ //directives and replace them with their contents (if they are to be applied of course)...
+
+ RuntimeApacheConfiguration.NodeInspectionResult res = nodeInspector.inspect(directive.getName(), directive.getValues(), directive.getValuesAsString());
+ if (res == null || (res.nodeIsConditional && !res.shouldRecurseIntoConditionalNode)) {
+ //ok, this node should be ignored, mark that fact with a null parent
+ stack.addDirective(null);
+ } else if (res.nodeIsConditional && res.shouldRecurseIntoConditionalNode) {
+ //this is a little tricky..
+ //we need to leave out this directive, because it is conditional and we should be replacing it with its contents
+ //but also we need to keep the stack balanced (i.e. we're going down a nested directive, so we ought to put something
+ //on the stack). By duplicating the last known directive on the stack we actually achieve both of the goals - the
+ //stack remains balanced and the child nodes get added to the parent of this directive (i.e. in the end it is going to
+ //look like we've replaced the directive with its child directives).
+ stack.addDirective(stack.getLastDirective());
+ } else {
+ //ok, a "normal" (non-conditional) nested node
+ //we might be inside an ignored nested directive, so leave all the weaving stuff
+ //out in that case...
+ if (stack.getLastDirective() != null) {
+ directive.setParentNode(stack.getLastDirective());
+ stack.getLastDirective().addChildDirective(directive);
+ }
+ stack.addDirective(directive);
+ }
+ } else {
+ //there is no node inspector, so we have no "guidance" on the tree construction.
+ //Just include all the nested structures so that a full configuration tree is built
+ //with all the directives.
+
+ //we might be inside an ignored nested directive, so leave all the weaving stuff
+ //out in that case...
+ if (stack.getLastDirective() != null) {
+ directive.setParentNode(stack.getLastDirective());
+ stack.getLastDirective().addChildDirective(directive);
+ }
+ stack.addDirective(directive);
+ }
}
private List<File> getIncludeFiles(String foundInclude) {
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
index 1f00aec..f8a0bdb 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/util/RuntimeApacheConfiguration.java
@@ -59,6 +59,185 @@ public class RuntimeApacheConfiguration {
}
/**
+ * A result of a node inspection using {@link NodeInspector}
+ *
+ *
+ * @author Lukas Krejci
+ */
+ public static class NodeInspectionResult {
+ public boolean nodeIsConditional;
+ public boolean shouldRecurseIntoConditionalNode;
+ }
+
+ /**
+ * Node inspector is used to determine how to proceed with the parsing of the configuration file.
+ *
+ *
+ * @author Lukas Krejci
+ */
+ public static class NodeInspector {
+ private TransformState state;
+
+ private NodeInspector(TransformState state) {
+ this.state = state;
+ }
+
+ /**
+ * Inspects a node.
+ *
+ * @param currentNodeName the name of the node
+ * @param allValues the list of all values specified on the node
+ * @param valueAsString the original value as a string (from which the list of values was somehow produced)
+ * @return the inspection result or null if there was some unexpected event (which has been logged)
+ */
+ public NodeInspectionResult inspect(String currentNodeName, List<String> allValues, String valueAsString) {
+ NodeInspectionResult result = new NodeInspectionResult();
+
+ result.shouldRecurseIntoConditionalNode = true;
+
+ if (currentNodeName.equalsIgnoreCase("LoadModule")) {
+ state.loadedModules.add(allValues.get(0));
+ result.nodeIsConditional = false;
+ } else if (currentNodeName.equalsIgnoreCase("<IfModule")) {
+ String moduleFile = valueAsString;
+ boolean negate = false;
+ if (moduleFile.startsWith("!")) {
+ negate = true;
+ moduleFile = moduleFile.substring(1);
+ }
+
+ boolean moduleLoaded = false;
+
+ switch (isModuleLoaded(moduleFile, state.loadedModules, state.moduleNames, state.moduleFiles)) {
+ case LOADED:
+ moduleLoaded = true;
+ break;
+ case NOT_LOADED:
+ moduleLoaded = false;
+ break;
+ case UNKNOWN:
+ if (state.suppressUnknownModuleWarnings && LOGGED_UNKNOWN_MODULES.contains(moduleFile)) {
+ LOG.debug("Encountered unknown module name in an IfModule directive: " + moduleFile);
+ } else {
+ LOG.warn("Encountered unknown module name in an IfModule directive: "
+ + moduleFile + ". If you are using Apache 2.1 or later, you can try changing the module identifier from the source file to "
+ + "the actual module name as used in the LoadModule directive to get rid of this warning.");
+ }
+ LOGGED_UNKNOWN_MODULES.add(moduleFile);
+ return null;
+ }
+
+ result.shouldRecurseIntoConditionalNode = moduleLoaded != negate;
+
+ result.nodeIsConditional = true;
+ } else if (currentNodeName.equalsIgnoreCase("<IfDefine")) {
+ String define = valueAsString;
+ boolean negate = false;
+ if (define.startsWith("!")) {
+ negate = true;
+ define = define.substring(1);
+ }
+
+ boolean isDefined = state.defines.contains(define);
+
+ result.shouldRecurseIntoConditionalNode = isDefined != negate;
+
+ result.nodeIsConditional = true;
+ } else if (currentNodeName.equalsIgnoreCase("<IfVersion")) {
+ //<IfVersion [[!]operator] version> ... </IfVersion>
+ //operator: =, ==, >, >=, <, <=, ~
+ //version major[.minor[.patch]] or /regex/
+ //if operator is ~, the version is assumed regex
+ //if operator is omitted, = is assumed
+
+ if (isModuleLoaded("mod_version.c", state.loadedModules, state.moduleNames, state.moduleFiles) != ModuleLoadedState.LOADED) {
+ LOG.debug("mod_version not loaded and IfVersion directive encountered. Skipping it.");
+ return null;
+ }
+
+ List<String> values = allValues;
+ String operator = null;
+ String version = null;
+ boolean negate = false;
+ boolean regex = false;
+
+ if (values.size() == 0) {
+ LOG.warn("Invalid IfVersion directive.");
+ return null;
+ }
+
+ if (values.size() == 1) {
+ operator = "=";
+ version = values.get(0);
+ } else if (values.size() == 2) {
+ operator = values.get(0);
+ version = values.get(1);
+ } else {
+ LOG.warn("Too many arguments to a IfVersion directive: " + values);
+ return null;
+ }
+
+ if (operator == null || version == null) {
+ LOG.warn("Invalid IfVersion with parameters: " + values);
+ return null;
+ }
+
+ if (operator.charAt(0) == '!') {
+ negate = true;
+ operator = operator.substring(1);
+ }
+
+ if ("==".equals(operator)) {
+ operator = "=";
+ }
+
+ if (version.charAt(0) == '/') {
+ if ("=".equals(operator) || "~".equals(operator)) {
+ regex = true;
+ version = version.substring(1, version.length() - 1);
+ } else {
+ LOG.warn("Unsupported operator " + operator
+ + " with regex version comparison in IfVersion directive.");
+ return null;
+ }
+ }
+
+ OSGiVersionComparator comp = new OSGiVersionComparator();
+
+ boolean hasVersion = false;
+ if ("=".equals(operator)) {
+ if (regex) {
+ hasVersion = Pattern.matches(version, state.httpdVersion);
+ } else {
+ hasVersion = comp.compare(version, state.httpdVersion) == 0;
+ }
+ } else if ("~".equals(operator)) {
+ hasVersion = Pattern.matches(version, state.httpdVersion);
+ } else if (">".equals(operator)) {
+ hasVersion = comp.compare(state.httpdVersion, version) > 0;
+ } else if (">=".equals(operator)) {
+ hasVersion = comp.compare(state.httpdVersion, version) >= 0;
+ } else if ("<".equals(operator)) {
+ hasVersion = comp.compare(state.httpdVersion, version) < 0;
+ } else if ("<=".equals(operator)) {
+ hasVersion = comp.compare(state.httpdVersion, version) <= 0;
+ } else {
+ LOG.warn("Unknown operator " + operator + " in an IfVersion directive.");
+ return null;
+ }
+
+ result.shouldRecurseIntoConditionalNode = hasVersion != negate;
+
+ result.nodeIsConditional = true;
+ } else {
+ result.nodeIsConditional = false;
+ }
+
+ return result;
+ }
+ }
+
+ /**
* This is a node visitor interface to be implemented by the users of the
* {@link RuntimeApacheConfiguration#walkRuntimeConfig(ApacheAugeasTree, ProcessInfo, ApacheBinaryInfo, Map)}
* or {@link RuntimeApacheConfiguration#walkRuntimeConfig(ApacheDirectiveTree, ProcessInfo, ApacheBinaryInfo, Map)}
@@ -244,6 +423,11 @@ public class RuntimeApacheConfiguration {
}
}
+ public static NodeInspector getNodeInspector(ProcessInfo httpdProcessInfo, ApacheBinaryInfo httpdBinaryInfo, Map<String, String> moduleNames, boolean suppressUnknownModuleWarnings) {
+ return new NodeInspector(new TransformState(httpdProcessInfo, httpdBinaryInfo,
+ moduleNames, suppressUnknownModuleWarnings));
+ }
+
/**
* Given the apache configuration and information about the parameters httpd was executed
* with this method provides the directive tree that corresponds to the actual
@@ -263,7 +447,7 @@ public class RuntimeApacheConfiguration {
public static ApacheDirectiveTree extract(ApacheDirectiveTree tree, ProcessInfo httpdProcessInfo,
ApacheBinaryInfo httpdBinaryInfo, Map<String, String> moduleNames, boolean suppressUnknownModuleWarnings) {
ApacheDirectiveTree ret = tree.clone();
- transform(new TransformingWalker(), ret.getRootNode(), new TransformState(httpdProcessInfo, httpdBinaryInfo,
+ transform(new TransformingWalker(), ret.getRootNode(), getNodeInspector(httpdProcessInfo, httpdBinaryInfo,
moduleNames, suppressUnknownModuleWarnings));
return ret;
@@ -303,7 +487,7 @@ public class RuntimeApacheConfiguration {
}
};
- transform(walker, tree.getRootNode(), new TransformState(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings));
+ transform(walker, tree.getRootNode(), getNodeInspector(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings));
}
public static void walkRuntimeConfig(final NodeVisitor<AugeasNode> visitor, AugeasTree tree,
@@ -350,10 +534,10 @@ public class RuntimeApacheConfiguration {
return node.getLabel();
}
};
- transform(walker, tree.getRootNode(), new TransformState(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings));
+ transform(walker, tree.getRootNode(), getNodeInspector(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings));
}
- private static <T> void transform(TreeWalker<T> walker, T parentNode, TransformState state) {
+ private static <T> void transform(TreeWalker<T> walker, T parentNode, NodeInspector inspector) {
if (walker.getChildren(parentNode).isEmpty()) {
return;
}
@@ -361,148 +545,17 @@ public class RuntimeApacheConfiguration {
walker.onBeforeChildrenScan(parentNode);
for (T node : walker.getChildren(parentNode)) {
- boolean recurseFurther = true;
-
- if (walker.getName(node).equalsIgnoreCase("LoadModule")) {
- state.loadedModules.add(walker.getValues(node).get(0));
+ NodeInspectionResult result = inspector.inspect(walker.getName(node), walker.getValues(node), walker.getValue(node));
+ if (result == null) {
+ continue;
+ }
+ if (!result.nodeIsConditional) {
walker.visitOrdinaryNode(node);
- } else if (walker.getName(node).equalsIgnoreCase("<IfModule")) {
- String moduleFile = walker.getValue(node);
- boolean negate = false;
- if (moduleFile.startsWith("!")) {
- negate = true;
- moduleFile = moduleFile.substring(1);
- }
-
- boolean result = false;
-
- switch (isModuleLoaded(moduleFile, state.loadedModules, state.moduleNames, state.moduleFiles)) {
- case LOADED:
- result = true;
- break;
- case NOT_LOADED:
- result = false;
- break;
- case UNKNOWN:
- if (state.suppressUnknownModuleWarnings && LOGGED_UNKNOWN_MODULES.contains(moduleFile)) {
- LOG.debug("Encountered unknown module name in an IfModule directive: " + moduleFile);
- } else {
- LOG.warn("Encountered unknown module name in an IfModule directive: "
- + moduleFile + ". If you are using Apache 2.1 or later, you can try changing the module identifier from the source file to "
- + "the actual module name as used in the LoadModule directive to get rid of this warning.");
- }
- LOGGED_UNKNOWN_MODULES.add(moduleFile);
- continue;
- }
-
- recurseFurther = result != negate;
-
- walker.visitConditionalNode(node, recurseFurther);
- } else if (walker.getName(node).equalsIgnoreCase("<IfDefine")) {
- String define = walker.getValue(node);
- boolean negate = false;
- if (define.startsWith("!")) {
- negate = true;
- define = define.substring(1);
- }
-
- boolean result = state.defines.contains(define);
-
- recurseFurther = result != negate;
-
- walker.visitConditionalNode(node, recurseFurther);
- } else if (walker.getName(node).equalsIgnoreCase("<IfVersion")) {
- //<IfVersion [[!]operator] version> ... </IfVersion>
- //operator: =, ==, >, >=, <, <=, ~
- //version major[.minor[.patch]] or /regex/
- //if operator is ~, the version is assumed regex
- //if operator is omitted, = is assumed
-
- if (isModuleLoaded("mod_version.c", state.loadedModules, state.moduleNames, state.moduleFiles) != ModuleLoadedState.LOADED) {
- LOG.debug("mod_version not loaded and IfVersion directive encountered. Skipping it.");
- continue;
- }
-
- List<String> values = walker.getValues(node);
- String operator = null;
- String version = null;
- boolean negate = false;
- boolean regex = false;
-
- if (values.size() == 0) {
- LOG.warn("Invalid IfVersion directive.");
- continue;
- }
-
- if (values.size() == 1) {
- operator = "=";
- version = values.get(0);
- } else if (values.size() == 2) {
- operator = values.get(0);
- version = values.get(1);
- } else {
- LOG.warn("Too many arguments to a IfVersion directive: " + values);
- continue;
- }
-
- if (operator == null || version == null) {
- LOG.warn("Invalid IfVersion with parameters: " + values);
- continue;
- }
-
- if (operator.charAt(0) == '!') {
- negate = true;
- operator = operator.substring(1);
- }
-
- if ("==".equals(operator)) {
- operator = "=";
- }
-
- if (version.charAt(0) == '/') {
- if ("=".equals(operator) || "~".equals(operator)) {
- regex = true;
- version = version.substring(1, version.length() - 1);
- } else {
- LOG.warn("Unsupported operator " + operator
- + " with regex version comparison in IfVersion directive.");
- continue;
- }
- }
-
- OSGiVersionComparator comp = new OSGiVersionComparator();
-
- boolean result = false;
- if ("=".equals(operator)) {
- if (regex) {
- result = Pattern.matches(version, state.httpdVersion);
- } else {
- result = comp.compare(version, state.httpdVersion) == 0;
- }
- } else if ("~".equals(operator)) {
- result = Pattern.matches(version, state.httpdVersion);
- } else if (">".equals(operator)) {
- result = comp.compare(state.httpdVersion, version) > 0;
- } else if (">=".equals(operator)) {
- result = comp.compare(state.httpdVersion, version) >= 0;
- } else if ("<".equals(operator)) {
- result = comp.compare(state.httpdVersion, version) < 0;
- } else if ("<=".equals(operator)) {
- result = comp.compare(state.httpdVersion, version) <= 0;
- } else {
- LOG.warn("Unknown operator " + operator + " in an IfVersion directive.");
- continue;
- }
-
- recurseFurther = result != negate;
-
- walker.visitConditionalNode(node, recurseFurther);
} else {
- walker.visitOrdinaryNode(node);
- }
-
- if (recurseFurther) {
- transform(walker, node, state);
+ walker.visitConditionalNode(node, result.shouldRecurseIntoConditionalNode);
+ if (result.shouldRecurseIntoConditionalNode) {
+ transform(walker, node, inspector);
+ }
}
}
walker.onAfterChildrenScan(parentNode);
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java
index 4a15b40..74f4e81 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/RuntimeConfigurationTest.java
@@ -94,15 +94,14 @@ public class RuntimeConfigurationTest {
public void testConditionalInclusion() {
MockApacheBinaryInfo binfo = new MockApacheBinaryInfo();
binfo.setVersion("2.2.17");
+ binfo.setRoot(new File(tmpDir, "runtime-config/conditional").getAbsolutePath());
MockProcessInfo pinfo = new MockProcessInfo();
- pinfo.setCommandLine(new String[] {"blahblah", "-D", "DEFINED"});
-
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, new File(tmpDir, "runtime-config/conditional").getAbsolutePath());
- ApacheConfigReader.buildTree(new File(tmpDir, "runtime-config/conditional/httpd.conf").getAbsolutePath(), parser);
-
- tree = RuntimeApacheConfiguration.extract(tree, pinfo, binfo, ApacheServerDiscoveryComponent.MODULE_SOURCE_FILE_TO_MODULE_NAME_20, false);
-
+ pinfo.setCommandLine(new String[] { "blahblah", "-D", "DEFINED" });
+
+ ApacheDirectiveTree tree =
+ ApacheServerDiscoveryComponent.parseRuntimeConfiguration(new File(tmpDir,
+ "runtime-config/conditional/httpd.conf").getAbsolutePath(), pinfo, binfo);
+
List<VhostSpec> vhosts = VhostSpec.detect(tree);
List<VhostSpec> expectedVhosts = new ArrayList<VhostSpec>();
@@ -124,15 +123,14 @@ public class RuntimeConfigurationTest {
public void testInclusionOrder() {
MockApacheBinaryInfo binfo = new MockApacheBinaryInfo();
binfo.setVersion("2.2.17");
+ binfo.setRoot(new File(tmpDir, "runtime-config/incl-order").getAbsolutePath());
MockProcessInfo pinfo = new MockProcessInfo();
- pinfo.setCommandLine(new String[] {"blahblah"});
-
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, new File(tmpDir, "runtime-config/incl-order").getAbsolutePath());
- ApacheConfigReader.buildTree(new File(tmpDir, "runtime-config/incl-order/httpd.conf").getAbsolutePath(), parser);
-
- tree = RuntimeApacheConfiguration.extract(tree, pinfo, binfo, ApacheServerDiscoveryComponent.MODULE_SOURCE_FILE_TO_MODULE_NAME_20, false);
-
+ pinfo.setCommandLine(new String[] { "blahblah" });
+
+ ApacheDirectiveTree tree =
+ ApacheServerDiscoveryComponent.parseRuntimeConfiguration(new File(tmpDir,
+ "runtime-config/incl-order/httpd.conf").getAbsolutePath(), pinfo, binfo);
+
List<ApacheDirective> listens = tree.search("/Listen");
assertEquals(listens.size(), 3, "There should be 3 listen directives");
diff --git a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java
index 19fdb67..fd825c1 100644
--- a/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java
+++ b/modules/plugins/apache/src/test/java/org/rhq/plugins/apache/SnmpMappingTest.java
@@ -101,13 +101,14 @@ public class SnmpMappingTest {
public void testVhostNames() {
MockApacheBinaryInfo binfo = new MockApacheBinaryInfo();
binfo.setVersion("2.2.17");
+ binfo.setRoot(new File(tmpDir, "snmp-mapping").getAbsolutePath());
MockProcessInfo pinfo = new MockProcessInfo();
- pinfo.setCommandLine(new String[] {"blahblah"});
-
- ApacheDirectiveTree tree = new ApacheDirectiveTree();
- ApacheParser parser = new ApacheParserImpl(tree, new File(tmpDir, "snmp-mapping").getAbsolutePath());
- ApacheConfigReader.buildTree(new File(tmpDir, "snmp-mapping/httpd.conf").getAbsolutePath(), parser);
-
+ pinfo.setCommandLine(new String[] { "blahblah" });
+
+ ApacheDirectiveTree tree =
+ ApacheServerDiscoveryComponent.parseRuntimeConfiguration(
+ new File(tmpDir, "snmp-mapping/httpd.conf").getAbsolutePath(), pinfo, binfo);
+
HttpdAddressUtility addrUtil = HttpdAddressUtility.get("2.2.17");
List<ApacheDirective> vhosts = tree.search("/<VirtualHost");
List<String> snmpNames = new ArrayList<String>(vhosts.size() + 1);
commit 4659f2308aa53b24db98a6eb9a4c8f6db310ae3c
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Wed Oct 26 16:11:16 2011 +0200
Formatting
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
index 8b68052..f563ccd 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/parser/ApacheParserImpl.java
@@ -1,3 +1,21 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
package org.rhq.plugins.apache.parser;
import java.io.File;
@@ -5,24 +23,28 @@ import java.util.List;
import org.rhq.augeas.util.Glob;
-public class ApacheParserImpl implements ApacheParser{
+/**
+ *
+ * @author Filip Drabek
+ */
+public class ApacheParserImpl implements ApacheParser {
private final static String INCLUDE_DIRECTIVE = "Include";
private final ApacheDirectiveTree tree;
private ApacheDirectiveStack stack;
private String serverRootPath;
- public ApacheParserImpl(ApacheDirectiveTree tree,String serverRootPath){
- stack = new ApacheDirectiveStack();
- this.serverRootPath = serverRootPath;
- this.tree = tree;
- stack.addDirective(this.tree.getRootNode());
+ public ApacheParserImpl(ApacheDirectiveTree tree, String serverRootPath) {
+ stack = new ApacheDirectiveStack();
+ this.serverRootPath = serverRootPath;
+ this.tree = tree;
+ stack.addDirective(this.tree.getRootNode());
}
-
- public void addDirective(ApacheDirective directive) throws Exception{
- if (directive.getName().equals(INCLUDE_DIRECTIVE)){
+
+ public void addDirective(ApacheDirective directive) throws Exception {
+ if (directive.getName().equals(INCLUDE_DIRECTIVE)) {
List<File> files = getIncludeFiles(directive.getValuesAsString());
- for (File fl : files){
+ for (File fl : files) {
if (fl.exists() && fl.isFile()) {
ApacheConfigReader.searchFile(fl.getAbsolutePath(), this);
}
@@ -32,20 +54,20 @@ public class ApacheParserImpl implements ApacheParser{
stack.getLastDirective().addChildDirective(directive);
}
- public void endNestedDirective(ApacheDirective directive) {
- stack.removeLastDirective();
+ public void endNestedDirective(ApacheDirective directive) {
+ stack.removeLastDirective();
}
public void startNestedDirective(ApacheDirective directive) {
- directive.setParentNode(stack.getLastDirective());
- stack.getLastDirective().addChildDirective(directive);
- stack.addDirective(directive);
+ directive.setParentNode(stack.getLastDirective());
+ stack.getLastDirective().addChildDirective(directive);
+ stack.addDirective(directive);
}
- private List<File> getIncludeFiles(String foundInclude) {
- File check = new File(foundInclude);
+ private List<File> getIncludeFiles(String foundInclude) {
+ File check = new File(foundInclude);
File root = new File(check.isAbsolute() ? Glob.rootPortion(foundInclude) : serverRootPath);
-
+
return Glob.match(root, foundInclude, Glob.ALPHABETICAL_COMPARATOR);
}
}
12 years, 6 months
[rhq] Branch 'feature/metric-tweek' - 41 commits - modules/cli-tests modules/common modules/core modules/enterprise modules/helpers modules/integration-tests modules/plugins modules/pom.xml modules/test-utils pom.xml publish_release.sh release.sh rhq_bash.lib
by mazz
modules/cli-tests/pom.xml | 2
modules/common/ant-bundle/pom.xml | 2
modules/common/drift/pom.xml | 2
modules/common/filetemplate-bundle/pom.xml | 2
modules/common/jboss-as/pom.xml | 2
modules/common/pom.xml | 2
modules/core/client-api/pom.xml | 2
modules/core/comm-api/pom.xml | 2
modules/core/dbutils/pom.xml | 2
modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml | 2
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 1
modules/core/domain/pom.xml | 2
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftDefinitionTemplateCriteria.java | 21 +
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java | 110 +++++++++
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java | 9
modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftSnapshot.java | 19 -
modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java | 4
modules/core/domain/src/main/java/org/rhq/core/domain/util/LDAPStringUtil.java | 100 --------
modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java | 37 +--
modules/core/domain/src/test/java/org/rhq/core/domain/util/LDAPStringUtilTest.java | 48 ----
modules/core/gui/pom.xml | 2
modules/core/native-system/pom.xml | 2
modules/core/plugin-api/pom.xml | 2
modules/core/plugin-container/pom.xml | 2
modules/core/plugin-validator/pom.xml | 2
modules/core/pom.xml | 2
modules/core/util/pom.xml | 2
modules/enterprise/agent/pom.xml | 2
modules/enterprise/agentupdate/pom.xml | 2
modules/enterprise/binding/pom.xml | 4
modules/enterprise/comm/pom.xml | 2
modules/enterprise/gui/base-perspective-jar/pom.xml | 2
modules/enterprise/gui/base-perspective-war/pom.xml | 2
modules/enterprise/gui/content_http-war/pom.xml | 2
modules/enterprise/gui/coregui/pom.xml | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java | 45 +++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java | 18 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemRolesNotificationSenderForm.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemUsersNotificationSenderForm.java | 5
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java | 26 +-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java | 14 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java | 10
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateDataSource.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplatesView.java | 16 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java | 73 ------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java | 61 ++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizard.java | 51 ++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java | 14 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizard.java | 32 --
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java | 18 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java | 32 ++
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java | 18 -
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java | 14 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 12 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 9
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 1
modules/enterprise/gui/coregui/src/main/webapp/images/header/rhq_logo_40px.png |binary
modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png |binary
modules/enterprise/gui/installer-war/pom.xml | 2
modules/enterprise/gui/pom.xml | 2
modules/enterprise/gui/portal-war/pom.xml | 2
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp | 8
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp | 7
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp | 8
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp | 11
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp | 7
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp | 13 -
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp | 10
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp | 8
modules/enterprise/gui/rest-war/pom.xml | 2
modules/enterprise/pom.xml | 2
modules/enterprise/remoting/cli/pom.xml | 2
modules/enterprise/remoting/client-api/pom.xml | 2
modules/enterprise/remoting/client-deps/pom.xml | 2
modules/enterprise/remoting/pom.xml | 2
modules/enterprise/remoting/webservices/pom.xml | 2
modules/enterprise/server/client-api/pom.xml | 4
modules/enterprise/server/container-lib/pom.xml | 2
modules/enterprise/server/container/pom.xml | 2
modules/enterprise/server/ear/pom.xml | 2
modules/enterprise/server/jar/pom.xml | 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java | 16 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java | 29 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java | 40 +--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LDAPStringUtil.java | 100 ++++++++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java | 1
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java | 79 ++++--
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java | 5
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java | 16 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java | 39 +--
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/AvailabilityManagerTest.java | 9
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginService.java | 113 ++++++++++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginServiceMBean.java | 25 ++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LDAPStringUtilTest.java | 50 ++++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/ldap/FakeLdapContext.java | 2
modules/enterprise/server/plugins/alert-cli/pom.xml | 4
modules/enterprise/server/plugins/alert-email/pom.xml | 4
modules/enterprise/server/plugins/alert-irc/pom.xml | 4
modules/enterprise/server/plugins/alert-log4j/pom.xml | 4
modules/enterprise/server/plugins/alert-microblog/pom.xml | 4
modules/enterprise/server/plugins/alert-mobicents/pom.xml | 4
modules/enterprise/server/plugins/alert-operations/pom.xml | 4
modules/enterprise/server/plugins/alert-roles/pom.xml | 4
modules/enterprise/server/plugins/alert-snmp/pom.xml | 4
modules/enterprise/server/plugins/alert-subject/pom.xml | 4
modules/enterprise/server/plugins/ant-bundle/pom.xml | 2
modules/enterprise/server/plugins/cobbler/pom.xml | 4
modules/enterprise/server/plugins/disk/pom.xml | 2
modules/enterprise/server/plugins/drift-rhq/pom.xml | 2
modules/enterprise/server/plugins/filetemplate-bundle/pom.xml | 2
modules/enterprise/server/plugins/groovy-script/pom.xml | 4
modules/enterprise/server/plugins/jboss-software/pom.xml | 2
modules/enterprise/server/plugins/packagetype-cli/pom.xml | 4
modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml | 2
modules/enterprise/server/plugins/perspectives/core/pom.xml | 2
modules/enterprise/server/plugins/pom.xml | 2
modules/enterprise/server/plugins/rhnhosted/pom.xml | 2
modules/enterprise/server/plugins/url/pom.xml | 2
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml | 2
modules/enterprise/server/plugins/yum/pom.xml | 2
modules/enterprise/server/pom.xml | 2
modules/enterprise/server/safe-invoker/pom.xml | 2
modules/enterprise/server/sars/agent-sar/pom.xml | 2
modules/enterprise/server/sars/pom.xml | 2
modules/enterprise/server/xml-schemas/pom.xml | 2
modules/helpers/bundleGen/pom.xml | 4
modules/helpers/perftest-support/pom.xml | 4
modules/helpers/pom.xml | 2
modules/helpers/rtfilter/pom.xml | 2
modules/integration-tests/apache-plugin-test/pom.xml | 2
modules/integration-tests/jboss-as-7-plugin-test/pom.xml | 2
modules/integration-tests/pom.xml | 2
modules/plugins/aliases/pom.xml | 2
modules/plugins/ant-bundle/pom.xml | 2
modules/plugins/apache/pom.xml | 2
modules/plugins/augeas/pom.xml | 2
modules/plugins/byteman/pom.xml | 2
modules/plugins/cobbler/pom.xml | 2
modules/plugins/cron/pom.xml | 2
modules/plugins/database/pom.xml | 2
modules/plugins/filetemplate-bundle/pom.xml | 2
modules/plugins/grub/pom.xml | 2
modules/plugins/hadoop/pom.xml | 2
modules/plugins/hibernate/pom.xml | 2
modules/plugins/hosts/pom.xml | 2
modules/plugins/hudson/pom.xml | 4
modules/plugins/iis/pom.xml | 2
modules/plugins/irc/pom.xml | 2
modules/plugins/jboss-as-5/pom.xml | 2
modules/plugins/jboss-as-7/pom.xml | 2
modules/plugins/jboss-as/pom.xml | 2
modules/plugins/jboss-cache-v3/pom.xml | 2
modules/plugins/jboss-cache/pom.xml | 2
modules/plugins/jmx/pom.xml | 2
modules/plugins/kickstart/pom.xml | 2
modules/plugins/mod-cluster/pom.xml | 2
modules/plugins/mysql/pom.xml | 2
modules/plugins/netservices/pom.xml | 2
modules/plugins/oracle/pom.xml | 2
modules/plugins/pattern-generator/pom.xml | 2
modules/plugins/perftest/pom.xml | 2
modules/plugins/platform/pom.xml | 2
modules/plugins/pom.xml | 4
modules/plugins/postfix/pom.xml | 2
modules/plugins/postgres/pom.xml | 2
modules/plugins/rhq-agent/pom.xml | 2
modules/plugins/rhq-server/pom.xml | 2
modules/plugins/samba/pom.xml | 2
modules/plugins/script/pom.xml | 2
modules/plugins/script2/pom.xml | 2
modules/plugins/snmptrapd/pom.xml | 2
modules/plugins/sshd/pom.xml | 2
modules/plugins/sudoers/pom.xml | 2
modules/plugins/tomcat/pom.xml | 2
modules/plugins/twitter/pom.xml | 2
modules/plugins/validate-all-plugins/pom.xml | 2
modules/plugins/virt/pom.xml | 2
modules/pom.xml | 10
modules/test-utils/pom.xml | 2
pom.xml | 2
publish_release.sh | 67 ++---
release.sh | 90 ++++++-
rhq_bash.lib | 26 ++
197 files changed, 1222 insertions(+), 742 deletions(-)
New commits:
commit 96101e631e5a47b11c5da4390f91967b6a4feb6e
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Oct 25 16:50:19 2011 -0400
[BZ 748474] add a fixed criteria and blank out the search bar. users find this more intuitive.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
index 4365aa0..4c1a348 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
@@ -137,8 +137,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
}, this.globalPermissions.contains(Permission.MANAGE_INVENTORY));
autodiscoveryQueueItem.setRefreshRequired(true);
- // TODO: Specify an icon for this item.
- NavigationItem allResourcesItem = new NavigationItem(PAGE_ALL_RESOURCES, null, new ViewFactory() {
+ NavigationItem allResourcesItem = new NavigationItem(PAGE_ALL_RESOURCES, "resources/all_resources.png", new ViewFactory() {
public Canvas createView() {
return new ResourceSearchView(extendLocatorId(PAGE_ALL_RESOURCES.getName()), null, PAGE_ALL_RESOURCES
.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.PLATFORM, Boolean.TRUE),
@@ -155,7 +154,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_PLATFORMS.getName()),
initialCriteria, PAGE_PLATFORMS.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.PLATFORM,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.PLATFORM.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.PLATFORM.name().toLowerCase());
return view;
}
});
@@ -168,7 +167,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_SERVERS.getName()),
initialCriteria, PAGE_SERVERS.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.SERVER,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase());
return view;
}
});
@@ -181,7 +180,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_SERVICES.getName()),
initialCriteria, PAGE_SERVICES.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.SERVICE,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVICE.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVICE.name().toLowerCase());
return view;
}
});
@@ -195,9 +194,8 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_UNAVAIL_SERVERS.getName()),
initialCriteria, MSG.view_inventory_unavailableServers(), ImageManager.getResourceLargeIcon(
ResourceCategory.SERVER, Boolean.FALSE));
- // TODO (ips, 10/28/10): Should we include down platforms too?
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase()
- + " availability=" + AvailabilityType.DOWN.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase()
+ // + " availability=" + AvailabilityType.DOWN.name().toLowerCase());
return view;
}
});
@@ -231,7 +229,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
extendLocatorId(PAGE_COMPATIBLE_GROUPS.getName()), new Criteria(
ResourceGroupDataSourceField.CATEGORY.propertyName(), GroupCategory.COMPATIBLE.name()),
PAGE_COMPATIBLE_GROUPS.getTitle(), ImageManager.getGroupLargeIcon(GroupCategory.COMPATIBLE));
- view.setInitialSearchBarSearchText("groupCategory=compatible");
+ //view.setInitialSearchBarSearchText("groupCategory=compatible");
return view;
}
});
@@ -242,7 +240,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceGroupListView view = new ResourceGroupListView(extendLocatorId(PAGE_MIXED_GROUPS.getName()),
new Criteria(ResourceGroupDataSourceField.CATEGORY.propertyName(), GroupCategory.MIXED.name()),
PAGE_MIXED_GROUPS.getTitle(), ImageManager.getGroupLargeIcon(GroupCategory.MIXED));
- view.setInitialSearchBarSearchText("groupCategory=mixed");
+ //view.setInitialSearchBarSearchText("groupCategory=mixed");
return view;
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
index 3019d73..9ac2107 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
@@ -127,7 +127,7 @@ public class ResourceSearchView extends Table {
final RPCDataSource<Resource, ResourceCriteria> datasource = getDataSourceInstance();
setDataSource(datasource);
- setInitialCriteriaFixed(false);
+ //setInitialCriteriaFixed(false);
}
// suppress unchecked warnings because the subclasses may have different generic types for the datasource
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png
new file mode 100644
index 0000000..63121fd
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png differ
commit 94f82c50704ec9f3d93b92adad0af5380e31e63a
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Oct 26 12:29:15 2011 -0400
[BZ 745456] catch exceptions in the EventJSON jsp pages so we don't blow up the Timeline component
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
index 40aeac8..b9857c1 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
@@ -37,7 +37,13 @@
criteria.addFilterEndTime(end);
criteria.setPageControl(pc);
- PageList<Alert> alerts = alertManager.findAlertsByCriteria(user.getSubject(), criteria);
+ PageList<Alert> alerts;
+ try {
+ alerts = alertManager.findAlertsByCriteria(user.getSubject(), criteria);
+ } catch (Exception e) {
+ alerts = new PageList<Alert>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
{ "events":
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
index 34baadf..c0f4402 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
@@ -23,8 +23,13 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
- PageList<ResourceConfigurationUpdate> configurationUpdates = configurationManager
+ PageList<ResourceConfigurationUpdate> configurationUpdates;
+ try {
+ configurationUpdates = configurationManager
.findResourceConfigurationUpdates(subject, resourceId, begin, end, true, new PageControl(0,100));
+ } catch (Exception e) {
+ configurationUpdates = new PageList<ResourceConfigurationUpdate>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
index 8edeebe..44515e5 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
@@ -26,8 +26,12 @@
ContentUIManagerLocal contentManager = LookupUtil.getContentUIManager();
- PageList<InstalledPackageHistory> history = contentManager.getInstalledPackageHistoryForResource(resourceId, new PageControl(0,20, new OrderingField("iph.timestamp",PageOrdering.DESC)));
-
+ PageList<InstalledPackageHistory> history;
+ try {
+ history = contentManager.getInstalledPackageHistoryForResource(resourceId, new PageControl(0,20, new OrderingField("iph.timestamp",PageOrdering.DESC)));
+ } catch (Exception e) {
+ history = new PageList<InstalledPackageHistory>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
index 114baf0..3951f1d 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
@@ -24,8 +24,15 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ResourceFactoryManagerLocal resourceFactoryManager = LookupUtil.getResourceFactoryManager();
- PageList<CreateResourceHistory> creates = resourceFactoryManager.findCreateChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
- PageList<DeleteResourceHistory> deletes = resourceFactoryManager.findDeleteChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ PageList<CreateResourceHistory> creates;
+ PageList<DeleteResourceHistory> deletes;
+ try {
+ creates = resourceFactoryManager.findCreateChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ deletes = resourceFactoryManager.findDeleteChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ } catch (Exception e) {
+ creates = new PageList<CreateResourceHistory>(0, PageControl.getUnlimitedInstance());
+ deletes = new PageList<DeleteResourceHistory>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
index b2f42fb..f283a99 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
@@ -27,7 +27,12 @@
criteria.addFilterResourceId(resourceId);
criteria.addFilterCreatedAfter(begin);
criteria.addFilterCreatedBefore(end);
- PageList<? extends DriftChangeSet<?>> results = driftManager.findDriftChangeSetsByCriteria(subject, criteria);
+ PageList<? extends DriftChangeSet<?>> results;
+ try {
+ results = driftManager.findDriftChangeSetsByCriteria(subject, criteria);
+ } catch (Exception e) {
+ results = new PageList(0, PageControl.getUnlimitedInstance());
+ }
%>
{ "events": [
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
index d14ab93..62d9a07 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
@@ -32,9 +32,14 @@
boolean tooManyEvents = false;
- PageList<EventComposite> list =
- eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
+ PageList<EventComposite> list;
+ try {
+ list = eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
null, null, new PageControl(0,10000, new OrderingField("timestamp", PageOrdering.ASC)));
+ } catch (Exception e) {
+ list = new PageList<EventComposite>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
<%! public String trimLength(String string, int length) {
@@ -154,14 +159,14 @@
if (grouped) {
link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History";
} else {
- link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
+ link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
}
String detail = null;
if (grouped) {
StringBuilder buf = new StringBuilder();
for (EventComposite childEvent : ((GroupedEventComposite)event).events) {
- String childColor = eventColor(childEvent.getSeverity());
+ String childColor = eventColor(childEvent.getSeverity());
buf.append("<a href='/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + childEvent.getEventId() + "'>");
buf.append("<font color=\"" + childColor + "\">" + escapeBackslashes(trimLength(childEvent.getEventDetail(),80)) + "</font></a><br />");
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
index 49fd1cb..04d3c11 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
@@ -24,8 +24,14 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
OperationManagerLocal operationManager = LookupUtil.getOperationManager();
- PageList<ResourceOperationHistory> operations = operationManager.findCompletedResourceOperationHistories(
- subject, resourceId, begin, end, new PageControl(0,100));
+ PageList<ResourceOperationHistory> operations;
+ try {
+ operations = operationManager.findCompletedResourceOperationHistories(
+ subject, resourceId, begin, end, new PageControl(0,100));
+ } catch (Exception e) {
+ operations = new PageList<ResourceOperationHistory>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
{ "events": [
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
index 17683c7..fe66e5e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
@@ -22,7 +22,13 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
- PageList<PluginConfigurationUpdate> configurationUpdates = configurationManager.findPluginConfigurationUpdates(subject, resourceId, begin, end, new PageControl(0,100));
+ PageList<PluginConfigurationUpdate> configurationUpdates;
+ try {
+ configurationUpdates = configurationManager.findPluginConfigurationUpdates(subject, resourceId, begin, end, new PageControl(0,100));
+ } catch (Exception e) {
+ configurationUpdates = new PageList<PluginConfigurationUpdate>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
commit 49564f7bc2b834721c0ed6ecc0ef7aa57d99dcb0
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Oct 27 12:23:23 2011 -0400
[BZ 749560] make it clear that "deleting" bundle entities only removes them from the DB, the remote content is not purged.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index e69994e..dd0902e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -957,7 +957,7 @@ view_bundle_createWizard_uploadStepName = Upload Bundle Files
view_bundle_createWizard_urlOption = URL
view_bundle_createWizard_windowTitle = Bundle Creation Wizard
view_bundle_createWizard_youMustChooseOne = You must choose one option in order to create a bundle!
-view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted.
+view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted. However, this will not remove any content from remote machines.
view_bundle_deploy = Deploy
view_bundle_deployDir = Deploy Directory
view_bundle_deployWizard_deployStep = Deploy Bundle to Destination Platforms
@@ -1011,7 +1011,7 @@ view_bundle_deployWizard_title = Bundle Deployment Wizard
view_bundle_deploy_action = Action
view_bundle_deploy_backButton = Back to Destination
view_bundle_deploy_clickForError = Click the icon for the error message
-view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment?
+view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment? This only deletes it from the database; all bundle content that was deployed on remote machines will remain.
view_bundle_deploy_deleteFailure = Failed to delete the bundle deployment [{0}]
view_bundle_deploy_deleteSuccessful = You successfully deleted the bundle deployment [{0}]
view_bundle_deploy_deployedBy = Deployed By
@@ -1054,7 +1054,7 @@ view_bundle_fileListView_sha256 = SHA256
view_bundle_files = Files
view_bundle_latestVersion = Latest Version
view_bundle_list_backToAll = Back to All Bundles
-view_bundle_list_deleteConfirm = Are you sure you want to delete the selected bundles?
+view_bundle_list_deleteConfirm = Are you sure you want to delete the selected bundles? This will delete all of their versions, destinations and deployments from the database. However, this will not remove any content from remote machines.
view_bundle_list_deleteFailure = Failed to delete the bundle [{0}]
view_bundle_list_deleteSuccessful = You successfully deleted the bundle [{0}]
view_bundle_list_deletesFailure = Failed to delete the bundles
@@ -1099,7 +1099,7 @@ view_bundle_tree_loadFailure = Failed to load bundle data
view_bundle_version_backToBundle = Back to Bundle
view_bundle_version_bundleVersionTagUpdateFailure = Failed to update bundle version tags
view_bundle_version_bundleVersionTagUpdateSuccessful = You have successfully updated the bundle version tags
-view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version?
+view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version? This will not remove any content from remote machines.
view_bundle_version_deleteFailure = Failed to delete the bundle version [{0}]
view_bundle_version_deleteSuccessful = You successfully deleted the bundle version [{0}]
view_bundle_version_loadFailure = Failed to load bundle version
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 1f42dfc..be8be01 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -839,6 +839,7 @@ view_bundle_createWizard_uploadStepName = Bundle-Dateien hochladen
view_bundle_createWizard_urlOption = URL
##view_bundle_createWizard_windowTitle = Bundle Creation Wizard
##view_bundle_createWizard_youMustChooseOne = You must choose one option in order to create a bundle!
+##view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted. However, this will not remove any content from remote machines.
view_bundle_deploy = Deploy
view_bundle_deployDir = Deploy-Verzeichnis
view_bundle_deployWizard_deployStep = Bundle auf die Zielplattformen deployen
@@ -888,6 +889,11 @@ view_bundle_deployWizard_getOptions_deployTime = Deployment-Zeitpunkt
##view_bundle_deployWizard_title = Bundle Deployment Wizard
view_bundle_deploy_action = Aktion
view_bundle_deploy_backButton = Zurück zum Ziel
+##view_bundle_deploy_clickForError = Click the icon for the error message
+##view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment? This only deletes it from the database; all bundle content that was deployed on remote machines will remain.
+##view_bundle_deploy_deleteFailure = Failed to delete the bundle deployment [{0}]
+##view_bundle_deploy_deleteSuccessful = You successfully deleted the bundle deployment [{0}]
+##view_bundle_deploy_deployedBy = Deployed By
##view_bundle_deploy_deploymentPlatforms = Deployment Resource
##view_bundle_deploy_installDetails = Install Details
##view_bundle_deploy_loadBundleFailure = Failed to find bundle
@@ -961,6 +967,9 @@ view_bundle_revert = Zurückrollen
view_bundle_version_backToBundle = Zurück zum Bundle
##view_bundle_version_bundleVersionTagUpdateFailure = Failed to update bundle version tags
##view_bundle_version_bundleVersionTagUpdateSuccessful = You have successfully updated the bundle version tags
+##view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version? This will not remove any content from remote machines.
+##view_bundle_version_deleteFailure = Failed to delete the bundle version [{0}]
+##view_bundle_version_deleteSuccessful = You successfully deleted the bundle version [{0}]
##view_bundle_version_loadFailure = Failed to load bundle version
view_bundle_versions = Versionen
##view_configCompare_comparingConfigs = Comparing Configurations
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index bffa78a..3050a0f 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -1012,7 +1012,6 @@ view_bundle_deploy_loadBundleFailure = バンドルの検索に失敗しまし
view_bundle_deploy_loadDeployFailure = バンドルデプロイのロードに失敗しました
view_bundle_deploy_loadFailure = バンドルデプロイのロードに失敗しました
view_bundle_deploy_name = デプロイ名
-view_bundle_deploy_operatingSystem = オペレーティングシステム
view_bundle_deploy_selectARow = インストールの詳細を表示するために行を選択してください
view_bundle_deploy_tagUpdateFailure = バンドルデプロイタブの更新に失敗しました
view_bundle_deploy_tagUpdateSuccessful = バンドルデプロイタグの更新に成功しました
commit c65f9cf713b010c97475359eba641ffa0569aefc
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Oct 31 07:39:27 2011 -0500
Add tag override to the release script to replace an existing tag with this new one.
diff --git a/release.sh b/release.sh
index 65a9596..8b48df2 100755
--- a/release.sh
+++ b/release.sh
@@ -62,6 +62,9 @@ USAGE: release.sh OPTIONS
--debug=[true|false] [OPTIONAL]
Set maven in debug mode. Default is false; true if option specified without argument.
+ --override-tag=[true|false]
+ Override the tag if it already exists remotely. Default is false; true if option specified without argument.
+
EOF
)
@@ -84,9 +87,10 @@ parse_and_validate_options()
SCM_STRATEGY="tag"
EXTRA_MAVEN_PROFILE=
DEBUG_MODE=false
+ OVERRIDE_TAG=false
short_options="h"
- long_options="help,release-version:,development-version:,release-branch:,release-type:,test-mode,production-mode,mode:,branch,tag,scm-strategy:,extra-profile:,debug::"
+ long_options="help,release-version:,development-version:,release-branch:,release-type:,test-mode,production-mode,mode:,branch,tag,scm-strategy:,extra-profile:,debug::,override-tag::"
PROGNAME=${0##*/}
ARGS=$(getopt -s bash --options $short_options --longoptions $long_options --name $PROGNAME -- "$@" )
@@ -169,6 +173,28 @@ parse_and_validate_options()
;;
esac
;;
+ --override-tag)
+ shift
+ case "$1" in
+ true)
+ OVERRIDE_TAG=true
+ shift
+ ;;
+ false)
+ OVERRIDE_TAG=false
+ shift
+ ;;
+ "")
+ OVERRIDE_TAG=true
+ shift
+ ;;
+ *)
+ OVERRIDE_TAG=false
+ shift
+ ;;
+ esac
+ ;;
+
--)
shift
break
@@ -322,9 +348,14 @@ run_release_version_and_tag_process()
# 7) Commit the change in version (if everything went well so far then this is a good tag)
git add -u
git commit -m "tag $RELEASE_TAG"
-
+
# 8) Tag the current source
- git tag "$RELEASE_TAG"
+ if [ "$OVERRIDE_TAG" ];
+ then
+ git tag --force "$RELEASE_TAG"
+ else
+ git tag "$RELEASE_TAG"
+ fi
# 9) If everything went well so far than means all the changes can be pushed!!!
git push origin "$BUILD_BRANCH"
@@ -364,7 +395,12 @@ verify_tags()
EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"`
if [ -n "$EXISTING_REMOTE_TAG" ];
then
- abort "A remote tag named $RELEASE_TAG already exists - aborting"
+ if[ "$OVERRIDE_TAG" ];
+ then
+ echo "A remote tag named $RELEASE_TAG already exists, but will be overriden."
+ else
+ abort "A remote tag named $RELEASE_TAG already exists - aborting"
+ fi
fi
# See if the specified tag already exists locally - if so, delete it (even if in production mode).
commit f41888af3d54bca114c1f15d1e48087835e74690
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Sat Oct 29 06:43:18 2011 -0500
Avoid having the settings file wiped out because of git clean commands.
diff --git a/publish_release.sh b/publish_release.sh
index 3eb6c98..3720a6b 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -53,7 +53,7 @@ set_variables()
echo "We appear to be running in a Hudson job."
WORKING_DIR="$WORKSPACE"
MAVEN_LOCAL_REPO_DIR="$WORKSPACE/.m2/repository"
- #MAVEN_SETTINGS_FILE="$HOME/.m2/hudson-$JOB_NAME-settings.xml"
+ MAVEN_SETTINGS_FILE="$WORKSPACE/.m2/settings.xml"
elif [ -z "$WORKING_DIR" ]; then
WORKING_DIR="$HOME/release/rhq"
MAVEN_LOCAL_REPO_DIR="$HOME/release/m2-repository"
@@ -61,7 +61,7 @@ set_variables()
MAVEN_SETTINGS_FILE="$HOME/release/m2-settings.xml"
fi
- MAVEN_SETTINGS_FILE="$WORKSPACE/settings.xml"
+ #MAVEN_SETTINGS_FILE="$WORKSPACE/settings.xml"
PROJECT_GIT_URL="git://git.fedorahosted.org/rhq/rhq.git"
commit cbe421b556347db94b6828bbb86be02ea2ce771b
Author: Hudson <jboss-qa-internal(a)redhat.com>
Date: Fri Oct 28 19:02:37 2011 -0400
development RHQ_4.3.0-SNAPSHOT
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index b080025..3a5f116 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 13cd80a..550ddfd 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index a5c0981..6a9bcf2 100644
--- a/modules/common/drift/pom.xml
+++ b/modules/common/drift/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-common-drift</artifactId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index 6273a4f..d645c7a 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-filetemplate-bundle-common</artifactId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index dfd8e5a..a999e68 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index bd88fa0..d7eedff 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 9f5f66a..c0ca9be 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 5a8b356..7eab16a 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index aa20853..dd75181 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index bd0fdb4..164f5ad 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index bb4dc2c..e2b1d14 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 4a24392..151521d 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 6b633bb..e01941d 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 25ae021..9718b0e 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-container</artifactId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index f2953a6..c143c00 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 62a73be..002912b 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index d388ca8..11efd74 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 199a996..88827a8 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 8b7ffe8..83aefb4 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index a6d3985..798353c 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Script Bindings</name>
<description>Abstraction of different facilities and default configurations for script bindings</description>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index f424704..af241d2 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index cebd439..ce48f40 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index b66da2c..e47afba 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml
index db7d757..e0c53c8 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index afb2fec..cecb704 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 900d476..0e65e6a 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index ecb02d5..bfac4e7 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml
index 4e2ac9f..6c48f27 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-war/pom.xml b/modules/enterprise/gui/rest-war/pom.xml
index 9ab5090..e828fbf 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 01fb7f6..2627ebf 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 24fbb60..d2990f3 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml
index bacb64b..344f171 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml b/modules/enterprise/remoting/client-deps/pom.xml
index 3fe07b7..d3dcb79 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index f4b1866..70333b1 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index dee43bc..28a0f43 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/client-api/pom.xml b/modules/enterprise/server/client-api/pom.xml
index c57eaba..e777e21 100644
--- a/modules/enterprise/server/client-api/pom.xml
+++ b/modules/enterprise/server/client-api/pom.xml
@@ -5,13 +5,13 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Client API</name>
<description>The implementation of the client API when accessing the server locally</description>
diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index 1aebae1..2139374 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index 8b3a73a..1e55e08 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 18a7436..32ce3d3 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index f0e2b36..c8a2707 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/alert-cli/pom.xml b/modules/enterprise/server/plugins/alert-cli/pom.xml
index b380393..3d64b03 100644
--- a/modules/enterprise/server/plugins/alert-cli/pom.xml
+++ b/modules/enterprise/server/plugins/alert-cli/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Script Alert Plugin</name>
<description>An alert sender able to execute an arbitrary CLI script as a response to an alert</description>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml
index e1e1890..103f28f 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml
index c38aff4..a63eeaf 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-log4j/pom.xml b/modules/enterprise/server/plugins/alert-log4j/pom.xml
index 1a27831..4bfdad5 100644
--- a/modules/enterprise/server/plugins/alert-log4j/pom.xml
+++ b/modules/enterprise/server/plugins/alert-log4j/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Log4J Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index 8574c9f..d9f7e6e 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 0adccaf..3a50667 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 2c9bcfa..0fe30c2 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 06bab65..86907a4 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index bdee60f..8d255a1 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml
index bb595b5..8ba0b56 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 26f4409..65eccd7 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml
index bdfe647..be0f5ef 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml
index 403ef41..17ca168 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-rhq/pom.xml b/modules/enterprise/server/plugins/drift-rhq/pom.xml
index 9c9d3b6..9100ee7 100644
--- a/modules/enterprise/server/plugins/drift-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/drift-rhq/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 8cae6d5..936f60d 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 83bb64a..742e49c 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index dacaec2..327171a 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/packagetype-cli/pom.xml b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
index 9a51242..de0163a 100644
--- a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
+++ b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index f73ecb8..94a0f6c 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index c2d5c7e..34e879a 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 3fa05d3..1e7d64d 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 04df0b8..4dff432 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index 79ccf2b..6669606 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 9e221a0..1cfef10 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml
index ce8468c..d24447a 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 517be69..fed4410 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 05cb339..22faa19 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 00344d4..9d67aa1 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 2377858..0b54ce9 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index 90c0da6..b071f6f 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 9e80f1f..9be012c 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index e488bb0..3b75eec 100644
--- a/modules/helpers/perftest-support/pom.xml
+++ b/modules/helpers/perftest-support/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>Performance Testing Support</name>
<description>To support performance testing, this is a basic tool to support extracting and later reimporting of
data from/to a database.
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 0c73fd3..92da29b 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 417a3df..93928a6 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml b/modules/integration-tests/apache-plugin-test/pom.xml
index 206a7a7..9feecf3 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jboss-as-7-plugin-test/pom.xml b/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
index 95c697b..2744b37 100644
--- a/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
+++ b/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-integration-tests</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 1b41b08..277fdc3 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index d983b6a..270330d 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index c62f40e..0c5505d 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 95ab8f8..e5d95e2 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index ff7d21f..f8e88f8 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 5037c78..331acc2 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index cb99a8c..9c12590 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 370b2de..d2c9331 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 6c1812b..a9be07c 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index 700e775..1d6f220 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index d197727..f964998 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index 840e619..af68966 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 08f6555..6c647fb 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 0c7ec29..33eee7a 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index b097071..fd0b274 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 2cdc32a..d3eaebb 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 3632ceb..506ffeb 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index aba88a7..cfd2e9c 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index 389eba3..826861b 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index 3e3432d..bd22e2f 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml
index 56efc5b..84d7f79 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index ae06793..30ee17f 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index e042824..989825b 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index dc87ed7..bcbb309 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 3a6deaa..7364fe3 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 835c57b..4919620 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 970f3ed..8b00d6a 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index ea74b9f..deb44d3 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 6b0791d..eb40cae 100644
--- a/modules/plugins/pattern-generator/pom.xml
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 63dd974..670f437 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 003e77e..87206a7 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 0a74452..3fd1b88 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 2a0eb28..dc905e9 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index d70ba83..d3ad8ac 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 19776c2..27aa74e 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index b1c3d22..0d72160 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 90337ed..cdb7869 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index d31afb9..c1b3fb2 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index e218ca8..472c868 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index a52a978..8317bdc 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 3a1df45..649d707 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 78ad464..ecf8343 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 1ae57af..01b7c6e 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index a13f91c..be036d3 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml
index 6565a7b..b83736c 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index e2fb957..116bbe5 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 5131fdc..f802f23 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 5c6e85c..0b19530 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 45a9c14..040e7e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 1a84eb70bac0fd6cc7a211ca90622620dc329462
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Oct 28 17:02:55 2011 -0400
[BZ 749415] Making the pinned field editable
When editing a definition created from an unpinned template the pinned
field in the editor should be editable.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
index c2398e1..4337010 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
@@ -184,7 +184,7 @@ public class DriftConfigurationDefinition implements Serializable {
INSTANCE_FOR_EXISTING_CONFIGS.put(createExcludes(INSTANCE_FOR_EXISTING_CONFIGS, true));
INSTANCE_FOR_EXISTING_CONFIGS.put(createExcludes(INSTANCE_FOR_EXISTING_CONFIGS, true));
INSTANCE_FOR_EXISTING_CONFIGS.put(createAttached(INSTANCE_FOR_EXISTING_CONFIGS, false));
- INSTANCE_FOR_EXISTING_CONFIGS.put(createPinned(INSTANCE_FOR_EXISTING_CONFIGS, true));
+ INSTANCE_FOR_EXISTING_CONFIGS.put(createPinned(INSTANCE_FOR_EXISTING_CONFIGS, false));
NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createName(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE, false));
commit 9019fab386213a9dfcd675d40c9a9b372d672bd2
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Oct 28 15:24:57 2011 -0400
fixing failing tests
Tests in AvailabilityManagerTest were failing because of a call in
AgentManagerBean to load the system settings. A list of the drift server
plugins is stored as part of the system settings. To obtain that list
SystemManagerBean attempts to access DriftServerPluginContainer via the
server plugin service.
I have supplied AvailabilityManagerTest with a stubbed out server plugin
service so that the SystemManagerBean is able to load the default
settings without error.
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/AvailabilityManagerTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/AvailabilityManagerTest.java
index 37c5992..3fbc4f7 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/AvailabilityManagerTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/AvailabilityManagerTest.java
@@ -73,6 +73,8 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
private Availability availability2;
private Availability availability3;
+ private DriftServerPluginService driftServerPluginService;
+
@BeforeMethod
public void beforeMethod() {
try {
@@ -83,6 +85,11 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
this.resourceManager = LookupUtil.getResourceManager();
this.overlord = LookupUtil.getSubjectManager().getOverlord();
additionalResources = new ArrayList<Resource>();
+
+ driftServerPluginService = new DriftServerPluginService();
+ prepareCustomServerPluginService(driftServerPluginService);
+ driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
+ driftServerPluginService.startMasterPluginContainer();
} catch (Throwable t) {
// Catch RuntimeExceptions and Errors and dump their stack trace, because Surefire will completely swallow them
// and throw a cryptic NPE (see http://jira.codehaus.org/browse/SUREFIRE-157)!
@@ -131,6 +138,8 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
finally {
unprepareScheduler();
+ unprepareServerPluginService();
+ driftServerPluginService.stopMasterPluginContainer();
}
}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginService.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginService.java
new file mode 100644
index 0000000..b20155a
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginService.java
@@ -0,0 +1,113 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.measurement.test;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.rhq.core.domain.plugin.PluginKey;
+import org.rhq.core.domain.plugin.ServerPlugin;
+import org.rhq.enterprise.server.plugin.pc.AbstractTypeServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainerConfiguration;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginEnvironment;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginManager;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginService;
+import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginContainer;
+import org.rhq.enterprise.server.plugin.pc.drift.DriftServerPluginManager;
+import org.rhq.enterprise.server.xmlschema.generated.serverplugin.ServerPluginDescriptorType;
+
+public class DriftServerPluginService extends ServerPluginService implements DriftServerPluginServiceMBean {
+
+ public TestMasterServerPluginContainer master;
+ public MasterServerPluginContainerConfiguration masterConfig;
+
+ public DriftServerPluginService() {
+ // build the config at constructor time so tests have it even before the PC is initialized
+ File dir = new File(System.getProperty("java.io.tmpdir"), "test-server-plugins");
+ this.masterConfig = new MasterServerPluginContainerConfiguration(dir, dir, dir, null);
+ }
+
+ @Override
+ public MasterServerPluginContainer createMasterPluginContainer() {
+ this.master = new TestMasterServerPluginContainer();
+ this.master.initialize(this.masterConfig);
+ return this.master;
+ }
+
+ class TestMasterServerPluginContainer extends MasterServerPluginContainer {
+ @Override
+ protected ClassLoader createRootServerPluginClassLoader() {
+ return getClass().getClassLoader();
+ }
+
+ @Override
+ protected Map<URL, ? extends ServerPluginDescriptorType> preloadAllPlugins() throws Exception {
+ return Collections.emptyMap();
+ }
+
+ @Override
+ protected List<PluginKey> getDisabledPluginKeys() {
+ // in the real world, the db is checked for enable flag, here we say all plugins are enabled
+ return new ArrayList<PluginKey>();
+ }
+
+ @Override
+ protected List<AbstractTypeServerPluginContainer> createPluginContainers() {
+ ArrayList<AbstractTypeServerPluginContainer> pcs = new ArrayList<AbstractTypeServerPluginContainer>(1);
+ DriftServerPluginContainer driftPC = new TestDriftServerPluginContainer(this);
+ pcs.add(driftPC);
+
+ return pcs;
+ }
+ }
+
+ class TestDriftServerPluginContainer extends DriftServerPluginContainer {
+ public TestDriftServerPluginContainer(MasterServerPluginContainer master) {
+ super(master);
+ }
+
+ @Override
+ protected ServerPluginManager createPluginManager() {
+ return new TestDriftServerPluginManager(this);
+ }
+ }
+
+ class TestDriftServerPluginManager extends DriftServerPluginManager {
+ public TestDriftServerPluginManager(DriftServerPluginContainer pc) {
+ super(pc);
+ }
+
+ @Override
+ public Collection<ServerPluginEnvironment> getPluginEnvironments() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ protected ServerPlugin getPlugin(ServerPluginEnvironment env) {
+ return null;
+ }
+ }
+}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginServiceMBean.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginServiceMBean.java
new file mode 100644
index 0000000..8473cf0
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginServiceMBean.java
@@ -0,0 +1,25 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.measurement.test;
+
+import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
+
+public interface DriftServerPluginServiceMBean extends ServerPluginServiceManagement {
+}
commit b3a6c8da4a5cee195a87214b1088e1cd7bc3329e
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Oct 28 11:38:27 2011 -0400
[BZ 749824] fix login logo so it isn't clipped. we now have two logo files - one 40px high and the other 28px high (40 for login screen, 28 for top menu bar)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
index 82e2d93..d691e0e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LoginView.java
@@ -35,7 +35,6 @@ import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.FormErrorOrientation;
-import com.smartgwt.client.types.ImageStyle;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.HTMLFlow;
import com.smartgwt.client.widgets.IButton;
@@ -121,14 +120,11 @@ public class LoginView extends LocatableCanvas {
form.setErrorOrientation(FormErrorOrientation.BOTTOM);
// NOTE: This image will either be an RHQ logo or a JON logo.
- Img logoImg = new Img("header/rhq_logo_28px.png");
- // NOTE: Don't explicitly specify a width, so the width will be scaled proportionally to the height.
- logoImg.setImageType(ImageStyle.NORMAL);
- logoImg.setImageHeight(40);
+ // but must be 80x40
+ Img logoImg = new Img("header/rhq_logo_40px.png", 80, 40);
CanvasItem logo = new CanvasItem();
logo.setShowTitle(false);
- logo.setHeight(logoImg.getImageHeight() + 4);
logo.setCanvas(logoImg);
HeaderItem header = new HeaderItem();
@@ -334,8 +330,7 @@ public class LoginView extends LocatableCanvas {
public void onFailure(Throwable caught) {
inputForm.setFieldErrors(FIRST, MSG.view_login_noLdap(), true);
- Log
- .debug("Optional LDAP detail retrieval did not succeed. Registration prepopulation will not occur.");
+ Log.debug("Optional LDAP detail retrieval did not succeed. Registration prepopulation will not occur.");
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
index 3bd11d2..7f14273 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/menu/MenuBarView.java
@@ -18,11 +18,13 @@
*/
package org.rhq.enterprise.gui.coregui.client.menu;
+import java.util.HashMap;
+import java.util.Map;
+
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.History;
import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.types.ImageStyle;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Canvas;
@@ -47,9 +49,6 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHStack;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableLabel;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* @author Greg Hinkle
* @author Joseph Marques
@@ -104,11 +103,8 @@ public class MenuBarView extends LocatableVLayout {
HLayout logoSection = new HLayout();
logoSection.setOverflow(Overflow.VISIBLE);
- // NOTE: This image will either be an RHQ logo or a JON logo.
- Img logo = new Img("header/rhq_logo_28px.png");
- // NOTE: Don't explicitly specify a width, so the width will be scaled proportionally to the height.
- logo.setImageType(ImageStyle.NORMAL);
- logo.setImageHeight(28);
+ // NOTE: This image will either be an RHQ logo or a JON logo, but must be 80x28
+ Img logo = new Img("header/rhq_logo_28px.png", 80, 28);
logo.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
aboutModalWindow.show();
@@ -136,7 +132,7 @@ public class MenuBarView extends LocatableVLayout {
lineLabel.setAlign(Alignment.CENTER);
String contents = "<a href='#" + LOGOUT_VIEW_ID.getName() + "' style='white-space: nowrap'>"
- + LOGOUT_VIEW_ID.getTitle() + "</a>";
+ + LOGOUT_VIEW_ID.getTitle() + "</a>";
LocatableLabel logoutLink = new LocatableLabel(this.extendLocatorId("LogoutLink"), contents);
logoutLink.setAutoWidth();
@@ -167,7 +163,7 @@ public class MenuBarView extends LocatableVLayout {
linkVLayout.setAlign(VerticalAlignment.CENTER);
String contents = "<a class='menuBar' href='#" + sectionName.getName() + "'>" + sectionName.getTitle()
- + "</a>";
+ + "</a>";
LocatableLabel link = new LocatableLabel(extendLocatorId(sectionName.getName()), contents);
link.setAutoHeight();
link.setAlign(Alignment.CENTER);
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/header/rhq_logo_40px.png b/modules/enterprise/gui/coregui/src/main/webapp/images/header/rhq_logo_40px.png
new file mode 100644
index 0000000..16eb22e
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/header/rhq_logo_40px.png differ
commit e8e80ae63b1505d9952894accc8cf3737387d386
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Oct 28 10:26:54 2011 -0400
fix ordering of modules so a clean mvn install can be done from the root dir
without having to build certain individual modules separately first
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f32159e..0a74452 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -106,8 +106,8 @@
<modules>
<!-- core plugins -->
<module>platform</module>
- <module>rhq-agent</module>
<module>jmx</module>
+ <module>rhq-agent</module>
</modules>
<profiles>
diff --git a/modules/pom.xml b/modules/pom.xml
index c846655..5131fdc 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -24,6 +24,10 @@
<properties>
</properties>
+ <modules>
+ <module>test-utils</module>
+ </modules>
+
<profiles>
<profile>
@@ -168,7 +172,5 @@
</profile>
</profiles>
- <modules>
- <module>test-utils</module>
- </modules>
</project>
+
commit 8289307ab638f7d138aa853c0f08248561c62323
Author: John Sanda <jsanda(a)redhat.com>
Date: Fri Oct 28 10:18:52 2011 -0400
Temporarily disabling drift tests due to test dependency issue
There is a dependency issue in drift tests where tests need a drift
server plugin, but the plugins are not built until after server/jar.
Temporarily disabling tests so we can get a release build. A fix for the
problem is in progress.
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index f5ba55f..f0e2b36 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -610,6 +610,7 @@ Build-OS-Version=${os.version}
<excludes>
<exclude>com/**/*.java</exclude>
<exclude>org/rhq/**/performance/**/*.java</exclude>
+ <exclude>**/drift/*.java</exclude>
</excludes>
<excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
<groups>${rhq.testng.includedGroups}</groups>
commit 88ada0fc9fa943d7f9d597f22c235daac5140e8c
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Fri Oct 28 09:13:30 2011 -0500
Revert "development RHQ_4.3.0-SNAPSHOT"
This reverts commit ef0818dff9a528b71ac354ae1968077118037751.
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index 3a5f116..b080025 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 550ddfd..13cd80a 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index 6a9bcf2..a5c0981 100644
--- a/modules/common/drift/pom.xml
+++ b/modules/common/drift/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-common-drift</artifactId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index d645c7a..6273a4f 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-filetemplate-bundle-common</artifactId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index a999e68..dfd8e5a 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index d7eedff..bd88fa0 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index c0ca9be..9f5f66a 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 7eab16a..5a8b356 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index dd75181..aa20853 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 164f5ad..bd0fdb4 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index e2b1d14..bb4dc2c 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 151521d..4a24392 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index e01941d..6b633bb 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 9718b0e..25ae021 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-container</artifactId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index c143c00..f2953a6 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 002912b..62a73be 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 11efd74..d388ca8 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 88827a8..199a996 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 83aefb4..8b7ffe8 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index 798353c..a6d3985 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Script Bindings</name>
<description>Abstraction of different facilities and default configurations for script bindings</description>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index af241d2..f424704 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index ce48f40..cebd439 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index e47afba..b66da2c 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml
index e0c53c8..db7d757 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index cecb704..afb2fec 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 0e65e6a..900d476 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index bfac4e7..ecb02d5 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml
index 6c48f27..4e2ac9f 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-war/pom.xml b/modules/enterprise/gui/rest-war/pom.xml
index e828fbf..9ab5090 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 2627ebf..01fb7f6 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index d2990f3..24fbb60 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml
index 344f171..bacb64b 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml b/modules/enterprise/remoting/client-deps/pom.xml
index d3dcb79..3fe07b7 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 70333b1..f4b1866 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index 28a0f43..dee43bc 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/client-api/pom.xml b/modules/enterprise/server/client-api/pom.xml
index e777e21..c57eaba 100644
--- a/modules/enterprise/server/client-api/pom.xml
+++ b/modules/enterprise/server/client-api/pom.xml
@@ -5,13 +5,13 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Client API</name>
<description>The implementation of the client API when accessing the server locally</description>
diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index 2139374..1aebae1 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index 1e55e08..8b3a73a 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 32ce3d3..18a7436 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index 7206726..f5ba55f 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/alert-cli/pom.xml b/modules/enterprise/server/plugins/alert-cli/pom.xml
index 3d64b03..b380393 100644
--- a/modules/enterprise/server/plugins/alert-cli/pom.xml
+++ b/modules/enterprise/server/plugins/alert-cli/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Script Alert Plugin</name>
<description>An alert sender able to execute an arbitrary CLI script as a response to an alert</description>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml
index 103f28f..e1e1890 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml
index a63eeaf..c38aff4 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-log4j/pom.xml b/modules/enterprise/server/plugins/alert-log4j/pom.xml
index 4bfdad5..1a27831 100644
--- a/modules/enterprise/server/plugins/alert-log4j/pom.xml
+++ b/modules/enterprise/server/plugins/alert-log4j/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Log4J Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index d9f7e6e..8574c9f 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 3a50667..0adccaf 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 0fe30c2..2c9bcfa 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 86907a4..06bab65 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index 8d255a1..bdee60f 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml
index 8ba0b56..bb595b5 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 65eccd7..26f4409 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml
index be0f5ef..bdfe647 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml
index 17ca168..403ef41 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-rhq/pom.xml b/modules/enterprise/server/plugins/drift-rhq/pom.xml
index 9100ee7..9c9d3b6 100644
--- a/modules/enterprise/server/plugins/drift-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/drift-rhq/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 936f60d..8cae6d5 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 742e49c..83bb64a 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 327171a..dacaec2 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/packagetype-cli/pom.xml b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
index de0163a..9a51242 100644
--- a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
+++ b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 94a0f6c..f73ecb8 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index 34e879a..c2d5c7e 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 1e7d64d..3fa05d3 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 4dff432..04df0b8 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index 6669606..79ccf2b 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 1cfef10..9e221a0 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml
index d24447a..ce8468c 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index fed4410..517be69 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 22faa19..05cb339 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 9d67aa1..00344d4 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 0b54ce9..2377858 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index b071f6f..90c0da6 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 9be012c..9e80f1f 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index 3b75eec..e488bb0 100644
--- a/modules/helpers/perftest-support/pom.xml
+++ b/modules/helpers/perftest-support/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<name>Performance Testing Support</name>
<description>To support performance testing, this is a basic tool to support extracting and later reimporting of
data from/to a database.
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 92da29b..0c73fd3 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 93928a6..417a3df 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml b/modules/integration-tests/apache-plugin-test/pom.xml
index 9feecf3..206a7a7 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jboss-as-7-plugin-test/pom.xml b/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
index 2744b37..95c697b 100644
--- a/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
+++ b/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-integration-tests</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 277fdc3..1b41b08 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index 270330d..d983b6a 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index 0c5505d..c62f40e 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index e5d95e2..95ab8f8 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index f8e88f8..ff7d21f 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 331acc2..5037c78 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 9c12590..cb99a8c 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index d2c9331..370b2de 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index a9be07c..6c1812b 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index 1d6f220..700e775 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index f964998..d197727 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index af68966..840e619 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 6c647fb..08f6555 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 33eee7a..0c7ec29 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index fd0b274..b097071 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index d3eaebb..2cdc32a 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 506ffeb..3632ceb 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index cfd2e9c..aba88a7 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index 826861b..389eba3 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index bd22e2f..3e3432d 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml
index 84d7f79..56efc5b 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 30ee17f..ae06793 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 989825b..e042824 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index bcbb309..dc87ed7 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 7364fe3..3a6deaa 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 4919620..835c57b 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 8b00d6a..970f3ed 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index deb44d3..ea74b9f 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index eb40cae..6b0791d 100644
--- a/modules/plugins/pattern-generator/pom.xml
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 670f437..63dd974 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 87206a7..003e77e 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 1ebba64..f32159e 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index dc905e9..2a0eb28 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index d3ad8ac..d70ba83 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 27aa74e..19776c2 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 0d72160..b1c3d22 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index cdb7869..90337ed 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index c1b3fb2..d31afb9 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 472c868..e218ca8 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 8317bdc..a52a978 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 649d707..3a1df45 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index ecf8343..78ad464 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 01b7c6e..1ae57af 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index be036d3..a13f91c 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml
index b83736c..6565a7b 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 116bbe5..e2fb957 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index 179a29d..c846655 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 0b19530..5c6e85c 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 040e7e6..45a9c14 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 23b3caab6c9a64b9acded0ed3265305c83239fa1
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Fri Oct 28 08:55:35 2011 -0500
Checkout the release branch regardless...
diff --git a/publish_release.sh b/publish_release.sh
index 359c084..3eb6c98 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -139,39 +139,32 @@ print_program_versions "${program_versions[@]}"
echo "==============================================================================="
-# We only need to worry about cloning the repo if we are not running on hudson
-if [ ! "$HUDSON_URL" ]; then
- # Clone and/or checkout the source from git.
-
- if [ -d "$WORKING_DIR" ]; then
- cd "$WORKING_DIR"
- git status >/dev/null 2>&1
- GIT_STATUS_EXIT_CODE=$?
- # Note, git 1.6 and earlier returns an exit code of 1, rather than 0, if there are any uncommitted changes,
- # and git 1.7 returns 0, so we check if the exit code is less than or equal to 1 to determine if $WORKING_DIR
- # is truly a git working copy.
- if [ "$GIT_STATUS_EXIT_CODE" -le 1 ]; then
- echo "Checking out a clean copy of the release branch ($RELEASE_BRANCH)..."
- git fetch origin "$RELEASE_BRANCH"
- [ "$?" -ne 0 ] && abort "Failed to fetch release branch ($RELEASE_BRANCH)."
- git checkout "$RELEASE_BRANCH" 2>/dev/null
- if [ "$?" -ne 0 ]; then
- git checkout --track -b "$RELEASE_BRANCH" "origin/$RELEASE_BRANCH"
- fi
- [ "$?" -ne 0 ] && abort "Failed to checkout release branch ($RELEASE_BRANCH)."
- git reset --hard "origin/$RELEASE_BRANCH"
- [ "$?" -ne 0 ] && abort "Failed to reset release branch ($RELEASE_BRANCH)."
- git clean -dxf
- [ "$?" -ne 0 ] && abort "Failed to clean release branch ($RELEASE_BRANCH)."
- git pull
- [ "$?" -ne 0 ] && abort "Failed to update release branch ($RELEASE_BRANCH)."
- else
- echo "$WORKING_DIR does not appear to be a git working directory ('git status' returned $GIT_STATUS_EXIT_CODE) - removing it so we can freshly clone the repo..."
- cd ..
- rm -rf "$WORKING_DIR"
- [ "$?" -ne 0 ] && abort "Failed to remove bogus working directory ($WORKING_DIR)."
- fi
- fi
+# Checkout the source from git.
+git status >/dev/null 2>&1
+GIT_STATUS_EXIT_CODE=$?
+# Note, git 1.6 and earlier returns an exit code of 1, rather than 0, if there are any uncommitted changes,
+# and git 1.7 returns 0, so we check if the exit code is less than or equal to 1 to determine if $WORKING_DIR
+# is truly a git working copy.
+if [ "$GIT_STATUS_EXIT_CODE" -le 1 ]; then
+ echo "Checking out a clean copy of the release branch ($RELEASE_BRANCH)..."
+ git fetch origin "$RELEASE_BRANCH"
+ [ "$?" -ne 0 ] && abort "Failed to fetch release branch ($RELEASE_BRANCH)."
+ git checkout "$RELEASE_BRANCH" 2>/dev/null
+ if [ "$?" -ne 0 ]; then
+ git checkout --track -b "$RELEASE_BRANCH" "origin/$RELEASE_BRANCH"
+ fi
+ [ "$?" -ne 0 ] && abort "Failed to checkout release branch ($RELEASE_BRANCH)."
+ git reset --hard "origin/$RELEASE_BRANCH"
+ [ "$?" -ne 0 ] && abort "Failed to reset release branch ($RELEASE_BRANCH)."
+ git clean -dxf
+ [ "$?" -ne 0 ] && abort "Failed to clean release branch ($RELEASE_BRANCH)."
+ git pull
+ [ "$?" -ne 0 ] && abort "Failed to update release branch ($RELEASE_BRANCH)."
+else
+ echo "$WORKING_DIR does not appear to be a git working directory ('git status' returned $GIT_STATUS_EXIT_CODE) - removing it so we can freshly clone the repo..."
+ cd ..
+ rm -rf "$WORKING_DIR"
+ [ "$?" -ne 0 ] && abort "Failed to remove bogus working directory ($WORKING_DIR)."
fi
commit 56cb7b1b9e00f3a9ab7e74ef68e69a4360d67642
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Fri Oct 28 09:36:23 2011 -0400
minor - fix a couple typos
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index e8212d4..e69994e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -1307,8 +1307,8 @@ view_dynagroup_mixed = Mixed
view_dynagroup_newGroupDefinition = New Group Definition
view_dynagroup_nextCalculationTime = Next Calculation Time
view_dynagroup_permDenied = You do not have permission to view group definitions
-view_dynagroup_recalcFailure = Failed to recalculated this group definition
-view_dynagroup_recalcFailureSelection = Failed to recalculated the selected group definitions
+view_dynagroup_recalcFailure = Failed to recalculate this group definition
+view_dynagroup_recalcFailureSelection = Failed to recalculate the selected group definitions
view_dynagroup_recalcSuccessful = You have successfully recalculated this group definition
view_dynagroup_recalcSuccessfulSelection = You have successfully recalculated [{0}] group definitions
view_dynagroup_recalculate = Recalculate
commit bb078c65d9b87f149f239a75254780aa7d532576
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Fri Oct 28 01:16:08 2011 -0500
Update the publish script to use a maven repo folder under the workspace folder.
diff --git a/publish_release.sh b/publish_release.sh
index 8ffc1ac..359c084 100755
--- a/publish_release.sh
+++ b/publish_release.sh
@@ -52,7 +52,7 @@ set_variables()
if [ -n "$HUDSON_URL" ] && [ -n "$WORKSPACE" ]; then
echo "We appear to be running in a Hudson job."
WORKING_DIR="$WORKSPACE"
- MAVEN_LOCAL_REPO_DIR="$HOME/.m2/hudson-release-$RELEASE_TYPE-repository"
+ MAVEN_LOCAL_REPO_DIR="$WORKSPACE/.m2/repository"
#MAVEN_SETTINGS_FILE="$HOME/.m2/hudson-$JOB_NAME-settings.xml"
elif [ -z "$WORKING_DIR" ]; then
WORKING_DIR="$HOME/release/rhq"
@@ -65,7 +65,7 @@ set_variables()
PROJECT_GIT_URL="git://git.fedorahosted.org/rhq/rhq.git"
- MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Prhq-publish-release,enterprise,dist"
+ MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE --batch-mode --errors -Prhq-publish-release,enterprise,dist -Dmaven.repo.local=$MAVEN_LOCAL_REPO_DIR"
if [ "$MODE" = "test" ]; then
MAVEN_ARGS="$MAVEN_ARGS -DskipTests=true"
commit e676d0f871f70a8dd9ad2d5ecfe9239d0d8e3cd7
Author: Hudson <jboss-qa-internal(a)redhat.com>
Date: Fri Oct 28 00:51:30 2011 -0400
development RHQ_4.3.0-SNAPSHOT
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index b080025..3a5f116 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 13cd80a..550ddfd 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index a5c0981..6a9bcf2 100644
--- a/modules/common/drift/pom.xml
+++ b/modules/common/drift/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-common-drift</artifactId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index 6273a4f..d645c7a 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-filetemplate-bundle-common</artifactId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index dfd8e5a..a999e68 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index bd88fa0..d7eedff 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 9f5f66a..c0ca9be 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 5a8b356..7eab16a 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index aa20853..dd75181 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index bd0fdb4..164f5ad 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index bb4dc2c..e2b1d14 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 4a24392..151521d 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 6b633bb..e01941d 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 25ae021..9718b0e 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-container</artifactId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index f2953a6..c143c00 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 62a73be..002912b 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index d388ca8..11efd74 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 199a996..88827a8 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 8b7ffe8..83aefb4 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index a6d3985..798353c 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Script Bindings</name>
<description>Abstraction of different facilities and default configurations for script bindings</description>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index f424704..af241d2 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index cebd439..ce48f40 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index b66da2c..e47afba 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml
index db7d757..e0c53c8 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index afb2fec..cecb704 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 900d476..0e65e6a 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index ecb02d5..bfac4e7 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml
index 4e2ac9f..6c48f27 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-war/pom.xml b/modules/enterprise/gui/rest-war/pom.xml
index 9ab5090..e828fbf 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 01fb7f6..2627ebf 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 24fbb60..d2990f3 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml
index bacb64b..344f171 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml b/modules/enterprise/remoting/client-deps/pom.xml
index 3fe07b7..d3dcb79 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index f4b1866..70333b1 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index dee43bc..28a0f43 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/client-api/pom.xml b/modules/enterprise/server/client-api/pom.xml
index c57eaba..e777e21 100644
--- a/modules/enterprise/server/client-api/pom.xml
+++ b/modules/enterprise/server/client-api/pom.xml
@@ -5,13 +5,13 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Client API</name>
<description>The implementation of the client API when accessing the server locally</description>
diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index 1aebae1..2139374 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index 8b3a73a..1e55e08 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 18a7436..32ce3d3 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index f5ba55f..7206726 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/alert-cli/pom.xml b/modules/enterprise/server/plugins/alert-cli/pom.xml
index b380393..3d64b03 100644
--- a/modules/enterprise/server/plugins/alert-cli/pom.xml
+++ b/modules/enterprise/server/plugins/alert-cli/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Script Alert Plugin</name>
<description>An alert sender able to execute an arbitrary CLI script as a response to an alert</description>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml
index e1e1890..103f28f 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml
index c38aff4..a63eeaf 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-log4j/pom.xml b/modules/enterprise/server/plugins/alert-log4j/pom.xml
index 1a27831..4bfdad5 100644
--- a/modules/enterprise/server/plugins/alert-log4j/pom.xml
+++ b/modules/enterprise/server/plugins/alert-log4j/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Log4J Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index 8574c9f..d9f7e6e 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 0adccaf..3a50667 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 2c9bcfa..0fe30c2 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 06bab65..86907a4 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index bdee60f..8d255a1 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml
index bb595b5..8ba0b56 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 26f4409..65eccd7 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml
index bdfe647..be0f5ef 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml
index 403ef41..17ca168 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-rhq/pom.xml b/modules/enterprise/server/plugins/drift-rhq/pom.xml
index 9c9d3b6..9100ee7 100644
--- a/modules/enterprise/server/plugins/drift-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/drift-rhq/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 8cae6d5..936f60d 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index 83bb64a..742e49c 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index dacaec2..327171a 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/packagetype-cli/pom.xml b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
index 9a51242..de0163a 100644
--- a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
+++ b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index f73ecb8..94a0f6c 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index c2d5c7e..34e879a 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 3fa05d3..1e7d64d 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/rhnhosted/pom.xml b/modules/enterprise/server/plugins/rhnhosted/pom.xml
index 04df0b8..4dff432 100644
--- a/modules/enterprise/server/plugins/rhnhosted/pom.xml
+++ b/modules/enterprise/server/plugins/rhnhosted/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index 79ccf2b..6669606 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 9e221a0..1cfef10 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml
index ce8468c..d24447a 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 517be69..fed4410 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 05cb339..22faa19 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 00344d4..9d67aa1 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 2377858..0b54ce9 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index 90c0da6..b071f6f 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 9e80f1f..9be012c 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index e488bb0..3b75eec 100644
--- a/modules/helpers/perftest-support/pom.xml
+++ b/modules/helpers/perftest-support/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<name>Performance Testing Support</name>
<description>To support performance testing, this is a basic tool to support extracting and later reimporting of
data from/to a database.
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 0c73fd3..92da29b 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index 417a3df..93928a6 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml b/modules/integration-tests/apache-plugin-test/pom.xml
index 206a7a7..9feecf3 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jboss-as-7-plugin-test/pom.xml b/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
index 95c697b..2744b37 100644
--- a/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
+++ b/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-integration-tests</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 1b41b08..277fdc3 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index d983b6a..270330d 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index c62f40e..0c5505d 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 95ab8f8..e5d95e2 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index ff7d21f..f8e88f8 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 5037c78..331acc2 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index cb99a8c..9c12590 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 370b2de..d2c9331 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 6c1812b..a9be07c 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index 700e775..1d6f220 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index d197727..f964998 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index 840e619..af68966 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 08f6555..6c647fb 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 0c7ec29..33eee7a 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index b097071..fd0b274 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index 2cdc32a..d3eaebb 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 3632ceb..506ffeb 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index aba88a7..cfd2e9c 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index 389eba3..826861b 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index 3e3432d..bd22e2f 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml
index 56efc5b..84d7f79 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index ae06793..30ee17f 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index e042824..989825b 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index dc87ed7..bcbb309 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 3a6deaa..7364fe3 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 835c57b..4919620 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 970f3ed..8b00d6a 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index ea74b9f..deb44d3 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 6b0791d..eb40cae 100644
--- a/modules/plugins/pattern-generator/pom.xml
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 63dd974..670f437 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 003e77e..87206a7 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index f32159e..1ebba64 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 2a0eb28..dc905e9 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index d70ba83..d3ad8ac 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 19776c2..27aa74e 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index b1c3d22..0d72160 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 90337ed..cdb7869 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index d31afb9..c1b3fb2 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index e218ca8..472c868 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index a52a978..8317bdc 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 3a1df45..649d707 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 78ad464..ecf8343 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 1ae57af..01b7c6e 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index a13f91c..be036d3 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml
index 6565a7b..b83736c 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index e2fb957..116bbe5 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index c846655..179a29d 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 5c6e85c..0b19530 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 45a9c14..040e7e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.1.0-SNAPSHOT</version>
+ <version>4.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit e15fb248d89279f63b71a823228c7dae08caf0b3
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Oct 27 19:36:30 2011 -0500
Activate profiles in a consistent order with other the build environments.
diff --git a/release.sh b/release.sh
index 27da8aa..65a9596 100755
--- a/release.sh
+++ b/release.sh
@@ -242,13 +242,16 @@ set_local_and_environment_variables()
MAVEN_SETTINGS_FILE="$HOME/.m2/settings.xml"
fi
- MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE -Dmaven.repo.local=$MAVEN_LOCAL_REPO_DIR --batch-mode --errors -Penterprise,dist,release"
+ MAVEN_ARGS="--settings $MAVEN_SETTINGS_FILE -Dmaven.repo.local=$MAVEN_LOCAL_REPO_DIR --batch-mode --errors"
if [ -n "$EXTRA_MAVEN_PROFILE" ];
then
- MAVEN_ARGS="$MAVEN_ARGS,$EXTRA_MAVEN_PROFILE"
+ MAVEN_ARGS="$MAVEN_ARGS --activate-profiles $EXTRA_MAVEN_PROFILE,enterprise,dist,release"
+ else
+ MAVEN_ARGS="$MAVEN_ARGS --activate-profiles enterprise,dist,release"
fi
+
if [ "$RELEASE_TYPE" = "enterprise" ];
then
MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav "
commit 3693aedd8f816837b66c72fbb4101dc226d45dde
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Oct 27 16:53:07 2011 -0400
[BZ 749657] display not-all-available-records-loaded warning message within selector widget itself, rather than in the main message bar (https://bugzilla.redhat.com/show_bug.cgi?id=749657)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
index b75fe75..4ed99cf 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
@@ -38,6 +38,7 @@ import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.ImgProperties;
+import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.TransferImgButton;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
@@ -62,9 +63,7 @@ import com.smartgwt.client.widgets.layout.SectionStack;
import com.smartgwt.client.widgets.layout.SectionStackSection;
import com.smartgwt.client.widgets.layout.VStack;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.util.RPCDataSource;
-import org.rhq.enterprise.gui.coregui.client.util.message.Message;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableSectionStack;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTransferImgButton;
@@ -103,6 +102,7 @@ public abstract class AbstractSelector<T, C extends org.rhq.core.domain.criteria
protected Criteria latestCriteria;
private boolean isReadOnly;
+ private Label messageLayout;
public AbstractSelector(String locatorId) {
this(locatorId, false);
@@ -187,6 +187,9 @@ public abstract class AbstractSelector<T, C extends org.rhq.core.domain.criteria
if (!this.isReadOnly) {
// LEFT SIDE
+ this.messageLayout = new Label();
+ this.messageLayout.setMargin(3);
+ addMember(this.messageLayout);
this.availableFilterForm = getAvailableFilterForm();
if (this.availableFilterForm != null) {
addMember(this.availableFilterForm);
@@ -373,13 +376,16 @@ public abstract class AbstractSelector<T, C extends org.rhq.core.domain.criteria
int totalAvailableRecords = totalRecords - assignedRecords.length;
if (availableRecords.size() < totalAvailableRecords) {
// TODO: i18n
- Message message = new Message("Only " + availableRecords.size() + " out of "
+ messageLayout.setContents("<b>Note:</b> Only " + availableRecords.size() + " out of "
+ totalAvailableRecords + " available " + getItemTitle()
- + " are listed - please specify one or more filters to find the " + getItemTitle()
- + " for which you are looking.",
- Message.Severity.Warning);
- CoreGUI.getMessageCenter().notify(message);
+ + " are listed - please specify more specific filters below to find the " + getItemTitle()
+ + " for which you are looking.");
+ } else {
+ // Clear the warning message, if any, from the previous fetch.
+ // Note, surprisingly, setContents(null) doesn't work.
+ messageLayout.setContents(" ");
}
+ messageLayout.markForRedraw();
availableGrid.setData(availableRecords.toArray(new Record[availableRecords.size()]));
} finally {
updateButtonEnablement();
commit c8eab981af2f3b99c73f2017706295c77110f49e
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Thu Oct 27 15:45:03 2011 -0400
[BZ 749654] (stopgap workaround for RHQ 4.2) for selectors with no filters, set the available record page size to 500, rather than 100, to minimize the chances of use not being able to view some available items (https://bugzilla.redhat.com/show_bug.cgi?id=749654)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
index bf82a12..d1358e5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
@@ -60,6 +60,11 @@ public class RoleSubjectSelector extends AbstractSelector<Subject, SubjectCriter
}
@Override
+ protected int getMaxAvailableRecords() {
+ return 500;
+ }
+
+ @Override
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
return null; // No Filters Currently
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
index 1c27994..44c2188 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/SubjectRoleSelector.java
@@ -49,6 +49,11 @@ public class SubjectRoleSelector extends AbstractSelector<Role, RoleCriteria> {
}
@Override
+ protected int getMaxAvailableRecords() {
+ return 500;
+ }
+
+ @Override
protected RPCDataSource<Role, RoleCriteria> getDataSource() {
return new RolesDataSource();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemRolesNotificationSenderForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemRolesNotificationSenderForm.java
index c4a7c51..2ba41e1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemRolesNotificationSenderForm.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemRolesNotificationSenderForm.java
@@ -181,6 +181,11 @@ public class SystemRolesNotificationSenderForm extends AbstractNotificationSende
}
@Override
+ protected int getMaxAvailableRecords() {
+ return 500;
+ }
+
+ @Override
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
return null; // No Filters Currently
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemUsersNotificationSenderForm.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemUsersNotificationSenderForm.java
index e7139a7..dbf1a8c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemUsersNotificationSenderForm.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SystemUsersNotificationSenderForm.java
@@ -192,6 +192,11 @@ public class SystemUsersNotificationSenderForm extends AbstractNotificationSende
}
@Override
+ protected int getMaxAvailableRecords() {
+ return 500;
+ }
+
+ @Override
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
return null; // No Filters Currently
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
index 9b9f4c4..b75fe75 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
@@ -315,7 +315,7 @@ public abstract class AbstractSelector<T, C extends org.rhq.core.domain.criteria
});
}
this.datasource = getDataSource();
- this.datasource.setDataPageSize(MAX_AVAILABLE_RECORDS);
+ this.datasource.setDataPageSize(getMaxAvailableRecords());
populateAvailableGrid((null == latestCriteria) ? new Criteria() : latestCriteria);
// Add event handlers.
commit 1df6f96ac51f6216ed0f1915ff6f40a606b568c5
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Oct 27 15:28:16 2011 -0400
[BZ 749415] check the right entity context to determine which drift config def to use
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java
index 9b0c9d9..0815405 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java
@@ -21,6 +21,7 @@ package org.rhq.enterprise.gui.coregui.client.drift.wizard;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
+import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.drift.DriftConfigurationDefinition;
@@ -64,7 +65,7 @@ public class DriftAddDefinitionWizardConfigStep extends AbstractWizardStep {
}
private ConfigurationDefinition getDriftConfigDef() {
- if (wizard.getEntityContext().isSubsystemView()) {
+ if (wizard.getEntityContext().getType() == EntityContext.Type.ResourceTemplate) {
return DriftConfigurationDefinition.getNewTemplateInstance();
}
commit 1ada648fd2f19e4fb3c6d401fe6161e322165cf6
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Oct 27 14:50:14 2011 -0400
fixing/updating tests
In a previous commit, the JPADrift.changeSet property was made required.
This required a number of tests to be updated.
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java
index 89789ff..b2eddb3 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/JPADriftChangeSetTest.java
@@ -119,35 +119,38 @@ public class JPADriftChangeSetTest extends DriftDataAccessTest {
@Test(groups = {"JPADriftChangeSet", "drift.ejb"})
public void saveAndLoadInitialChangeSet() {
- JPADrift drift = new JPADrift(null, "drift.1", FILE_ADDED, null, null);
- drift.setDirectory("/basedir");
-
- JPADriftSet driftSet = new JPADriftSet();
- driftSet.addDrift(drift);
-
- final JPADriftChangeSet changeSet = new JPADriftChangeSet();
- changeSet.setCategory(COVERAGE);
- changeSet.setVersion(0);
- changeSet.setDriftDefinition(definition);
- changeSet.setDriftHandlingMode(DriftHandlingMode.normal);
- changeSet.setResource(resource);
- changeSet.setInitialDriftSet(driftSet);
-
executeInTransaction(new TransactionCallback() {
@Override
public void execute() throws Exception {
EntityManager em = getEntityManager();
+
+ JPADriftChangeSet changeSet = new JPADriftChangeSet();
+ changeSet.setCategory(COVERAGE);
+ changeSet.setVersion(0);
+ changeSet.setDriftDefinition(definition);
+ changeSet.setDriftHandlingMode(DriftHandlingMode.normal);
+ changeSet.setResource(resource);
+
em.persist(changeSet);
em.flush();
+
+ JPADriftSet driftSet = new JPADriftSet();
+ driftSet.addDrift(new JPADrift(changeSet, "drift.1", FILE_ADDED, null, null));
+
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
+ em.flush();
em.clear();
+
JPADriftChangeSet savedChangeSet = em
.find(JPADriftChangeSet.class, Integer.parseInt(changeSet.getId()));
assertNotNull("Failed to persist change set", savedChangeSet);
- JPADriftSet driftSet = savedChangeSet.getInitialDriftSet();
- assertNotNull("Failed to persist drift set", driftSet);
- assertEquals("Failed to persist drift belonging to drift set", 1, driftSet.getDrifts().size());
+ JPADriftSet savedDriftSet = savedChangeSet.getInitialDriftSet();
+ assertNotNull("Failed to persist drift set", savedDriftSet);
+ assertEquals("Failed to persist drift belonging to drift set", 1, savedDriftSet.getDrifts().size());
}
});
}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
index a39faa0..125dfb3 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
@@ -278,15 +278,14 @@ public class DriftTemplateManagerBeanTest extends DriftServerTest {
final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
// create initial change set from which the snapshot will be generated
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
+
driftFile1 = new JPADriftFile("a1b2c3");
- drift1 = new JPADrift(null, "drift.1", FILE_ADDED, null, driftFile1);
+ drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
- JPADriftSet driftSet = new JPADriftSet();
+ final JPADriftSet driftSet = new JPADriftSet();
driftSet.addDrift(drift1);
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
- changeSet0.setInitialDriftSet(driftSet);
-
// create change set v1
driftFile2 = new JPADriftFile("1a2b3c");
final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, attachedDef1);
@@ -296,13 +295,19 @@ public class DriftTemplateManagerBeanTest extends DriftServerTest {
@Override
public void execute() throws Exception {
EntityManager em = getEntityManager();
+
em.persist(attachedDef1);
+
em.persist(driftFile1);
em.persist(driftFile2);
- em.persist(drift1);
- em.persist(drift2);
+
em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
+
em.persist(changeSet1);
+ em.persist(drift2);
em.persist(attachedDef2);
em.persist(detachedDef1);
@@ -404,39 +409,44 @@ public class DriftTemplateManagerBeanTest extends DriftServerTest {
final DriftDefinition detachedDef2 = createDefinition(template, "detachedDef2", false);
// create some change sets
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
+
driftFile1 = new JPADriftFile("a1b2c3");
- drift1 = new JPADrift(null, "drift.1", FILE_ADDED, null, driftFile1);
+ drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
- JPADriftSet driftSet0 = new JPADriftSet();
+ final JPADriftSet driftSet0 = new JPADriftSet();
driftSet0.addDrift(drift1);
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, attachedDef1);
- changeSet0.setInitialDriftSet(driftSet0);
-
+ final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 0, DRIFT, detachedDef1);
driftFile2 = new JPADriftFile("1a2b3c");
- drift2 = new JPADrift(null, "drift.2", FILE_ADDED, null, driftFile2);
+ drift2 = new JPADrift(changeSet1, "drift.2", FILE_ADDED, null, driftFile2);
- JPADriftSet driftSet1 = new JPADriftSet();
+ final JPADriftSet driftSet1 = new JPADriftSet();
driftSet1.addDrift(drift2);
- final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 0, DRIFT, detachedDef1);
- changeSet1.setInitialDriftSet(driftSet1);
-
executeInTransaction(new TransactionCallback() {
@Override
public void execute() throws Exception {
EntityManager em = getEntityManager();
+
em.persist(attachedDef1);
em.persist(attachedDef2);
em.persist(detachedDef1);
em.persist(detachedDef2);
+
em.persist(driftFile1);
em.persist(driftFile2);
- em.persist(drift1);
- em.persist(drift2);
+
em.persist(changeSet0);
+ em.persist(driftSet0);
+ changeSet0.setInitialDriftSet(driftSet0);
+ em.merge(changeSet0);
+
em.persist(changeSet1);
+ em.persist(driftSet1);
+ changeSet1.setInitialDriftSet(driftSet1);
+ em.merge(changeSet1);
}
});
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
index 5afca31..2b3b33a 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/JPADriftServerBeanTest.java
@@ -260,10 +260,11 @@ public class JPADriftServerBeanTest extends DriftServerTest {
@Override
public void execute() throws Exception {
EntityManager em = getEntityManager();
- em.persist(driftSet);
- changeSet.setInitialDriftSet(driftSet);
em.persist(changeSet);
em.persist(driftDef);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
}
});
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
index cfcc4ba..1353293 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageDriftDefinitionsTest.java
@@ -103,20 +103,19 @@ public class ManageDriftDefinitionsTest extends DriftServerTest {
// and persisting the pinned change set.
// first create the change set
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(null, 0, COVERAGE, null);
+ changeSet0.setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode.normal);
+
final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
- JPADrift drift1 = new JPADrift(null, "drift.1", FILE_ADDED, null, driftFile1);
- JPADrift drift2 = new JPADrift(null, "drift.2", FILE_ADDED, null, driftFile2);
+ JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
+ JPADrift drift2 = new JPADrift(changeSet0, "drift.2", FILE_ADDED, null, driftFile2);
- JPADriftSet driftSet = new JPADriftSet();
+ final JPADriftSet driftSet = new JPADriftSet();
driftSet.addDrift(drift1);
driftSet.addDrift(drift2);
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(null, 0, COVERAGE, null);
- changeSet0.setInitialDriftSet(driftSet);
- changeSet0.setDriftHandlingMode(DriftConfigurationDefinition.DriftHandlingMode.normal);
-
// create the template
final DriftDefinition templateDef = new DriftDefinition(new Configuration());
templateDef.setName("test_createUnpinnedDefinition");
@@ -137,6 +136,9 @@ public class ManageDriftDefinitionsTest extends DriftServerTest {
em.persist(driftFile1);
em.persist(driftFile2);
em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
// setting the change set id on the template is the last and the
// most important step in making the template pinned
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
index dbab012..190df2f 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/ManageSnapshotsTest.java
@@ -45,11 +45,8 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
import org.rhq.core.domain.drift.Drift;
import org.rhq.core.domain.drift.DriftChangeSet;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition;
import org.rhq.core.domain.drift.DriftDefinition;
-import org.rhq.core.domain.drift.DriftDefinitionTemplate;
import org.rhq.core.domain.drift.DriftSnapshot;
-import org.rhq.core.domain.drift.DriftSnapshotRequest;
import org.rhq.core.domain.drift.JPADrift;
import org.rhq.core.domain.drift.JPADriftChangeSet;
import org.rhq.core.domain.drift.JPADriftFile;
@@ -74,21 +71,23 @@ public class ManageSnapshotsTest extends DriftServerTest {
final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
// create initial change set
+ final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift = new JPADrift(null, "drift.1", FILE_ADDED, null, driftFile1);
+ JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
- JPADriftSet driftSet = new JPADriftSet();
+ final JPADriftSet driftSet = new JPADriftSet();
driftSet.addDrift(drift);
- final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
- changeSet.setInitialDriftSet(driftSet);
-
executeInTransaction(new TransactionCallback() {
@Override
public void execute() throws Exception {
EntityManager em = getEntityManager();
em.persist(driftFile1);
em.persist(changeSet);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
}
});
@@ -104,15 +103,14 @@ public class ManageSnapshotsTest extends DriftServerTest {
final DriftDefinition driftDef = createAndPersistDriftDef("test::makeSnapshotVersionZero");
// create initial change set
+ final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift1 = new JPADrift(null, "drift.1", FILE_ADDED, null, driftFile1);
+ JPADrift drift1 = new JPADrift(changeSet0, "drift.1", FILE_ADDED, null, driftFile1);
- JPADriftSet driftSet = new JPADriftSet();
+ final JPADriftSet driftSet = new JPADriftSet();
driftSet.addDrift(drift1);
- final JPADriftChangeSet changeSet0 = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
- changeSet0.setInitialDriftSet(driftSet);
-
// create change set v1
final JPADriftFile driftFile2 = new JPADriftFile("1a2b3c");
final JPADriftChangeSet changeSet1 = new JPADriftChangeSet(resource, 1, DRIFT, driftDef);
@@ -125,6 +123,9 @@ public class ManageSnapshotsTest extends DriftServerTest {
em.persist(driftFile1);
em.persist(driftFile2);
em.persist(changeSet0);
+ em.persist(driftSet);
+ changeSet0.setInitialDriftSet(driftSet);
+ em.merge(changeSet0);
em.persist(changeSet1);
em.persist(drift2);
}
@@ -168,21 +169,23 @@ public class ManageSnapshotsTest extends DriftServerTest {
final DriftDefinition driftDef = createAndPersistDriftDef("test::setPinnedFlag");
// create initial change set
+ final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
+
final JPADriftFile driftFile1 = new JPADriftFile("a1b2c3");
- JPADrift drift = new JPADrift(null, "drift.1", FILE_ADDED, null, driftFile1);
+ JPADrift drift = new JPADrift(changeSet, "drift.1", FILE_ADDED, null, driftFile1);
- JPADriftSet driftSet = new JPADriftSet();
+ final JPADriftSet driftSet = new JPADriftSet();
driftSet.addDrift(drift);
- final JPADriftChangeSet changeSet = new JPADriftChangeSet(resource, 0, COVERAGE, driftDef);
- changeSet.setInitialDriftSet(driftSet);
-
executeInTransaction(new TransactionCallback() {
@Override
public void execute() throws Exception {
EntityManager em = getEntityManager();
em.persist(driftFile1);
em.persist(changeSet);
+ em.persist(driftSet);
+ changeSet.setInitialDriftSet(driftSet);
+ em.merge(changeSet);
}
});
commit 2b78703a764489575b6fb81f9673bdc132c60f9a
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Oct 27 11:52:10 2011 -0400
A post 4.2 TODO for Table
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index 8d6e3a4..2fa8985 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -228,6 +228,8 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
this.flexRowDisplay = flexRowDisplay;
}
+ // TODO: I think this should just be a simple getter. Returning the canvas before we're initialized is likely
+ // a bad thing. -Jay. Will do after the 4.2 release as it doesn't seem to bite us at the moment.
/**
* Returns the encompassing canvas that contains all content for this table component.
* This content includes the list grid, the buttons, etc.
@@ -407,7 +409,6 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
drawFooter();
}
-
if (!autoFetchData && (initialCriteria != null)) {
refresh();
}
@@ -1073,7 +1074,6 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
field.setHidden(true);
}
-
// -------------- Inner utility classes ------------- //
/**
commit 9e4f630b62a42667fdc18b57c2e9443fcbf78126
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Oct 27 11:51:58 2011 -0400
[BZ 749432 - Drift detail view navigation issues]
Provide a temporary solution for navigating to Drift detail from various
places in the drift gui. As it stands the DriftSnapshotView does not
offer support for proper Master-Detail and this is complicated by the
various ways in which the SnapshotView is embedded into the gui, at the
resource and template levels. The basic fallout is that the backButton
for the drift detail page is not going to bring you back to the snapshot
page, but rather that page's parent view.
My plan is to hopefully embed the detail view into the snapshot view (via
expanding rows), making the whole navigation issue moot. But that is post
RHQ 4.2
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index 4bc881d..1985cd4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -25,6 +25,7 @@ package org.rhq.enterprise.gui.coregui.client;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.enterprise.gui.coregui.client.admin.roles.RolesView;
+import org.rhq.enterprise.gui.coregui.client.admin.templates.DriftDefinitionTemplateTypeView;
import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView;
import org.rhq.enterprise.gui.coregui.client.components.table.StringIDTableSection;
@@ -395,7 +396,7 @@ public class LinkManager {
}
}
- public static String getAdminTemplatesEditLink(String viewName, String typeId) {
+ public static String getAdminTemplatesEditLink(String viewName, int typeId) {
if (GWT) {
return "#Administration/Configuration/" + viewName + "/" + typeId;
} else {
@@ -516,15 +517,51 @@ public class LinkManager {
return "#Resource/" + resourceId + "/Drift/Definitions/" + driftDefId + "/Edit";
}
- public static String getDriftHistoryLink(int resourceId, int driftDefId, String driftId) {
+ public static String getDriftCarouselDriftLink(int resourceId, int driftDefId, String driftId) {
if (!driftId.startsWith(StringIDTableSection.ID_PREFIX)) {
driftId = StringIDTableSection.ID_PREFIX + driftId;
}
- return "#Resource/" + resourceId + "/Drift/Definitions/" + driftDefId + "/History/" + driftId;
+ return "#Resource/" + resourceId + "/Drift/Definitions/" + driftDefId + "/Drift/" + driftId;
}
- public static String getDriftSnapshotLink(int resourceId, int driftDefId, int version) {
+ public static String getDriftCarouselSnapshotLink(int resourceId, int driftDefId, int version) {
return "#Resource/" + resourceId + "/Drift/Definitions/" + driftDefId + "/Snapshot/" + version;
}
+ public static String getDriftCarouselSnapshotDriftLink(int resourceId, int driftDefId, int version, String driftId) {
+ if (!driftId.startsWith(StringIDTableSection.ID_PREFIX)) {
+ driftId = StringIDTableSection.ID_PREFIX + driftId;
+ }
+
+ // TODO: for now, just make this the same as the carousel drift link. The downside is that the back button
+ // will bring us back to the carousel and not the snapshot view. Eventually would like another
+ // master-detail relationship here, but it's hairy to get this working.
+ //
+ // return "#Resource/" + resourceId + "/Drift/Definitions/" + driftDefId + "/Snapshot/" + version + "/" + driftId;
+
+ return getDriftCarouselDriftLink(resourceId, driftDefId, driftId);
+ }
+
+ public static String getDriftTemplateLink(int typeId, int templateId) {
+ String result = getAdminTemplatesEditLink(DriftDefinitionTemplateTypeView.VIEW_ID.getName(), typeId);
+
+ return result + "/" + templateId;
+ }
+
+ public static String getDriftTemplateSnapshotLink(int typeId, int templateId) {
+ String result = getDriftTemplateLink(typeId, templateId);
+
+ return result + "/Snapshot";
+ }
+
+ public static String getDriftTemplateSnapshotDriftLink(int typeId, int templateId, String driftId) {
+ String result = getDriftTemplateSnapshotLink(typeId, templateId);
+
+ if (!driftId.startsWith(StringIDTableSection.ID_PREFIX)) {
+ driftId = StringIDTableSection.ID_PREFIX + driftId;
+ }
+
+ return result + "/" + driftId;
+ }
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java
index 0c495b5..a4da48b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/AlertDefinitionTemplateTypeView.java
@@ -71,7 +71,7 @@ public class AlertDefinitionTemplateTypeView extends ResourceTypeTreeView {
return LinkManager.getAdminTemplatesLink(VIEW_ID.getName());
}
- return LinkManager.getAdminTemplatesEditLink(VIEW_ID.getName(), typeId);
+ return LinkManager.getAdminTemplatesEditLink(VIEW_ID.getName(), Integer.valueOf(typeId));
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java
index 72f11a2..ea18a4e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/DriftDefinitionTemplateTypeView.java
@@ -74,7 +74,7 @@ public class DriftDefinitionTemplateTypeView extends ResourceTypeTreeView {
return LinkManager.getAdminTemplatesLink(VIEW_ID.getName());
}
- return LinkManager.getAdminTemplatesEditLink(VIEW_ID.getName(), typeId);
+ return LinkManager.getAdminTemplatesEditLink(VIEW_ID.getName(), Integer.valueOf(typeId));
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java
index 6296c42..858bc8d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/MetricTemplateTypeView.java
@@ -69,7 +69,7 @@ public class MetricTemplateTypeView extends ResourceTypeTreeView {
return LinkManager.getAdminTemplatesLink(VIEW_ID.getName());
}
- return LinkManager.getAdminTemplatesEditLink(VIEW_ID.getName(), typeId);
+ return LinkManager.getAdminTemplatesEditLink(VIEW_ID.getName(), Integer.valueOf(typeId));
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
index d8371db..7872a0c 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/ResourceAlertDefinitionsDataSource.java
@@ -94,8 +94,7 @@ public class ResourceAlertDefinitionsDataSource extends AbstractAlertDefinitions
} else {
if (parentId != null && parentId.intValue() != 0) {
record.setAttribute(FIELD_PARENT, LinkManager.getAdminTemplatesEditLink(
- AlertDefinitionTemplateTypeView.VIEW_ID.getName(), String.valueOf(this.resource.getResourceType()
- .getId()))
+ AlertDefinitionTemplateTypeView.VIEW_ID.getName(), this.resource.getResourceType().getId())
+ "/" + parentId);
record.setLinkText(MSG.view_alert_definition_for_type());
} else {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java
index fbf4123..47b5d3d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselMemberView.java
@@ -103,7 +103,7 @@ public class DriftCarouselMemberView extends DriftHistoryView implements Carouse
Integer resourceId = record.getAttributeAsInt(AncestryUtil.RESOURCE_ID);
Integer driftDefId = record.getAttributeAsInt(DriftDataSource.ATTR_CHANGESET_DEF_ID);
String driftId = getId(record);
- String url = LinkManager.getDriftHistoryLink(resourceId, driftDefId, driftId);
+ String url = LinkManager.getDriftCarouselDriftLink(resourceId, driftDefId, driftId);
CoreGUI.goToView(url);
}
}
@@ -149,7 +149,7 @@ public class DriftCarouselMemberView extends DriftHistoryView implements Carouse
public void updateTitleCanvas(String titleString) {
int resourceId = getContext().getResourceId();
String imageHtml = Canvas.imgHTML(ImageManager.getViewIcon());
- String link = LinkManager.getDriftSnapshotLink(resourceId, changeSet.getDriftDefinitionId(), changeSet
+ String link = LinkManager.getDriftCarouselSnapshotLink(resourceId, changeSet.getDriftDefinitionId(), changeSet
.getVersion());
StringBuilder sb = new StringBuilder();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java
index 7239ef6..4489472 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftCarouselView.java
@@ -72,7 +72,7 @@ public class DriftCarouselView extends BookmarkableCarousel implements DetailsVi
private boolean hasWriteAccess;
private Integer maxCarouselEndFilter;
private ArrayList<Record> selectedRecords = new ArrayList<Record>();
- private boolean useHistoryDetailsView;
+ private boolean useDriftDetailsView;
private DriftGWTServiceAsync driftService = GWTServiceLookup.getDriftService();
@@ -397,16 +397,16 @@ public class DriftCarouselView extends BookmarkableCarousel implements DetailsVi
return true;
}
- // this class is somewhat unusual in that it is a detail view for the drift defs list view, but also a pseudo-
- // master view for snapshot and drift detail views. It's "pseudo" in that there is no master-detail infrastructure
+ // this class is somewhat unusual in that it is a detail view for the drift defs list view, but also a pseudo-master
+ // view for snapshot and drift detail views. It's "pseudo" in that there is no master-detail infrastructure
// like that found in TableSection. The following paths must be handled (starting at the ^):
- // #Resource/10001/Drift/Definitions/10001/History/driftId
+ // #Resource/10001/Drift/Definitions/10001/Drift/driftId
// #Resource/10001/Drift/Definitions/10001/Snapshot/version
// ^
@Override
public void renderView(ViewPath viewPath) {
if (!viewPath.isEnd() && !viewPath.isNextEnd()) {
- this.useHistoryDetailsView = !viewPath.isNextEnd() && "History".equals(viewPath.getNext().getPath());
+ this.useDriftDetailsView = !viewPath.isNextEnd() && "Drift".equals(viewPath.getNext().getPath());
}
super.renderView(viewPath);
@@ -414,8 +414,8 @@ public class DriftCarouselView extends BookmarkableCarousel implements DetailsVi
@Override
public Canvas getDetailsView(String id) {
- if (this.useHistoryDetailsView) {
- return new DriftDetailsView(extendLocatorId("History"), id);
+ if (this.useDriftDetailsView) {
+ return new DriftDetailsView(extendLocatorId("Drift"), id);
}
return new DriftSnapshotView(extendLocatorId("Snapshot"), null, context.getResourceId(), driftDefId, Integer
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java
index 69335e3..71ffeca 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java
@@ -108,8 +108,8 @@ public class DriftDefinitionDataSource extends RPCDataSource<DriftDefinitionComp
public void onRecordClick(RecordClickEvent event) {
switch (entityContext.getType()) {
case Resource:
- CoreGUI.goToView(LinkManager.getDriftSnapshotLink(entityContext.getResourceId(), event.getRecord()
- .getAttributeAsInt(ATTR_ID), 0));
+ CoreGUI.goToView(LinkManager.getDriftCarouselSnapshotLink(entityContext.getResourceId(), event
+ .getRecord().getAttributeAsInt(ATTR_ID), 0));
break;
default:
throw new IllegalArgumentException("Entity Type not supported");
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateDataSource.java
index 034a039..ffcbf5e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateDataSource.java
@@ -115,7 +115,7 @@ public class DriftDefinitionTemplateDataSource extends
if (event.getRecord().getAttributeAsBoolean(ATTR_IS_PINNED)) {
CoreGUI.goToView(LinkManager.getAdminTemplatesEditLink(DriftDefinitionTemplateTypeView.VIEW_ID
- .getName(), String.valueOf(resourceTypeId))
+ .getName(), resourceTypeId)
+ "/" + event.getRecord().getAttribute(ATTR_ID) + "/Snapshot");
}
}
@@ -157,7 +157,7 @@ public class DriftDefinitionTemplateDataSource extends
public void onRecordClick(RecordClickEvent event) {
CoreGUI.goToView(LinkManager.getAdminTemplatesEditLink(DriftDefinitionTemplateTypeView.VIEW_ID
- .getName(), String.valueOf(resourceTypeId))
+ .getName(), resourceTypeId)
+ "/" + event.getRecord().getAttribute(ATTR_ID) + "/Edit");
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplatesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplatesView.java
index 0d61047..8b0e4d5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplatesView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplatesView.java
@@ -54,6 +54,7 @@ public class DriftDefinitionTemplatesView extends TableSection<DriftDefinitionTe
private boolean hasWriteAccess;
private DriftDefinitionTemplateDataSource dataSource;
private boolean useSnapshotDetailsView;
+ private String snapshotDriftDetailsId;
static {
DriftCategory[] categoryValues = DriftCategory.values();
@@ -147,10 +148,7 @@ public class DriftDefinitionTemplatesView extends TableSection<DriftDefinitionTe
}
private void add() {
-
- DriftAddDefinitionWizard wizard = new DriftAddDefinitionWizard(EntityContext.forSubsystemView(), this.type,
- this);
- wizard.startWizard();
+ DriftAddDefinitionWizard.showWizard(EntityContext.forTemplate(type.getId()), this);
// we can refresh the table buttons immediately since the wizard is a dialog, the
// user can't access enabled buttons anyway.
@@ -192,6 +190,11 @@ public class DriftDefinitionTemplatesView extends TableSection<DriftDefinitionTe
// one we're dealing with. The default is the editor.
if (!viewPath.isEnd()) {
this.useSnapshotDetailsView = !viewPath.isNextEnd() && "Snapshot".equals(viewPath.getNext().getPath());
+ snapshotDriftDetailsId = null;
+ if (viewPath.viewsLeft() > 1) {
+ snapshotDriftDetailsId = viewPath.getViewForIndex(viewPath.getCurrentIndex() + 2).getPath().substring(
+ "0id_".length());
+ }
}
super.renderView(viewPath);
@@ -200,7 +203,10 @@ public class DriftDefinitionTemplatesView extends TableSection<DriftDefinitionTe
@Override
public Canvas getDetailsView(Integer driftTemplateId) {
if (this.useSnapshotDetailsView) {
- return new DriftDefinitionTemplateSnapshotView(extendLocatorId("TemplateSnapshot"), driftTemplateId);
+ if (null == snapshotDriftDetailsId) {
+ return new DriftDefinitionTemplateSnapshotView(extendLocatorId("TemplateSnapshot"), driftTemplateId);
+ }
+ return new DriftDetailsView(extendLocatorId("TemplateSnapshotDrift"), snapshotDriftDetailsId);
}
return new DriftDefinitionTemplateEditView(extendLocatorId("TemplateEdit"), driftTemplateId, hasWriteAccess);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java
index f95cf77..801b258 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftHistoryView.java
@@ -158,7 +158,7 @@ public class DriftHistoryView extends StringIDTableSection<DriftDataSource> {
Integer resourceId = record.getAttributeAsInt(AncestryUtil.RESOURCE_ID);
Integer driftDefId = record.getAttributeAsInt(DriftDataSource.ATTR_CHANGESET_DEF_ID);
String driftId = getId(record);
- String url = LinkManager.getDriftHistoryLink(resourceId, driftDefId, driftId);
+ String url = LinkManager.getDriftCarouselDriftLink(resourceId, driftDefId, driftId);
String formattedValue = TimestampCellFormatter.format(value);
return SeleniumUtility.getLocatableHref(url, formattedValue, null);
}
@@ -166,77 +166,8 @@ public class DriftHistoryView extends StringIDTableSection<DriftDataSource> {
}
protected void setupTableInteractions(final boolean hasWriteAccess) {
-
- /*
- * TODO add ack
- *
- TableActionEnablement singleTargetEnablement = hasWriteAccess ? TableActionEnablement.ANY
- : TableActionEnablement.NEVER;
-
- addTableAction("AcknowledgeDrift", MSG.common_button_ack(), MSG.view_drift_ack_confirm(),
- new AbstractTableAction(singleTargetEnablement) {
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- acknowledge(selection);
- }
- });
-
- addTableAction("AcknowledgeAll", MSG.common_button_ack_all(), MSG.view_drift_ack_confirm_all(),
- new TableAction() {
- public boolean isEnabled(ListGridRecord[] selection) {
- ListGrid grid = getListGrid();
- ResultSet resultSet = (null != grid) ? grid.getResultSet() : null;
- return (hasWriteAccess && grid != null && resultSet != null && !resultSet.isEmpty());
- }
-
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- acknowledgeAll();
- }
- });
- *
- *
- */
- }
-
- /*
- * TODO add ack
- *
- private void acknowledge(ListGridRecord[] records) {
- final int[] alertIds = new int[records.length];
- for (int i = 0, selectionLength = records.length; i < selectionLength; i++) {
- ListGridRecord record = records[i];
- Integer alertId = record.getAttributeAsInt(DriftDataSource.ATTR_ID);
- alertIds[i] = alertId;
- }
-
- GWTServiceLookup.getDriftService().acknowledgeDrifts(alertIds, new AsyncCallback<Integer>() {
- public void onSuccess(Integer resultCount) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.view_drift_ack_success(String.valueOf(resultCount)), Message.Severity.Info));
- refresh();
- }
-
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_drift_ack_failure(Arrays.toString(alertIds)), caught);
- }
- });
- }
-
- private void acknowledgeAll() {
- GWTServiceLookup.getDriftService().acknowledgeDriftsByContext(context, new AsyncCallback<Integer>() {
- public void onSuccess(Integer resultCount) {
- CoreGUI.getMessageCenter().notify(
- new Message(MSG.view_drift_ack_success(String.valueOf(resultCount)), Message.Severity.Info));
- refresh();
- }
-
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_drift_ack_failure_all(), caught);
- }
- });
+ // currently no buttons, etc
}
- *
- *
- */
@Override
public Canvas getDetailsView(String driftId) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
index 570f6f0..e0996eb 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
@@ -32,6 +32,8 @@ import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ExpansionMode;
import com.smartgwt.client.types.ListGridFieldType;
import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.events.DoubleClickEvent;
+import com.smartgwt.client.widgets.events.DoubleClickHandler;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.HoverCustomizer;
import com.smartgwt.client.widgets.grid.ListGrid;
@@ -70,8 +72,9 @@ import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
*
* @author Jay Shaughnessy
*/
+// TODO: Make this extend an abstract table so we can set up true master-detail
+//public class DriftSnapshotView extends StringIDTableSection<DriftSnapshotDataSource> {
public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
-
private static final String DEFAULT_TITLE = MSG.view_drift_table_snapshot();
private Integer templateId;
@@ -81,6 +84,7 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
private boolean hasWriteAccess;
private String templateChangeSetId;
+ private int templateResourceTypeId;
protected DriftSnapshotDataSource dataSource;
protected DriftSnapshotListGrid listGrid;
@@ -159,6 +163,7 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
} else {
DriftDefinitionTemplateCriteria templateCriteria = new DriftDefinitionTemplateCriteria();
templateCriteria.addFilterId(templateId);
+ templateCriteria.fetchResourceType(true);
DriftGWTServiceAsync driftService = GWTServiceLookup.getDriftService();
driftService.findDriftDefinitionTemplatesByCriteria(templateCriteria,
@@ -172,6 +177,7 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
String templateName = template.getName();
String title = MSG.view_drift_table_title_templateSnapshot(templateName);
setTitleString(title);
+ templateResourceTypeId = template.getResourceType().getId();
DriftSnapshotView.super.onDraw();
}
});
@@ -288,6 +294,23 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
getListGrid().setFields(dataSourceFields.toArray(new ListGridField[dataSourceFields.size()]));
super.configureTable();
+
+ // TODO: when we have true detail support then we'll want to remove this.
+ setListGridDoubleClickHandler(new DoubleClickHandler() {
+ @Override
+ public void onDoubleClick(DoubleClickEvent event) {
+ ListGrid listGrid = (ListGrid) event.getSource();
+ ListGridRecord[] selectedRows = listGrid.getSelection();
+ if (selectedRows != null && selectedRows.length == 1) {
+ String driftId = getId(selectedRows[0]);
+ String link = (null == templateId) ? LinkManager.getDriftCarouselSnapshotDriftLink(resourceId,
+ driftDefId, version, driftId) : LinkManager.getDriftTemplateSnapshotDriftLink(
+ templateResourceTypeId, templateId, driftId);
+ CoreGUI.goToView(link);
+
+ }
+ }
+ });
}
@Override
@@ -302,9 +325,12 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
return new CellFormatter() {
public String format(Object value, ListGridRecord record, int i, int i1) {
String driftId = getId(record);
- String url = LinkManager.getDriftHistoryLink(resourceId, driftDefId, driftId);
+ String link = (null == templateId) ? LinkManager.getDriftCarouselSnapshotDriftLink(resourceId,
+ driftDefId, version, driftId) : LinkManager.getDriftTemplateSnapshotDriftLink(
+ templateResourceTypeId, templateId, driftId);
+
String formattedValue = TimestampCellFormatter.format(value);
- return SeleniumUtility.getLocatableHref(url, formattedValue, null);
+ return SeleniumUtility.getLocatableHref(link, formattedValue, null);
}
};
} else {
@@ -488,4 +514,20 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
return (i < 0) ? path.trim() : path.substring(++i).trim();
}
+ // TODO: Make this extend an abstract table so we can set up true master-detail
+
+ /*
+ @Override
+ public void renderView(ViewPath viewPath) {
+ viewPath.next();
+ super.renderView(viewPath);
+ }
+
+
+ @Override
+ public Canvas getDetailsView(String driftId) {
+ return new DriftDetailsView(extendLocatorId("Details"), driftId);
+ }
+ */
+
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
index c9c3a2f..5521ef5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/AlertDefinitionReportView.java
@@ -175,7 +175,7 @@ public class AlertDefinitionReportView extends Table<AlertDefinitionReportView.D
} else {
int typeId = result.get(0).getResourceType().getId();
CoreGUI.goToView(LinkManager.getAdminTemplatesEditLink(
- AlertDefinitionTemplateTypeView.VIEW_ID.getName(), String.valueOf(typeId))
+ AlertDefinitionTemplateTypeView.VIEW_ID.getName(), typeId)
+ "/" + templateId);
}
}
commit 63a5553e1160bf7088fa891c8336a7d9a01cd172
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Oct 27 11:41:13 2011 -0400
Coregui: add ability to get the current viewpath index. Without this
viewsLeft() and getViewForIndex() are not very useful.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java
index 47b1f91..e448610 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/ViewPath.java
@@ -53,7 +53,7 @@ public class ViewPath {
public String getParentViewPath() {
return getPathToIndex(this.index - 1);
}
-
+
public ViewPath next() {
index++;
return this;
@@ -75,6 +75,10 @@ public class ViewPath {
}
}
+ public int getCurrentIndex() {
+ return index;
+ }
+
public String getPathToCurrent() {
return getPathToIndex(this.index);
}
@@ -102,13 +106,12 @@ public class ViewPath {
return !(isEnd() || providedViewId == null || !getCurrent().equals(providedViewId));
}
-
public boolean isNext(ViewId providedViewId) {
return ((index + 1) < viewPath.size() && providedViewId != null && getNext().equals(providedViewId));
}
public boolean isNextEnd() {
- return viewPath.size() <= index+1;
+ return viewPath.size() <= index + 1;
}
public int viewsLeft() {
@@ -135,4 +138,3 @@ public class ViewPath {
return path;
}
}
-
commit 4b7939e0b72c3d2a220b58e97dde8d8a63f4c021
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Oct 27 11:39:54 2011 -0400
Fix subtle caching issues suffered by the drift template wizards because
of the way we were gathering a type's drift def templates. Now always
gather this through the typerepository mechanism, which has been updated
to handle things correctly.
- also, fix the message supplied for a successful template pinning
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizard.java
index ee9016a..cb59f03 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizard.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizard.java
@@ -19,12 +19,12 @@
package org.rhq.enterprise.gui.coregui.client.drift.wizard;
import java.util.ArrayList;
+import java.util.EnumSet;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.criteria.ResourceCriteria;
-import org.rhq.core.domain.criteria.ResourceTypeCriteria;
import org.rhq.core.domain.drift.DriftDefinitionTemplate;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
@@ -33,6 +33,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
@@ -42,7 +43,7 @@ public class DriftAddDefinitionWizard extends AbstractDriftAddDefinitionWizard {
private Table<?> table;
- public DriftAddDefinitionWizard(EntityContext context, ResourceType type, Table<?> table) {
+ protected DriftAddDefinitionWizard(EntityContext context, ResourceType type, Table<?> table) {
super(context, type);
this.table = table;
@@ -110,7 +111,7 @@ public class DriftAddDefinitionWizard extends AbstractDriftAddDefinitionWizard {
break;
- case SubsystemView:
+ case ResourceTemplate:
GWTServiceLookup.getDriftService().createTemplate(getType().getId(), getNewDriftDefinition(),
new AsyncCallback<DriftDefinitionTemplate>() {
public void onSuccess(DriftDefinitionTemplate result) {
@@ -150,30 +151,8 @@ public class DriftAddDefinitionWizard extends AbstractDriftAddDefinitionWizard {
throw new IllegalArgumentException("Entity not found [" + context + "]");
}
- final Resource resource = result.get(0);
-
- // bypass type cache because this is infrequent and we don't need to cache the
- // drift def templates
- ResourceTypeCriteria rtc = new ResourceTypeCriteria();
- rtc.addFilterId(resource.getResourceType().getId());
- rtc.fetchDriftDefinitionTemplates(true);
- GWTServiceLookup.getResourceTypeGWTService().findResourceTypesByCriteria(rtc,
- new AsyncCallback<PageList<ResourceType>>() {
- public void onSuccess(PageList<ResourceType> result) {
- if (result.isEmpty()) {
- throw new IllegalArgumentException("Resource Type not found ["
- + resource.getResourceType().getId() + "]");
- }
-
- DriftAddDefinitionWizard wizard = new DriftAddDefinitionWizard(context, result.get(0),
- table);
- wizard.startWizard();
- }
-
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.widget_typeTree_loadFail(), caught);
- }
- });
+ Resource resource = result.get(0);
+ showWizard(context, resource.getResourceType().getId(), table);
}
public void onFailure(Throwable caught) {
@@ -183,11 +162,29 @@ public class DriftAddDefinitionWizard extends AbstractDriftAddDefinitionWizard {
break;
+ case ResourceTemplate:
+ showWizard(context, context.getResourceTypeId(), table);
+
+ break;
+
default:
throw new IllegalArgumentException("Entity Context Type not supported [" + context + "]");
}
}
+ private static void showWizard(final EntityContext context, int resourceTypeId, final Table<?> table) {
+
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(resourceTypeId,
+ EnumSet.of(ResourceTypeRepository.MetadataType.driftDefinitionTemplates),
+ new ResourceTypeRepository.TypeLoadedCallback() {
+
+ public void onTypesLoaded(ResourceType type) {
+ DriftAddDefinitionWizard wizard = new DriftAddDefinitionWizard(context, type, table);
+ wizard.startWizard();
+ }
+ });
+ }
+
@Override
public void cancel() {
super.cancel();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizard.java
index 77fd037..2a24e9b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizard.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizard.java
@@ -19,11 +19,11 @@
package org.rhq.enterprise.gui.coregui.client.drift.wizard;
import java.util.ArrayList;
+import java.util.EnumSet;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.rhq.core.domain.criteria.DriftDefinitionCriteria;
-import org.rhq.core.domain.criteria.ResourceTypeCriteria;
import org.rhq.core.domain.drift.DriftDefinition;
import org.rhq.core.domain.drift.DriftDefinitionTemplate;
import org.rhq.core.domain.resource.Resource;
@@ -33,6 +33,7 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.wizard.WizardStep;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
+import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
/**
@@ -104,15 +105,15 @@ public class DriftPinTemplateWizard extends AbstractDriftPinTemplateWizard {
public void onSuccess(Void result) {
CoreGUI.getMessageCenter().notify(
- new Message(MSG.view_drift_wizard_addTemplate_success(template.getName()),
+ new Message(MSG.view_drift_wizard_pinTemplate_success(template.getName()),
Message.Severity.Info));
getView().closeDialog();
DriftPinTemplateWizard.this.table.refresh();
}
public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(
- MSG.view_drift_wizard_addDef_failure(template.getName()), caught);
+ CoreGUI.getErrorHandler().handleError(MSG.view_drift_wizard_addDef_failure(template.getName()),
+ caught);
getView().closeDialog();
}
});
@@ -146,25 +147,12 @@ public class DriftPinTemplateWizard extends AbstractDriftPinTemplateWizard {
final DriftDefinition driftDef = result.get(0);
final Resource resource = driftDef.getResource();
- // bypass type cache because this is infrequent and we don't need to cache the
- // drift def templates
- ResourceTypeCriteria rtc = new ResourceTypeCriteria();
- rtc.addFilterId(resource.getResourceType().getId());
- rtc.fetchDriftDefinitionTemplates(true);
- GWTServiceLookup.getResourceTypeGWTService().findResourceTypesByCriteria(rtc,
- new AsyncCallback<PageList<ResourceType>>() {
-
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.widget_typeTree_loadFail(), caught);
- }
-
- public void onSuccess(PageList<ResourceType> result) {
- if (result.isEmpty()) {
- throw new IllegalArgumentException("Resource Type not found ["
- + resource.getResourceType().getId() + "]");
- }
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(resource.getResourceType().getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.driftDefinitionTemplates),
+ new ResourceTypeRepository.TypeLoadedCallback() {
- DriftPinTemplateWizard wizard = new DriftPinTemplateWizard(result.get(0), driftDef,
+ public void onTypesLoaded(ResourceType type) {
+ DriftPinTemplateWizard wizard = new DriftPinTemplateWizard(type, driftDef,
snapshotVersion, table);
wizard.startWizard();
}
commit d2d837f9831b06c4d4f8c34ea58837466a6f18da
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Oct 27 11:31:21 2011 -0400
Coregui: Add the ability for the ResourceType cache to provide non-cached
data. This means for non-cached metadata types we'll always call to the db.
This is basically a convenience such that we can make a single call through
this mechanism to gather all the needed data for a type. Whether it
merges cached and uncached data remains a black box to the caller.
- set driftDefinitionTemplates as non-cached metadata because the drift
templates available on a type can change as user-defined templates come
and go.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
index 6a38d89..2b3dbb1 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java
@@ -57,8 +57,29 @@ public class ResourceTypeRepository {
private static ResourceTypeGWTServiceAsync resourceTypeService = GWTServiceLookup.getResourceTypeGWTService();
+ /**
+ * The following MetadadaTypes are not cached and will always be queried from the database:<br/>
+ * driftDefinitionTemplates
+ *
+ * @author Jay Shaughnessy
+ */
public enum MetadataType {
- children, operations, measurements, content, events, pluginConfigurationDefinition, resourceConfigurationDefinition, subCategory, parentTypes, processScans, productVersions, driftDefinitionTemplates
+ children, operations, measurements, content, events, pluginConfigurationDefinition, resourceConfigurationDefinition, subCategory, parentTypes, processScans, productVersions, driftDefinitionTemplates(
+ false);
+
+ private boolean isCachedMetadata;
+
+ private MetadataType() {
+ this.isCachedMetadata = true;
+ }
+
+ private MetadataType(boolean isCachedMetadata) {
+ this.isCachedMetadata = isCachedMetadata;
+ }
+
+ public boolean isCachedMetadata() {
+ return isCachedMetadata;
+ }
}
public static class Cache {
@@ -248,8 +269,7 @@ public class ResourceTypeRepository {
criteria.fetchDriftDefinitionTemplates(true);
break;
default:
- Log.error("Metadata type [" + metadataType.name()
- + "] not incorporated into ResourceType criteria.");
+ Log.error("Metadata type [" + metadataType.name() + "] not incorporated into ResourceType criteria.");
}
}
@@ -375,7 +395,11 @@ public class ResourceTypeRepository {
if (typeCacheLevel.containsKey(type.getId())) {
typeCacheLevel.get(type.getId()).addAll(metadataTypes);
} else {
- typeCacheLevel.put(type.getId(), EnumSet.copyOf(metadataTypes));
+ for (MetadataType metadataType : metadataTypes) {
+ if (metadataType.isCachedMetadata) {
+ typeCacheLevel.put(type.getId(), EnumSet.copyOf(metadataTypes));
+ }
+ }
}
}
}
commit d48b81b3a66b24e3bf4727650bd8ce05ab68fbab
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Oct 27 11:26:54 2011 -0400
Add optional fetch for DriftDefinitionTemplate.resourceType
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftDefinitionTemplateCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftDefinitionTemplateCriteria.java
index ce1c017..d4ff131 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftDefinitionTemplateCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/DriftDefinitionTemplateCriteria.java
@@ -29,6 +29,7 @@ public class DriftDefinitionTemplateCriteria extends Criteria {
private String filterName;
private Integer filterResourceTypeId;
+ private boolean fetchResourceType;
private boolean fetchDriftDefinitions;
public DriftDefinitionTemplateCriteria() {
@@ -40,19 +41,23 @@ public class DriftDefinitionTemplateCriteria extends Criteria {
return DriftDefinitionTemplate.class;
}
- public void addFilterId(Integer id) {
- filterId = id;
+ public void addFilterId(Integer filterId) {
+ this.filterId = filterId;
}
- public void addFilterName(String name) {
- filterName = name;
+ public void addFilterName(String filterName) {
+ this.filterName = filterName;
}
- public void addFilterResourceTypeId(Integer resourceTypeId) {
- filterResourceTypeId = resourceTypeId;
+ public void addFilterResourceTypeId(Integer filterResourceTypeId) {
+ this.filterResourceTypeId = filterResourceTypeId;
}
- public void fetchDriftDefinitions(boolean fetchDefinitions) {
- fetchDriftDefinitions = fetchDefinitions;
+ public void fetchResourceType(boolean fetchResourceType) {
+ this.fetchResourceType = fetchResourceType;
+ }
+
+ public void fetchDriftDefinitions(boolean fetchDriftDefinitions) {
+ this.fetchDriftDefinitions = fetchDriftDefinitions;
}
}
commit b318ac65980530c4f2cd3c79657b82c4baf7b655
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Oct 27 11:25:27 2011 -0400
Drift - Make JPADrift.changeSet not null. This field should never be
null so define it that way. For a while nulls were allowed but that is
no longer the case as every drift should refer to either a pinned template's
change set or a drift definition's change set.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
index 76613d2..d6975d5 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/content-schema.xml
@@ -728,7 +728,7 @@
<column name="CTIME" type="LONG" required="true"/>
<column name="CATEGORY" type="VARCHAR2" size="20" required="true"/>
<column name="DRIFT_SET_ID" type="INTEGER" required="false" references="RHQ_DRIFT_SET"/>
- <column name="DRIFT_CHANGE_SET_ID" type="INTEGER" required="false" references="RHQ_DRIFT_CHANGE_SET"/>
+ <column name="DRIFT_CHANGE_SET_ID" type="INTEGER" required="true" references="RHQ_DRIFT_CHANGE_SET"/>
<!-- the file path not including the base directory -->
<column name="PATH" type="VARCHAR2" size="1024" required="true"/>
<!-- the same as PATH less [/]filename.ext. Redundant storage for the purpose of strict directory search.
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index bd040c6..9221532 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3617,6 +3617,7 @@
<schema-addColumn table="RHQ_DRIFT" column="PATH_DIRECTORY" columnType="VARCHAR2" precision="1024" />
<schema-alterColumn table="RHQ_DRIFT" column="PATH_DIRECTORY" nullable="FALSE" />
<schema-addColumn table="RHQ_DRIFT" column="DRIFT_CHANGE_SET_ID" columnType="INTEGER" />
+ <schema-alterColumn table="RHQ_DRIFT" column="DRIFT_CHANGE_SET_ID" nullable="FALSE" />
<schema-addColumn table="RHQ_DRIFT" column="DRIFT_SET_ID" columnType="INTEGER"/>
<schema-directSQL>
<statement desc="Creating RHQ_DRIFT foreign key relation to RHQ_DRIFT_CHANGE_SET">
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java
index acfc55d..049dc6f 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java
@@ -84,8 +84,8 @@ public class JPADrift implements Serializable, Drift<JPADriftChangeSet, JPADrift
@Enumerated(EnumType.STRING)
private String directory;
- @JoinColumn(name = "DRIFT_CHANGE_SET_ID", referencedColumnName = "ID", nullable = true)
- @ManyToOne(fetch = FetchType.LAZY, optional = true)
+ @JoinColumn(name = "DRIFT_CHANGE_SET_ID", referencedColumnName = "ID", nullable = false)
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
private JPADriftChangeSet changeSet;
@JoinColumn(name = "OLD_DRIFT_FILE", referencedColumnName = "HASH_ID", nullable = true)
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index 8c7b506..882d22e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -233,11 +233,14 @@ public class JPADriftServerBean implements JPADriftServerLocal {
for (Drift<?, ?> drift : changeSet.getDrifts()) {
JPADrift jpaDrift = new JPADrift(jpaChangeSet, drift.getPath(), drift.getCategory(), toJPADriftFile(drift
.getOldDriftFile()), toJPADriftFile(drift.getNewDriftFile()));
+
driftSet.addDrift(jpaDrift);
}
+ entityManager.persist(jpaChangeSet);
+
entityManager.persist(driftSet);
+
jpaChangeSet.setInitialDriftSet(driftSet);
- entityManager.persist(jpaChangeSet);
return jpaChangeSet.getId();
}
@@ -322,9 +325,9 @@ public class JPADriftServerBean implements JPADriftServerLocal {
+ "]. Change set cannot be saved.");
return false;
}
- // Commenting out the following line for now. We want to set the
- // version to the value specified in the headers, but we also
- // want to get the latest version we have in the database so that
+ // TODO: Commenting out the following line for now. We want to set the
+ // version to the value specified in the headers, but we may want to also
+ // validate it against the latest version we have in the database so that
// we can make sure that the agent is in sync with the server.
//
//int version = getChangeSetVersion(resource, config);
@@ -370,7 +373,11 @@ public class JPADriftServerBean implements JPADriftServerLocal {
for (FileEntry entry : reader) {
JPADriftFile newDriftFile = getDriftFile(entry.getNewSHA(), emptyDriftFiles);
String path = FileUtil.useForwardSlash(entry.getFile());
- driftSet.addDrift(new JPADrift(null, path, entry.getType(), null, newDriftFile));
+ // A Drift always has a changeSet. Note that in this code section the changeset is
+ // always going to be set to a DriftDefinition's changeSet. But that is not always the
+ // case, it could also be set to a DriftDefinitionTemplate's changeSet.
+ driftSet.addDrift(new JPADrift(driftChangeSet, path, entry.getType(), null,
+ newDriftFile));
}
entityManager.persist(driftSet);
driftChangeSet.setInitialDriftSet(driftSet);
commit 8cc09ef54e6dcef2a37bbdec98d5490d07877f9a
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Oct 26 21:39:39 2011 -0400
[BZ 749415] Control drift def fields that are rendered and editable
Depending on the type of definition you are creating/editing, certain
fields should either be read-only or not rendered at all. See
https://bugzilla.redhat.com/show_bug.cgi?id=749415 a detailed
description and specification of what should be read-only and rendered
and when.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
index a5e54ca..c2398e1 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftConfigurationDefinition.java
@@ -100,6 +100,22 @@ public class DriftConfigurationDefinition implements Serializable {
private static final ConfigurationDefinition INSTANCE_FOR_EXISTING_CONFIGS = new ConfigurationDefinition(
"GLOBAL_DRIFT_CONFIG_DEF", "The drift detection definition");
+ private static final ConfigurationDefinition NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE = new ConfigurationDefinition(
+ "NEW_RESOURCE_DRIFT_DEF_BY_PINNED_TEMPLATE", "A new resource drift definition created from a pinned template");
+
+ private static final ConfigurationDefinition EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE =
+ new ConfigurationDefinition("EXISTING_RESOURCE_DRIFT_DEF_BY_PINNED_TEMPLATE",
+ "An existing resource drift definition created from a pinned template");
+
+ private static final ConfigurationDefinition NEW_TEMPLATE_INSTANCE = new ConfigurationDefinition(
+ "NEW_TEMPLATE_DRIFT_CONFIG_DEF", "A new template drift definition");
+
+ private static final ConfigurationDefinition EXISTING_TEMPLATE_INSTANCE = new ConfigurationDefinition(
+ "EXISTING_TEMPLATE_DRIFT_CONFIG_DEF", "An existing template drift definition");
+
+ private static final ConfigurationDefinition NEW_PINNED_TEMPLATE_INSTANCE = new ConfigurationDefinition(
+ "NEW_PINNED_TEMPLATE_DRIFT_CONFIG_DEF", "A new pinned template drift definition");
+
/**
* Returns a configuration definition suitable for showing a new configuration form - that is,
* a configuration that has not yet been created.
@@ -124,6 +140,26 @@ public class DriftConfigurationDefinition implements Serializable {
return INSTANCE_FOR_EXISTING_CONFIGS;
}
+ public static ConfigurationDefinition getNewResourceInstanceByPinnedTemplate() {
+ return NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE;
+ }
+
+ public static ConfigurationDefinition getExistingResourceInstanceByPinnedTemplate() {
+ return EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE;
+ }
+
+ public static ConfigurationDefinition getNewTemplateInstance() {
+ return NEW_TEMPLATE_INSTANCE;
+ }
+
+ public static ConfigurationDefinition getExistingTemplateInstance() {
+ return EXISTING_TEMPLATE_INSTANCE;
+ }
+
+ public static ConfigurationDefinition getNewPinnedTemplateInstance() {
+ return NEW_PINNED_TEMPLATE_INSTANCE;
+ }
+
static {
INSTANCE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
INSTANCE.put(createName(INSTANCE, false));
@@ -134,8 +170,8 @@ public class DriftConfigurationDefinition implements Serializable {
INSTANCE.put(createBasedir(INSTANCE, false));
INSTANCE.put(createIncludes(INSTANCE, false));
INSTANCE.put(createExcludes(INSTANCE, false));
- INSTANCE.put(createPinned(INSTANCE));
- INSTANCE.put(createAttached(INSTANCE));
+ INSTANCE.put(createPinned(INSTANCE, false));
+ INSTANCE.put(createAttached(INSTANCE, false));
INSTANCE_FOR_EXISTING_CONFIGS.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
INSTANCE_FOR_EXISTING_CONFIGS.put(createName(INSTANCE_FOR_EXISTING_CONFIGS, true));
@@ -146,7 +182,69 @@ public class DriftConfigurationDefinition implements Serializable {
INSTANCE_FOR_EXISTING_CONFIGS.put(createBasedir(INSTANCE_FOR_EXISTING_CONFIGS, true));
INSTANCE_FOR_EXISTING_CONFIGS.put(createIncludes(INSTANCE_FOR_EXISTING_CONFIGS, true));
INSTANCE_FOR_EXISTING_CONFIGS.put(createExcludes(INSTANCE_FOR_EXISTING_CONFIGS, true));
- INSTANCE_FOR_EXISTING_CONFIGS.put(createPinned(INSTANCE_FOR_EXISTING_CONFIGS));
+ INSTANCE_FOR_EXISTING_CONFIGS.put(createExcludes(INSTANCE_FOR_EXISTING_CONFIGS, true));
+ INSTANCE_FOR_EXISTING_CONFIGS.put(createAttached(INSTANCE_FOR_EXISTING_CONFIGS, false));
+ INSTANCE_FOR_EXISTING_CONFIGS.put(createPinned(INSTANCE_FOR_EXISTING_CONFIGS, true));
+
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createName(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE, false));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createDescription(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createInterval(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createEnabled(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createDriftHandlingMode(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createBasedir(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE, true));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createIncludes(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE, true));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createExcludes(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE, true));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createPinned(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE, true));
+ NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createAttached(NEW_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE, true));
+
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createName(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
+ true));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createDescription(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createInterval(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createEnabled(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createDriftHandlingMode(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createBasedir(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
+ true));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createIncludes(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
+ true));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createExcludes(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
+ true));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createPinned(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
+ true));
+ EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE.put(createAttached(EXISTING_RESOURCE_INSTANCE_BY_PINNED_TEMPLATE,
+ true));
+
+ NEW_TEMPLATE_INSTANCE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
+ NEW_TEMPLATE_INSTANCE.put(createName(NEW_TEMPLATE_INSTANCE, false));
+ NEW_TEMPLATE_INSTANCE.put(createDescription(NEW_TEMPLATE_INSTANCE));
+ NEW_TEMPLATE_INSTANCE.put(createInterval(NEW_TEMPLATE_INSTANCE));
+ NEW_TEMPLATE_INSTANCE.put(createEnabled(NEW_TEMPLATE_INSTANCE));
+ NEW_TEMPLATE_INSTANCE.put(createDriftHandlingMode(NEW_TEMPLATE_INSTANCE));
+ NEW_TEMPLATE_INSTANCE.put(createBasedir(NEW_TEMPLATE_INSTANCE, false));
+ NEW_TEMPLATE_INSTANCE.put(createIncludes(NEW_TEMPLATE_INSTANCE, false));
+ NEW_TEMPLATE_INSTANCE.put(createExcludes(NEW_TEMPLATE_INSTANCE, false));
+
+ EXISTING_TEMPLATE_INSTANCE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
+ EXISTING_TEMPLATE_INSTANCE.put(createName(EXISTING_TEMPLATE_INSTANCE, true));
+ EXISTING_TEMPLATE_INSTANCE.put(createDescription(EXISTING_TEMPLATE_INSTANCE));
+ EXISTING_TEMPLATE_INSTANCE.put(createInterval(EXISTING_TEMPLATE_INSTANCE));
+ EXISTING_TEMPLATE_INSTANCE.put(createEnabled(EXISTING_TEMPLATE_INSTANCE));
+ EXISTING_TEMPLATE_INSTANCE.put(createDriftHandlingMode(EXISTING_TEMPLATE_INSTANCE));
+ EXISTING_TEMPLATE_INSTANCE.put(createBasedir(EXISTING_TEMPLATE_INSTANCE, true));
+ EXISTING_TEMPLATE_INSTANCE.put(createIncludes(EXISTING_TEMPLATE_INSTANCE, true));
+ EXISTING_TEMPLATE_INSTANCE.put(createExcludes(EXISTING_TEMPLATE_INSTANCE, true));
+
+ NEW_PINNED_TEMPLATE_INSTANCE.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
+ NEW_PINNED_TEMPLATE_INSTANCE.put(createName(NEW_PINNED_TEMPLATE_INSTANCE, false));
+ NEW_PINNED_TEMPLATE_INSTANCE.put(createDescription(NEW_PINNED_TEMPLATE_INSTANCE));
+ NEW_PINNED_TEMPLATE_INSTANCE.put(createInterval(NEW_PINNED_TEMPLATE_INSTANCE));
+ NEW_PINNED_TEMPLATE_INSTANCE.put(createEnabled(NEW_PINNED_TEMPLATE_INSTANCE));
+ NEW_PINNED_TEMPLATE_INSTANCE.put(createDriftHandlingMode(NEW_PINNED_TEMPLATE_INSTANCE));
+ NEW_PINNED_TEMPLATE_INSTANCE.put(createBasedir(NEW_PINNED_TEMPLATE_INSTANCE, true));
+ NEW_PINNED_TEMPLATE_INSTANCE.put(createIncludes(NEW_PINNED_TEMPLATE_INSTANCE, true));
+ NEW_PINNED_TEMPLATE_INSTANCE.put(createExcludes(NEW_PINNED_TEMPLATE_INSTANCE, true));
}
private static PropertyDefinitionSimple createName(ConfigurationDefinition configDef, boolean readOnly) {
@@ -203,7 +301,7 @@ public class DriftConfigurationDefinition implements Serializable {
return pd;
}
- private static PropertyDefinitionSimple createAttached(ConfigurationDefinition configDef) {
+ private static PropertyDefinitionSimple createAttached(ConfigurationDefinition configDef, boolean readOnly) {
String name = PROP_ATTACHED;
String description = "A flag that indicates whether or not the definition is attached to the template from " +
"which it is created. When a template is updated, the changes will be propagated to any attached " +
@@ -216,6 +314,7 @@ public class DriftConfigurationDefinition implements Serializable {
pd.setDisplayName("Attached to Template");
pd.setDefaultValue("true");
pd.setOrder(3);
+ pd.setReadOnly(readOnly);
pd.setConfigurationDefinition(configDef);
return pd;
@@ -258,7 +357,7 @@ public class DriftConfigurationDefinition implements Serializable {
return pd;
}
- private static PropertyDefinitionSimple createPinned(ConfigurationDefinition configDef) {
+ private static PropertyDefinitionSimple createPinned(ConfigurationDefinition configDef, boolean readOnly) {
String name = PROP_PINNED;
String description = "If set, pins the snapshot that the agent uses for comparing files during drift "
+ "detection. Normally, the agent compares those files being monitored for drift against the latest "
@@ -271,6 +370,7 @@ public class DriftConfigurationDefinition implements Serializable {
pd.setDisplayName("Pinned");
pd.setDefaultValue("false");
pd.setOrder(5);
+ pd.setReadOnly(readOnly);
pd.setConfigurationDefinition(configDef);
return pd;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java
index 98450a6..802327a 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java
@@ -201,11 +201,16 @@ public class DriftDefinitionTemplate implements Serializable {
}
public Configuration createConfiguration() {
- return configuration.deepCopyWithoutProxies();
+ return createDefinition().getConfiguration();
}
public DriftDefinition createDefinition() {
- return new DriftDefinition(configuration.deepCopyWithoutProxies());
+ DriftDefinition definition = new DriftDefinition(configuration.deepCopyWithoutProxies());
+ definition.setAttached(true);
+ definition.setPinned(isPinned());
+ definition.setTemplate(this);
+
+ return definition;
}
public boolean isPinned() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java
index 1808dfa..21c5d7b 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionEditView.java
@@ -30,6 +30,7 @@ import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.drift.DriftConfigurationDefinition;
import org.rhq.core.domain.drift.DriftDefinition;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
@@ -116,9 +117,14 @@ public class DriftDefinitionEditView extends LocatableVLayout implements Propert
GWTServiceLookup.getDriftService().getDriftDefinition(driftDefId, new AsyncCallback<DriftDefinition>() {
@Override
public void onSuccess(final DriftDefinition result) {
+ ConfigurationDefinition configDef = null;
+ if (result.getTemplate() != null && result.getTemplate().isPinned()) {
+ configDef = DriftConfigurationDefinition.getExistingResourceInstanceByPinnedTemplate();
+ } else {
+ configDef = DriftConfigurationDefinition.getInstanceForExistingConfiguration();
+ }
- editor = new ConfigurationEditor(extendLocatorId("Editor"), DriftConfigurationDefinition
- .getInstanceForExistingConfiguration(), result.getConfiguration());
+ editor = new ConfigurationEditor(extendLocatorId("Editor"), configDef, result.getConfiguration());
editor.setOverflow(Overflow.AUTO);
editor.addPropertyValueChangeListener(DriftDefinitionEditView.this);
editor.setReadOnly(!hasWriteAccess);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java
index 5f60e8c..d7541c7 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionTemplateEditView.java
@@ -121,7 +121,7 @@ public class DriftDefinitionTemplateEditView extends LocatableVLayout implements
DriftDefinitionTemplate template = result.get(0);
editor = new ConfigurationEditor(extendLocatorId("Editor"), DriftConfigurationDefinition
- .getInstanceForExistingConfiguration(), template.getConfiguration());
+ .getExistingTemplateInstance(), template.getConfiguration());
editor.setOverflow(Overflow.AUTO);
editor.addPropertyValueChangeListener(DriftDefinitionTemplateEditView.this);
editor.setReadOnly(!hasWriteAccess);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java
index a0b15f5..9b0c9d9 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftAddDefinitionWizardConfigStep.java
@@ -55,7 +55,7 @@ public class DriftAddDefinitionWizardConfigStep extends AbstractWizardStep {
// keep a reference to the startingConfig in case the user navs back and changes it
startingConfig = wizard.getNewStartingConfiguration();
- ConfigurationDefinition def = DriftConfigurationDefinition.getInstance();
+ ConfigurationDefinition def = getDriftConfigDef();
editor = new ConfigurationEditor(vLayout.extendLocatorId("Editor"), def, startingConfig);
vLayout.addMember(editor);
}
@@ -63,6 +63,17 @@ public class DriftAddDefinitionWizardConfigStep extends AbstractWizardStep {
return vLayout;
}
+ private ConfigurationDefinition getDriftConfigDef() {
+ if (wizard.getEntityContext().isSubsystemView()) {
+ return DriftConfigurationDefinition.getNewTemplateInstance();
+ }
+
+ if (wizard.getSelectedTemplate().isPinned()) {
+ return DriftConfigurationDefinition.getNewResourceInstanceByPinnedTemplate();
+ }
+ return DriftConfigurationDefinition.getInstance();
+ }
+
public boolean nextPage() {
if (editor != null && editor.validate()) {
wizard.setNewConfiguration(editor.getConfiguration());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
index 2917689..ccbe621 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/wizard/DriftPinTemplateWizardConfigStep.java
@@ -61,7 +61,7 @@ public class DriftPinTemplateWizardConfigStep extends AbstractWizardStep {
vLayout.setOverflow(Overflow.AUTO);
Configuration startingConfig = wizard.getSnapshotDriftDef().getConfiguration();
- ConfigurationDefinition def = DriftConfigurationDefinition.getInstance();
+ ConfigurationDefinition def = DriftConfigurationDefinition.getNewPinnedTemplateInstance();
editor = new ConfigurationEditor(vLayout.extendLocatorId("Editor"), def, startingConfig);
vLayout.addMember(editor);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index b7779a3..3b1626c 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -43,11 +43,9 @@ import javax.jms.Session;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-import difflib.DiffUtils;
-import difflib.Patch;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.Hibernate;
import org.jboss.remoting.CannotConnectException;
@@ -65,8 +63,10 @@ import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftChangeSetCategory;
import org.rhq.core.domain.drift.DriftComposite;
import org.rhq.core.domain.drift.DriftConfigurationDefinition;
+import org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode;
import org.rhq.core.domain.drift.DriftDefinition;
import org.rhq.core.domain.drift.DriftDefinitionComparator;
+import org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode;
import org.rhq.core.domain.drift.DriftDefinitionComposite;
import org.rhq.core.domain.drift.DriftDefinitionTemplate;
import org.rhq.core.domain.drift.DriftDetails;
@@ -74,8 +74,6 @@ import org.rhq.core.domain.drift.DriftFile;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.DriftSnapshotRequest;
import org.rhq.core.domain.drift.FileDiffReport;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode;
-import org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode;
import org.rhq.core.domain.drift.dto.DriftChangeSetDTO;
import org.rhq.core.domain.drift.dto.DriftDTO;
import org.rhq.core.domain.drift.dto.DriftFileDTO;
@@ -98,6 +96,9 @@ import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
import org.rhq.enterprise.server.util.LookupUtil;
+import difflib.DiffUtils;
+import difflib.Patch;
+
/**
* The SLSB supporting Drift management to clients.
*
@@ -502,7 +503,8 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
// force lazy loads
result.getConfiguration().getProperties();
- result.getResource();
+ Hibernate.initialize(result.getResource());
+ Hibernate.initialize(result.getTemplate());
return result;
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
index 58c5453..2c4bab4 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
@@ -102,7 +102,6 @@ public class DriftTemplateManagerBean implements DriftTemplateManagerLocal, Drif
@TransactionAttribute(NEVER)
public void pinTemplate(Subject subject, int templateId, int driftDefId, int snapshotVersion) {
templateMgr.createTemplateChangeSet(subject, templateId, driftDefId, snapshotVersion);
- //pinDefinitions(subject, template);
DriftDefinitionTemplateCriteria templateCriteria = new DriftDefinitionTemplateCriteria();
templateCriteria.addFilterId(templateId);
@@ -127,8 +126,6 @@ public class DriftTemplateManagerBean implements DriftTemplateManagerLocal, Drif
newDef.setPinned(true);
driftMgr.updateDriftDefinition(subject, forResource(resourceId), newDef);
-// templateMgr.pinDefinition(subject, def.getResource().getId(), templateId,
-// new DriftDefinition(def.getConfiguration().deepCopyWithoutProxies()));
}
}
}
@@ -148,28 +145,6 @@ public class DriftTemplateManagerBean implements DriftTemplateManagerLocal, Drif
template.setChangeSetId(newChangeSetId);
}
-// private void pinDefinitions(Subject subject, DriftDefinitionTemplate template) {
-// // TODO filter out the detached definitions with a query to avoid loading all of them into memory
-// for (DriftDefinition definition : template.getDriftDefinitions()) {
-// if (definition.isAttached()) {
-// DriftDefinition pinnedDef = new DriftDefinition(definition.getConfiguration().deepCopyWithoutProxies());
-// pinnedDef.setPinned(true);
-// //pinnedDef.setTemplate(template);
-// templateMgr.pinDefinition(subject, definition.getResource().getId(), template.getId(), pinnedDef);
-// }
-// }
-// }
-//
-// @Override
-// //@TransactionAttribute(NOT_SUPPORTED)
-// public void pinDefinition(Subject subject, int resourceId, int templateId, DriftDefinition newDef) {
-// driftMgr.deleteDriftDefinition(subject, forResource(resourceId), newDef.getName());
-// DriftDefinitionTemplate template = entityMgr.find(DriftDefinitionTemplate.class, templateId);
-// newDef.setTemplate(template);
-// newDef.setPinned(true);
-// driftMgr.updateDriftDefinition(subject, forResource(resourceId), newDef);
-// }
-
@RequiredPermission(Permission.MANAGE_SETTINGS)
@Override
public void deleteTemplate(Subject subject, int templateId) {
commit c65be8b4ce2b6cfef01f4bb6389c25993f171bff
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Oct 26 17:42:52 2011 -0400
[BZ 749277] fix bug where the ""Only 1 out of 2 available items are listed -
please specify one or more filters to find the items for which you are looking."
yellow warning message is always erroneously displayed for the user selector on
the role edit view (https://bugzilla.redhat.com/show_bug.cgi?id=749277)
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
index 99e0dbf..bf82a12 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleSubjectSelector.java
@@ -75,6 +75,17 @@ public class RoleSubjectSelector extends AbstractSelector<Subject, SubjectCriter
}
class RoleUsersDataSource extends UsersDataSource {
+/*
+ @Override
+ protected SubjectCriteria getFetchCriteria(DSRequest request) {
+ SubjectCriteria criteria = super.getFetchCriteria(request);
+ // Filter out system users.
+ // TODO: Add a new custom filter to SubjectCriteria that returns only non-superusers (i.e. subjects with
+ // id > 2), then replace the hack below with this method.
+ return criteria;
+ }
+*/
+
@Override
protected void sendSuccessResponseRecords(DSRequest request, DSResponse response, PageList<Record> records) {
Record rhqAdminRecord = null;
@@ -82,9 +93,11 @@ public class RoleSubjectSelector extends AbstractSelector<Subject, SubjectCriter
Integer id = record.getAttributeAsInt(Field.ID);
if (id.equals(ID_RHQADMIN)) {
rhqAdminRecord = record;
+ break;
}
}
if (rhqAdminRecord != null) {
+ records.setTotalSize(records.getTotalSize() - 1);
records.remove(rhqAdminRecord);
}
super.sendSuccessResponseRecords(request, response, records);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
index 60cf787..9b9f4c4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/selector/AbstractSelector.java
@@ -369,12 +369,14 @@ public abstract class AbstractSelector<T, C extends org.rhq.core.domain.criteria
} else {
availableRecords.addAll(Arrays.asList(allRecords));
}
- int totalAvailableRecords = response.getTotalRows() - assignedRecords.length;
+ int totalRecords = (response.getTotalRows() != null) ? response.getTotalRows() : allRecords.length;
+ int totalAvailableRecords = totalRecords - assignedRecords.length;
if (availableRecords.size() < totalAvailableRecords) {
// TODO: i18n
Message message = new Message("Only " + availableRecords.size() + " out of "
- + totalAvailableRecords
- + " available items are listed - please specify one or more filters to find the items for which you are looking.",
+ + totalAvailableRecords + " available " + getItemTitle()
+ + " are listed - please specify one or more filters to find the " + getItemTitle()
+ + " for which you are looking.",
Message.Severity.Warning);
CoreGUI.getMessageCenter().notify(message);
}
commit 554a5ff5545b7cbaf5a08bfcbb23e18828524501
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Wed Oct 26 16:28:54 2011 -0400
there is a bug in the RHQ criteria API, where when an unlimited
PageControl is used in combination with one or more join fetches,
the fetch results contain duplicates. to avoid this bug, when
a DSRequest specifies endRow=null (i.e. no paging), still use
a PageControl with pageSize=50, rather than an unlimited PageControl
(which is what we used to commit 604b996 (10/21/11))
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
index ad34c8b..c12c605 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/RPCDataSource.java
@@ -98,7 +98,7 @@ public abstract class RPCDataSource<T, C extends BaseCriteria> extends DataSourc
setCacheAllData(false);
setDataProtocol(DSProtocol.CLIENTCUSTOM);
setDataFormat(DSDataFormat.CUSTOM);
- setDataPageSize(75);
+ setDataPageSize(50);
}
/**
@@ -178,6 +178,9 @@ public abstract class RPCDataSource<T, C extends BaseCriteria> extends DataSourc
* @param dataPageSize the data page size that should be used for fetch requests, or null if results should not be paged
*/
public void setDataPageSize(Integer dataPageSize) {
+ if (dataPageSize <= 0) {
+ throw new IllegalArgumentException("Page size must be greater than 0.");
+ }
this.dataPageSize = dataPageSize;
}
@@ -214,9 +217,12 @@ public abstract class RPCDataSource<T, C extends BaseCriteria> extends DataSourc
// Create PageControl and initialize paging.
PageControl pageControl;
if (request.getEndRow() == null) {
- // null endRow means no paging
- Log.debug("WARNING: " + getClass().getName() + " is not using paging for fetch request.");
- pageControl = PageControl.getUnlimitedInstance();
+ // A null endRow means no paging. However, there is a bug in the RHQ criteria API, where when an unlimited
+ // PageControl is used in combination with one or more join fetches, the results contain duplicates.
+ // So until that bug is fixed, always use paging.
+ //Log.debug("WARNING: " + getClass().getName() + " is not using paging for fetch request.");
+ //pageControl = PageControl.getUnlimitedInstance();
+ pageControl = PageControl.getExplicitPageControl(0, getDataPageSize());
} else {
int startRow = (request.getStartRow() != null) ? request.getStartRow() : 0;
int endRow = request.getEndRow();
commit 1c4c9851749e195cd40712bc24c1d526ea3bb610
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Oct 26 14:34:05 2011 -0500
Add parsing for debug mode.
diff --git a/release.sh b/release.sh
index 3565cc1..27da8aa 100755
--- a/release.sh
+++ b/release.sh
@@ -86,7 +86,7 @@ parse_and_validate_options()
DEBUG_MODE=false
short_options="h"
- long_options="help,release-version:,development-version:,release-branch:,release-type:,test-mode,production-mode,mode:,branch,tag,scm-strategy:,extra-profile:,debug-maven"
+ long_options="help,release-version:,development-version:,release-branch:,release-type:,test-mode,production-mode,mode:,branch,tag,scm-strategy:,extra-profile:,debug::"
PROGNAME=${0##*/}
ARGS=$(getopt -s bash --options $short_options --longoptions $long_options --name $PROGNAME -- "$@" )
commit 4e7de8c3ebc1bf78405a7cbbfaf00538b280d460
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Oct 26 14:30:41 2011 -0500
Add debug mode support for the release script.
diff --git a/release.sh b/release.sh
index 1219dfc..3565cc1 100755
--- a/release.sh
+++ b/release.sh
@@ -59,8 +59,8 @@ USAGE: release.sh OPTIONS
--extra-profile=extra_profile [OPTIONAL]
An extra maven profile to be used for all the maven commands.
- --debug-maven [OPTIONAL]
- Set maven in debug mode.
+ --debug=[true|false] [OPTIONAL]
+ Set maven in debug mode. Default is false; true if option specified without argument.
EOF
)
@@ -83,7 +83,7 @@ parse_and_validate_options()
MODE="test"
SCM_STRATEGY="tag"
EXTRA_MAVEN_PROFILE=
- DEBUG_MAVEN=
+ DEBUG_MODE=false
short_options="h"
long_options="help,release-version:,development-version:,release-branch:,release-type:,test-mode,production-mode,mode:,branch,tag,scm-strategy:,extra-profile:,debug-maven"
@@ -148,9 +148,26 @@ parse_and_validate_options()
EXTRA_MAVEN_PROFILE="$1"
shift
;;
- --debug-maven)
+ --debug)
shift
- DEBUG_MAVEN="true"
+ case "$1" in
+ true)
+ DEBUG_MODE=true
+ shift
+ ;;
+ false)
+ DEBUG_MODE=false
+ shift
+ ;;
+ "")
+ DEBUG_MODE=true
+ shift
+ ;;
+ *)
+ DEBUG_MODE=false
+ shift
+ ;;
+ esac
;;
--)
shift
@@ -237,7 +254,7 @@ set_local_and_environment_variables()
MAVEN_ARGS="$MAVEN_ARGS -Dexclude-webdav "
fi
- if [ -n "$DEBUG_MAVEN" ]; then
+ if [ -n "$DEBUG_MODE" ]; then
echo "Maven debug enabled"
MAVEN_ARGS="$MAVEN_ARGS --debug"
fi
@@ -495,6 +512,8 @@ checkout_build_branch_for_development()
parse_and_validate_options $@
+set_script_debug_mode $DEBUG_MODE
+
validate_system_utilities
set_local_and_environment_variables
@@ -513,3 +532,4 @@ update_development_version
print_release_information
+unset_script_debug_mode $DEBUG_MODE
commit 1d795e099afcccbee61a5c4847df74ccfeb1913f
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Oct 26 14:19:09 2011 -0500
Update script to avoid platforms compatibility issues.
diff --git a/release.sh b/release.sh
index e1492c8..1219dfc 100755
--- a/release.sh
+++ b/release.sh
@@ -162,17 +162,17 @@ parse_and_validate_options()
esac
done
- if [ -z $RELEASE_VERSION ];
+ if [ -z "$RELEASE_VERSION" ];
then
usage "Release version not specified!"
fi
- if [ -z $DEVELOPMENT_VERSION ];
+ if [ -z "$DEVELOPMENT_VERSION" ];
then
usage "Development version not specified!"
fi
- if [ -z $RELEASE_BRANCH ];
+ if [ -z "$RELEASE_BRANCH" ];
then
usage "Release branch not specified!"
fi
@@ -512,3 +512,4 @@ checkout_build_branch_for_development
update_development_version
print_release_information
+
commit d93e1672d8fa611d1d2cbaf47b3d81b233d40c67
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Oct 26 14:16:45 2011 -0500
Add debug mode support to the bash library.
diff --git a/rhq_bash.lib b/rhq_bash.lib
index fcd90a0..8f9b3dd 100644
--- a/rhq_bash.lib
+++ b/rhq_bash.lib
@@ -210,3 +210,29 @@ print_centered()
eval "printf '=%.0s' {1..${right_side}}"
printf "\n"
}
+
+
+#========================================================================================
+# Description: Sets the script in debug mode; this will print all the commands before
+# executing them.
+#========================================================================================
+set_script_debug_mode()
+{
+ if [ -n "$1" ] && [ "$1" ];
+ then
+ set -x
+ else
+ set +x
+ fi
+}
+
+
+#========================================================================================
+# Description: Resets the script in debug mode; this will stop printing all the commands
+# before executing them.
+#========================================================================================
+unset_script_debug_mode()
+{
+ set +x
+}
+
commit 6297e70458e147d6474d7d49c3505d381cfcf5eb
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Oct 25 17:35:49 2011 -0400
Handle detached definitions when deleting a template
This commit adds code that deletes the actual template and it handles
detached definitions by unsetting their template references. This means
that definitions can re-attach to a template and that a definition can
outlive the template from which it was created. These things only apply
however to definitions created from unpinned templates. Definitions
created from pinned templates are always necessarily attached.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
index 9ae958e..58c5453 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBean.java
@@ -106,6 +106,7 @@ public class DriftTemplateManagerBean implements DriftTemplateManagerLocal, Drif
DriftDefinitionTemplateCriteria templateCriteria = new DriftDefinitionTemplateCriteria();
templateCriteria.addFilterId(templateId);
+ templateCriteria.fetchDriftDefinitions(true);
PageList<DriftDefinitionTemplate> templates = templateMgr.findTemplatesByCriteria(subject, templateCriteria);
DriftDefinitionTemplate template = templates.get(0);
@@ -177,8 +178,11 @@ public class DriftTemplateManagerBean implements DriftTemplateManagerLocal, Drif
if (defintion.isAttached()) {
driftMgr.deleteDriftDefinition(subject, forResource(defintion.getResource().getId()),
defintion.getName());
+ } else {
+ defintion.setTemplate(null);
}
}
+ entityMgr.remove(template);
}
@RequiredPermission(Permission.MANAGE_SETTINGS)
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
index 3e8edd1..a39faa0 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/drift/DriftTemplateManagerBeanTest.java
@@ -385,7 +385,7 @@ public class DriftTemplateManagerBeanTest extends DriftServerTest {
assertDefinitionIsNotPinned(detachedDefs.get(1));
}
- public void deleteUnpinnedTemplate() throws Exception {
+ public void deleteTemplate() throws Exception {
// first create the template
final DriftDefinition templateDef = new DriftDefinition(new Configuration());
templateDef.setName("test::pinTemplate");
@@ -454,10 +454,12 @@ public class DriftTemplateManagerBeanTest extends DriftServerTest {
// verify that detached definitions along with their change sets have not been deleted
assertNotNull("Change sets belonging to detached definitions should not be deleted",
loadChangeSet(changeSet1.getId()));
- assertNotNull("Detached definition " + toString(detachedDef1) + " should not be deleted",
- loadDefinition(detachedDef1.getId()));
- assertNotNull("Detached definition " + toString(detachedDef2) + " should not be deleted",
- loadDefinition(detachedDef2.getId()));
+ assertDetachedDefinitionNotDeleted(detachedDef1.getId());
+ assertDetachedDefinitionNotDeleted(detachedDef2.getId());
+
+ // verify that the template itself has been deleted
+ assertNull("The template " + toString(template) + " should have been deleted",
+ loadTemplate(template.getName(), false));
}
private void assertDefinitionIsPinned(DriftDefinition definition) throws Exception {
@@ -523,6 +525,13 @@ public class DriftTemplateManagerBeanTest extends DriftServerTest {
assertEquals(msg, 0, comparator.compare(expected, actual));
}
+ private void assertDetachedDefinitionNotDeleted(int definitionId) {
+ DriftDefinition definition = loadDefinition(definitionId);
+ assertNotNull("Detached definition " + toString(definition) + " should not be deleted", definition);
+ assertNull("The detached definition's template reference should be set to null when the template is deleted",
+ definition.getTemplate());
+ }
+
private DriftDefinition createDefinition(DriftDefinitionTemplate template, String defName, boolean isAttached) {
DriftDefinition def = template.createDefinition();
def.setName(defName);
@@ -533,14 +542,23 @@ public class DriftTemplateManagerBeanTest extends DriftServerTest {
}
private DriftDefinitionTemplate loadTemplate(String name) {
+ return loadTemplate(name, true);
+ }
+
+ private DriftDefinitionTemplate loadTemplate(String name, boolean verifyResultsUnique) {
DriftDefinitionTemplateCriteria criteria = new DriftDefinitionTemplateCriteria();
criteria.addFilterResourceTypeId(resourceType.getId());
criteria.addFilterName(name);
criteria.fetchDriftDefinitions(true);
PageList<DriftDefinitionTemplate> templates = templateMgr.findTemplatesByCriteria(getOverlord(), criteria);
- assertEquals("Expected to find one template", 1, templates.size());
+ if (verifyResultsUnique) {
+ assertEquals("Expected to find one template", 1, templates.size());
+ }
+ if (templates.isEmpty()) {
+ return null;
+ }
return templates.get(0);
}
@@ -548,6 +566,7 @@ public class DriftTemplateManagerBeanTest extends DriftServerTest {
DriftDefinitionCriteria criteria = new DriftDefinitionCriteria();
criteria.addFilterId(definitionId);
criteria.fetchConfiguration(true);
+ criteria.fetchTemplate(true);
PageList<DriftDefinition> definitions = driftMgr.findDriftDefinitionsByCriteria(getOverlord(), criteria);
if (definitions.isEmpty()) {
commit e3389c48c40bcfc6ea8795c4b01674a331a2ef27
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Oct 25 17:26:49 2011 -0400
Drift, fix diffs involving new and removed files.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index 2d0a384..b7779a3 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -673,10 +673,12 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
@Override
public FileDiffReport generateUnifiedDiff(Subject subject, Drift<?, ?> drift1, Drift<?, ?> drift2) {
- String content1 = getDriftFileBits(subject, drift1.getNewDriftFile().getHashId());
+ DriftFile drift1File = drift1.getNewDriftFile();
+ String content1 = (null == drift1File) ? "" : getDriftFileBits(subject, drift1File.getHashId());
List<String> content1List = asList(content1.split("\\n"));
- String content2 = getDriftFileBits(subject, drift2.getNewDriftFile().getHashId());
+ DriftFile drift2File = drift2.getNewDriftFile();
+ String content2 = (null == drift2File) ? "" : getDriftFileBits(subject, drift2File.getHashId());
List<String> content2List = asList(content2.split("\\n"));
Patch patch = DiffUtils.diff(content1List, content2List);
commit 0cd7035a83d1da9ae95136d749773ff4ea84728f
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Oct 25 17:05:50 2011 -0400
Drift Defs View, make sure ATTR_ENTITY is properly set for use by
Detect Now button.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java
index 8eaf519..69335e3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftDefinitionDataSource.java
@@ -325,8 +325,8 @@ public class DriftDefinitionDataSource extends RPCDataSource<DriftDefinitionComp
DriftChangeSet<?> changeSet = from.getMostRecentChangeset();
ListGridRecord record = new ListGridRecord();
- // don't store this unless it's needed
- // record.setAttribute(ATTR_ENTITY, from);
+ // We need this for Detect Now support
+ record.setAttribute(ATTR_ENTITY, from.getDriftDefinition());
record.setAttribute(ATTR_ID, def.getId());
record.setAttribute(ATTR_NAME, def.getName());
commit 8eb8bb612ad496a6b75be8e1a6b39d2cd9b2de33
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Oct 25 17:05:04 2011 -0400
Fix snapshot directory view, removing bad assumption about what will
be available from Drift.getChangeSet().
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
index b798d93..570f6f0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/drift/DriftSnapshotView.java
@@ -103,7 +103,7 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
this.templateId = templateId;
this.resourceId = resourceId;
this.driftDefId = driftDefId;
- this.version = version;
+ this.version = (null == version) ? 0 : version;
this.hasWriteAccess = hasWriteAccess;
setDataSource(getDataSource());
@@ -454,15 +454,8 @@ public class DriftSnapshotView extends Table<DriftSnapshotDataSource> {
record.setAttribute(DriftDataSource.ATTR_CTIME, new Date(from.getCtime()));
- switch (from.getChangeSet().getCategory()) {
- case COVERAGE:
- record.setAttribute(DriftDataSource.ATTR_CATEGORY, ImageManager.getDriftCategoryIcon(null));
- break;
- case DRIFT:
- record.setAttribute(DriftDataSource.ATTR_CATEGORY, ImageManager.getDriftCategoryIcon(from
- .getCategory()));
- break;
- }
+ record.setAttribute(DriftDataSource.ATTR_CATEGORY, ImageManager
+ .getDriftCategoryIcon((0 == version) ? null : from.getCategory()));
record.setAttribute(DriftDataSource.ATTR_CHANGESET_VERSION, (null == from.getChangeSet()) ? "0" : from
.getChangeSet().getVersion());
commit 35006e13a10796cb4ff1ebe13e82d66da66d0185
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Oct 25 17:04:02 2011 -0400
Drift fix for accidentally reassigning a drift's changeset id in
getSnapshot() logic. With this change we maintain the proper changeset
for a drift record That means drift records for a template's pinned
snapshot will always refer back to the template's change set. Which in
turn means that the initial snapshot for a definition attached to a
pinned template will have drift records that refer to the template's
changset. Obvious, right :)
Also, a little cleanup and use of proper generic decls.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftSnapshot.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftSnapshot.java
index 8de4821..dd3d676 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftSnapshot.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftSnapshot.java
@@ -87,25 +87,16 @@ public class DriftSnapshot implements Serializable {
return directoryMap.values();
}
- //public <D extends Drift<?, ?>> DriftSnapshot addChangeSet(DriftChangeSet<D> changeSet) {
- // TODO: add to plugin facet a getInstance capability for DriftChangeSet so we can actually
- // create a slim DriftChangeSet to set on the Drifts. Without this we'll get class cast
- // exceptions. That's why we currently hijack the passed in DriftChangeSet. When we do that
- // perhaps we can get a version that doesn't need to suppress unchecked warnings.
/**
- * MAJOR SIDE_EFFECT! This method will on exit will leave changeSet.getDrifts() null.
- *
- * @param changeSet
+ * @param changeSet The drifts must be set for the changeSet
* @return
*/
- @SuppressWarnings("unchecked")
- public DriftSnapshot addChangeSet(DriftChangeSet changeSet) {
+ public DriftSnapshot addChangeSet(DriftChangeSet<? extends Drift<?, ?>> changeSet) {
String dirFilter = request.getDirectory();
- Set<Drift> drifts = changeSet.getDrifts();
- changeSet.setDrifts(null);
+ Set<? extends Drift<?, ?>> drifts = changeSet.getDrifts();
- for (Drift drift : drifts) {
+ for (Drift<?, ?> drift : drifts) {
String path = drift.getPath();
if (request.isIncludeDriftDirectories()) {
@@ -142,8 +133,6 @@ public class DriftSnapshot implements Serializable {
if (drift.getCategory() == FILE_REMOVED) {
driftMap.remove(path);
} else {
- // add drift instance to map, or replace with latest drift instance for the given path
- drift.setChangeSet(changeSet);
driftMap.put(drift.getPath(), drift);
}
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
index a037bee..2d0a384 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/DriftManagerBean.java
@@ -43,6 +43,9 @@ import javax.jms.Session;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
+import difflib.DiffUtils;
+import difflib.Patch;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -62,10 +65,8 @@ import org.rhq.core.domain.drift.DriftChangeSet;
import org.rhq.core.domain.drift.DriftChangeSetCategory;
import org.rhq.core.domain.drift.DriftComposite;
import org.rhq.core.domain.drift.DriftConfigurationDefinition;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode;
import org.rhq.core.domain.drift.DriftDefinition;
import org.rhq.core.domain.drift.DriftDefinitionComparator;
-import org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode;
import org.rhq.core.domain.drift.DriftDefinitionComposite;
import org.rhq.core.domain.drift.DriftDefinitionTemplate;
import org.rhq.core.domain.drift.DriftDetails;
@@ -73,6 +74,8 @@ import org.rhq.core.domain.drift.DriftFile;
import org.rhq.core.domain.drift.DriftSnapshot;
import org.rhq.core.domain.drift.DriftSnapshotRequest;
import org.rhq.core.domain.drift.FileDiffReport;
+import org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode;
+import org.rhq.core.domain.drift.DriftDefinitionComparator.CompareMode;
import org.rhq.core.domain.drift.dto.DriftChangeSetDTO;
import org.rhq.core.domain.drift.dto.DriftDTO;
import org.rhq.core.domain.drift.dto.DriftFileDTO;
@@ -95,9 +98,6 @@ import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
import org.rhq.enterprise.server.util.LookupUtil;
-import difflib.DiffUtils;
-import difflib.Patch;
-
/**
* The SLSB supporting Drift management to clients.
*
@@ -283,7 +283,7 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
int startVersion = request.getStartVersion();
if (0 == startVersion) {
- DriftChangeSet<?> initialChangeset = loadInitialChangeSet(subject, request);
+ DriftChangeSet<? extends Drift<?, ?>> initialChangeset = loadInitialChangeSet(subject, request);
if (null == initialChangeset) {
if (log.isDebugEnabled()) {
log.debug("Cannot create snapshot, no initial changeset for: " + request);
@@ -316,14 +316,14 @@ public class DriftManagerBean implements DriftManagerLocal, DriftManagerRemote {
criteria.addSortVersion(PageOrdering.ASC);
PageList<? extends DriftChangeSet<?>> changeSets = findDriftChangeSetsByCriteria(subject, criteria);
- for (DriftChangeSet<?> changeSet : changeSets) {
+ for (DriftChangeSet<? extends Drift<?, ?>> changeSet : changeSets) {
result.addChangeSet(changeSet);
}
return result;
}
- private DriftChangeSet<?> loadInitialChangeSet(Subject subject, DriftSnapshotRequest request) {
+ private DriftChangeSet<? extends Drift<?, ?>> loadInitialChangeSet(Subject subject, DriftSnapshotRequest request) {
DriftChangeSetCriteria criteria = new GenericDriftChangeSetCriteria();
criteria.addFilterCategory(COVERAGE);
criteria.addFilterVersion("0");
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index 2542049..8c7b506 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -130,8 +130,8 @@ public class JPADriftServerBean implements JPADriftServerLocal {
driftsDeleted = q.executeUpdate();
// delete the drift set
-// JPADriftChangeSet changeSet = entityManager.createQuery(
-// "select c from JPADriftChangeSet c where c.version = 0 and c.driftDefinition")
+ // JPADriftChangeSet changeSet = entityManager.createQuery(
+ // "select c from JPADriftChangeSet c where c.version = 0 and c.driftDefinition")
// now purge all changesets
q = entityManager.createNamedQuery(JPADriftChangeSet.QUERY_DELETE_BY_DRIFTDEF_RESOURCE);
@@ -151,12 +151,18 @@ public class JPADriftServerBean implements JPADriftServerLocal {
JPADriftChangeSetCriteria jpaCriteria = (criteria instanceof JPADriftChangeSetCriteria) ? (JPADriftChangeSetCriteria) criteria
: new JPADriftChangeSetCriteria(criteria);
+ // If looking for the initial change set make sure version is to to 0
if (criteria.getFilterCategory() != null && criteria.getFilterCategory() == COVERAGE) {
+
+ // If fetching Drifts then make sure we go through the DriftSet. Note that there is no guarantee
+ // that the fetched Drift will refer to the ChangeSets found, because it may refer to a pinned
+ // template's changeset and be shared amongst changesets.
if (jpaCriteria.isFetchDrifts()) {
jpaCriteria.fetchInitialDriftSet(true);
jpaCriteria.fetchDrifts(false);
}
jpaCriteria.addFilterVersion("0");
+
} else {
jpaCriteria.fetchInitialDriftSet(false);
}
@@ -166,15 +172,6 @@ public class JPADriftServerBean implements JPADriftServerLocal {
generator, entityManager);
PageList<JPADriftChangeSet> result = queryRunner.execute();
- if (jpaCriteria.isFetchInitialDriftSet()) {
- for (JPADriftChangeSet changeSet : result) {
- // Need to wire up each drift with its parent change set.
- for (JPADrift drift : changeSet.getInitialDriftSet().getDrifts()) {
- drift.setChangeSet(changeSet);
- }
- }
- }
-
return result;
}
@@ -234,8 +231,8 @@ public class JPADriftServerBean implements JPADriftServerLocal {
JPADriftSet driftSet = new JPADriftSet();
for (Drift<?, ?> drift : changeSet.getDrifts()) {
- JPADrift jpaDrift = new JPADrift(jpaChangeSet, drift.getPath(), drift.getCategory(),
- toJPADriftFile(drift.getOldDriftFile()), toJPADriftFile(drift.getNewDriftFile()));
+ JPADrift jpaDrift = new JPADrift(jpaChangeSet, drift.getPath(), drift.getCategory(), toJPADriftFile(drift
+ .getOldDriftFile()), toJPADriftFile(drift.getNewDriftFile()));
driftSet.addDrift(jpaDrift);
}
entityManager.persist(driftSet);
commit ed03c55e1603ab7c54fc09111fc1d798d5963810
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Oct 25 16:33:31 2011 -0400
BZ 748966: moving LDAP test and utils into server/jar instead.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/util/LDAPStringUtil.java b/modules/core/domain/src/main/java/org/rhq/core/domain/util/LDAPStringUtil.java
deleted file mode 100644
index 8e6b62a..0000000
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/util/LDAPStringUtil.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.core.domain.util;
-
-import java.io.UnsupportedEncodingException;
-
-/**
- * A utility class containing static methods to perform common string
- * manipulations or modifications for use with an LDAP implementation.
- *
- * @author loleary
- * @since 4.0.1
- *
- */
-public class LDAPStringUtil {
-
- /**
- * <p>Encode a string so that it can be used in an LDAP search filter.</p>
- *
- * <p>The following table shows the characters that are encoded and their
- * encoded version.</p>
- *
- * <table>
- * <tr><th align="center">Character</th><th>Encoded As</th></tr>
- * <tr><td align="center">*</td><td>\2a</td></tr>
- * <tr><td align="center">(</td><td>\28</td></tr>
- * <tr><td align="center">)</td><td>\29</td></tr>
- * <tr><td align="center">\</td><td>\5c</td></tr>
- * <tr><td align="center"><code>null</code></td><td>\00</td></tr>
- * </table>
- *
- * <p>In addition to encoding the above characters, any non-ASCII character
- * (any character with a hex value greater then <code>0x7f</code>) is also
- * encoded and rewritten as a UTF-8 character or sequence of characters in
- * hex notation.</p>
- *
- * @param filterString a string that is to be encoded
- * @return the encoded version of <code>filterString</code> suitable for use
- * in a LDAP search filter
- * @see <a href="http://tools.ietf.org/html/rfc4515">RFC 4515</a>
- */
- public static String encodeForFilter(final String filterString) {
- if (filterString != null && filterString.length() > 0) {
- StringBuilder encString = new StringBuilder(filterString.length());
- for (int i = 0; i < filterString.length(); i++) {
- char ch = filterString.charAt(i);
- switch (ch) {
- case '*': // encode a wildcard * character
- encString.append("\\2a");
- break;
- case '(': // encode a open parenthesis ( character
- encString.append("\\28");
- break;
- case ')': // encode a close parenthesis ) character
- encString.append("\\29");
- break;
- case '\\': // encode a backslash \ character
- encString.append("\\5c");
- break;
- case '\u0000': // encode a null character
- encString.append("\\00");
- break;
- default:
- if (ch <= 0x7f) { // an ASCII character
- encString.append(ch);
- } else if (ch >= 0x80) { // encode to UTF-8
- try {
- byte[] utf8bytes = String.valueOf(ch).getBytes("UTF8");
- for (byte b : utf8bytes) {
- encString.append(String.format("\\%02x", b));
- }
- } catch (UnsupportedEncodingException e) {
- // ignore
- }
- }
- }
- }
- return encString.toString();
- }
- return filterString;
- }
-
-}
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/util/LDAPStringUtilTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/util/LDAPStringUtilTest.java
deleted file mode 100644
index d3fbc69..0000000
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/util/LDAPStringUtilTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.core.domain.util;
-
-import static org.testng.Assert.assertEquals;
-
-import org.testng.annotations.Test;
-
-/**
- * Test various methods of the {@link LDAPStringUtil} class.
- *
- * @author loleary
- * @since 4.0.1
- *
- */
-public class LDAPStringUtilTest {
-
- /**
- * Test method for {@link org.rhq.core.domain.util.LDAPStringUtil#encodeForFilter(java.lang.String)}.
- */
- @Test
- public void testEncodeForFilter() {
- assertEquals(LDAPStringUtil.encodeForFilter("\\, (, ), and *"), "\\5c, \\28, \\29, and \\2a",
- "Failed to encode \"\\, (, ), and *\"");
- assertEquals(LDAPStringUtil.encodeForFilter("A " + '\0' + " empty value"), "A \\00 empty value",
- "Failed to encode \"A <null> empty value\"");
- assertEquals(LDAPStringUtil.encodeForFilter("A " + '\u00E9' + " value"), "A \\c3\\a9 value",
- "Failed to encode \"A <letter e with acute> value\"");
- }
-
-}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LDAPStringUtil.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LDAPStringUtil.java
new file mode 100644
index 0000000..71fb0b6
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LDAPStringUtil.java
@@ -0,0 +1,100 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.resource.group;
+
+import java.io.UnsupportedEncodingException;
+
+/**
+ * A utility class containing static methods to perform common string
+ * manipulations or modifications for use with an LDAP implementation.
+ *
+ * @author loleary
+ * @since 4.0.1
+ *
+ */
+public class LDAPStringUtil {
+
+ /**
+ * <p>Encode a string so that it can be used in an LDAP search filter.</p>
+ *
+ * <p>The following table shows the characters that are encoded and their
+ * encoded version.</p>
+ *
+ * <table>
+ * <tr><th align="center">Character</th><th>Encoded As</th></tr>
+ * <tr><td align="center">*</td><td>\2a</td></tr>
+ * <tr><td align="center">(</td><td>\28</td></tr>
+ * <tr><td align="center">)</td><td>\29</td></tr>
+ * <tr><td align="center">\</td><td>\5c</td></tr>
+ * <tr><td align="center"><code>null</code></td><td>\00</td></tr>
+ * </table>
+ *
+ * <p>In addition to encoding the above characters, any non-ASCII character
+ * (any character with a hex value greater then <code>0x7f</code>) is also
+ * encoded and rewritten as a UTF-8 character or sequence of characters in
+ * hex notation.</p>
+ *
+ * @param filterString a string that is to be encoded
+ * @return the encoded version of <code>filterString</code> suitable for use
+ * in a LDAP search filter
+ * @see <a href="http://tools.ietf.org/html/rfc4515">RFC 4515</a>
+ */
+ public static String encodeForFilter(final String filterString) {
+ if (filterString != null && filterString.length() > 0) {
+ StringBuilder encString = new StringBuilder(filterString.length());
+ for (int i = 0; i < filterString.length(); i++) {
+ char ch = filterString.charAt(i);
+ switch (ch) {
+ case '*': // encode a wildcard * character
+ encString.append("\\2a");
+ break;
+ case '(': // encode a open parenthesis ( character
+ encString.append("\\28");
+ break;
+ case ')': // encode a close parenthesis ) character
+ encString.append("\\29");
+ break;
+ case '\\': // encode a backslash \ character
+ encString.append("\\5c");
+ break;
+ case '\u0000': // encode a null character
+ encString.append("\\00");
+ break;
+ default:
+ if (ch <= 0x7f) { // an ASCII character
+ encString.append(ch);
+ } else if (ch >= 0x80) { // encode to UTF-8
+ try {
+ byte[] utf8bytes = String.valueOf(ch).getBytes("UTF8");
+ for (byte b : utf8bytes) {
+ encString.append(String.format("\\%02x", b));
+ }
+ } catch (UnsupportedEncodingException e) {
+ // ignore
+ }
+ }
+ }
+ }
+ return encString.toString();
+ }
+ return filterString;
+ }
+
+}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
index 19ea74b..396b2c8 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/LdapGroupManagerBean.java
@@ -51,7 +51,6 @@ import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.authz.Role;
import org.rhq.core.domain.common.composite.SystemSetting;
import org.rhq.core.domain.resource.group.LdapGroup;
-import org.rhq.core.domain.util.LDAPStringUtil;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.server.PersistenceUtility;
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LDAPStringUtilTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LDAPStringUtilTest.java
new file mode 100644
index 0000000..a6e50cb
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LDAPStringUtilTest.java
@@ -0,0 +1,50 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.enterprise.server.resource.group.test;
+
+import static org.testng.Assert.assertEquals;
+
+import org.testng.annotations.Test;
+
+import org.rhq.enterprise.server.resource.group.LDAPStringUtil;
+
+/**
+ * Test various methods of the {@link LDAPStringUtil} class.
+ *
+ * @author loleary
+ * @since 4.0.1
+ *
+ */
+public class LDAPStringUtilTest {
+
+ /**
+ * Test method for {@link org.rhq.core.domain.util.LDAPStringUtil#encodeForFilter(java.lang.String)}.
+ */
+ @Test
+ public void testEncodeForFilter() {
+ assertEquals(LDAPStringUtil.encodeForFilter("\\, (, ), and *"), "\\5c, \\28, \\29, and \\2a",
+ "Failed to encode \"\\, (, ), and *\"");
+ assertEquals(LDAPStringUtil.encodeForFilter("A " + '\0' + " empty value"), "A \\00 empty value",
+ "Failed to encode \"A <null> empty value\"");
+ assertEquals(LDAPStringUtil.encodeForFilter("A " + '\u00E9' + " value"), "A \\c3\\a9 value",
+ "Failed to encode \"A <letter e with acute> value\"");
+ }
+
+}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/ldap/FakeLdapContext.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/ldap/FakeLdapContext.java
index 9031913..0df53e8 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/ldap/FakeLdapContext.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/ldap/FakeLdapContext.java
@@ -44,7 +44,7 @@ import javax.naming.ldap.ExtendedRequest;
import javax.naming.ldap.ExtendedResponse;
import javax.naming.ldap.LdapContext;
-import org.rhq.core.domain.util.LDAPStringUtil;
+import org.rhq.enterprise.server.resource.group.LDAPStringUtil;
/**
* A fake implementation of {@link LdapContext} which can be used for LDAP
12 years, 6 months
[rhq] 3 commits - modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java | 18 ++++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 2 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 8 ++--
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 9 +++++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 1
modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp | 8 +++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp | 7 +++
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp | 8 +++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp | 11 +++++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp | 7 +++
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp | 13 +++++--
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp | 10 ++++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp | 8 +++-
14 files changed, 80 insertions(+), 30 deletions(-)
New commits:
commit 63b0af8fb4ade7e4c447c084cbff3544eadc832a
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Oct 25 16:50:19 2011 -0400
[BZ 748474] add a fixed criteria and blank out the search bar. users find this more intuitive.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
index 4365aa0..4c1a348 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
@@ -137,8 +137,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
}, this.globalPermissions.contains(Permission.MANAGE_INVENTORY));
autodiscoveryQueueItem.setRefreshRequired(true);
- // TODO: Specify an icon for this item.
- NavigationItem allResourcesItem = new NavigationItem(PAGE_ALL_RESOURCES, null, new ViewFactory() {
+ NavigationItem allResourcesItem = new NavigationItem(PAGE_ALL_RESOURCES, "resources/all_resources.png", new ViewFactory() {
public Canvas createView() {
return new ResourceSearchView(extendLocatorId(PAGE_ALL_RESOURCES.getName()), null, PAGE_ALL_RESOURCES
.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.PLATFORM, Boolean.TRUE),
@@ -155,7 +154,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_PLATFORMS.getName()),
initialCriteria, PAGE_PLATFORMS.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.PLATFORM,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.PLATFORM.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.PLATFORM.name().toLowerCase());
return view;
}
});
@@ -168,7 +167,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_SERVERS.getName()),
initialCriteria, PAGE_SERVERS.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.SERVER,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase());
return view;
}
});
@@ -181,7 +180,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_SERVICES.getName()),
initialCriteria, PAGE_SERVICES.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.SERVICE,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVICE.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVICE.name().toLowerCase());
return view;
}
});
@@ -195,9 +194,8 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_UNAVAIL_SERVERS.getName()),
initialCriteria, MSG.view_inventory_unavailableServers(), ImageManager.getResourceLargeIcon(
ResourceCategory.SERVER, Boolean.FALSE));
- // TODO (ips, 10/28/10): Should we include down platforms too?
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase()
- + " availability=" + AvailabilityType.DOWN.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase()
+ // + " availability=" + AvailabilityType.DOWN.name().toLowerCase());
return view;
}
});
@@ -231,7 +229,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
extendLocatorId(PAGE_COMPATIBLE_GROUPS.getName()), new Criteria(
ResourceGroupDataSourceField.CATEGORY.propertyName(), GroupCategory.COMPATIBLE.name()),
PAGE_COMPATIBLE_GROUPS.getTitle(), ImageManager.getGroupLargeIcon(GroupCategory.COMPATIBLE));
- view.setInitialSearchBarSearchText("groupCategory=compatible");
+ //view.setInitialSearchBarSearchText("groupCategory=compatible");
return view;
}
});
@@ -242,7 +240,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceGroupListView view = new ResourceGroupListView(extendLocatorId(PAGE_MIXED_GROUPS.getName()),
new Criteria(ResourceGroupDataSourceField.CATEGORY.propertyName(), GroupCategory.MIXED.name()),
PAGE_MIXED_GROUPS.getTitle(), ImageManager.getGroupLargeIcon(GroupCategory.MIXED));
- view.setInitialSearchBarSearchText("groupCategory=mixed");
+ //view.setInitialSearchBarSearchText("groupCategory=mixed");
return view;
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
index 3019d73..9ac2107 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
@@ -127,7 +127,7 @@ public class ResourceSearchView extends Table {
final RPCDataSource<Resource, ResourceCriteria> datasource = getDataSourceInstance();
setDataSource(datasource);
- setInitialCriteriaFixed(false);
+ //setInitialCriteriaFixed(false);
}
// suppress unchecked warnings because the subclasses may have different generic types for the datasource
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png
new file mode 100644
index 0000000..63121fd
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png differ
commit fb1c12b52f9fc5e5ec98af36fbb669658f8f4380
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Oct 26 12:29:15 2011 -0400
[BZ 745456] catch exceptions in the EventJSON jsp pages so we don't blow up the Timeline component
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
index 40aeac8..b9857c1 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
@@ -37,7 +37,13 @@
criteria.addFilterEndTime(end);
criteria.setPageControl(pc);
- PageList<Alert> alerts = alertManager.findAlertsByCriteria(user.getSubject(), criteria);
+ PageList<Alert> alerts;
+ try {
+ alerts = alertManager.findAlertsByCriteria(user.getSubject(), criteria);
+ } catch (Exception e) {
+ alerts = new PageList<Alert>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
{ "events":
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
index 34baadf..c0f4402 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
@@ -23,8 +23,13 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
- PageList<ResourceConfigurationUpdate> configurationUpdates = configurationManager
+ PageList<ResourceConfigurationUpdate> configurationUpdates;
+ try {
+ configurationUpdates = configurationManager
.findResourceConfigurationUpdates(subject, resourceId, begin, end, true, new PageControl(0,100));
+ } catch (Exception e) {
+ configurationUpdates = new PageList<ResourceConfigurationUpdate>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
index 8edeebe..44515e5 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
@@ -26,8 +26,12 @@
ContentUIManagerLocal contentManager = LookupUtil.getContentUIManager();
- PageList<InstalledPackageHistory> history = contentManager.getInstalledPackageHistoryForResource(resourceId, new PageControl(0,20, new OrderingField("iph.timestamp",PageOrdering.DESC)));
-
+ PageList<InstalledPackageHistory> history;
+ try {
+ history = contentManager.getInstalledPackageHistoryForResource(resourceId, new PageControl(0,20, new OrderingField("iph.timestamp",PageOrdering.DESC)));
+ } catch (Exception e) {
+ history = new PageList<InstalledPackageHistory>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
index 114baf0..3951f1d 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
@@ -24,8 +24,15 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ResourceFactoryManagerLocal resourceFactoryManager = LookupUtil.getResourceFactoryManager();
- PageList<CreateResourceHistory> creates = resourceFactoryManager.findCreateChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
- PageList<DeleteResourceHistory> deletes = resourceFactoryManager.findDeleteChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ PageList<CreateResourceHistory> creates;
+ PageList<DeleteResourceHistory> deletes;
+ try {
+ creates = resourceFactoryManager.findCreateChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ deletes = resourceFactoryManager.findDeleteChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ } catch (Exception e) {
+ creates = new PageList<CreateResourceHistory>(0, PageControl.getUnlimitedInstance());
+ deletes = new PageList<DeleteResourceHistory>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
index b2f42fb..f283a99 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
@@ -27,7 +27,12 @@
criteria.addFilterResourceId(resourceId);
criteria.addFilterCreatedAfter(begin);
criteria.addFilterCreatedBefore(end);
- PageList<? extends DriftChangeSet<?>> results = driftManager.findDriftChangeSetsByCriteria(subject, criteria);
+ PageList<? extends DriftChangeSet<?>> results;
+ try {
+ results = driftManager.findDriftChangeSetsByCriteria(subject, criteria);
+ } catch (Exception e) {
+ results = new PageList(0, PageControl.getUnlimitedInstance());
+ }
%>
{ "events": [
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
index d14ab93..62d9a07 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
@@ -32,9 +32,14 @@
boolean tooManyEvents = false;
- PageList<EventComposite> list =
- eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
+ PageList<EventComposite> list;
+ try {
+ list = eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
null, null, new PageControl(0,10000, new OrderingField("timestamp", PageOrdering.ASC)));
+ } catch (Exception e) {
+ list = new PageList<EventComposite>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
<%! public String trimLength(String string, int length) {
@@ -154,14 +159,14 @@
if (grouped) {
link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History";
} else {
- link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
+ link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
}
String detail = null;
if (grouped) {
StringBuilder buf = new StringBuilder();
for (EventComposite childEvent : ((GroupedEventComposite)event).events) {
- String childColor = eventColor(childEvent.getSeverity());
+ String childColor = eventColor(childEvent.getSeverity());
buf.append("<a href='/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + childEvent.getEventId() + "'>");
buf.append("<font color=\"" + childColor + "\">" + escapeBackslashes(trimLength(childEvent.getEventDetail(),80)) + "</font></a><br />");
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
index 49fd1cb..04d3c11 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
@@ -24,8 +24,14 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
OperationManagerLocal operationManager = LookupUtil.getOperationManager();
- PageList<ResourceOperationHistory> operations = operationManager.findCompletedResourceOperationHistories(
- subject, resourceId, begin, end, new PageControl(0,100));
+ PageList<ResourceOperationHistory> operations;
+ try {
+ operations = operationManager.findCompletedResourceOperationHistories(
+ subject, resourceId, begin, end, new PageControl(0,100));
+ } catch (Exception e) {
+ operations = new PageList<ResourceOperationHistory>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
{ "events": [
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
index 17683c7..fe66e5e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
@@ -22,7 +22,13 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
- PageList<PluginConfigurationUpdate> configurationUpdates = configurationManager.findPluginConfigurationUpdates(subject, resourceId, begin, end, new PageControl(0,100));
+ PageList<PluginConfigurationUpdate> configurationUpdates;
+ try {
+ configurationUpdates = configurationManager.findPluginConfigurationUpdates(subject, resourceId, begin, end, new PageControl(0,100));
+ } catch (Exception e) {
+ configurationUpdates = new PageList<PluginConfigurationUpdate>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
commit 4821904bdbf4c53071c9f1fb5cdacfa0aa4c6f85
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Oct 27 12:23:23 2011 -0400
[BZ 749560] make it clear that "deleting" bundle entities only removes them from the DB, the remote content is not purged.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index e69994e..dd0902e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -957,7 +957,7 @@ view_bundle_createWizard_uploadStepName = Upload Bundle Files
view_bundle_createWizard_urlOption = URL
view_bundle_createWizard_windowTitle = Bundle Creation Wizard
view_bundle_createWizard_youMustChooseOne = You must choose one option in order to create a bundle!
-view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted.
+view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted. However, this will not remove any content from remote machines.
view_bundle_deploy = Deploy
view_bundle_deployDir = Deploy Directory
view_bundle_deployWizard_deployStep = Deploy Bundle to Destination Platforms
@@ -1011,7 +1011,7 @@ view_bundle_deployWizard_title = Bundle Deployment Wizard
view_bundle_deploy_action = Action
view_bundle_deploy_backButton = Back to Destination
view_bundle_deploy_clickForError = Click the icon for the error message
-view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment?
+view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment? This only deletes it from the database; all bundle content that was deployed on remote machines will remain.
view_bundle_deploy_deleteFailure = Failed to delete the bundle deployment [{0}]
view_bundle_deploy_deleteSuccessful = You successfully deleted the bundle deployment [{0}]
view_bundle_deploy_deployedBy = Deployed By
@@ -1054,7 +1054,7 @@ view_bundle_fileListView_sha256 = SHA256
view_bundle_files = Files
view_bundle_latestVersion = Latest Version
view_bundle_list_backToAll = Back to All Bundles
-view_bundle_list_deleteConfirm = Are you sure you want to delete the selected bundles?
+view_bundle_list_deleteConfirm = Are you sure you want to delete the selected bundles? This will delete all of their versions, destinations and deployments from the database. However, this will not remove any content from remote machines.
view_bundle_list_deleteFailure = Failed to delete the bundle [{0}]
view_bundle_list_deleteSuccessful = You successfully deleted the bundle [{0}]
view_bundle_list_deletesFailure = Failed to delete the bundles
@@ -1099,7 +1099,7 @@ view_bundle_tree_loadFailure = Failed to load bundle data
view_bundle_version_backToBundle = Back to Bundle
view_bundle_version_bundleVersionTagUpdateFailure = Failed to update bundle version tags
view_bundle_version_bundleVersionTagUpdateSuccessful = You have successfully updated the bundle version tags
-view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version?
+view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version? This will not remove any content from remote machines.
view_bundle_version_deleteFailure = Failed to delete the bundle version [{0}]
view_bundle_version_deleteSuccessful = You successfully deleted the bundle version [{0}]
view_bundle_version_loadFailure = Failed to load bundle version
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 1f42dfc..be8be01 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -839,6 +839,7 @@ view_bundle_createWizard_uploadStepName = Bundle-Dateien hochladen
view_bundle_createWizard_urlOption = URL
##view_bundle_createWizard_windowTitle = Bundle Creation Wizard
##view_bundle_createWizard_youMustChooseOne = You must choose one option in order to create a bundle!
+##view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted. However, this will not remove any content from remote machines.
view_bundle_deploy = Deploy
view_bundle_deployDir = Deploy-Verzeichnis
view_bundle_deployWizard_deployStep = Bundle auf die Zielplattformen deployen
@@ -888,6 +889,11 @@ view_bundle_deployWizard_getOptions_deployTime = Deployment-Zeitpunkt
##view_bundle_deployWizard_title = Bundle Deployment Wizard
view_bundle_deploy_action = Aktion
view_bundle_deploy_backButton = Zurück zum Ziel
+##view_bundle_deploy_clickForError = Click the icon for the error message
+##view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment? This only deletes it from the database; all bundle content that was deployed on remote machines will remain.
+##view_bundle_deploy_deleteFailure = Failed to delete the bundle deployment [{0}]
+##view_bundle_deploy_deleteSuccessful = You successfully deleted the bundle deployment [{0}]
+##view_bundle_deploy_deployedBy = Deployed By
##view_bundle_deploy_deploymentPlatforms = Deployment Resource
##view_bundle_deploy_installDetails = Install Details
##view_bundle_deploy_loadBundleFailure = Failed to find bundle
@@ -961,6 +967,9 @@ view_bundle_revert = Zurückrollen
view_bundle_version_backToBundle = Zurück zum Bundle
##view_bundle_version_bundleVersionTagUpdateFailure = Failed to update bundle version tags
##view_bundle_version_bundleVersionTagUpdateSuccessful = You have successfully updated the bundle version tags
+##view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version? This will not remove any content from remote machines.
+##view_bundle_version_deleteFailure = Failed to delete the bundle version [{0}]
+##view_bundle_version_deleteSuccessful = You successfully deleted the bundle version [{0}]
##view_bundle_version_loadFailure = Failed to load bundle version
view_bundle_versions = Versionen
##view_configCompare_comparingConfigs = Comparing Configurations
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index bffa78a..3050a0f 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -1012,7 +1012,6 @@ view_bundle_deploy_loadBundleFailure = バンドルの検索に失敗しまし
view_bundle_deploy_loadDeployFailure = バンドルデプロイのロードに失敗しました
view_bundle_deploy_loadFailure = バンドルデプロイのロードに失敗しました
view_bundle_deploy_name = デプロイ名
-view_bundle_deploy_operatingSystem = オペレーティングシステム
view_bundle_deploy_selectARow = インストールの詳細を表示するために行を選択してください
view_bundle_deploy_tagUpdateFailure = バンドルデプロイタブの更新に失敗しました
view_bundle_deploy_tagUpdateSuccessful = バンドルデプロイタグの更新に成功しました
12 years, 6 months
[rhq] Branch 'release_jon3.x' - 3 commits - modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java | 18 ++++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java | 2 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 8 ++--
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 9 +++++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 1
modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png |binary
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp | 8 +++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp | 7 +++
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp | 8 +++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp | 11 +++++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp | 7 +++
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp | 13 +++++--
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp | 10 ++++-
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp | 8 +++-
14 files changed, 80 insertions(+), 30 deletions(-)
New commits:
commit bfdc984796b40483ca07bf6755ef8edb1265e6ed
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Oct 25 16:50:19 2011 -0400
[BZ 748474] add a fixed criteria and blank out the search bar. users find this more intuitive.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
index 4365aa0..4c1a348 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/InventoryView.java
@@ -137,8 +137,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
}, this.globalPermissions.contains(Permission.MANAGE_INVENTORY));
autodiscoveryQueueItem.setRefreshRequired(true);
- // TODO: Specify an icon for this item.
- NavigationItem allResourcesItem = new NavigationItem(PAGE_ALL_RESOURCES, null, new ViewFactory() {
+ NavigationItem allResourcesItem = new NavigationItem(PAGE_ALL_RESOURCES, "resources/all_resources.png", new ViewFactory() {
public Canvas createView() {
return new ResourceSearchView(extendLocatorId(PAGE_ALL_RESOURCES.getName()), null, PAGE_ALL_RESOURCES
.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.PLATFORM, Boolean.TRUE),
@@ -155,7 +154,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_PLATFORMS.getName()),
initialCriteria, PAGE_PLATFORMS.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.PLATFORM,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.PLATFORM.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.PLATFORM.name().toLowerCase());
return view;
}
});
@@ -168,7 +167,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_SERVERS.getName()),
initialCriteria, PAGE_SERVERS.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.SERVER,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase());
return view;
}
});
@@ -181,7 +180,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_SERVICES.getName()),
initialCriteria, PAGE_SERVICES.getTitle(), ImageManager.getResourceLargeIcon(ResourceCategory.SERVICE,
Boolean.TRUE));
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVICE.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVICE.name().toLowerCase());
return view;
}
});
@@ -195,9 +194,8 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceSearchView view = new ResourceSearchView(extendLocatorId(PAGE_UNAVAIL_SERVERS.getName()),
initialCriteria, MSG.view_inventory_unavailableServers(), ImageManager.getResourceLargeIcon(
ResourceCategory.SERVER, Boolean.FALSE));
- // TODO (ips, 10/28/10): Should we include down platforms too?
- view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase()
- + " availability=" + AvailabilityType.DOWN.name().toLowerCase());
+ //view.setInitialSearchBarSearchText("category=" + ResourceCategory.SERVER.name().toLowerCase()
+ // + " availability=" + AvailabilityType.DOWN.name().toLowerCase());
return view;
}
});
@@ -231,7 +229,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
extendLocatorId(PAGE_COMPATIBLE_GROUPS.getName()), new Criteria(
ResourceGroupDataSourceField.CATEGORY.propertyName(), GroupCategory.COMPATIBLE.name()),
PAGE_COMPATIBLE_GROUPS.getTitle(), ImageManager.getGroupLargeIcon(GroupCategory.COMPATIBLE));
- view.setInitialSearchBarSearchText("groupCategory=compatible");
+ //view.setInitialSearchBarSearchText("groupCategory=compatible");
return view;
}
});
@@ -242,7 +240,7 @@ public class InventoryView extends AbstractSectionedLeftNavigationView {
ResourceGroupListView view = new ResourceGroupListView(extendLocatorId(PAGE_MIXED_GROUPS.getName()),
new Criteria(ResourceGroupDataSourceField.CATEGORY.propertyName(), GroupCategory.MIXED.name()),
PAGE_MIXED_GROUPS.getTitle(), ImageManager.getGroupLargeIcon(GroupCategory.MIXED));
- view.setInitialSearchBarSearchText("groupCategory=mixed");
+ //view.setInitialSearchBarSearchText("groupCategory=mixed");
return view;
}
});
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
index 3019d73..9ac2107 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/ResourceSearchView.java
@@ -127,7 +127,7 @@ public class ResourceSearchView extends Table {
final RPCDataSource<Resource, ResourceCriteria> datasource = getDataSourceInstance();
setDataSource(datasource);
- setInitialCriteriaFixed(false);
+ //setInitialCriteriaFixed(false);
}
// suppress unchecked warnings because the subclasses may have different generic types for the datasource
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png
new file mode 100644
index 0000000..63121fd
Binary files /dev/null and b/modules/enterprise/gui/coregui/src/main/webapp/images/resources/all_resources.png differ
commit 3d74362f9ea99bb0dd8a66ec85c012bbae6002df
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Oct 26 12:29:15 2011 -0400
[BZ 745456] catch exceptions in the EventJSON jsp pages so we don't blow up the Timeline component
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
index 40aeac8..b9857c1 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventAlertJSON.jsp
@@ -37,7 +37,13 @@
criteria.addFilterEndTime(end);
criteria.setPageControl(pc);
- PageList<Alert> alerts = alertManager.findAlertsByCriteria(user.getSubject(), criteria);
+ PageList<Alert> alerts;
+ try {
+ alerts = alertManager.findAlertsByCriteria(user.getSubject(), criteria);
+ } catch (Exception e) {
+ alerts = new PageList<Alert>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
{ "events":
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
index 34baadf..c0f4402 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventConfigJSON.jsp
@@ -23,8 +23,13 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
- PageList<ResourceConfigurationUpdate> configurationUpdates = configurationManager
+ PageList<ResourceConfigurationUpdate> configurationUpdates;
+ try {
+ configurationUpdates = configurationManager
.findResourceConfigurationUpdates(subject, resourceId, begin, end, true, new PageControl(0,100));
+ } catch (Exception e) {
+ configurationUpdates = new PageList<ResourceConfigurationUpdate>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
index 8edeebe..44515e5 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventContentJSON.jsp
@@ -26,8 +26,12 @@
ContentUIManagerLocal contentManager = LookupUtil.getContentUIManager();
- PageList<InstalledPackageHistory> history = contentManager.getInstalledPackageHistoryForResource(resourceId, new PageControl(0,20, new OrderingField("iph.timestamp",PageOrdering.DESC)));
-
+ PageList<InstalledPackageHistory> history;
+ try {
+ history = contentManager.getInstalledPackageHistoryForResource(resourceId, new PageControl(0,20, new OrderingField("iph.timestamp",PageOrdering.DESC)));
+ } catch (Exception e) {
+ history = new PageList<InstalledPackageHistory>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
index 114baf0..3951f1d 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventCreateDeleteChildJSON.jsp
@@ -24,8 +24,15 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ResourceFactoryManagerLocal resourceFactoryManager = LookupUtil.getResourceFactoryManager();
- PageList<CreateResourceHistory> creates = resourceFactoryManager.findCreateChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
- PageList<DeleteResourceHistory> deletes = resourceFactoryManager.findDeleteChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ PageList<CreateResourceHistory> creates;
+ PageList<DeleteResourceHistory> deletes;
+ try {
+ creates = resourceFactoryManager.findCreateChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ deletes = resourceFactoryManager.findDeleteChildResourceHistory(subject, resourceId, begin, end, new PageControl(0, 100));
+ } catch (Exception e) {
+ creates = new PageList<CreateResourceHistory>(0, PageControl.getUnlimitedInstance());
+ deletes = new PageList<DeleteResourceHistory>(0, PageControl.getUnlimitedInstance());
+ }
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
index b2f42fb..f283a99 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventDriftJSON.jsp
@@ -27,7 +27,12 @@
criteria.addFilterResourceId(resourceId);
criteria.addFilterCreatedAfter(begin);
criteria.addFilterCreatedBefore(end);
- PageList<? extends DriftChangeSet<?>> results = driftManager.findDriftChangeSetsByCriteria(subject, criteria);
+ PageList<? extends DriftChangeSet<?>> results;
+ try {
+ results = driftManager.findDriftChangeSetsByCriteria(subject, criteria);
+ } catch (Exception e) {
+ results = new PageList(0, PageControl.getUnlimitedInstance());
+ }
%>
{ "events": [
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
index d14ab93..62d9a07 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventEventsJSON.jsp
@@ -32,9 +32,14 @@
boolean tooManyEvents = false;
- PageList<EventComposite> list =
- eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
+ PageList<EventComposite> list;
+ try {
+ list = eventManager.findEventComposites(subject, EntityContext.forResource(resourceId), begin, end, null,
null, null, new PageControl(0,10000, new OrderingField("timestamp", PageOrdering.ASC)));
+ } catch (Exception e) {
+ list = new PageList<EventComposite>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
<%! public String trimLength(String string, int length) {
@@ -154,14 +159,14 @@
if (grouped) {
link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History";
} else {
- link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
+ link = "/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + event.getEventId();
}
String detail = null;
if (grouped) {
StringBuilder buf = new StringBuilder();
for (EventComposite childEvent : ((GroupedEventComposite)event).events) {
- String childColor = eventColor(childEvent.getSeverity());
+ String childColor = eventColor(childEvent.getSeverity());
buf.append("<a href='/coregui/CoreGUI.html#Resource/" + resourceId + "/Events/History/" + childEvent.getEventId() + "'>");
buf.append("<font color=\"" + childColor + "\">" + escapeBackslashes(trimLength(childEvent.getEventDetail(),80)) + "</font></a><br />");
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
index 49fd1cb..04d3c11 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventOperationsJSON.jsp
@@ -24,8 +24,14 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
OperationManagerLocal operationManager = LookupUtil.getOperationManager();
- PageList<ResourceOperationHistory> operations = operationManager.findCompletedResourceOperationHistories(
- subject, resourceId, begin, end, new PageControl(0,100));
+ PageList<ResourceOperationHistory> operations;
+ try {
+ operations = operationManager.findCompletedResourceOperationHistories(
+ subject, resourceId, begin, end, new PageControl(0,100));
+ } catch (Exception e) {
+ operations = new PageList<ResourceOperationHistory>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
{ "events": [
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
index 17683c7..fe66e5e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventPluginConfigJSON.jsp
@@ -22,7 +22,13 @@
long begin = Long.parseLong(WebUtility.getRequiredRequestParameter(request, "begin"));
ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
- PageList<PluginConfigurationUpdate> configurationUpdates = configurationManager.findPluginConfigurationUpdates(subject, resourceId, begin, end, new PageControl(0,100));
+ PageList<PluginConfigurationUpdate> configurationUpdates;
+ try {
+ configurationUpdates = configurationManager.findPluginConfigurationUpdates(subject, resourceId, begin, end, new PageControl(0,100));
+ } catch (Exception e) {
+ configurationUpdates = new PageList<PluginConfigurationUpdate>(0, PageControl.getUnlimitedInstance());
+ }
+
%>
commit a94a8992b37b10a4224eef050911dd6759a7705e
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Oct 27 12:23:23 2011 -0400
[BZ 749560] make it clear that "deleting" bundle entities only removes them from the DB, the remote content is not purged.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index e69994e..dd0902e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -957,7 +957,7 @@ view_bundle_createWizard_uploadStepName = Upload Bundle Files
view_bundle_createWizard_urlOption = URL
view_bundle_createWizard_windowTitle = Bundle Creation Wizard
view_bundle_createWizard_youMustChooseOne = You must choose one option in order to create a bundle!
-view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted.
+view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted. However, this will not remove any content from remote machines.
view_bundle_deploy = Deploy
view_bundle_deployDir = Deploy Directory
view_bundle_deployWizard_deployStep = Deploy Bundle to Destination Platforms
@@ -1011,7 +1011,7 @@ view_bundle_deployWizard_title = Bundle Deployment Wizard
view_bundle_deploy_action = Action
view_bundle_deploy_backButton = Back to Destination
view_bundle_deploy_clickForError = Click the icon for the error message
-view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment?
+view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment? This only deletes it from the database; all bundle content that was deployed on remote machines will remain.
view_bundle_deploy_deleteFailure = Failed to delete the bundle deployment [{0}]
view_bundle_deploy_deleteSuccessful = You successfully deleted the bundle deployment [{0}]
view_bundle_deploy_deployedBy = Deployed By
@@ -1054,7 +1054,7 @@ view_bundle_fileListView_sha256 = SHA256
view_bundle_files = Files
view_bundle_latestVersion = Latest Version
view_bundle_list_backToAll = Back to All Bundles
-view_bundle_list_deleteConfirm = Are you sure you want to delete the selected bundles?
+view_bundle_list_deleteConfirm = Are you sure you want to delete the selected bundles? This will delete all of their versions, destinations and deployments from the database. However, this will not remove any content from remote machines.
view_bundle_list_deleteFailure = Failed to delete the bundle [{0}]
view_bundle_list_deleteSuccessful = You successfully deleted the bundle [{0}]
view_bundle_list_deletesFailure = Failed to delete the bundles
@@ -1099,7 +1099,7 @@ view_bundle_tree_loadFailure = Failed to load bundle data
view_bundle_version_backToBundle = Back to Bundle
view_bundle_version_bundleVersionTagUpdateFailure = Failed to update bundle version tags
view_bundle_version_bundleVersionTagUpdateSuccessful = You have successfully updated the bundle version tags
-view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version?
+view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version? This will not remove any content from remote machines.
view_bundle_version_deleteFailure = Failed to delete the bundle version [{0}]
view_bundle_version_deleteSuccessful = You successfully deleted the bundle version [{0}]
view_bundle_version_loadFailure = Failed to load bundle version
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 1f42dfc..be8be01 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -839,6 +839,7 @@ view_bundle_createWizard_uploadStepName = Bundle-Dateien hochladen
view_bundle_createWizard_urlOption = URL
##view_bundle_createWizard_windowTitle = Bundle Creation Wizard
##view_bundle_createWizard_youMustChooseOne = You must choose one option in order to create a bundle!
+##view_bundle_deleteConfirm = Are you sure you want to delete this bundle? All versions, destinations and deployments for this bundle will also be deleted. However, this will not remove any content from remote machines.
view_bundle_deploy = Deploy
view_bundle_deployDir = Deploy-Verzeichnis
view_bundle_deployWizard_deployStep = Bundle auf die Zielplattformen deployen
@@ -888,6 +889,11 @@ view_bundle_deployWizard_getOptions_deployTime = Deployment-Zeitpunkt
##view_bundle_deployWizard_title = Bundle Deployment Wizard
view_bundle_deploy_action = Aktion
view_bundle_deploy_backButton = Zurück zum Ziel
+##view_bundle_deploy_clickForError = Click the icon for the error message
+##view_bundle_deploy_deleteConfirm = Are you sure you want to delete this bundle deployment? This only deletes it from the database; all bundle content that was deployed on remote machines will remain.
+##view_bundle_deploy_deleteFailure = Failed to delete the bundle deployment [{0}]
+##view_bundle_deploy_deleteSuccessful = You successfully deleted the bundle deployment [{0}]
+##view_bundle_deploy_deployedBy = Deployed By
##view_bundle_deploy_deploymentPlatforms = Deployment Resource
##view_bundle_deploy_installDetails = Install Details
##view_bundle_deploy_loadBundleFailure = Failed to find bundle
@@ -961,6 +967,9 @@ view_bundle_revert = Zurückrollen
view_bundle_version_backToBundle = Zurück zum Bundle
##view_bundle_version_bundleVersionTagUpdateFailure = Failed to update bundle version tags
##view_bundle_version_bundleVersionTagUpdateSuccessful = You have successfully updated the bundle version tags
+##view_bundle_version_deleteConfirm = Are you sure you want to delete this bundle version? This will not remove any content from remote machines.
+##view_bundle_version_deleteFailure = Failed to delete the bundle version [{0}]
+##view_bundle_version_deleteSuccessful = You successfully deleted the bundle version [{0}]
##view_bundle_version_loadFailure = Failed to load bundle version
view_bundle_versions = Versionen
##view_configCompare_comparingConfigs = Comparing Configurations
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index bffa78a..3050a0f 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -1012,7 +1012,6 @@ view_bundle_deploy_loadBundleFailure = バンドルの検索に失敗しまし
view_bundle_deploy_loadDeployFailure = バンドルデプロイのロードに失敗しました
view_bundle_deploy_loadFailure = バンドルデプロイのロードに失敗しました
view_bundle_deploy_name = デプロイ名
-view_bundle_deploy_operatingSystem = オペレーティングシステム
view_bundle_deploy_selectARow = インストールの詳細を表示するために行を選択してください
view_bundle_deploy_tagUpdateFailure = バンドルデプロイタブの更新に失敗しました
view_bundle_deploy_tagUpdateSuccessful = バンドルデプロイタグの更新に成功しました
12 years, 6 months