[rhq] Branch 'release_jon3.x' - modules/cli-tests modules/common modules/core modules/enterprise modules/helpers modules/integration-tests modules/plugins modules/pom.xml modules/test-utils pom.xml
by John Sanda
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/domain/pom.xml | 2 +-
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/installer-war/pom.xml | 2 +-
modules/enterprise/gui/pom.xml | 2 +-
modules/enterprise/gui/portal-war/pom.xml | 2 +-
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/itests/pom.xml | 2 +-
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java | 2 +-
modules/enterprise/server/jar/pom.xml | 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 | 2 +-
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 | 2 +-
modules/test-utils/pom.xml | 2 +-
pom.xml | 2 +-
127 files changed, 145 insertions(+), 145 deletions(-)
New commits:
commit 918e7e231c96e7c7033b0526a8102aafd6e19316
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 15:05:23 2011 -0400
Bumping versions up to 4.2.1-SNAPSHOT
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index a367296..03467e2 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index b57d9cb..b2b1771 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index eccf152..27d02bc 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.2.0</version>
+ <version>4.2.1-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 7aa6f19..cd68909 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.2.0</version>
+ <version>4.2.1-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 acb2e54..1ed9905 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 6733a58..2fbe891c 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 8609b6b..cef7816 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index 6d3b339..0d6e274 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 0e806b5..5439df4 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.2.0</version>
+ <version>4.2.1-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 3817d43..04cb646 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index e1e5aab..e728dce 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index c64a60d..6ed2974 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 341b8bb..d98a57f 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 97d472f..f416d0f 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.2.0</version>
+ <version>4.2.1-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 81de687..47fa3d8 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index d68e126..ec9e6df 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index 1ec69e7..5f90f5e 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index a2219e7..fcbafcc 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index 117cc9d..d16bab4 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index e6afb92..3c322fa 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 3371750..069d354 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.2.0</version>
+ <version>4.2.1-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 645b6f8..f464bb8 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.2.0</version>
+ <version>4.2.1-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 e6afc1b..cf2193b 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.2.0</version>
+ <version>4.2.1-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 35fecc0..cbde422 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index bc07c61..81ff1bc 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.2.0</version>
+ <version>4.2.1-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 9e2cbce..470c6a6 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index c510f55..e181681 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.2.0</version>
+ <version>4.2.1-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 a4bbbd9..06a77a1 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.2.0</version>
+ <version>4.2.1-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 fe0fcb5..9efcd7b 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index 856a2d5..bedda69 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index b26ce9d..dd65e82 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.2.0</version>
+ <version>4.2.1-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 6f3d60b..4e9da90 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.2.0</version>
+ <version>4.2.1-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 ee74f18..ff6217d 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 4d61287..d136524 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index 6a7f5cf..9a0a2be 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.2.0</version>
+ <version>4.2.1-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 8ed324b..88f070b 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 b43fa25..72495bf 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index 7fb0ded..d834140 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 3acb8d6..92cd59a 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/itests/pom.xml b/modules/enterprise/server/itests/pom.xml
index d9d8677..c98dc8d 100644
--- a/modules/enterprise/server/itests/pom.xml
+++ b/modules/enterprise/server/itests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.2.1-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..375ec1e 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.2.1-SNAPSHOT.jar");
assertTrue("Drift server plugin JAR file not found at" + jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
FileUtils.copyFileToDirectory(jpaDriftPlugin, driftServerPluginService.masterConfig.getPluginDirectory());
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index 541313b..ef48e29 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.2.0</version>
+ <version>4.2.1-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 ee7f7c6..20fc0ae 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 568478f..b3deea4 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 873a446..c6c00d8 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 3b29e06..7d61e1a 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 a8be5e5..c8a969d 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 c40dced..9794306 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 09000bd..f9282be 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.2.0</version>
+ <version>4.2.1-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 472bc40..31484ff 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 ff6a48c..8a03696 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 10773a5..a6114af 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 c6aa056..4c7a293 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.2.0</version>
+ <version>4.2.1-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 175d49a..14dd6d8 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 95c6ad9..54f5669 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.2.0</version>
+ <version>4.2.1-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 b1745a8..8aa3616 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.2.0</version>
+ <version>4.2.1-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 b50b330..e43add2 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.2.0</version>
+ <version>4.2.1-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 6dcaf75..6932fed 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 850bb80..bec89bf 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.2.0</version>
+ <version>4.2.1-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 ca7a344..b48db49 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 5d96301..1b3d8f6 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.2.0</version>
+ <version>4.2.1-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 6edf4af..e859b37 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 8ded5f3..4012589 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.2.0</version>
+ <version>4.2.1-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 a649633..9e4b2a5 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.2.0</version>
+ <version>4.2.1-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 fe7612f..d5e4b54 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.2.0</version>
+ <version>4.2.1-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 33f640b..2970ede 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.2.0</version>
+ <version>4.2.1-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 3336626..2810793 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index a83ff2b..010dc28 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.2.0</version>
+ <version>4.2.1-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 6378d3e..fd630e5 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.2.0</version>
+ <version>4.2.1-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 0b3a04f..b80a1e6 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index 4b99af3..9861a6d 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.2.0</version>
+ <version>4.2.1-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 81de565..470f76d 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 5e8f5d3..0214b90 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index cf5574f..6fe6ad2 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 ed0d879..2003318 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index c980074..3ed2254 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.2.0</version>
+ <version>4.2.1-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 0dbbd9e..53feac2 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.2.0</version>
+ <version>4.2.1-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 0b2c0a5..1ef7051 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 11b704d..b38da63 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.2.0</version>
+ <version>4.2.1-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 a978512..33c7d2b 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index f66b5c8..cc69563 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index f3c8ead..58c19f8 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index b35b84a..b034046 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 7f84b12..44580c7 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index 8a947ac..e2e1c30 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index c963e19..90ce0b3 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index 296d4bb..5a2c7f5 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index 09bfc55..fe72ab0 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 57fd55f..3fceabd 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index e19a470..ec72325 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 37c1211..6e5f386 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 4e29cda..d282e64 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index 529288c..afeb816 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-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 44eef27..8a84928 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index a248740..248fe1f 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.2.0</version>
+ <version>4.2.1-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 d0883a8..3824ac1 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.2.0</version>
+ <version>4.2.1-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 2797cd3..5a5c944 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index b910fde..12899cf 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.2.0</version>
+ <version>4.2.1-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 2ffeb52..7f27acc 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.2.0</version>
+ <version>4.2.1-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 be298bb..177483a 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index 439603b..3af9e8c 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index f31ceac..2d0b9e0 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 9bd96bc..50d734c 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 1a59693..b962a50 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index dca825b..60e546f 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index 9fb061d..6efcb65 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 279c21d..f7f73fd 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index 7cac241..0e3ff34 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index 6a0927a..1d0bd5e 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 4f8e56e..42c22fd 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index b79382d..ed6c1bb 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index b204ce6..9da8d07 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 58a225c..ca6eb29 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index ce48ee5..efccb01 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index 817fa5d..85a2442 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 5b42602..86b9dcb 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index 21df1b1..29bede9 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index 222f927..de93119 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 2c58489..19850f8 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 731bbb6..7fd77fa 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index bb6e551..b9e2ecd 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index db41e6e..ca6e0ff 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.2.0</version>
+ <version>4.2.1-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 a99726a..858db4f 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index 80a474b..3b8e312 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index eb44d59..6d39dab 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index acecf16..22a8be7 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.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index 860a992..6f4ebd5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.2.0</version>
+ <version>4.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
12 years, 6 months
[rhq] Branch 'release_jon3.x' - 3 commits - modules/core modules/plugins
by mazz
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java | 33 +-
modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml | 44 ---
modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml | 15 -
modules/plugins/hardware/src/main/resources/META-INF/rhq-plugin.xml | 28 +-
modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml | 14 -
modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml | 37 --
modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 138 +++++-----
modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml | 105 ++-----
modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml | 6
modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml | 26 -
modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml | 38 +-
modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml | 69 ++---
modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml | 4
modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml | 21 -
modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml | 14 -
modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml | 7
modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml | 6
20 files changed, 243 insertions(+), 368 deletions(-)
New commits:
commit 2279e1e27e1474b90958eea5afc08cb383eb9e11
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Sep 27 13:12:49 2011 -0400
[BZ 741331] turn off all plugin metrics by default, up all default collection intervals
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java
index f5b4b5d..77ecd37 100644
--- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java
+++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java
@@ -44,10 +44,11 @@ import org.rhq.core.domain.util.StringUtils;
* @author Greg Hinkle
*/
public class MetricsMetadataParser {
- public static final long MIN_1 = 1L * 60 * 1000L;
- public static final long MIN_5 = 5L * MIN_1;
- public static final long MIN_10 = 10L * MIN_1;
- public static final long MIN_30 = 30L * MIN_1;
+ private static final long MIN_1 = 1L * 60 * 1000L;
+ private static final long MIN_10 = 10L * MIN_1;
+ private static final long MIN_20 = 20L * MIN_1;
+ private static final long MIN_30 = 30L * MIN_1;
+ private static final long MIN_60 = 60L * MIN_1;
public static final long MINIMUM_INTERVAL = MeasurementSchedule.MINIMUM_INTERVAL;
@@ -58,39 +59,41 @@ public class MetricsMetadataParser {
DataType dataType = DataType.valueOf(metricDescriptor.getDataType().toUpperCase());
DisplayType displayType = DisplayType.valueOf(metricDescriptor.getDisplayType().toUpperCase());
- long collectionInterval = MIN_10;
+ long collectionInterval = MIN_30;
MeasurementUnits units = getMeasurementUnits(metricDescriptor.getUnits(), dataType);
switch (dataType) {
case MEASUREMENT: {
switch (resourceType.getCategory()) {
case PLATFORM: {
- collectionInterval = MIN_1;
+ collectionInterval = MIN_10;
break;
}
case SERVER: {
- collectionInterval = MIN_5;
+ collectionInterval = MIN_20;
break;
}
case SERVICE: {
- collectionInterval = MIN_10;
+ collectionInterval = MIN_30;
break;
}
}
- collectionInterval = (displayType == DisplayType.SUMMARY) ? collectionInterval : (collectionInterval * 2);
+ if (displayType != DisplayType.SUMMARY) {
+ collectionInterval *= 2;
+ }
break;
}
case TRAIT: {
- collectionInterval = (displayType == DisplayType.SUMMARY) ? MIN_10 : MIN_30;
+ collectionInterval = (displayType == DisplayType.SUMMARY) ? MIN_30 : MIN_60;
break;
}
case CALLTIME: {
- collectionInterval = MIN_1;
+ collectionInterval = MIN_10;
if (units != MeasurementUnits.MILLISECONDS) {
throw new IllegalStateException("Units must always be set to 'milliseconds' for call-time metrics.");
}
@@ -126,9 +129,11 @@ public class MetricsMetadataParser {
definition.setDestinationType(metricDescriptor.getDestinationType());
// Make sure that all summary properties are on by default.
- if (definition.getDisplayType() == DisplayType.SUMMARY) {
- definition.setDefaultOn(true);
- }
+ // BZ 741331 - we no longer want to imply any metric should be on by default
+ // let the plugin writer tell us explicitly if it should be on by default
+ // if (definition.getDisplayType() == DisplayType.SUMMARY) {
+ // definition.setDefaultOn(true);
+ // }
if ((definition.getNumericType() == NumericType.TRENDSUP)
|| (definition.getNumericType() == NumericType.TRENDSDOWN)) {
diff --git a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
index ad08a22..e88ffbc 100644
--- a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
@@ -463,19 +463,19 @@
<metric displayName="Number of Concurrent Connections" property="applInboundAssociations"
destinationType="The number of current connections to this application"
- defaultOn="true" defaultInterval="300000" displayType="summary" units="none"/>
+ displayType="summary" units="none"/>
<!-- traits determined via "httpd -V" -->
<metric displayName="Server Built" property="serverBuilt"
description="the date and time this Apache server's binary was compiled"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<!-- traits determined via SNMP (format for property attribute is "MIB_column_name") -->
<metric displayName="Start Time" property="wwwServiceStartTime"
description="the date and time this Apache server was last started"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<!-- Metric collected by pinging availability over http -->
<metric property="rhq_avail_ping_time" displayType="summary" units="milliseconds"
@@ -533,27 +533,27 @@
<metric displayName="Host" property="wwwServiceName"
description="the host name or IP address of this virtual host"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<metric displayName="Port" property="wwwServiceProtocol"
description="the TCP port of this virtual host"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<metric displayName="Administrator" property="wwwServiceContact"
description="the administrator of this virtual host"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<!-- summary metrics for requests - determined via SNMP
(format for property attribute is "MIB_column_name") -->
<metric displayName="Total Number of Requests" property="wwwSummaryInRequests"
description="The number of inbound requests on the service"
- defaultOn="true" defaultInterval="300000" displayType="summary"
+ displayType="summary"
units="none" measurementType="trendsup"/>
<metric displayName="Total Number of Bytes Received" property="wwwSummaryInLowBytes"
description="The number of bytes received by the service"
- defaultOn="true" defaultInterval="300000" displayType="summary"
+ displayType="summary"
units="bytes" measurementType="trendsup"/>
<!-- summary metrics for responses - determined via SNMP
@@ -561,12 +561,12 @@
<metric displayName="Total Number of Responses" property="wwwSummaryOutResponses"
description="The number of outbound requests on the service"
- defaultOn="true" defaultInterval="300000" displayType="summary"
+ displayType="summary"
units="none" measurementType="trendsup"/>
<metric displayName="Total Number of Bytes Sent" property="wwwSummaryOutLowBytes"
description="The number of bytes sent by the service"
- defaultOn="true" defaultInterval="300000" displayType="summary"
+ displayType="summary"
units="bytes" measurementType="trendsup"/>
<!-- per-request-method metrics - determined via SNMP
@@ -574,42 +574,34 @@
<metric displayName="Number of GET Requests" property="wwwRequestInRequests.GET"
description="The number of inbound GET requests on the service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of HEAD Requests" property="wwwRequestInRequests.HEAD"
description="The number of inbound HEAD requests on the service"
- defaultOn="false" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of POST Requests" property="wwwRequestInRequests.POST"
description="The number of inbound POST requests on the service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of PUT Requests" property="wwwRequestInRequests.PUT"
description="The number of inbound PUT requests on the service"
- defaultOn="false" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Received for GET Requests" property="wwwRequestInBytes.GET"
description="The number of bytes received by GET requests on the service"
- defaultOn="true" defaultInterval="300000"
units="bytes" measurementType="trendsup"/>
<metric displayName="Bytes Received for HEAD Requests" property="wwwRequestInBytes.HEAD"
description="The number of bytes received by HEAD requests on the service"
- defaultOn="false" defaultInterval="300000"
units="bytes" measurementType="trendsup"/>
<metric displayName="Bytes Received for POST Requests" property="wwwRequestInBytes.POST"
description="The number of bytes received by POST requests on the service"
- defaultOn="true" defaultInterval="300000"
units="bytes" measurementType="trendsup"/>
<metric displayName="Bytes Received for PUT Requests" property="wwwRequestInBytes.PUT"
description="The number of bytes received by PUT requests on the service"
- defaultOn="false" defaultInterval="300000"
units="bytes" measurementType="trendsup"/>
<!-- per-response-status-code metrics - determined via SNMP
@@ -617,78 +609,64 @@
<metric displayName="Number of 200 Responses" property="wwwResponseOutResponses.200"
description="The number of 200 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 301 Responses" property="wwwResponseOutResponses.301"
description="The number of 301 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 302 Responses" property="wwwResponseOutResponses.302"
description="The number of 302 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 401 Responses" property="wwwResponseOutResponses.401"
description="The number of 401 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 403 Responses" property="wwwResponseOutResponses.403"
description="The number of 403 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 404 Responses" property="wwwResponseOutResponses.404"
description="The number of 404 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 500 Responses" property="wwwResponseOutResponses.500"
description="The number of 500 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 200 Responses" property="wwwResponseOutBytes.200"
description="The number of bytes sent for 200 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 301 Responses" property="wwwResponseOutBytes.301"
description="The number of bytes sent for 301 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 302 Responses" property="wwwResponseOutBytes.302"
description="The number of bytes sent for 302 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 401 Responses" property="wwwResponseOutBytes.401"
description="The number of bytes sent for 401 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 403 Responses" property="wwwResponseOutBytes.403"
description="The number of bytes sent for 403 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 404 Responses" property="wwwResponseOutBytes.404"
description="The number of bytes sent for 404 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 500 Responses" property="wwwResponseOutBytes.500"
description="The number of bytes sent for 500 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<!-- response-time metric - determined by parsing the RT logfile that's specified in the plugin config -->
<metric property="ResponseTime" displayName="HTTP Response Time"
- dataType="calltime" defaultOn="false" units="milliseconds" destinationType="URL"
+ dataType="calltime" units="milliseconds" destinationType="URL"
description="The minimum, maximum, and average response times for HTTP requests serviced by this virtual host"/>
<resource-configuration>
diff --git a/modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml
index e1d6c6c..8f50485 100644
--- a/modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml
@@ -85,32 +85,27 @@
displayName="Client Version"
description="The version of the client used by this plugin to talk to the Byteman agent."
category="utilization"
- dataType="trait"
- defaultOn="true" />
+ dataType="trait" />
<metric property="totalNumberOfScripts"
description="The total number of scripts currently deployed in the Byteman agent. Scripts contain one or more rules."
category="utilization"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric property="totalNumberOfRules"
description="The total number of individual rules currently deployed in the Byteman agent"
category="utilization"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric property="totalNumberOfBootJars"
description="The total number of jar files that have been added to the Byteman agent's boot classpath"
category="utilization"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric property="totalNumberOfSystemJars"
description="The total number of jar files that have been added to the Byteman agent's system classpath"
category="utilization"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<!--
bootJar/systemJar content allow users to push jar content to the RHQ agent machine and manage that content.
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 225adcf..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
@@ -17,14 +17,14 @@
<metric property="gpusAverageTemperature" units="celsius" displayName="Average GPU Temperature" displayType="summary"/>
<metric property="fanAverageSpeed" displayName="Average Fan Speed" displayType="summary"/>
- <metric property="smolt.System Memory" dataType="trait" displayType="summary" displayName="System Memory" defaultInterval="86400"/>
- <metric property="smolt.System Swap" dataType="trait" displayType="summary" displayName="System Swap" defaultInterval="86400"/>
- <metric property="smolt.Vendor" dataType="trait" displayType="summary" displayName="Vendor" defaultInterval="86400"/>
- <metric property="smolt.System" dataType="trait" displayType="summary" displayName="System Model" defaultInterval="86400"/>
- <metric property="smolt.Form factor" dataType="trait" displayType="summary" displayName="Form Factor" defaultInterval="86400"/>
- <metric property="smolt.CPU Vendor" dataType="trait" displayType="summary" displayName="CPU Vendor" defaultInterval="86400"/>
- <metric property="smolt.CPU Model" dataType="trait" displayType="summary" displayName="CPU Model" defaultInterval="86400"/>
- <metric property="smolt.BogoMIPS" dataType="trait" displayType="summary" displayName="BogoMIPS" defaultInterval="86400"/>
+ <metric property="smolt.System Memory" dataType="trait" displayType="summary" displayName="System Memory"/>
+ <metric property="smolt.System Swap" dataType="trait" displayType="summary" displayName="System Swap"/>
+ <metric property="smolt.Vendor" dataType="trait" displayType="summary" displayName="Vendor"/>
+ <metric property="smolt.System" dataType="trait" displayType="summary" displayName="System Model"/>
+ <metric property="smolt.Form factor" dataType="trait" displayType="summary" displayName="Form Factor"/>
+ <metric property="smolt.CPU Vendor" dataType="trait" displayType="summary" displayName="CPU Vendor"/>
+ <metric property="smolt.CPU Model" dataType="trait" displayType="summary" displayName="CPU Model"/>
+ <metric property="smolt.BogoMIPS" dataType="trait" displayType="summary" displayName="BogoMIPS"/>
</server>
diff --git a/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml
index ad8a9cf..dfadc25 100644
--- a/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml
@@ -91,7 +91,7 @@
<metric displayName="Successful Transaction Count" property="SuccessfulTransactionCount"
description="The global number of transactions known to have been successful since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Query Cache Hit Count" property="QueryCacheHitCount"
description="The global number of cached queries successfully retrieved from cache since the statistics were reset"
@@ -103,11 +103,11 @@
<metric displayName="Connect Count" property="ConnectCount"
description="The global number of connections asked by the sessions (the actual number of connections used may be much smaller depending whether you use a connection pool or not) since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Start Time" property="StartTime" dataType="trait"
description="The time when the statistics collection started or were last reset"
- category="availability" defaultOn="true" units="epoch_milliseconds" measurementType="dynamic"/>
+ category="availability" units="epoch_milliseconds" measurementType="dynamic"/>
<metric displayName="Second Level Cache Put Count" property="SecondLevelCachePutCount"
description="The global number of cacheable entities/collections put in the cache since the statistics were reset"
@@ -119,11 +119,11 @@
<metric displayName="Session Open Count" property="SessionOpenCount"
description="The global number of sessions closed since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Transaction Count" property="TransactionCount"
description="The global number of transactions known to have completed since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Collection Fetch Count" property="CollectionFetchCount"
description="The global number of collections fetched since the statistics were reset"
@@ -131,11 +131,11 @@
<metric displayName="Session Close Count" property="SessionCloseCount"
description="The global number of sessions closed since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Query Cache Miss Count" property="QueryCacheMissCount"
description="The global number of cached queries *not* found in cache since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Second Level Cache Miss Count" property="SecondLevelCacheMissCount"
description="The global number of cacheable entities/collections not found in the cache and loaded from the database since the statistics were reset"
diff --git a/modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml
index 5065353..287f835 100644
--- a/modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml
@@ -5,184 +5,149 @@
<metric displayName="Bytes Sent"
description="Shows the rate that data bytes are sent by the Web service."
property="Bytes Sent/sec"
- defaultOn="true"
displayType="summary"
measurementType="trendsup"
units="bytes"/>
<metric displayName="Bytes Received"
description="Shows the rate that data bytes are received by the Web service."
property="Bytes Received/sec"
- defaultOn="true"
displayType="summary"
measurementType="trendsup"
units="bytes"/>
<metric displayName="Total Files Sent"
description="Shows the total number of files sent by the Web service (counted since service startup)."
property="Total Files Sent"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total Files Received"
description="Shows the total number of files received by the Web service (counted since service startup)."
property="Total Files Received"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total Files Transferred"
description="Shows the sum of Files Sent and Files Received. This is the total number of files transferred by the Web service (counted since service startup)."
property="Total Files Transferred"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Current Anonymous Users"
description="Shows the number of users who currently have an anonymous connection using the Web service."
property="Current Anonymous Users"
- defaultOn="true"
units="none"/>
<metric displayName="Current NonAnonymous Users"
description="Shows the number of users who currently have a non-anonymous connection using the Web service."
property="Current NonAnonymous Users"
- defaultOn="true"
units="none"/>
<metric displayName="Total Anonymous Users"
description="Shows the total number of users who established an anonymous connection with the Web service (counted since service startup)."
property="Total Anonymous Users"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total NonAnonymous Users"
description="Shows the total number of users who established a non-anonymous connection with the Web service (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Maximum Anonymous Users"
description="Shows the maximum number of users who established concurrent anonymous connections using the Web service (counted since service startup)."
- defaultOn="true"
units="none"/>
<metric property="Maximum NonAnonymous Users"
description="Shows the maximum number of users who established concurrent non-anonymous connections using the Web service (counted since service startup)."
- defaultOn="true"
units="none"/>
<metric property="Current Connections"
description="Shows the current number of connections established with the Web service."
- defaultOn="true"
displayType="summary"
units="none"/>
<metric property="Maximum Connections"
description="Shows the maximum number of simultaneous connections established with the Web service."
- defaultOn="true"
units="none"/>
<metric property="Total Logon Attempts"
description="Shows the number of logons that have been attempted using the Web service (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total GET Requests"
description="Shows the number of HTTP requests using the GET method (counted since service startup). GET requests are generally used for basic file retrievals or image maps, though they can be used with forms."
property="Total Get Requests"
- defaultOn="true"
displayType="summary"
measurementType="trendsup"
units="none"/>
<metric displayName="Total POST Requests"
description="Shows the number of HTTP requests using the POST method (counted since service startup). POST requests are generally used for forms or gateway requests."
property="Total Post Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total HEAD Requests"
description="Shows the number of HTTP requests using the HEAD method (counted since service startup). Head requests generally indicate a client is querying the state of a document they already have to see if it needs to be refreshed."
property="Total Head Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total PUT Requests"
description="Shows the number of HTTP requests using the PUT method (counted since service startup)."
property="Total Put Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total DELETE Requests"
description="Shows the number of HTTP requests using the DELETE method (counted since service startup). Delete requests are generally used for file removals."
property="Total Delete Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total TRACE Requests"
description="Shows the number of HTTP requests using the TRACE method (counted since service startup). TRACE requests allow the client to see what is being received at the end of the request chain and use the information for diagnostic purposes."
property="Total Trace Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Other Request Methods"
description="Shows the number of HTTP requests that are not OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, MOVE, COPY, MKCOL, PROPFIND, PROPPATCH, MS-SEARCH, LOCK or UNLOCK methods (counted since service startup). These may include LINK or other methods supported by gateway applications."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Method Requests"
description="Shows the number of all HTTP requests (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total CGI Requests"
description="Shows the total number of CGI requests. CGI requests are custom gateway executables (.exe) the administrator can install to add forms processing or other dynamic data sources. CGI requests initiate a process on the server which can be a large drain on server resources. The count is the total since service startup."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total ISAPI Extension Requests"
description="Shows the total number of ISAPI Extension Requests. ISAPI Extension Requests are custom gateway Dynamic Link Libraries (.dll) the administrator can install to add forms processing or other dynamic data sources. Unlike CGI requests, ISAPI requests are simple calls to a DLL library routine, thus they are better suited to high performance gateway applications. The count is the total since service startup."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Not Found Errors"
description="Shows the number of requests that could not be satisfied by the server because the requested document could not be found. These are generally reported as an HTTP 404 error code to the client. The count is the total since service startup."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Locked Errors"
description="Shows the number of requests that could not be satisfied by the server because the requested was locked. These are generally reported as an HTTP 423 error code to the client. The count is the total since service startup."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Current CGI Requests"
description="Shows the current number of CGI requests that are simultaneously being processed by the Web service."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Current ISAPI Extension Requests"
description="Shows the current number of Extension requests that are simultaneously being processed by the Web service."
- defaultOn="true"
units="none"/>
<metric property="Maximum CGI Requests"
description="Shows the maximum number of CGI requests simultaneously processed by the Web service."
- defaultOn="true"
units="none"/>
<metric property="Maximum ISAPI Extension Requests"
description="Shows the maximum number of Extension requests simultaneously processed by the Web service."
- defaultOn="true"
units="none"/>
<metric property="Total Blocked Async I/O Requests"
description="Shows the number of total requests temporarily blocked due to bandwidth throttling settings (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Allowed Async I/O Requests"
description="Shows the total number of requests allowed by bandwidth throttling settings (counted since service startup). When bandwidth throttling is defined, the number of allowed user requests is restricted."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Rejected Async I/O Requests"
description="Shows the total number of requests rejected due to bandwidth throttling settings (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Current Blocked Async I/O Requests"
description="Shows current requests that are temporarily blocked due to bandwidth throttling settings."
- defaultOn="true"
units="none"/>
<metric property="Measured Async I/O Bandwidth Usage"
description="Shows the measured bandwidth of asynchronous I/O averaged over a minute."
- defaultOn="true"
units="none"/>
'>
]>
@@ -229,12 +194,10 @@
<!-- Server only -->
<metric property="Total Connection Attempts (all instances)"
description="Shows the number of connections that have been attempted using the Web service (counted since service startup). This counter is for all instances listed."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Service Uptime"
description="The amount of time this service has been up for"
- defaultOn="true"
units="seconds"/>
<service name="VHost" description="IIS VHost"
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 e8cd691..2ae0e71 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
@@ -4,7 +4,7 @@
<!ENTITY managedObjectMetrics '
<metric property="runState" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"/>
+ dataType="trait" category="performance"/>
'>
<!ENTITY datasourceAndConnectionFactoryOperations '
@@ -49,42 +49,42 @@
<!ENTITY datasourceMetrics '
<!-- Traits -->
<metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="the JNDI name of the connection pool for this datasource"/>
<!-- Numerics -->
<metric property="availableConnectionCount" measurementType="dynamic" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the maximum number of connections that are available"/>
<metric property="connectionCount" measurementType="dynamic" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the number of connections that are currently in the pool"/>
<metric property="connectionCreatedCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the number of connections that have been created since the datasource was last started"/>
<metric property="connectionDestroyedCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the number of connections that have been destroyed since the datasource was last started"/>
<metric property="inUseConnectionCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the number of connections that are currently in use"/>
<metric property="local-transaction" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"/>
+ dataType="trait" category="performance"/>
<metric property="maxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the most connections that have been simultaneously in use since this datasource was started"/>
<metric property="maxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="minSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
'>
<!-- NOTE: For Datasource ManagedProperty annotations, see:
@@ -593,39 +593,39 @@
<!ENTITY connectionFactoryMetrics '
<!-- Traits -->
- <metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name" defaultOn="true"
- defaultInterval="600000" dataType="trait" category="performance"/>
+ <metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name"
+ dataType="trait" category="performance"/>
<!-- Numerics -->
<metric property="availableConnectionCount" measurementType="dynamic" displayType="summary"
displayName="Available Connection Count" description="Number of available connections."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="connectionCount" measurementType="dynamic" displayType="summary"
- displayName="Connection Count" defaultOn="true" defaultInterval="600000" dataType="measurement"
+ displayName="Connection Count" dataType="measurement"
category="performance"/>
<metric property="connectionCreatedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Created Count" defaultOn="true" defaultInterval="600000"
+ displayName="Connection Created Count"
dataType="measurement" category="performance"/>
<metric property="connectionDestroyedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Destroyed Count" defaultOn="true" defaultInterval="600000"
+ displayName="Connection Destroyed Count"
dataType="measurement" category="performance"/>
<metric property="inUseConnectionCount" measurementType="dynamic" displayType="detail"
displayName="In Use Connection Count" description="Mumber of connections currently in use."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="maxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
displayName="Max Connections In Use Count" description="Maximum number of maximum connections that have been in use."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="maxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="minSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
'>
<!-- These are the operations that both Topics and Queues have. -->
@@ -672,14 +672,14 @@
<!ENTITY webApplicationContextMetrics '
<metric property="clustered" dataType="trait" displayType="summary"
- description="True if this web application context is clustered" defaultOn="true" defaultInterval="3600000" />
+ description="True if this web application context is clustered" />
<metric property="virtualHost"
dataType="trait" displayType="summary"
description="the virtual host with which this context is associated"/>
<metric property="responseTime"
- dataType="calltime" defaultOn="false" defaultInterval="600000" units="milliseconds" destinationType="URL"
+ dataType="calltime" defaultOn="false" units="milliseconds" destinationType="URL"
description="the minimum, maximum, and average response times for requests serviced by this webapp"/>
<metric property="activeSessions"
@@ -782,30 +782,30 @@
<!-- default interval == 600000 ms == 10 min -->
<metric property="methodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
'>
<!ENTITY ejb3StatefulSessionBeanMetrics '
<metric property="cacheSize" measurementType="dynamic" displayType="detail" displayName="Cache Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="passivatedCount" measurementType="dynamic" displayType="detail" displayName="Passivated Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="totalSize" measurementType="dynamic" displayType="detail" displayName="Total Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
'>
<!ENTITY ejb3MessageDrivenBeanMetrics '
<metric property="minPoolSize" measurementType="dynamic" displayType="detail" displayName="Minimum Pool Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="maxPoolSize" measurementType="dynamic" displayType="detail" displayName="Maximum Pool Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="maxMessages" measurementType="dynamic" displayType="detail" displayName="Maximum number of Messages"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
'>
<!ENTITY ejb2PoolMetrics '
@@ -827,7 +827,7 @@
<!ENTITY ejb2SessionBeanMetrics '
<!-- default interval == 600000 ms == 10 min -->
<metric property="methodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
'>
@@ -902,8 +902,7 @@
<!ENTITY ejb2EntityBeanMetrics '
<metric property="CacheSize"
displayName="Cache Size"
- displayType="summary"
- defaultOn="true"/>
+ displayType="summary"/>
'>
<!ENTITY subscriptionsResultProperty '
@@ -1140,35 +1139,35 @@
<metric displayName="Active Thread Count" property="MCBean|ServerInfo|*|activeThreadCount"
description="The current number of active threads for this app server instance"
- defaultInterval="300000" displayType="summary" category="throughput"/>
+ displayType="summary" category="throughput"/>
<metric displayName="Active Thread Group Count" property="MCBean|ServerInfo|*|activeThreadGroupCount"
description="The current number of active thread groups for this app server instance"
- defaultInterval="300000" defaultOn="true" category="throughput"/>
+ category="throughput"/>
<metric displayName="JVM Free Memory" property="MCBean|ServerInfo|*|freeMemory" displayType="summary"
defaultOn="true"
description="An approximation of the total amount of memory currently available in the app server JVM for future allocated objects, measured in bytes"
- defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric displayName="JVM Max Memory" property="MCBean|ServerInfo|*|maxMemory"
description="The maximum amount of memory that the app server JVM will attempt to use, measured in bytes; if there is no inherent limit then the value Long.MAX_VALUE will be returned"
- defaultInterval="1800000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric displayName="JVM Total Memory" property="MCBean|ServerInfo|*|totalMemory" displayType="summary"
description="The total amount of memory currently available in the app server JVM for current and future objects, measured in bytes"
- defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric displayName="Total Transactions" property="MCBean|JTA|*|transactionCount" measurementType="trendsup"
- defaultInterval="300000" defaultOn="true" category="utilization"
+ category="utilization"
description="Total number of transactions since last restart"/>
<metric displayName="Transactions Committed" property="MCBean|JTA|*|commitCount" displayType="summary" measurementType="trendsup"
- defaultInterval="600000" defaultOn="true" category="utilization"
+ category="utilization"
description="Number of transactions committed since last restart"/>
<metric displayName="Transactions Rolled Back" property="MCBean|JTA|*|rollbackCount" measurementType="trendsup"
- defaultInterval="600000" defaultOn="true" category="utilization"
+ category="utilization"
description="Number of transactions rolled back since last restart"/>
<event name="logEntry" description="an entry was appended to a log file"/>
@@ -1255,7 +1254,7 @@
displayName="Maximum Request Time"
description="the maximum time it took to process a request since the last restart"
units="milliseconds"
- defaultOn="true" category="performance"/>
+ category="performance"/>
<metric property="requestCount"
displayName="Request Count" description="the total number of requests processed since the last restart"
@@ -1263,16 +1262,16 @@
<metric property="errorCount"
displayName="Error Count" description="the number of errors while processing requests since the last restart"
- defaultOn="true" category="utilization" measurementType="trendsup"/>
+ category="utilization" measurementType="trendsup"/>
<metric property="ThreadPool|currentThreadsBusy"
displayName="Current Active Threads"
- defaultOn="true" category="utilization" displayType="summary"
+ category="utilization" displayType="summary"
description="the number of threads for this connector that are currently active"/>
<metric property="ThreadPool|currentThreadCount"
displayName="Current Thread Count"
- defaultOn="true" category="utilization" displayType="summary"
+ category="utilization" displayType="summary"
description="the number of threads for this connector that currently exist"/>
</service>
@@ -1583,7 +1582,7 @@
<metric property="custom.transactionType" displayName="Transaction Type" displayType="summary"
description="The type of transactions used by this connection factory - Local or XA"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"/>
+ dataType="trait" category="performance"/>
&managedObjectMetrics;
&connectionFactoryMetrics;
@@ -1762,54 +1761,54 @@
<!-- Traits -->
<metric property="createdProgrammatically" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="Was this queue created programmatically? If Yes, the queue will not survive a restart of the application server. If No, the queue was created via a deployment XML file."/>
<!-- NOTE: We have to make this a trait rather than a resource config prop due to a bug in JBMESSAGING
(see https://jira.jboss.org/jira/browse/JBAS-6721). -->
<metric property="messageCounterHistoryDayLimit"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="This queue's message counter history day limit - <0: unlimited, =0: history disabled, >0: maximum day count"/>
<!-- Numerics -->
<metric property="consumerCount" measurementType="dynamic" displayType="summary" displayName="Consumer Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The number of consumers on the queue"/>
<metric property="deliveringCount" measurementType="dynamic" displayType="detail" displayName="Delivering Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The number of messages currently being delivered"/>
<metric property="messageCount" measurementType="dynamic" displayType="summary" displayName="Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The number of messages in the queue"/>
<metric property="scheduledMessageCount" measurementType="dynamic" displayType="detail" displayName="Scheduled Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The number of scheduled messages in the queue"/>
<metric property="messageStatistics.count" measurementType="dynamic" displayType="detail" displayName="Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The total message count since startup or last counter reset"/>
<metric property="messageStatistics.countDelta" measurementType="dynamic" displayType="detail" displayName="Count Delta"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The message count delta since last method call"/>
<metric property="messageStatistics.depth" measurementType="dynamic" displayType="detail" displayName="Depth"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The current message count of pending messages within the queue waiting for dispatch"/>
<metric property="messageStatistics.depthDelta" measurementType="dynamic" displayType="detail" displayName="Depth Delta"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The message count delta of pending messages since last method call"/>
<metric property="messageStatistics.timeLastUpdate" measurementType="dynamic" displayType="detail" displayName="Time Last Update"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The timestamp of the last message add"/>
- <metric property="clustered" dataType="trait" description="True if this queue is clustered, false otherwise" defaultInterval="3600000" defaultOn="true"/>
+ <metric property="clustered" dataType="trait" description="True if this queue is clustered, false otherwise" />
<resource-configuration>
@@ -2113,42 +2112,42 @@
<!-- Traits -->
<metric property="createdProgrammatically" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="Was this topic created programmatically? If Yes, the topic will not survive a restart of the application server. If No, the topic was created via a deployment XML file."/>
<!-- NOTE: We have to make this a trait rather than a resource config prop due to a bug in JBMESSAGING
(see https://jira.jboss.org/jira/browse/JBAS-6721). -->
<metric property="messageCounterHistoryDayLimit"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="This topic's message counter history day limit - <0: unlimited, =0: history disabled, >0: maximum day count"/>
<!-- Numerics -->
<metric property="allMessageCount" measurementType="dynamic" displayType="summary" displayName="All Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all messages in all subscriptions to this topic"/>
<metric property="allSubscriptionsCount" measurementType="dynamic" displayType="summary" displayName="All Subscriptions Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all subscriptions to this topic"/>
<metric property="durableMessageCount" measurementType="dynamic" displayType="detail" displayName="Durable Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all messages for all durable subscriptions to this topic"/>
<metric property="durableSubscriptionsCount" measurementType="dynamic" displayType="detail" displayName="Durable Subscriptions Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all durable subscriptions to this topic"/>
<metric property="nonDurableMessageCount" measurementType="dynamic" displayType="detail" displayName="Non Durable Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all messages in all non durable subscriptions to this topic"/>
<metric property="nonDurableSubscriptionsCount" measurementType="dynamic" displayType="detail" displayName="Non Durable Subscriptions Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all non durable subscriptions to this topic"/>
- <metric property="clustered" dataType="trait" description="True if this topic is clustered, false otherwise" defaultInterval="3600000" defaultOn="true"/>
+ <metric property="clustered" dataType="trait" description="True if this topic is clustered, false otherwise" />
<resource-configuration>
@@ -2569,7 +2568,7 @@
&ejb2StatelessSessionBeanMetrics;
<metric property="methodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
</service>
@@ -2585,7 +2584,7 @@
&ejb2StatefulSessionBeanMetrics;
<metric property="methodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
</service>
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 6588d0d..2536cb5 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
@@ -203,35 +203,35 @@
<metric property="jboss.system:type=ServerInfo:ActiveThreadCount" displayName="Active Thread Count"
description="The current number of active threads for this app server instance"
- defaultInterval="300000" displayType="summary" category="throughput"/>
+ displayType="summary" category="throughput"/>
<metric property="jboss.system:type=ServerInfo:ActiveThreadGroupCount" displayName="Active Thread Group Count"
description="The current number of active thread groups for this app server instance"
- defaultInterval="300000" defaultOn="true" category="throughput"/>
+ category="throughput"/>
<metric property="jboss.system:type=ServerInfo:FreeMemory" displayName="JVM Free Memory" displayType="summary"
defaultOn="true"
description="An approximation of the total amount of memory currently available in the app server JVM for future allocated objects, measured in bytes"
- defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric property="jboss.system:type=ServerInfo:MaxMemory" displayName="JVM Max Memory"
description="The maximum amount of memory that the app server JVM will attempt to use, measured in bytes; if there is no inherent limit then the value Long.MAX_VALUE will be returned"
- defaultInterval="1800000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric property="jboss.system:type=ServerInfo:TotalMemory" displayName="JVM Total Memory" displayType="summary"
description="The total amount of memory currently available in the app server JVM for current and future objects, measured in bytes"
- defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric property="jboss:service=TransactionManager:TransactionCount" displayName="Total Transactions" measurementType="trendsup"
- defaultInterval="300000" defaultOn="true" category="utilization"
+ category="utilization"
description="Total number of transactions since last restart"/>
<metric property="jboss:service=TransactionManager:CommitCount" displayName="Transactions Committed" displayType="summary" measurementType="trendsup"
- defaultInterval="600000" defaultOn="true" category="utilization"
+ category="utilization"
description="Number of transactions commited since last restart"/>
<metric property="jboss:service=TransactionManager:RollbackCount" displayName="Transactions Rolledback" measurementType="trendsup"
- defaultInterval="600000" defaultOn="true" category="utilization"
+ category="utilization"
description="Number of transactions commited since last restart"/>
<event name="logEntry" description="an entry in a log file"/>
@@ -392,7 +392,7 @@
displayName="Maximum Request Time"
description="Maximum time it took to process a request"
units="milliseconds"
- defaultOn="true" category="performance"/>
+ category="performance"/>
<!-- jboss.web:name=http-0.0.0.0-8080,type=GlobalRequestProcessor:requestCount -->
<metric property="jboss.web:name=%schema%%dash%%address%-%port%,type=GlobalRequestProcessor:requestCount"
@@ -402,17 +402,17 @@
<!-- jboss.web:name=http-0.0.0.0-8080,type=GlobalRequestProcessor:errorCount -->
<metric property="jboss.web:name=%schema%%dash%%address%-%port%,type=GlobalRequestProcessor:errorCount"
displayName="Error count" description="Number of errors while processing since last restart."
- defaultOn="true" category="utilization" measurementType="trendsup"/>
+ category="utilization" measurementType="trendsup"/>
<!-- jboss.web:name=http-0.0.0.0-8080,type=ThreadPool:currentThreadsBusy -->
<metric property="jboss.web:name=%schema%%dash%%address%-%port%,type=ThreadPool:currentThreadsBusy"
displayName="Threads Active"
- defaultOn="true" category="utilization" displayType="summary"/>
+ category="utilization" displayType="summary"/>
<!-- jboss.web:name=http-0.0.0.0-8080,type=ThreadPool:currentThreadCount -->
<metric property="jboss.web:name=%schema%%dash%%address%-%port%,type=ThreadPool:currentThreadCount"
displayName="Threads Allocated"
- defaultOn="true" category="utilization" displayType="summary"/>
+ category="utilization" displayType="summary"/>
</service>
<service name="VHost"
@@ -429,7 +429,7 @@
<metric property="jboss.web:type=Host,host=%name%:aliases"
description="The aliases for this virtual host"
displayName="Aliases"
- defaultOn="true" dataType="trait" />
+ dataType="trait" />
</service>
</server>
@@ -461,20 +461,20 @@
created."/>
<metric displayName="Total Connections" property="ConnectionCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
description="Total Number of Connections for the Connection Pool, both active and in-active."/>
<metric displayName="Available Connections" property="AvailableConnectionCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
description="Number of available connections in the connection pool in-active and waiting."/>
<metric displayName="Active Connections" property="InUseConnectionCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
description="Number of Connections currently supporting clients."/>
<metric displayName="Connections Created" property="ConnectionCreatedCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
measurementType="trendsup"
description="Number of Connections created since the Connection Pool was created."/>
<metric displayName="Connections Destroyed" property="ConnectionDestroyedCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
measurementType="trendsup"
description="Number of Connections destroyed since the Connection Pool was created."/>
@@ -601,33 +601,33 @@
<metric property="AvailableConnectionCount" measurementType="dynamic" displayType="summary"
displayName="Available Connection Count" description="Number of available connections."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="ConnectionCount" measurementType="dynamic" displayType="summary"
- displayName="Connection Count" defaultOn="true" defaultInterval="600000" dataType="measurement"
+ displayName="Connection Count" dataType="measurement"
category="performance"/>
<metric property="ConnectionCreatedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Created Count" defaultOn="true" defaultInterval="600000"
+ displayName="Connection Created Count"
dataType="measurement" category="performance"/>
<metric property="ConnectionDestroyedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Destroyed Count" defaultOn="true" defaultInterval="600000"
+ displayName="Connection Destroyed Count"
dataType="measurement" category="performance"/>
<metric property="InUseConnectionCount" measurementType="dynamic" displayType="detail"
displayName="In Use Connection Count" description="Mumber of connections currently in use."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="MaxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
displayName="Max Connections In Use Count" description="Maximum number of maximum connections that have been in use."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="MaxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="MinSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<resource-configuration>
@@ -972,27 +972,27 @@
<metric property="jboss.mq:service=MessageCache:CacheHits" displayName="JMS Message Cache Hits"
description="The number of cache hits to the JMS Message Cache"
- defaultInterval="300000" defaultOn="false" category="throughput" measurementType="trendsup"/>
+ defaultOn="false" category="throughput" measurementType="trendsup"/>
<metric property="jboss.mq:service=MessageCache:CacheMisses" displayName="JMS Message Cache Misses"
description="The number of cache misses to the JMS Message Cache"
- defaultInterval="300000" defaultOn="false" category="throughput" measurementType="trendsup"/>
+ defaultOn="false" category="throughput" measurementType="trendsup"/>
<metric property="jboss.mq:service=MessageCache:CurrentMemoryUsage" displayName="JMS Message Cache Current Memory Usage"
description="The total memory currently in use by the JMS Message Cache"
- defaultInterval="300000" defaultOn="false" category="utilization" units="bytes"/>
+ defaultOn="false" category="utilization" units="bytes"/>
<metric property="jboss.mq:service=MessageCache:HighMemoryMark" displayName="JMS Message Cache High Memory Mark"
description="The peak amount of memory the JMS Message Cache has actively used since server start"
- defaultInterval="300000" defaultOn="false" category="utilization" units="bytes"/>
+ defaultOn="false" category="utilization" units="bytes"/>
<metric property="jboss.mq:service=MessageCache:MaxMemoryMark" displayName="JMS Message Cache Max Memory Mark"
description="The maximum amount of memory the JMS Message Cache is allowed to use"
- defaultInterval="300000" defaultOn="false" category="utilization" units="bytes"/>
+ defaultOn="false" category="utilization" units="bytes"/>
<metric property="jboss.mq:service=MessageCache:TotalCacheSize" displayName="JMS Message Cache Size"
description="The number of messages currently in the JMS Message Cache"
- defaultInterval="300000" defaultOn="false" category="utilization"/>
+ defaultOn="false" category="utilization"/>
<service name="JMQ JMS Queue" class="JMSComponent"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
@@ -1049,26 +1049,22 @@
<metric displayName="Messages in Queue"
property="QueueDepth"
category="utilization"
- defaultOn="true"
displayType="summary"
description="The number of undelivered messages in the queue."/>
<metric displayName="Receivers Count"
property="ReceiversCount"
category="utilization"
- defaultOn="true"
description="The number of ClientConsumers waiting for a message."/>
<metric displayName="Scheduled Message Count"
property="ScheduledMessageCount"
category="utilization"
- defaultOn="true"
description="The number of messages waiting to be scheduled"/>
<metric displayName="In Process Message Count"
property="InProcessMessageCount"
category="utilization"
- defaultOn="true"
description="The number of messages received by clients but not acknowledged (from AS 4.0.5)"/>
<resource-configuration>
@@ -1389,37 +1385,31 @@
<metric displayName="All Message Counter"
property="AllMessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Returns the total message count for all subscriptions."/>
<metric displayName="Durable Message Count"
property="DurableMessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Total number of messages for all durable subscriptions."/>
<metric displayName="Non-durable Message Count"
property="NonDurableMessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Total number of messages for all non-durable subscriptions."/>
<metric displayName="All Subscription Count"
property="AllSubscriptionsCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Number of subscriptions waiting for a message."/>
<metric displayName="Durable Subscription Count"
property="DurableSubscriptionsCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Number of durable subscriptions waiting for a message."/>
<metric displayName="Non-durable Subscription Count"
property="NonDurableSubscriptionsCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Number of non-durable subscriptions waiting for a message."/>
@@ -1624,24 +1614,20 @@
<metric displayName="Messages in Queue"
property="MessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="The number of messages in the queue."/>
<metric displayName="Consumer Count"
property="ConsumerCount"
category="utilization"
- defaultOn="true"
description="The number of ClientConsumers waiting for a message."/>
<metric displayName="Scheduled Message Count"
property="ScheduledMessageCount"
category="utilization"
- defaultOn="true"
description="The number of scheduled messages in the Queue"/>
<metric displayName="Created programmatically"
property="CreatedProgrammatically"
dataType="trait"
displayType="summary"
- defaultOn="true"
description="Was this Queue created dynamically" />
<metric displayName="Delivering Count"
property="DeliveringCount"
@@ -1843,7 +1829,6 @@
<metric displayName="All Message Counter"
property="AllMessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Returns the total message count for all subscriptions."/>
<metric displayName="Durable Message Count"
@@ -1859,7 +1844,6 @@
<metric displayName="All Subscription Count"
property="AllSubscriptionsCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Number of subscriptions waiting for a message."/>
<metric displayName="Durable Subscription Count"
@@ -1876,7 +1860,6 @@
property="CreatedProgrammatically"
dataType="trait"
displayType="summary"
- defaultOn="true"
description="Was this Topic created dynamically" />
<resource-configuration>
@@ -2046,9 +2029,8 @@
<metric displayName="Max Size" property="MaxSize"
description="The maximum number of instances that are allowed to be pooled"/>
- <!-- default interval == 600000 ms == 10 min -->
<metric property="MethodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB;
NOTE: this metric is only available if JBoss EJB3 RC9 Patch 1 or later is being used
(a capable version of EJB3 is included with JBossAS 4.2.0.GA or later)"/>
@@ -2096,9 +2078,8 @@
description="The maximum number of instances that are allowed to be pooled"
property="{{jboss.j2ee:jndiName=%name%,plugin=pool,service=EJB}MaxSize}"/>
- <!-- default interval == 600000 ms == 10 min -->
<metric property="MethodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="the minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
</service>
@@ -2142,9 +2123,8 @@
property="{stats.passiveCount.current}"
displayType="summary"/>
- <!-- default interval == 600000 ms == 10 min -->
<metric property="MethodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="the minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
</service>
@@ -2190,24 +2170,20 @@
<metric property="{{jboss.j2ee:jndiName=%name%,plugin=cache,service=EJB}CacheSize}"
description="The total number of currently cached instances of this EJB 1.x or 2.x Entity Bean"
- displayName="Cache Size"
- defaultOn="true"/>
+ displayName="Cache Size"/>
<metric property="{{jboss.j2ee:jndiName=%name%,plugin=cache,service=EJB}PassivatedCount}"
description="The number of pooled instances of this EJB 1.x or 2.x Entity Bean in the passivated state"
displayName="Passivated Count"
- defaultOn="true"
measurementType="trendsup"/>
<metric property="{{jboss.j2ee:jndiName=%name%,plugin=pool,service=EJB}PoolSize}"
description="The total number of currently pooled instances of this EJB 1.x or 2.x Entity Bean"
- displayName="Current Size"
- defaultOn="true"/>
+ displayName="Current Size"/>
<metric property="{{jboss.j2ee:jndiName=%name%,plugin=pool,service=EJB}MaxPoolSize}"
description="The maximum number of instances that are allowed to be pooled"
- displayName="Max Size"
- defaultOn="true"/>
+ displayName="Max Size"/>
</service>
@@ -2412,7 +2388,7 @@
<metric property="Session.sessionMaxAliveTime" displayName="Max Session alive time"
units="seconds" description="Maximum alive time of a Sessions" />
- <metric property="Vhost.name" displayName="Vhost" dataType="trait" defaultOn="true"
+ <metric property="Vhost.name" displayName="Vhost" dataType="trait"
description="Virtual hosts this app runs on"/>
</service>
@@ -2539,7 +2515,7 @@
<metric property="Session.sessionMaxAliveTime" displayName="Max Session alive time"
units="seconds" description="Maximum alive time of a Sessions" />
- <metric property="Vhost.name" displayName="Vhost" dataType="trait" defaultOn="true"
+ <metric property="Vhost.name" displayName="Vhost" dataType="trait"
description="Virtual hosts this app runs on"/>
<content name="file" displayName="WAR File" category="deployable" isCreationType="true">
diff --git a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
index b142a22..b2c71b9 100644
--- a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
@@ -126,7 +126,6 @@
</plugin-configuration>
<metric displayName="Free Physical Memory"
- defaultOn="true"
displayType="summary"
category="performance"
property="FreePhysicalMemorySize"
@@ -147,7 +146,6 @@
measurementType="trendsup"
units="nanoseconds"/>
<metric displayName="Committed Virtual Memory"
- defaultOn="true"
category="utilization"
property="CommittedVirtualMemorySize"
description="Size of virtual memory used by this process"
@@ -208,23 +206,19 @@
</operation>
<metric displayName="Thread Count"
- defaultOn="true"
displayType="summary"
category="performance"
property="ThreadCount"
description="Number of active threads in the system"/>
<metric displayName="Peak Thread Count"
- defaultOn="true"
category="performance"
property="PeakThreadCount"
description="Peak count of active threads in the system"/>
<metric displayName="Total Started Thread Count"
- defaultOn="true"
category="performance"
property="TotalStartedThreadCount"
description="Count of threads started since system start"/>
<metric displayName="Daemon Thread Count"
- defaultOn="true"
category="performance"
property="DaemonThreadCount"
description="Count of threads marked as daemons in the system"/>
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 282987e..491af1c 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -477,7 +477,7 @@
<metric property="Load" displayName="Load" category="utilization"
description="The current load of this metric as a percent of the metric's capacity." dataType="measurement"
- defaultOn="true" displayType="summary"/>
+ displayType="summary"/>
<resource-configuration>
<c:simple-property name="weight" type="integer" description="The significance of this load metric compared to the other metrics." />
diff --git a/modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml
index 6a96c19..9c3e148 100644
--- a/modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml
@@ -361,21 +361,21 @@
<c:simple-property name="tableName" readOnly="true" />
</plugin-configuration>
<!-- Summary Traits -->
- <metric property="Engine" displayType="summary" dataType="trait" description="Database Engine that created the Table" defaultOn="true"/>
- <metric property="Version" displayType="summary" dataType="trait" description="Version of the Table" defaultOn="true"/>
- <metric property="Row_format" displayType="summary" dataType="trait" description="Row Format" defaultOn="true"/>
- <metric property="Collation" displayType="summary" dataType="trait" description="Collation Character Set" defaultOn="true"/>
- <metric property="Comment" displayType="summary" dataType="trait" description="Table Creation Comment" defaultOn="true"/>
- <metric property="Create_options" displayType="summary" dataType="trait" description="Table Creation Options" defaultOn="true"/>
- <metric property="Create_time" displayType="summary" dataType="trait" description="Table Creation Time" defaultOn="true"/>
+ <metric property="Engine" displayType="summary" dataType="trait" description="Database Engine that created the Table" />
+ <metric property="Version" displayType="summary" dataType="trait" description="Version of the Table" />
+ <metric property="Row_format" displayType="summary" dataType="trait" description="Row Format" />
+ <metric property="Collation" displayType="summary" dataType="trait" description="Collation Character Set" />
+ <metric property="Comment" displayType="summary" dataType="trait" description="Table Creation Comment" />
+ <metric property="Create_options" displayType="summary" dataType="trait" description="Table Creation Options" />
+ <metric property="Create_time" displayType="summary" dataType="trait" description="Table Creation Time" />
<!-- Dynamic Metrics -->
- <metric property="Rows" displayType="summary" measurementType="dynamic" description="Number of Rows in the Table" defaultOn="true"/>
- <metric property="Avg_row_length" displayType="summary" measurementType="dynamic" units="bytes" description="Average Row Length(bytes)" defaultOn="true"/>
- <metric property="Data_length" displayType="summary" measurementType="dynamic" units="bytes" description="Table Data Size(bytes)" defaultOn="true"/>
- <metric property="Max_data_length" displayType="summary" measurementType="dynamic" units="bytes" description="Max Table Data Size(bytes)" defaultOn="true"/>
- <metric property="Index_length" displayType="summary" measurementType="dynamic" units="bytes" description="Table Index Size(bytes)" defaultOn="true"/>
- <metric property="Data_free" displayType="summary" measurementType="dynamic" units="bytes" description="Table Free Space(bytes)" defaultOn="true"/>
+ <metric property="Rows" displayType="summary" measurementType="dynamic" description="Number of Rows in the Table" />
+ <metric property="Avg_row_length" displayType="summary" measurementType="dynamic" units="bytes" description="Average Row Length(bytes)" />
+ <metric property="Data_length" displayType="summary" measurementType="dynamic" units="bytes" description="Table Data Size(bytes)" />
+ <metric property="Max_data_length" displayType="summary" measurementType="dynamic" units="bytes" description="Max Table Data Size(bytes)" />
+ <metric property="Index_length" displayType="summary" measurementType="dynamic" units="bytes" description="Table Index Size(bytes)" />
+ <metric property="Data_free" displayType="summary" measurementType="dynamic" units="bytes" description="Table Free Space(bytes)" />
</service>
</service>
<service name="User" class="MySqlUserComponent" discovery="MySqlUserDiscoveryComponent"
diff --git a/modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml
index a8ea1e3..5cca30b 100644
--- a/modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml
@@ -25,7 +25,7 @@
discovery="DS1820Discovery"
>
- <metric property="temperature" defaultOn="true" description="Temperature measured"
+ <metric property="temperature" description="Temperature measured"
displayType="summary" units="celsius"/>
</service>
diff --git a/modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml
index 11eb232..fea33f1 100644
--- a/modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml
@@ -33,13 +33,13 @@
<metric property="totalSize" displayType="summary" units="bytes"/>
- <metric property="logons cumulative" defaultOn="true"/>
+ <metric property="logons cumulative" />
<metric property="logons current" displayType="summary"/>
<metric property="opened cursors cumulative"/>
- <metric property="opened cursors current" defaultOn="true"/>
+ <metric property="opened cursors current" />
<metric property="user commits" displayType="summary"/>
<metric property="user rollbacks" displayType="summary"/>
- <metric property="user calls" defaultOn="true"/>
+ <metric property="user calls" />
<metric property="recursive calls"/>
<metric property="recursive cpu usage"/>
<metric property="session logical reads"/>
@@ -49,8 +49,8 @@
<metric property="DB time"/>
<metric property="cluster wait time"/>
<metric property="concurrency wait time"/>
- <metric property="application wait time" defaultOn="true"/>
- <metric property="user I/O wait time" defaultOn="true"/>
+ <metric property="application wait time" />
+ <metric property="user I/O wait time" />
<metric property="session connect time"/>
<metric property="process last non-idle time"/>
<!--<metric property="session uga memory" displayType="summary" units="bytes"/>
@@ -70,30 +70,30 @@
<metric property="global enqueue gets async"/>
<metric property="global enqueue get time"/>
<metric property="global enqueue releases"/>
- <metric property="physical read total IO requests" defaultOn="true"/>
+ <metric property="physical read total IO requests" />
<metric property="physical read total multi block requests"/>
- <metric property="physical read total bytes" defaultOn="true"/>
- <metric property="physical write total IO requests" defaultOn="true"/>
+ <metric property="physical read total bytes" />
+ <metric property="physical write total IO requests" />
<metric property="physical write total multi block requests"/>
- <metric property="physical write total bytes" defaultOn="true"/>
+ <metric property="physical write total bytes" />
<metric property="IPC CPU used by this session"/>
<metric property="gcs messages sent"/>
<metric property="ges messages sent"/>
<metric property="global enqueue CPU used by this session"/>
- <metric property="db block gets" defaultOn="true"/>
- <metric property="db block gets from cache" defaultOn="true"/>
- <metric property="db block gets direct" defaultOn="true"/>
+ <metric property="db block gets" />
+ <metric property="db block gets from cache" />
+ <metric property="db block gets direct" />
<metric property="consistent gets"/>
<metric property="consistent gets from cache"/>
<metric property="consistent gets - examination"/>
<metric property="consistent gets direct"/>
- <metric property="physical reads" defaultOn="true"/>
+ <metric property="physical reads" />
<metric property="physical reads cache"/>
<metric property="physical reads direct"/>
- <metric property="physical read IO requests" defaultOn="true"/>
+ <metric property="physical read IO requests" />
<metric property="physical read bytes"/>
- <metric property="db block changes" defaultOn="true"/>
- <metric property="consistent changes" defaultOn="true"/>
+ <metric property="db block changes" />
+ <metric property="consistent changes" />
<metric property="recovery blocks read"/>
<metric property="physical writes"/>
<metric property="physical writes direct"/>
@@ -367,15 +367,15 @@
<metric property="parse count (hard)"/>
<metric property="parse count (failures)"/>
<metric property="frame signature mismatch"/>
- <metric property="execute count" defaultOn="true"/>
+ <metric property="execute count" />
<metric property="bytes sent via SQL*Net to client"/>
<metric property="bytes received via SQL*Net from client"/>
<metric property="SQL*Net roundtrips to/from client"/>
<metric property="bytes sent via SQL*Net to dblink"/>
<metric property="bytes received via SQL*Net from dblink"/>
<metric property="SQL*Net roundtrips to/from dblink"/>
- <metric property="sorts (memory)" defaultOn="true"/>
- <metric property="sorts (disk)" defaultOn="true"/>
+ <metric property="sorts (memory)" />
+ <metric property="sorts (disk)" />
<metric property="sorts (rows)"/>
<metric property="OTC commit optimization attempts"/>
<metric property="OTC commit optimization hits"/>
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 64575d9..cd70d40 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
@@ -54,34 +54,29 @@
description="Name that this platform is known as"
defaultOn="true"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric displayName="OS Name"
property="Trait.osname"
description="Name that the operating system is known as"
defaultOn="true"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric displayName="OS Version"
property="Trait.osversion"
description="Version of the operating system"
defaultOn="true"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric displayName="Architecture"
property="Trait.sysarch"
description="Hardware architecture of the platform"
defaultOn="true"
dataType="trait"
- displayType="summary"
- defaultOn="true"/>
+ displayType="summary" />
'>
<!ENTITY nativeMetrics '
<metric displayName="Free Memory"
property="Native.MemoryInfo.free"
- defaultOn="true"
displayType="summary"
defaultOn="true"
units="bytes"
@@ -89,7 +84,6 @@
<metric displayName="Used Memory"
property="Native.MemoryInfo.used"
- defaultOn="true"
displayType="summary"
defaultOn="true"
units="bytes"
@@ -97,29 +91,23 @@
<metric displayName="Total Memory"
property="Native.MemoryInfo.total"
- defaultOn="true"
units="bytes"
- defaultInterval="1200000"
description="The total system memory"/>
<metric displayName="Free Swap Space"
property="Native.SwapInfo.free"
- defaultOn="true"
units="bytes"
description="The total free system swap"/>
<metric displayName="Used Swap Space"
property="Native.SwapInfo.used"
- defaultOn="true"
displayType="summary"
units="bytes"
description="The total used system swap"/>
<metric displayName="Total Swap Space"
property="Native.SwapInfo.total"
- defaultOn="true"
units="bytes"
- defaultInterval="1200000"
description="The total system swap"/>
'>
@@ -151,29 +139,21 @@
property="CpuTrait.vendor"
defaultOn="true"
dataType="trait"
- defaultOn="true"
- defaultInterval="3600000"
description="Vendor of this CPU"/>
<metric displayName="CPU Model"
property="CpuTrait.model"
defaultOn="true"
dataType="trait"
- defaultOn="true"
- defaultInterval="3600000"
description="Model of this CPU"/>
<metric displayName="CPU Speed"
property="CpuTrait.mhz"
defaultOn="true"
dataType="trait"
- defaultOn="true"
- defaultInterval="3600000"
description="Speed of this CPU in Mhz"/>
<metric displayName="Cache size"
property="CpuTrait.cacheSize"
defaultOn="true"
dataType="trait"
- defaultOn="true"
- defaultInterval="3600000"
description="Cache Size of this CPU"/>
'>
@@ -348,15 +328,13 @@
description="name of the Linux distribution"
defaultOn="true"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric displayName="Distribution Version"
property="distro.version"
description="version of the Linux distribution"
defaultOn="true"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
&syslogEventDefinition;
@@ -538,29 +516,29 @@
description="The total free bytes on filesystem"/>
<metric property="fileSystemUsage.usePercent" displayName="Used Percentage" units="percentage" displayType="summary"
description="The percentage of disk used"/>
- <metric property="fileSystemUsage.total" displayName="Capacity" units="kilobytes" dataType="trait" defaultOn="true"
+ <metric property="fileSystemUsage.total" displayName="Capacity" units="kilobytes" dataType="trait"
description="The total size of the filesystem"/>
<metric property="fileSystem.typeName" displayName="Volume Type" dataType="trait" displayType="summary"
description="The filesystem's generic type name"/>
<metric property="fileSystem.sysTypeName" displayName="Drive Type" dataType="trait" displayType="summary"
description="The filesystem's operating system-specific type name"/>
- <metric property="fileSystem.devName" displayName="name" dataType="trait" defaultOn="true"
+ <metric property="fileSystem.devName" displayName="name" dataType="trait"
description="The name of this device"/>
<metric property="fileSystemUsage.freeFiles" displayName="Free Files"
description="The number of free file nodes on the filesystem"/>
- <metric property="fileSystem.flags" displayName="Flags" dataType="trait" defaultOn="true"
+ <metric property="fileSystem.flags" displayName="Flags" dataType="trait"
description="The filesystem's flags"/>
- <metric property="fileSystemUsage.used" displayName="Used" units="kilobytes" defaultOn="true"
+ <metric property="fileSystemUsage.used" displayName="Used" units="kilobytes"
description="The total bytes used on the filesystem"/>
<metric property="fileSystemUsage.diskReads" displayName="Disk Reads" measurementType="trendsup" displayType="summary"
description="The number of physical disk reads"/>
<metric property="fileSystemUsage.diskWrites" displayName="Disk Writes" measurementType="trendsup" displayType="summary"
description="The number of physical disk writes"/>
- <metric property="fileSystemUsage.diskReadBytes" displayName="Disk Read Bytes" measurementType="trendsup" units="bytes" defaultOn="true"
+ <metric property="fileSystemUsage.diskReadBytes" displayName="Disk Read Bytes" measurementType="trendsup" units="bytes"
description="The number of physical disk bytes read"/>
- <metric property="fileSystemUsage.diskWriteBytes" displayName="Disk Write Bytes" measurementType="trendsup" units="bytes" defaultOn="true"
+ <metric property="fileSystemUsage.diskWriteBytes" displayName="Disk Write Bytes" measurementType="trendsup" units="bytes"
description="The number of physical disk bytes written"/>
- <metric property="fileSystemUsage.diskQueue" displayName="Disk Queue" defaultOn="true"
+ <metric property="fileSystemUsage.diskQueue" displayName="Disk Queue"
description="The number of I/Os currently in progress"/>
</service>
diff --git a/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
index 88df960..6d55124 100644
--- a/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
@@ -391,10 +391,10 @@
<metric displayName="Total Size" property="total_size" measurementType="dynamic" displayType="summary" units="bytes"
description="The size in bytes of the data and all associated indexes and toast tables"/>
<metric displayName="Rows" property="rows" measurementType="dynamic"
- defaultOn="false" defaultInterval="600000"
+ defaultOn="false"
description="The count of rows in the table. Warning: This may be an expensive operation"/>
<metric displayName="Approximate rows" property="rows_approx" measurementType="dynamic"
- defaultOn="false" defaultInterval="300000"
+ defaultOn="false"
description="The approximate count of rows in the table. This is basically the number of rows of the last ANALYZE of the table. This metric is not expensive."/>
<!-- TODO GH: add metrics for data and index space used -->
diff --git a/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
index 3517bf6..69cbf8a 100644
--- a/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
@@ -197,13 +197,11 @@
dataType="trait"
displayType="detail"
defaultInterval="86400000"
- defaultOn="true"
description="The directory where the agent is installed" />
<metric property="NumberAgentRestarts"
displayName="Number of Agent Restarts"
description="Number of times the agent was restarted during the lifetime of its Java Virtual Machine"
- defaultOn="true"
displayType="detail"
units="none"
category="availability"
@@ -212,8 +210,6 @@
<metric property="AgentServerClockDifference"
displayName="Agent-Server Clock Difference"
description="Number of milliseconds the agent's clock differs from its server's clock"
- defaultInterval="1800000"
- defaultOn="true"
displayType="summary"
units="milliseconds"
category="performance"
@@ -230,7 +226,6 @@
<metric property="NumberTotalCommandsReceived"
displayName="Total Number Of Commands Received"
description="Total number of messages this agent has received from the RHQ Server"
- defaultOn="true"
displayType="summary"
category="throughput"
measurementType="trendsup" />
@@ -238,21 +233,18 @@
<metric property="NumberSuccessfulCommandsReceived"
displayName="Number of Commands Received Successfully"
description="Number of messages this agent has received from the RHQ Server and succesfully processed"
- defaultOn="true"
category="throughput"
measurementType="trendsup" />
<metric property="NumberFailedCommandsReceived"
displayName="Number of Commands Received but Failed "
description="Number of messages this agent has received from the RHQ Server but failed to process"
- defaultOn="true"
category="throughput"
measurementType="trendsup" />
<metric property="AverageExecutionTimeReceived"
displayName="Avg Execution Time Commands Received Successfully"
description="Average time it took to process incoming commands that are ultimately successful"
- defaultOn="true"
displayType="summary"
category="performance"
measurementType="dynamic"
@@ -261,7 +253,6 @@
<metric property="AverageExecutionTimeSent"
displayName="Avg Execution Time Commands Sent Successfully"
description="Average time it took to send commands that are ultimately successful"
- defaultOn="true"
displayType="summary"
category="performance"
measurementType="dynamic"
@@ -270,7 +261,6 @@
<metric property="NumberTotalCommandsSent"
displayName="Total Number of Commands Sent"
description="Total number of messages this agent has sent to the RHQ Server"
- defaultOn="true"
displayType="summary"
category="throughput"
measurementType="trendsup" />
@@ -278,21 +268,18 @@
<metric property="NumberSuccessfulCommandsSent"
displayName="Number of Commands Successfully Sent"
description="Number of messages this agent has sent to the RHQ Server successfully"
- defaultOn="true"
category="throughput"
measurementType="trendsup" />
<metric property="NumberFailedCommandsSent"
displayName="Number of Commands Sent but Failed"
description="Number of messages this agent has either tried, but failed, to send or were not processed succesfully by the RHQ Server"
- defaultOn="true"
category="throughput"
measurementType="trendsup" />
<metric property="NumberCommandsActiveSent"
displayName="Number Of Active Commands Being Sent"
description="The number of messages this agent is currently sending"
- defaultOn="true"
displayType="summary"
category="throughput"
measurementType="dynamic" />
@@ -300,7 +287,6 @@
<metric property="NumberCommandsInQueue"
displayName="Number of Commands In Queue"
description="Number of messages currently queued waiting to be sent to the RHQ Server"
- defaultOn="true"
displayType="summary"
category="throughput"
measurementType="dynamic" />
@@ -308,14 +294,12 @@
<metric property="NumberCommandsSpooled"
displayName="Number of Commands Spooled To Disk"
description="Number of messages spooled to disk waiting to be sent to the RHQ Server"
- defaultOn="true"
category="throughput"
measurementType="dynamic" />
<metric property="JVMFreeMemory"
displayName="JVM Free Memory"
description="The amount of free memory the agent JVM has in its heap"
- defaultOn="true"
units="bytes"
category="performance"
measurementType="dynamic" />
@@ -323,7 +307,6 @@
<metric property="JVMTotalMemory"
displayName="JVM Total Memory"
description="The amount of total memory the agent JVM has in its heap"
- defaultOn="true"
units="bytes"
category="performance"
measurementType="dynamic" />
@@ -331,7 +314,6 @@
<metric property="JVMActiveThreads"
displayName="JVM Active Threads"
description="The number of active threads currently running in the agent JVM"
- defaultOn="true"
category="performance"
measurementType="dynamic" />
@@ -750,16 +732,13 @@
<metric property="NumberOfPluginClassLoaders"
defaultOn="false"
displayType="detail"
- defaultInterval="3600000"
description="The total number of plugin classloaders currently created and actively managed."/>
<metric property="NumberOfDiscoveryClassLoaders"
defaultOn="false"
displayType="detail"
- defaultInterval="3600000"
description="The total number of discovery classloaders currently created and actively managed."/>
<metric property="NumberOfResourceClassLoaders"
displayType="summary"
- defaultInterval="600000"
description="The total number of individual resource classloaders currently created and assigned to resources."/>
</service>
diff --git a/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
index 9f0f6a3..18cae0e 100644
--- a/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
@@ -128,19 +128,19 @@
<metric property="FullAvailabilityReports" displayType="summary" measurementType="trendsup"
description="The number of full availability reports received and processed by this RHQ Server since it was started"/>
- <metric property="PurgedAlerts" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedAlerts" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of alerts purged by the last purge job"/>
- <metric property="PurgedAlertConditions" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedAlertConditions" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of alert conditions purged by the last purge job"/>
- <metric property="PurgedAlertNotifications" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedAlertNotifications" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of alert notifications purged by the last purge job"/>
- <metric property="PurgedAvailabilities" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedAvailabilities" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of availabilities purged by the last purge job"/>
- <metric property="PurgedCallTimeData" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedCallTimeData" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of call time data purged by the last purge job"/>
- <metric property="PurgedEvents" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedEvents" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of events purged by the last purge job"/>
- <metric property="PurgedMeasurementTraits" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedMeasurementTraits" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of traits purged by the last purge job"/>
</service>
diff --git a/modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml
index 016985e..851e830 100644
--- a/modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml
@@ -80,9 +80,7 @@
dataType="measurement"
displayName="The Measurement Name"
description="Describes what this measurement is actually telling you"
- defaultOn="true"
units="none"
- defaultInterval="300000"
displayType="summary"
category="performance" />
-->
diff --git a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
index 09ad1af..15caad5 100644
--- a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
@@ -442,7 +442,6 @@
property="VHost.name"
displayName="Virtual Hosts"
dataType="trait"
- defaultOn="true"
description="Virtual hosts this app runs on" />
<metric
@@ -705,14 +704,12 @@
displayName="Maximum Request Time"
description="Maximum time it took to process a request."
units="milliseconds"
- defaultOn="true"
category="performance" />
<metric
property="Catalina:type=GlobalRequestProcessor,name=%handler%%address%-%port%:requestCount"
displayName="Request count"
description="Total number of requests processed since last restart."
- defaultOn="true"
category="utilization"
measurementType="trendsup" />
@@ -720,7 +717,6 @@
property="Catalina:type=GlobalRequestProcessor,name=%handler%%address%-%port%:errorCount"
displayName="Error count"
description="Number of errors while processing since last restart."
- defaultOn="true"
category="utilization"
measurementType="trendsup" />
@@ -728,7 +724,6 @@
property="Catalina:type=ThreadPool,name=%handler%%address%-%port%:currentThreadsBusy"
displayName="Threadpool Threads Active"
description="Number of current busy threads."
- defaultOn="true"
category="utilization"
displayType="summary" />
@@ -736,7 +731,6 @@
property="Catalina:type=ThreadPool,name=%handler%%address%-%port%:currentThreadCount"
displayName="Threadpool Threads Allocated"
description="Number of current threads."
- defaultOn="true"
category="utilization"
displayType="summary" />
@@ -744,7 +738,6 @@
property="Catalina:type=ThreadPool,name=%handler%%address%-%port%:maxThreads"
displayName="Threadpool Max Threads"
description="Maximum number of threads that can be allocated for the ThreadPool."
- defaultOn="true"
category="utilization"
displayType="detail" />
diff --git a/modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml
index a066afc..4944199 100644
--- a/modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml
@@ -45,11 +45,11 @@
</operation>
<metric property="tweetCount" displayName="Tweet count" category="utilization" dataType="measurement"
- defaultOn="true" displayType="summary" measurementType="dynamic"
+ displayType="summary" measurementType="dynamic"
description="Number of new tweets since last poll"/>
<metric property="followerCount" displayName="Follower count" dataType="measurement"
- defaultOn="true" displayType="summary" measurementType="dynamic" defaultInterval="14400000"
+ displayType="summary" measurementType="dynamic" defaultInterval="14400000"
description="Number of followers" />
@@ -77,7 +77,7 @@
</plugin-configuration>
<metric property="tweetCount" displayName="Tweet count" category="utilization" dataType="measurement"
- defaultOn="true" displayType="summary" measurementType="dynamic"
+ displayType="summary" measurementType="dynamic"
description="Number of new tweets since last poll"/>
<event name="FeedEvent"/>
commit e5c7414502b4440378858da2c7e188d8b5a71e52
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Sep 27 16:06:28 2011 -0400
[BZ 741331] just some very limited number of metrics to be enabled out of box - mainly in platform plugin
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 e337217..e8cd691 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
@@ -1147,6 +1147,7 @@
defaultInterval="300000" defaultOn="true" category="throughput"/>
<metric displayName="JVM Free Memory" property="MCBean|ServerInfo|*|freeMemory" displayType="summary"
+ defaultOn="true"
description="An approximation of the total amount of memory currently available in the app server JVM for future allocated objects, measured in bytes"
defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
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 d02a8c0..6588d0d 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
@@ -210,6 +210,7 @@
defaultInterval="300000" defaultOn="true" category="throughput"/>
<metric property="jboss.system:type=ServerInfo:FreeMemory" displayName="JVM Free Memory" displayType="summary"
+ defaultOn="true"
description="An approximation of the total amount of memory currently available in the app server JVM for future allocated objects, measured in bytes"
defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
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 fa07736..64575d9 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
@@ -52,24 +52,28 @@
<metric displayName="Hostname"
property="Trait.hostname"
description="Name that this platform is known as"
+ defaultOn="true"
dataType="trait"
displayType="summary"
defaultOn="true" />
<metric displayName="OS Name"
property="Trait.osname"
description="Name that the operating system is known as"
+ defaultOn="true"
dataType="trait"
displayType="summary"
defaultOn="true" />
<metric displayName="OS Version"
property="Trait.osversion"
description="Version of the operating system"
+ defaultOn="true"
dataType="trait"
displayType="summary"
defaultOn="true" />
<metric displayName="Architecture"
property="Trait.sysarch"
description="Hardware architecture of the platform"
+ defaultOn="true"
dataType="trait"
displayType="summary"
defaultOn="true"/>
@@ -79,6 +83,7 @@
property="Native.MemoryInfo.free"
defaultOn="true"
displayType="summary"
+ defaultOn="true"
units="bytes"
description="The total free system memory"/>
@@ -86,6 +91,7 @@
property="Native.MemoryInfo.used"
defaultOn="true"
displayType="summary"
+ defaultOn="true"
units="bytes"
description="The total used system memory"/>
@@ -124,11 +130,13 @@
description="Idle percentage of all CPUs"/>
<metric displayName="System Load"
property="CpuPerc.sys"
+ defaultOn="true"
displayType="summary"
units="percentage"
description="Percentage of all CPUs running in system mode"/>
<metric displayName="User Load"
property="CpuPerc.user"
+ defaultOn="true"
displayType="summary"
units="percentage"
description="Percentage of all CPUs running in user mode"/>
@@ -141,24 +149,28 @@
<!ENTITY cpuDetail '
<metric displayName="Vendor"
property="CpuTrait.vendor"
+ defaultOn="true"
dataType="trait"
defaultOn="true"
defaultInterval="3600000"
description="Vendor of this CPU"/>
<metric displayName="CPU Model"
property="CpuTrait.model"
+ defaultOn="true"
dataType="trait"
defaultOn="true"
defaultInterval="3600000"
description="Model of this CPU"/>
<metric displayName="CPU Speed"
property="CpuTrait.mhz"
+ defaultOn="true"
dataType="trait"
defaultOn="true"
defaultInterval="3600000"
description="Speed of this CPU in Mhz"/>
<metric displayName="Cache size"
property="CpuTrait.cacheSize"
+ defaultOn="true"
dataType="trait"
defaultOn="true"
defaultInterval="3600000"
@@ -334,12 +346,14 @@
<metric displayName="Distribution Name"
property="distro.name"
description="name of the Linux distribution"
+ defaultOn="true"
dataType="trait"
displayType="summary"
defaultOn="true" />
<metric displayName="Distribution Version"
property="distro.version"
description="version of the Linux distribution"
+ defaultOn="true"
dataType="trait"
displayType="summary"
defaultOn="true" />
@@ -469,11 +483,12 @@
</runs-inside>
<metric displayName="Inet4Address"
+ defaultOn="true"
property="Trait.net4.address" dataType="trait" displayType="summary"
- description="IP address of the network adaptor"/>
+ description="IP address of the network adapter"/>
- <metric property="Trait.interfaceFlags" displayName="Interface Flags" dataType="trait" displayType="summary"
- description="Flag constants for network related ops"/>
+ <metric property="Trait.interfaceFlags" displayName="Interface Flags" dataType="trait"
+ description="Flag constants for network related operations"/>
<metric property="rxBytes" displayName="Bytes Received" units="bytes" measurementType="trendsup" displayType="summary"
description="The total number of bytes received across this network interface since it started"/>
commit 9da7796c9d21db1f53c542913480fe73033761e6
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 3ef6c2e..225adcf 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] 3 commits - modules/core modules/plugins
by mazz
modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java | 33 +-
modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml | 44 ---
modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml | 15 -
modules/plugins/hardware/src/main/resources/META-INF/rhq-plugin.xml | 28 +-
modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml | 14 -
modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml | 37 --
modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 138 +++++-----
modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml | 105 ++-----
modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml | 6
modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml | 26 -
modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml | 38 +-
modules/plugins/platform/src/main/resources/META-INF/rhq-plugin.xml | 67 ++--
modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml | 4
modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml | 21 -
modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml | 14 -
modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml | 2
modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml | 7
modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml | 6
20 files changed, 243 insertions(+), 366 deletions(-)
New commits:
commit d169c246b5e5480381884aa9bdbc69b2e19963e7
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>
commit 58cf87f24160d25cd60d8fb9848988004d50b499
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Sep 27 16:06:28 2011 -0400
[BZ 741331] just some very limited number of metrics to be enabled out of box - mainly in platform plugin
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 f50502e..2ae0e71 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
@@ -1146,6 +1146,7 @@
category="throughput"/>
<metric displayName="JVM Free Memory" property="MCBean|ServerInfo|*|freeMemory" displayType="summary"
+ defaultOn="true"
description="An approximation of the total amount of memory currently available in the app server JVM for future allocated objects, measured in bytes"
category="utilization" units="bytes"/>
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 f3b6dd8..2536cb5 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
@@ -210,6 +210,7 @@
category="throughput"/>
<metric property="jboss.system:type=ServerInfo:FreeMemory" displayName="JVM Free Memory" displayType="summary"
+ defaultOn="true"
description="An approximation of the total amount of memory currently available in the app server JVM for future allocated objects, measured in bytes"
category="utilization" units="bytes"/>
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 8cebdf0..10ddc0b 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
@@ -52,21 +52,25 @@
<metric displayName="Hostname"
property="Trait.hostname"
description="Name that this platform is known as"
+ defaultOn="true"
dataType="trait"
displayType="summary" />
<metric displayName="OS Name"
property="Trait.osname"
description="Name that the operating system is known as"
+ defaultOn="true"
dataType="trait"
displayType="summary" />
<metric displayName="OS Version"
property="Trait.osversion"
description="Version of the operating system"
+ defaultOn="true"
dataType="trait"
displayType="summary" />
<metric displayName="Architecture"
property="Trait.sysarch"
description="Hardware architecture of the platform"
+ defaultOn="true"
dataType="trait"
displayType="summary" />
'>
@@ -74,12 +78,14 @@
<metric displayName="Free Memory"
property="Native.MemoryInfo.free"
displayType="summary"
+ defaultOn="true"
units="bytes"
description="The total free system memory"/>
<metric displayName="Used Memory"
property="Native.MemoryInfo.used"
displayType="summary"
+ defaultOn="true"
units="bytes"
description="The total used system memory"/>
@@ -90,11 +96,13 @@
<metric displayName="Free Swap Space"
property="Native.SwapInfo.free"
+ defaultOn="true"
units="bytes"
description="The total free system swap"/>
<metric displayName="Used Swap Space"
property="Native.SwapInfo.used"
+ defaultOn="true"
displayType="summary"
units="bytes"
description="The total used system swap"/>
@@ -112,11 +120,13 @@
description="Idle percentage of all CPUs"/>
<metric displayName="System Load"
property="CpuPerc.sys"
+ defaultOn="true"
displayType="summary"
units="percentage"
description="Percentage of all CPUs running in system mode"/>
<metric displayName="User Load"
property="CpuPerc.user"
+ defaultOn="true"
displayType="summary"
units="percentage"
description="Percentage of all CPUs running in user mode"/>
@@ -129,18 +139,22 @@
<!ENTITY cpuDetail '
<metric displayName="Vendor"
property="CpuTrait.vendor"
+ defaultOn="true"
dataType="trait"
description="Vendor of this CPU"/>
<metric displayName="CPU Model"
property="CpuTrait.model"
+ defaultOn="true"
dataType="trait"
description="Model of this CPU"/>
<metric displayName="CPU Speed"
property="CpuTrait.mhz"
+ defaultOn="true"
dataType="trait"
description="Speed of this CPU in Mhz"/>
<metric displayName="Cache size"
property="CpuTrait.cacheSize"
+ defaultOn="true"
dataType="trait"
description="Cache Size of this CPU"/>
'>
@@ -314,11 +328,13 @@
<metric displayName="Distribution Name"
property="distro.name"
description="name of the Linux distribution"
+ defaultOn="true"
dataType="trait"
displayType="summary" />
<metric displayName="Distribution Version"
property="distro.version"
description="version of the Linux distribution"
+ defaultOn="true"
dataType="trait"
displayType="summary" />
@@ -447,11 +463,12 @@
</runs-inside>
<metric displayName="Inet4Address"
+ defaultOn="true"
property="Trait.net4.address" dataType="trait" displayType="summary"
- description="IP address of the network adaptor"/>
+ description="IP address of the network adapter"/>
- <metric property="Trait.interfaceFlags" displayName="Interface Flags" dataType="trait" displayType="summary"
- description="Flag constants for network related ops"/>
+ <metric property="Trait.interfaceFlags" displayName="Interface Flags" dataType="trait"
+ description="Flag constants for network related operations"/>
<metric property="rxBytes" displayName="Bytes Received" units="bytes" measurementType="trendsup" displayType="summary"
description="The total number of bytes received across this network interface since it started"/>
commit 969aed591eb630af61258441633c3fafd5804860
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Sep 27 13:12:49 2011 -0400
[BZ 741331] turn off all plugin metrics by default, up all default collection intervals
diff --git a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java
index f5b4b5d..77ecd37 100644
--- a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java
+++ b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/MetricsMetadataParser.java
@@ -44,10 +44,11 @@ import org.rhq.core.domain.util.StringUtils;
* @author Greg Hinkle
*/
public class MetricsMetadataParser {
- public static final long MIN_1 = 1L * 60 * 1000L;
- public static final long MIN_5 = 5L * MIN_1;
- public static final long MIN_10 = 10L * MIN_1;
- public static final long MIN_30 = 30L * MIN_1;
+ private static final long MIN_1 = 1L * 60 * 1000L;
+ private static final long MIN_10 = 10L * MIN_1;
+ private static final long MIN_20 = 20L * MIN_1;
+ private static final long MIN_30 = 30L * MIN_1;
+ private static final long MIN_60 = 60L * MIN_1;
public static final long MINIMUM_INTERVAL = MeasurementSchedule.MINIMUM_INTERVAL;
@@ -58,39 +59,41 @@ public class MetricsMetadataParser {
DataType dataType = DataType.valueOf(metricDescriptor.getDataType().toUpperCase());
DisplayType displayType = DisplayType.valueOf(metricDescriptor.getDisplayType().toUpperCase());
- long collectionInterval = MIN_10;
+ long collectionInterval = MIN_30;
MeasurementUnits units = getMeasurementUnits(metricDescriptor.getUnits(), dataType);
switch (dataType) {
case MEASUREMENT: {
switch (resourceType.getCategory()) {
case PLATFORM: {
- collectionInterval = MIN_1;
+ collectionInterval = MIN_10;
break;
}
case SERVER: {
- collectionInterval = MIN_5;
+ collectionInterval = MIN_20;
break;
}
case SERVICE: {
- collectionInterval = MIN_10;
+ collectionInterval = MIN_30;
break;
}
}
- collectionInterval = (displayType == DisplayType.SUMMARY) ? collectionInterval : (collectionInterval * 2);
+ if (displayType != DisplayType.SUMMARY) {
+ collectionInterval *= 2;
+ }
break;
}
case TRAIT: {
- collectionInterval = (displayType == DisplayType.SUMMARY) ? MIN_10 : MIN_30;
+ collectionInterval = (displayType == DisplayType.SUMMARY) ? MIN_30 : MIN_60;
break;
}
case CALLTIME: {
- collectionInterval = MIN_1;
+ collectionInterval = MIN_10;
if (units != MeasurementUnits.MILLISECONDS) {
throw new IllegalStateException("Units must always be set to 'milliseconds' for call-time metrics.");
}
@@ -126,9 +129,11 @@ public class MetricsMetadataParser {
definition.setDestinationType(metricDescriptor.getDestinationType());
// Make sure that all summary properties are on by default.
- if (definition.getDisplayType() == DisplayType.SUMMARY) {
- definition.setDefaultOn(true);
- }
+ // BZ 741331 - we no longer want to imply any metric should be on by default
+ // let the plugin writer tell us explicitly if it should be on by default
+ // if (definition.getDisplayType() == DisplayType.SUMMARY) {
+ // definition.setDefaultOn(true);
+ // }
if ((definition.getNumericType() == NumericType.TRENDSUP)
|| (definition.getNumericType() == NumericType.TRENDSDOWN)) {
diff --git a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
index ad08a22..e88ffbc 100644
--- a/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/apache/src/main/resources/META-INF/rhq-plugin.xml
@@ -463,19 +463,19 @@
<metric displayName="Number of Concurrent Connections" property="applInboundAssociations"
destinationType="The number of current connections to this application"
- defaultOn="true" defaultInterval="300000" displayType="summary" units="none"/>
+ displayType="summary" units="none"/>
<!-- traits determined via "httpd -V" -->
<metric displayName="Server Built" property="serverBuilt"
description="the date and time this Apache server's binary was compiled"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<!-- traits determined via SNMP (format for property attribute is "MIB_column_name") -->
<metric displayName="Start Time" property="wwwServiceStartTime"
description="the date and time this Apache server was last started"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<!-- Metric collected by pinging availability over http -->
<metric property="rhq_avail_ping_time" displayType="summary" units="milliseconds"
@@ -533,27 +533,27 @@
<metric displayName="Host" property="wwwServiceName"
description="the host name or IP address of this virtual host"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<metric displayName="Port" property="wwwServiceProtocol"
description="the TCP port of this virtual host"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<metric displayName="Administrator" property="wwwServiceContact"
description="the administrator of this virtual host"
- dataType="trait" defaultOn="true" displayType="summary"/>
+ dataType="trait" displayType="summary"/>
<!-- summary metrics for requests - determined via SNMP
(format for property attribute is "MIB_column_name") -->
<metric displayName="Total Number of Requests" property="wwwSummaryInRequests"
description="The number of inbound requests on the service"
- defaultOn="true" defaultInterval="300000" displayType="summary"
+ displayType="summary"
units="none" measurementType="trendsup"/>
<metric displayName="Total Number of Bytes Received" property="wwwSummaryInLowBytes"
description="The number of bytes received by the service"
- defaultOn="true" defaultInterval="300000" displayType="summary"
+ displayType="summary"
units="bytes" measurementType="trendsup"/>
<!-- summary metrics for responses - determined via SNMP
@@ -561,12 +561,12 @@
<metric displayName="Total Number of Responses" property="wwwSummaryOutResponses"
description="The number of outbound requests on the service"
- defaultOn="true" defaultInterval="300000" displayType="summary"
+ displayType="summary"
units="none" measurementType="trendsup"/>
<metric displayName="Total Number of Bytes Sent" property="wwwSummaryOutLowBytes"
description="The number of bytes sent by the service"
- defaultOn="true" defaultInterval="300000" displayType="summary"
+ displayType="summary"
units="bytes" measurementType="trendsup"/>
<!-- per-request-method metrics - determined via SNMP
@@ -574,42 +574,34 @@
<metric displayName="Number of GET Requests" property="wwwRequestInRequests.GET"
description="The number of inbound GET requests on the service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of HEAD Requests" property="wwwRequestInRequests.HEAD"
description="The number of inbound HEAD requests on the service"
- defaultOn="false" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of POST Requests" property="wwwRequestInRequests.POST"
description="The number of inbound POST requests on the service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of PUT Requests" property="wwwRequestInRequests.PUT"
description="The number of inbound PUT requests on the service"
- defaultOn="false" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Received for GET Requests" property="wwwRequestInBytes.GET"
description="The number of bytes received by GET requests on the service"
- defaultOn="true" defaultInterval="300000"
units="bytes" measurementType="trendsup"/>
<metric displayName="Bytes Received for HEAD Requests" property="wwwRequestInBytes.HEAD"
description="The number of bytes received by HEAD requests on the service"
- defaultOn="false" defaultInterval="300000"
units="bytes" measurementType="trendsup"/>
<metric displayName="Bytes Received for POST Requests" property="wwwRequestInBytes.POST"
description="The number of bytes received by POST requests on the service"
- defaultOn="true" defaultInterval="300000"
units="bytes" measurementType="trendsup"/>
<metric displayName="Bytes Received for PUT Requests" property="wwwRequestInBytes.PUT"
description="The number of bytes received by PUT requests on the service"
- defaultOn="false" defaultInterval="300000"
units="bytes" measurementType="trendsup"/>
<!-- per-response-status-code metrics - determined via SNMP
@@ -617,78 +609,64 @@
<metric displayName="Number of 200 Responses" property="wwwResponseOutResponses.200"
description="The number of 200 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 301 Responses" property="wwwResponseOutResponses.301"
description="The number of 301 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 302 Responses" property="wwwResponseOutResponses.302"
description="The number of 302 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 401 Responses" property="wwwResponseOutResponses.401"
description="The number of 401 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 403 Responses" property="wwwResponseOutResponses.403"
description="The number of 403 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 404 Responses" property="wwwResponseOutResponses.404"
description="The number of 404 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Number of 500 Responses" property="wwwResponseOutResponses.500"
description="The number of 500 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 200 Responses" property="wwwResponseOutBytes.200"
description="The number of bytes sent for 200 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 301 Responses" property="wwwResponseOutBytes.301"
description="The number of bytes sent for 301 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 302 Responses" property="wwwResponseOutBytes.302"
description="The number of bytes sent for 302 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 401 Responses" property="wwwResponseOutBytes.401"
description="The number of bytes sent for 401 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 403 Responses" property="wwwResponseOutBytes.403"
description="The number of bytes sent for 403 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 404 Responses" property="wwwResponseOutBytes.404"
description="The number of bytes sent for 404 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<metric displayName="Bytes Sent for 500 Responses" property="wwwResponseOutBytes.500"
description="The number of bytes sent for 500 responses generated by this service"
- defaultOn="true" defaultInterval="300000"
units="none" measurementType="trendsup"/>
<!-- response-time metric - determined by parsing the RT logfile that's specified in the plugin config -->
<metric property="ResponseTime" displayName="HTTP Response Time"
- dataType="calltime" defaultOn="false" units="milliseconds" destinationType="URL"
+ dataType="calltime" units="milliseconds" destinationType="URL"
description="The minimum, maximum, and average response times for HTTP requests serviced by this virtual host"/>
<resource-configuration>
diff --git a/modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml
index e1d6c6c..8f50485 100644
--- a/modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/byteman/src/main/resources/META-INF/rhq-plugin.xml
@@ -85,32 +85,27 @@
displayName="Client Version"
description="The version of the client used by this plugin to talk to the Byteman agent."
category="utilization"
- dataType="trait"
- defaultOn="true" />
+ dataType="trait" />
<metric property="totalNumberOfScripts"
description="The total number of scripts currently deployed in the Byteman agent. Scripts contain one or more rules."
category="utilization"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric property="totalNumberOfRules"
description="The total number of individual rules currently deployed in the Byteman agent"
category="utilization"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric property="totalNumberOfBootJars"
description="The total number of jar files that have been added to the Byteman agent's boot classpath"
category="utilization"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric property="totalNumberOfSystemJars"
description="The total number of jar files that have been added to the Byteman agent's system classpath"
category="utilization"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<!--
bootJar/systemJar content allow users to push jar content to the RHQ agent machine and manage that content.
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 3ef6c2e..e195a69 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
@@ -17,14 +17,14 @@
<metric property="gpusAverageTemperature" units="celsius" displayName="Average GPU Temperature" displayType="summary"/>
<metric property="fanAverageSpeed" displayName="Average Fan Speed" displayType="summary"/>
- <metric property="smolt.System Memory" dataType="trait" displayType="summary" displayName="System Memory" defaultInterval="86400"/>
- <metric property="smolt.System Swap" dataType="trait" displayType="summary" displayName="System Swap" defaultInterval="86400"/>
- <metric property="smolt.Vendor" dataType="trait" displayType="summary" displayName="Vendor" defaultInterval="86400"/>
- <metric property="smolt.System" dataType="trait" displayType="summary" displayName="System Model" defaultInterval="86400"/>
- <metric property="smolt.Form factor" dataType="trait" displayType="summary" displayName="Form Factor" defaultInterval="86400"/>
- <metric property="smolt.CPU Vendor" dataType="trait" displayType="summary" displayName="CPU Vendor" defaultInterval="86400"/>
- <metric property="smolt.CPU Model" dataType="trait" displayType="summary" displayName="CPU Model" defaultInterval="86400"/>
- <metric property="smolt.BogoMIPS" dataType="trait" displayType="summary" displayName="BogoMIPS" defaultInterval="86400"/>
+ <metric property="smolt.System Memory" dataType="trait" displayType="summary" displayName="System Memory"/>
+ <metric property="smolt.System Swap" dataType="trait" displayType="summary" displayName="System Swap"/>
+ <metric property="smolt.Vendor" dataType="trait" displayType="summary" displayName="Vendor"/>
+ <metric property="smolt.System" dataType="trait" displayType="summary" displayName="System Model"/>
+ <metric property="smolt.Form factor" dataType="trait" displayType="summary" displayName="Form Factor"/>
+ <metric property="smolt.CPU Vendor" dataType="trait" displayType="summary" displayName="CPU Vendor"/>
+ <metric property="smolt.CPU Model" dataType="trait" displayType="summary" displayName="CPU Model"/>
+ <metric property="smolt.BogoMIPS" dataType="trait" displayType="summary" displayName="BogoMIPS"/>
</server>
diff --git a/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml
index ad8a9cf..dfadc25 100644
--- a/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/hibernate/src/main/resources/META-INF/rhq-plugin.xml
@@ -91,7 +91,7 @@
<metric displayName="Successful Transaction Count" property="SuccessfulTransactionCount"
description="The global number of transactions known to have been successful since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Query Cache Hit Count" property="QueryCacheHitCount"
description="The global number of cached queries successfully retrieved from cache since the statistics were reset"
@@ -103,11 +103,11 @@
<metric displayName="Connect Count" property="ConnectCount"
description="The global number of connections asked by the sessions (the actual number of connections used may be much smaller depending whether you use a connection pool or not) since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Start Time" property="StartTime" dataType="trait"
description="The time when the statistics collection started or were last reset"
- category="availability" defaultOn="true" units="epoch_milliseconds" measurementType="dynamic"/>
+ category="availability" units="epoch_milliseconds" measurementType="dynamic"/>
<metric displayName="Second Level Cache Put Count" property="SecondLevelCachePutCount"
description="The global number of cacheable entities/collections put in the cache since the statistics were reset"
@@ -119,11 +119,11 @@
<metric displayName="Session Open Count" property="SessionOpenCount"
description="The global number of sessions closed since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Transaction Count" property="TransactionCount"
description="The global number of transactions known to have completed since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Collection Fetch Count" property="CollectionFetchCount"
description="The global number of collections fetched since the statistics were reset"
@@ -131,11 +131,11 @@
<metric displayName="Session Close Count" property="SessionCloseCount"
description="The global number of sessions closed since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Query Cache Miss Count" property="QueryCacheMissCount"
description="The global number of cached queries *not* found in cache since the statistics were reset"
- category="throughput" defaultOn="true" measurementType="trendsup"/>
+ category="throughput" measurementType="trendsup"/>
<metric displayName="Second Level Cache Miss Count" property="SecondLevelCacheMissCount"
description="The global number of cacheable entities/collections not found in the cache and loaded from the database since the statistics were reset"
diff --git a/modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml
index 5065353..287f835 100644
--- a/modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/iis/src/main/resources/META-INF/rhq-plugin.xml
@@ -5,184 +5,149 @@
<metric displayName="Bytes Sent"
description="Shows the rate that data bytes are sent by the Web service."
property="Bytes Sent/sec"
- defaultOn="true"
displayType="summary"
measurementType="trendsup"
units="bytes"/>
<metric displayName="Bytes Received"
description="Shows the rate that data bytes are received by the Web service."
property="Bytes Received/sec"
- defaultOn="true"
displayType="summary"
measurementType="trendsup"
units="bytes"/>
<metric displayName="Total Files Sent"
description="Shows the total number of files sent by the Web service (counted since service startup)."
property="Total Files Sent"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total Files Received"
description="Shows the total number of files received by the Web service (counted since service startup)."
property="Total Files Received"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total Files Transferred"
description="Shows the sum of Files Sent and Files Received. This is the total number of files transferred by the Web service (counted since service startup)."
property="Total Files Transferred"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Current Anonymous Users"
description="Shows the number of users who currently have an anonymous connection using the Web service."
property="Current Anonymous Users"
- defaultOn="true"
units="none"/>
<metric displayName="Current NonAnonymous Users"
description="Shows the number of users who currently have a non-anonymous connection using the Web service."
property="Current NonAnonymous Users"
- defaultOn="true"
units="none"/>
<metric displayName="Total Anonymous Users"
description="Shows the total number of users who established an anonymous connection with the Web service (counted since service startup)."
property="Total Anonymous Users"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total NonAnonymous Users"
description="Shows the total number of users who established a non-anonymous connection with the Web service (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Maximum Anonymous Users"
description="Shows the maximum number of users who established concurrent anonymous connections using the Web service (counted since service startup)."
- defaultOn="true"
units="none"/>
<metric property="Maximum NonAnonymous Users"
description="Shows the maximum number of users who established concurrent non-anonymous connections using the Web service (counted since service startup)."
- defaultOn="true"
units="none"/>
<metric property="Current Connections"
description="Shows the current number of connections established with the Web service."
- defaultOn="true"
displayType="summary"
units="none"/>
<metric property="Maximum Connections"
description="Shows the maximum number of simultaneous connections established with the Web service."
- defaultOn="true"
units="none"/>
<metric property="Total Logon Attempts"
description="Shows the number of logons that have been attempted using the Web service (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total GET Requests"
description="Shows the number of HTTP requests using the GET method (counted since service startup). GET requests are generally used for basic file retrievals or image maps, though they can be used with forms."
property="Total Get Requests"
- defaultOn="true"
displayType="summary"
measurementType="trendsup"
units="none"/>
<metric displayName="Total POST Requests"
description="Shows the number of HTTP requests using the POST method (counted since service startup). POST requests are generally used for forms or gateway requests."
property="Total Post Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total HEAD Requests"
description="Shows the number of HTTP requests using the HEAD method (counted since service startup). Head requests generally indicate a client is querying the state of a document they already have to see if it needs to be refreshed."
property="Total Head Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total PUT Requests"
description="Shows the number of HTTP requests using the PUT method (counted since service startup)."
property="Total Put Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total DELETE Requests"
description="Shows the number of HTTP requests using the DELETE method (counted since service startup). Delete requests are generally used for file removals."
property="Total Delete Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric displayName="Total TRACE Requests"
description="Shows the number of HTTP requests using the TRACE method (counted since service startup). TRACE requests allow the client to see what is being received at the end of the request chain and use the information for diagnostic purposes."
property="Total Trace Requests"
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Other Request Methods"
description="Shows the number of HTTP requests that are not OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, MOVE, COPY, MKCOL, PROPFIND, PROPPATCH, MS-SEARCH, LOCK or UNLOCK methods (counted since service startup). These may include LINK or other methods supported by gateway applications."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Method Requests"
description="Shows the number of all HTTP requests (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total CGI Requests"
description="Shows the total number of CGI requests. CGI requests are custom gateway executables (.exe) the administrator can install to add forms processing or other dynamic data sources. CGI requests initiate a process on the server which can be a large drain on server resources. The count is the total since service startup."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total ISAPI Extension Requests"
description="Shows the total number of ISAPI Extension Requests. ISAPI Extension Requests are custom gateway Dynamic Link Libraries (.dll) the administrator can install to add forms processing or other dynamic data sources. Unlike CGI requests, ISAPI requests are simple calls to a DLL library routine, thus they are better suited to high performance gateway applications. The count is the total since service startup."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Not Found Errors"
description="Shows the number of requests that could not be satisfied by the server because the requested document could not be found. These are generally reported as an HTTP 404 error code to the client. The count is the total since service startup."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Locked Errors"
description="Shows the number of requests that could not be satisfied by the server because the requested was locked. These are generally reported as an HTTP 423 error code to the client. The count is the total since service startup."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Current CGI Requests"
description="Shows the current number of CGI requests that are simultaneously being processed by the Web service."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Current ISAPI Extension Requests"
description="Shows the current number of Extension requests that are simultaneously being processed by the Web service."
- defaultOn="true"
units="none"/>
<metric property="Maximum CGI Requests"
description="Shows the maximum number of CGI requests simultaneously processed by the Web service."
- defaultOn="true"
units="none"/>
<metric property="Maximum ISAPI Extension Requests"
description="Shows the maximum number of Extension requests simultaneously processed by the Web service."
- defaultOn="true"
units="none"/>
<metric property="Total Blocked Async I/O Requests"
description="Shows the number of total requests temporarily blocked due to bandwidth throttling settings (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Allowed Async I/O Requests"
description="Shows the total number of requests allowed by bandwidth throttling settings (counted since service startup). When bandwidth throttling is defined, the number of allowed user requests is restricted."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Total Rejected Async I/O Requests"
description="Shows the total number of requests rejected due to bandwidth throttling settings (counted since service startup)."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Current Blocked Async I/O Requests"
description="Shows current requests that are temporarily blocked due to bandwidth throttling settings."
- defaultOn="true"
units="none"/>
<metric property="Measured Async I/O Bandwidth Usage"
description="Shows the measured bandwidth of asynchronous I/O averaged over a minute."
- defaultOn="true"
units="none"/>
'>
]>
@@ -229,12 +194,10 @@
<!-- Server only -->
<metric property="Total Connection Attempts (all instances)"
description="Shows the number of connections that have been attempted using the Web service (counted since service startup). This counter is for all instances listed."
- defaultOn="true"
measurementType="trendsup"
units="none"/>
<metric property="Service Uptime"
description="The amount of time this service has been up for"
- defaultOn="true"
units="seconds"/>
<service name="VHost" description="IIS VHost"
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 e337217..f50502e 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
@@ -4,7 +4,7 @@
<!ENTITY managedObjectMetrics '
<metric property="runState" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"/>
+ dataType="trait" category="performance"/>
'>
<!ENTITY datasourceAndConnectionFactoryOperations '
@@ -49,42 +49,42 @@
<!ENTITY datasourceMetrics '
<!-- Traits -->
<metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="the JNDI name of the connection pool for this datasource"/>
<!-- Numerics -->
<metric property="availableConnectionCount" measurementType="dynamic" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the maximum number of connections that are available"/>
<metric property="connectionCount" measurementType="dynamic" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the number of connections that are currently in the pool"/>
<metric property="connectionCreatedCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the number of connections that have been created since the datasource was last started"/>
<metric property="connectionDestroyedCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the number of connections that have been destroyed since the datasource was last started"/>
<metric property="inUseConnectionCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the number of connections that are currently in use"/>
<metric property="local-transaction" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"/>
+ dataType="trait" category="performance"/>
<metric property="maxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"
+ dataType="measurement" category="performance"
description="the most connections that have been simultaneously in use since this datasource was started"/>
<metric property="maxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="minSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
'>
<!-- NOTE: For Datasource ManagedProperty annotations, see:
@@ -593,39 +593,39 @@
<!ENTITY connectionFactoryMetrics '
<!-- Traits -->
- <metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name" defaultOn="true"
- defaultInterval="600000" dataType="trait" category="performance"/>
+ <metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name"
+ dataType="trait" category="performance"/>
<!-- Numerics -->
<metric property="availableConnectionCount" measurementType="dynamic" displayType="summary"
displayName="Available Connection Count" description="Number of available connections."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="connectionCount" measurementType="dynamic" displayType="summary"
- displayName="Connection Count" defaultOn="true" defaultInterval="600000" dataType="measurement"
+ displayName="Connection Count" dataType="measurement"
category="performance"/>
<metric property="connectionCreatedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Created Count" defaultOn="true" defaultInterval="600000"
+ displayName="Connection Created Count"
dataType="measurement" category="performance"/>
<metric property="connectionDestroyedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Destroyed Count" defaultOn="true" defaultInterval="600000"
+ displayName="Connection Destroyed Count"
dataType="measurement" category="performance"/>
<metric property="inUseConnectionCount" measurementType="dynamic" displayType="detail"
displayName="In Use Connection Count" description="Mumber of connections currently in use."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="maxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
displayName="Max Connections In Use Count" description="Maximum number of maximum connections that have been in use."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="maxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="minSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
'>
<!-- These are the operations that both Topics and Queues have. -->
@@ -672,14 +672,14 @@
<!ENTITY webApplicationContextMetrics '
<metric property="clustered" dataType="trait" displayType="summary"
- description="True if this web application context is clustered" defaultOn="true" defaultInterval="3600000" />
+ description="True if this web application context is clustered" />
<metric property="virtualHost"
dataType="trait" displayType="summary"
description="the virtual host with which this context is associated"/>
<metric property="responseTime"
- dataType="calltime" defaultOn="false" defaultInterval="600000" units="milliseconds" destinationType="URL"
+ dataType="calltime" defaultOn="false" units="milliseconds" destinationType="URL"
description="the minimum, maximum, and average response times for requests serviced by this webapp"/>
<metric property="activeSessions"
@@ -782,30 +782,30 @@
<!-- default interval == 600000 ms == 10 min -->
<metric property="methodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
'>
<!ENTITY ejb3StatefulSessionBeanMetrics '
<metric property="cacheSize" measurementType="dynamic" displayType="detail" displayName="Cache Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="passivatedCount" measurementType="dynamic" displayType="detail" displayName="Passivated Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="totalSize" measurementType="dynamic" displayType="detail" displayName="Total Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
'>
<!ENTITY ejb3MessageDrivenBeanMetrics '
<metric property="minPoolSize" measurementType="dynamic" displayType="detail" displayName="Minimum Pool Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="maxPoolSize" measurementType="dynamic" displayType="detail" displayName="Maximum Pool Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="maxMessages" measurementType="dynamic" displayType="detail" displayName="Maximum number of Messages"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
'>
<!ENTITY ejb2PoolMetrics '
@@ -827,7 +827,7 @@
<!ENTITY ejb2SessionBeanMetrics '
<!-- default interval == 600000 ms == 10 min -->
<metric property="methodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
'>
@@ -902,8 +902,7 @@
<!ENTITY ejb2EntityBeanMetrics '
<metric property="CacheSize"
displayName="Cache Size"
- displayType="summary"
- defaultOn="true"/>
+ displayType="summary"/>
'>
<!ENTITY subscriptionsResultProperty '
@@ -1140,34 +1139,34 @@
<metric displayName="Active Thread Count" property="MCBean|ServerInfo|*|activeThreadCount"
description="The current number of active threads for this app server instance"
- defaultInterval="300000" displayType="summary" category="throughput"/>
+ displayType="summary" category="throughput"/>
<metric displayName="Active Thread Group Count" property="MCBean|ServerInfo|*|activeThreadGroupCount"
description="The current number of active thread groups for this app server instance"
- defaultInterval="300000" defaultOn="true" category="throughput"/>
+ category="throughput"/>
<metric displayName="JVM Free Memory" property="MCBean|ServerInfo|*|freeMemory" displayType="summary"
description="An approximation of the total amount of memory currently available in the app server JVM for future allocated objects, measured in bytes"
- defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric displayName="JVM Max Memory" property="MCBean|ServerInfo|*|maxMemory"
description="The maximum amount of memory that the app server JVM will attempt to use, measured in bytes; if there is no inherent limit then the value Long.MAX_VALUE will be returned"
- defaultInterval="1800000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric displayName="JVM Total Memory" property="MCBean|ServerInfo|*|totalMemory" displayType="summary"
description="The total amount of memory currently available in the app server JVM for current and future objects, measured in bytes"
- defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric displayName="Total Transactions" property="MCBean|JTA|*|transactionCount" measurementType="trendsup"
- defaultInterval="300000" defaultOn="true" category="utilization"
+ category="utilization"
description="Total number of transactions since last restart"/>
<metric displayName="Transactions Committed" property="MCBean|JTA|*|commitCount" displayType="summary" measurementType="trendsup"
- defaultInterval="600000" defaultOn="true" category="utilization"
+ category="utilization"
description="Number of transactions committed since last restart"/>
<metric displayName="Transactions Rolled Back" property="MCBean|JTA|*|rollbackCount" measurementType="trendsup"
- defaultInterval="600000" defaultOn="true" category="utilization"
+ category="utilization"
description="Number of transactions rolled back since last restart"/>
<event name="logEntry" description="an entry was appended to a log file"/>
@@ -1254,7 +1253,7 @@
displayName="Maximum Request Time"
description="the maximum time it took to process a request since the last restart"
units="milliseconds"
- defaultOn="true" category="performance"/>
+ category="performance"/>
<metric property="requestCount"
displayName="Request Count" description="the total number of requests processed since the last restart"
@@ -1262,16 +1261,16 @@
<metric property="errorCount"
displayName="Error Count" description="the number of errors while processing requests since the last restart"
- defaultOn="true" category="utilization" measurementType="trendsup"/>
+ category="utilization" measurementType="trendsup"/>
<metric property="ThreadPool|currentThreadsBusy"
displayName="Current Active Threads"
- defaultOn="true" category="utilization" displayType="summary"
+ category="utilization" displayType="summary"
description="the number of threads for this connector that are currently active"/>
<metric property="ThreadPool|currentThreadCount"
displayName="Current Thread Count"
- defaultOn="true" category="utilization" displayType="summary"
+ category="utilization" displayType="summary"
description="the number of threads for this connector that currently exist"/>
</service>
@@ -1582,7 +1581,7 @@
<metric property="custom.transactionType" displayName="Transaction Type" displayType="summary"
description="The type of transactions used by this connection factory - Local or XA"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"/>
+ dataType="trait" category="performance"/>
&managedObjectMetrics;
&connectionFactoryMetrics;
@@ -1761,54 +1760,54 @@
<!-- Traits -->
<metric property="createdProgrammatically" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="Was this queue created programmatically? If Yes, the queue will not survive a restart of the application server. If No, the queue was created via a deployment XML file."/>
<!-- NOTE: We have to make this a trait rather than a resource config prop due to a bug in JBMESSAGING
(see https://jira.jboss.org/jira/browse/JBAS-6721). -->
<metric property="messageCounterHistoryDayLimit"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="This queue's message counter history day limit - <0: unlimited, =0: history disabled, >0: maximum day count"/>
<!-- Numerics -->
<metric property="consumerCount" measurementType="dynamic" displayType="summary" displayName="Consumer Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The number of consumers on the queue"/>
<metric property="deliveringCount" measurementType="dynamic" displayType="detail" displayName="Delivering Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The number of messages currently being delivered"/>
<metric property="messageCount" measurementType="dynamic" displayType="summary" displayName="Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The number of messages in the queue"/>
<metric property="scheduledMessageCount" measurementType="dynamic" displayType="detail" displayName="Scheduled Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The number of scheduled messages in the queue"/>
<metric property="messageStatistics.count" measurementType="dynamic" displayType="detail" displayName="Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The total message count since startup or last counter reset"/>
<metric property="messageStatistics.countDelta" measurementType="dynamic" displayType="detail" displayName="Count Delta"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The message count delta since last method call"/>
<metric property="messageStatistics.depth" measurementType="dynamic" displayType="detail" displayName="Depth"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The current message count of pending messages within the queue waiting for dispatch"/>
<metric property="messageStatistics.depthDelta" measurementType="dynamic" displayType="detail" displayName="Depth Delta"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The message count delta of pending messages since last method call"/>
<metric property="messageStatistics.timeLastUpdate" measurementType="dynamic" displayType="detail" displayName="Time Last Update"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="utilization"
+ dataType="measurement" category="utilization"
description="The timestamp of the last message add"/>
- <metric property="clustered" dataType="trait" description="True if this queue is clustered, false otherwise" defaultInterval="3600000" defaultOn="true"/>
+ <metric property="clustered" dataType="trait" description="True if this queue is clustered, false otherwise" />
<resource-configuration>
@@ -2112,42 +2111,42 @@
<!-- Traits -->
<metric property="createdProgrammatically" displayType="summary"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="Was this topic created programmatically? If Yes, the topic will not survive a restart of the application server. If No, the topic was created via a deployment XML file."/>
<!-- NOTE: We have to make this a trait rather than a resource config prop due to a bug in JBMESSAGING
(see https://jira.jboss.org/jira/browse/JBAS-6721). -->
<metric property="messageCounterHistoryDayLimit"
- defaultOn="true" defaultInterval="600000" dataType="trait" category="performance"
+ dataType="trait" category="performance"
description="This topic's message counter history day limit - <0: unlimited, =0: history disabled, >0: maximum day count"/>
<!-- Numerics -->
<metric property="allMessageCount" measurementType="dynamic" displayType="summary" displayName="All Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all messages in all subscriptions to this topic"/>
<metric property="allSubscriptionsCount" measurementType="dynamic" displayType="summary" displayName="All Subscriptions Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all subscriptions to this topic"/>
<metric property="durableMessageCount" measurementType="dynamic" displayType="detail" displayName="Durable Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all messages for all durable subscriptions to this topic"/>
<metric property="durableSubscriptionsCount" measurementType="dynamic" displayType="detail" displayName="Durable Subscriptions Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all durable subscriptions to this topic"/>
<metric property="nonDurableMessageCount" measurementType="dynamic" displayType="detail" displayName="Non Durable Message Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all messages in all non durable subscriptions to this topic"/>
<metric property="nonDurableSubscriptionsCount" measurementType="dynamic" displayType="detail" displayName="Non Durable Subscriptions Count"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="throughput"
+ dataType="measurement" category="throughput"
description="The count of all non durable subscriptions to this topic"/>
- <metric property="clustered" dataType="trait" description="True if this topic is clustered, false otherwise" defaultInterval="3600000" defaultOn="true"/>
+ <metric property="clustered" dataType="trait" description="True if this topic is clustered, false otherwise" />
<resource-configuration>
@@ -2568,7 +2567,7 @@
&ejb2StatelessSessionBeanMetrics;
<metric property="methodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
</service>
@@ -2584,7 +2583,7 @@
&ejb2StatefulSessionBeanMetrics;
<metric property="methodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
</service>
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 d02a8c0..f3b6dd8 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
@@ -203,34 +203,34 @@
<metric property="jboss.system:type=ServerInfo:ActiveThreadCount" displayName="Active Thread Count"
description="The current number of active threads for this app server instance"
- defaultInterval="300000" displayType="summary" category="throughput"/>
+ displayType="summary" category="throughput"/>
<metric property="jboss.system:type=ServerInfo:ActiveThreadGroupCount" displayName="Active Thread Group Count"
description="The current number of active thread groups for this app server instance"
- defaultInterval="300000" defaultOn="true" category="throughput"/>
+ category="throughput"/>
<metric property="jboss.system:type=ServerInfo:FreeMemory" displayName="JVM Free Memory" displayType="summary"
description="An approximation of the total amount of memory currently available in the app server JVM for future allocated objects, measured in bytes"
- defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric property="jboss.system:type=ServerInfo:MaxMemory" displayName="JVM Max Memory"
description="The maximum amount of memory that the app server JVM will attempt to use, measured in bytes; if there is no inherent limit then the value Long.MAX_VALUE will be returned"
- defaultInterval="1800000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric property="jboss.system:type=ServerInfo:TotalMemory" displayName="JVM Total Memory" displayType="summary"
description="The total amount of memory currently available in the app server JVM for current and future objects, measured in bytes"
- defaultInterval="300000" defaultOn="true" category="utilization" units="bytes"/>
+ category="utilization" units="bytes"/>
<metric property="jboss:service=TransactionManager:TransactionCount" displayName="Total Transactions" measurementType="trendsup"
- defaultInterval="300000" defaultOn="true" category="utilization"
+ category="utilization"
description="Total number of transactions since last restart"/>
<metric property="jboss:service=TransactionManager:CommitCount" displayName="Transactions Committed" displayType="summary" measurementType="trendsup"
- defaultInterval="600000" defaultOn="true" category="utilization"
+ category="utilization"
description="Number of transactions commited since last restart"/>
<metric property="jboss:service=TransactionManager:RollbackCount" displayName="Transactions Rolledback" measurementType="trendsup"
- defaultInterval="600000" defaultOn="true" category="utilization"
+ category="utilization"
description="Number of transactions commited since last restart"/>
<event name="logEntry" description="an entry in a log file"/>
@@ -391,7 +391,7 @@
displayName="Maximum Request Time"
description="Maximum time it took to process a request"
units="milliseconds"
- defaultOn="true" category="performance"/>
+ category="performance"/>
<!-- jboss.web:name=http-0.0.0.0-8080,type=GlobalRequestProcessor:requestCount -->
<metric property="jboss.web:name=%schema%%dash%%address%-%port%,type=GlobalRequestProcessor:requestCount"
@@ -401,17 +401,17 @@
<!-- jboss.web:name=http-0.0.0.0-8080,type=GlobalRequestProcessor:errorCount -->
<metric property="jboss.web:name=%schema%%dash%%address%-%port%,type=GlobalRequestProcessor:errorCount"
displayName="Error count" description="Number of errors while processing since last restart."
- defaultOn="true" category="utilization" measurementType="trendsup"/>
+ category="utilization" measurementType="trendsup"/>
<!-- jboss.web:name=http-0.0.0.0-8080,type=ThreadPool:currentThreadsBusy -->
<metric property="jboss.web:name=%schema%%dash%%address%-%port%,type=ThreadPool:currentThreadsBusy"
displayName="Threads Active"
- defaultOn="true" category="utilization" displayType="summary"/>
+ category="utilization" displayType="summary"/>
<!-- jboss.web:name=http-0.0.0.0-8080,type=ThreadPool:currentThreadCount -->
<metric property="jboss.web:name=%schema%%dash%%address%-%port%,type=ThreadPool:currentThreadCount"
displayName="Threads Allocated"
- defaultOn="true" category="utilization" displayType="summary"/>
+ category="utilization" displayType="summary"/>
</service>
<service name="VHost"
@@ -428,7 +428,7 @@
<metric property="jboss.web:type=Host,host=%name%:aliases"
description="The aliases for this virtual host"
displayName="Aliases"
- defaultOn="true" dataType="trait" />
+ dataType="trait" />
</service>
</server>
@@ -460,20 +460,20 @@
created."/>
<metric displayName="Total Connections" property="ConnectionCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
description="Total Number of Connections for the Connection Pool, both active and in-active."/>
<metric displayName="Available Connections" property="AvailableConnectionCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
description="Number of available connections in the connection pool in-active and waiting."/>
<metric displayName="Active Connections" property="InUseConnectionCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
description="Number of Connections currently supporting clients."/>
<metric displayName="Connections Created" property="ConnectionCreatedCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
measurementType="trendsup"
description="Number of Connections created since the Connection Pool was created."/>
<metric displayName="Connections Destroyed" property="ConnectionDestroyedCount"
- category="utilization" defaultOn="true" displayType="summary"
+ category="utilization" displayType="summary"
measurementType="trendsup"
description="Number of Connections destroyed since the Connection Pool was created."/>
@@ -600,33 +600,33 @@
<metric property="AvailableConnectionCount" measurementType="dynamic" displayType="summary"
displayName="Available Connection Count" description="Number of available connections."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="ConnectionCount" measurementType="dynamic" displayType="summary"
- displayName="Connection Count" defaultOn="true" defaultInterval="600000" dataType="measurement"
+ displayName="Connection Count" dataType="measurement"
category="performance"/>
<metric property="ConnectionCreatedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Created Count" defaultOn="true" defaultInterval="600000"
+ displayName="Connection Created Count"
dataType="measurement" category="performance"/>
<metric property="ConnectionDestroyedCount" measurementType="dynamic" displayType="detail"
- displayName="Connection Destroyed Count" defaultOn="true" defaultInterval="600000"
+ displayName="Connection Destroyed Count"
dataType="measurement" category="performance"/>
<metric property="InUseConnectionCount" measurementType="dynamic" displayType="detail"
displayName="In Use Connection Count" description="Mumber of connections currently in use."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="MaxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
displayName="Max Connections In Use Count" description="Maximum number of maximum connections that have been in use."
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="MaxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<metric property="MinSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
- defaultOn="true" defaultInterval="600000" dataType="measurement" category="performance"/>
+ dataType="measurement" category="performance"/>
<resource-configuration>
@@ -971,27 +971,27 @@
<metric property="jboss.mq:service=MessageCache:CacheHits" displayName="JMS Message Cache Hits"
description="The number of cache hits to the JMS Message Cache"
- defaultInterval="300000" defaultOn="false" category="throughput" measurementType="trendsup"/>
+ defaultOn="false" category="throughput" measurementType="trendsup"/>
<metric property="jboss.mq:service=MessageCache:CacheMisses" displayName="JMS Message Cache Misses"
description="The number of cache misses to the JMS Message Cache"
- defaultInterval="300000" defaultOn="false" category="throughput" measurementType="trendsup"/>
+ defaultOn="false" category="throughput" measurementType="trendsup"/>
<metric property="jboss.mq:service=MessageCache:CurrentMemoryUsage" displayName="JMS Message Cache Current Memory Usage"
description="The total memory currently in use by the JMS Message Cache"
- defaultInterval="300000" defaultOn="false" category="utilization" units="bytes"/>
+ defaultOn="false" category="utilization" units="bytes"/>
<metric property="jboss.mq:service=MessageCache:HighMemoryMark" displayName="JMS Message Cache High Memory Mark"
description="The peak amount of memory the JMS Message Cache has actively used since server start"
- defaultInterval="300000" defaultOn="false" category="utilization" units="bytes"/>
+ defaultOn="false" category="utilization" units="bytes"/>
<metric property="jboss.mq:service=MessageCache:MaxMemoryMark" displayName="JMS Message Cache Max Memory Mark"
description="The maximum amount of memory the JMS Message Cache is allowed to use"
- defaultInterval="300000" defaultOn="false" category="utilization" units="bytes"/>
+ defaultOn="false" category="utilization" units="bytes"/>
<metric property="jboss.mq:service=MessageCache:TotalCacheSize" displayName="JMS Message Cache Size"
description="The number of messages currently in the JMS Message Cache"
- defaultInterval="300000" defaultOn="false" category="utilization"/>
+ defaultOn="false" category="utilization"/>
<service name="JMQ JMS Queue" class="JMSComponent"
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
@@ -1048,26 +1048,22 @@
<metric displayName="Messages in Queue"
property="QueueDepth"
category="utilization"
- defaultOn="true"
displayType="summary"
description="The number of undelivered messages in the queue."/>
<metric displayName="Receivers Count"
property="ReceiversCount"
category="utilization"
- defaultOn="true"
description="The number of ClientConsumers waiting for a message."/>
<metric displayName="Scheduled Message Count"
property="ScheduledMessageCount"
category="utilization"
- defaultOn="true"
description="The number of messages waiting to be scheduled"/>
<metric displayName="In Process Message Count"
property="InProcessMessageCount"
category="utilization"
- defaultOn="true"
description="The number of messages received by clients but not acknowledged (from AS 4.0.5)"/>
<resource-configuration>
@@ -1388,37 +1384,31 @@
<metric displayName="All Message Counter"
property="AllMessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Returns the total message count for all subscriptions."/>
<metric displayName="Durable Message Count"
property="DurableMessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Total number of messages for all durable subscriptions."/>
<metric displayName="Non-durable Message Count"
property="NonDurableMessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Total number of messages for all non-durable subscriptions."/>
<metric displayName="All Subscription Count"
property="AllSubscriptionsCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Number of subscriptions waiting for a message."/>
<metric displayName="Durable Subscription Count"
property="DurableSubscriptionsCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Number of durable subscriptions waiting for a message."/>
<metric displayName="Non-durable Subscription Count"
property="NonDurableSubscriptionsCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Number of non-durable subscriptions waiting for a message."/>
@@ -1623,24 +1613,20 @@
<metric displayName="Messages in Queue"
property="MessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="The number of messages in the queue."/>
<metric displayName="Consumer Count"
property="ConsumerCount"
category="utilization"
- defaultOn="true"
description="The number of ClientConsumers waiting for a message."/>
<metric displayName="Scheduled Message Count"
property="ScheduledMessageCount"
category="utilization"
- defaultOn="true"
description="The number of scheduled messages in the Queue"/>
<metric displayName="Created programmatically"
property="CreatedProgrammatically"
dataType="trait"
displayType="summary"
- defaultOn="true"
description="Was this Queue created dynamically" />
<metric displayName="Delivering Count"
property="DeliveringCount"
@@ -1842,7 +1828,6 @@
<metric displayName="All Message Counter"
property="AllMessageCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Returns the total message count for all subscriptions."/>
<metric displayName="Durable Message Count"
@@ -1858,7 +1843,6 @@
<metric displayName="All Subscription Count"
property="AllSubscriptionsCount"
category="utilization"
- defaultOn="true"
displayType="summary"
description="Number of subscriptions waiting for a message."/>
<metric displayName="Durable Subscription Count"
@@ -1875,7 +1859,6 @@
property="CreatedProgrammatically"
dataType="trait"
displayType="summary"
- defaultOn="true"
description="Was this Topic created dynamically" />
<resource-configuration>
@@ -2045,9 +2028,8 @@
<metric displayName="Max Size" property="MaxSize"
description="The maximum number of instances that are allowed to be pooled"/>
- <!-- default interval == 600000 ms == 10 min -->
<metric property="MethodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="The minimum, maximum, and average invocation times for each of the methods exposed by this EJB;
NOTE: this metric is only available if JBoss EJB3 RC9 Patch 1 or later is being used
(a capable version of EJB3 is included with JBossAS 4.2.0.GA or later)"/>
@@ -2095,9 +2077,8 @@
description="The maximum number of instances that are allowed to be pooled"
property="{{jboss.j2ee:jndiName=%name%,plugin=pool,service=EJB}MaxSize}"/>
- <!-- default interval == 600000 ms == 10 min -->
<metric property="MethodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="the minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
</service>
@@ -2141,9 +2122,8 @@
property="{stats.passiveCount.current}"
displayType="summary"/>
- <!-- default interval == 600000 ms == 10 min -->
<metric property="MethodInvocationTime" dataType="calltime" units="milliseconds"
- defaultOn="false" defaultInterval="600000" destinationType="Method Name"
+ defaultOn="false" destinationType="Method Name"
description="the minimum, maximum, and average invocation times for each of the methods exposed by this EJB"/>
</service>
@@ -2189,24 +2169,20 @@
<metric property="{{jboss.j2ee:jndiName=%name%,plugin=cache,service=EJB}CacheSize}"
description="The total number of currently cached instances of this EJB 1.x or 2.x Entity Bean"
- displayName="Cache Size"
- defaultOn="true"/>
+ displayName="Cache Size"/>
<metric property="{{jboss.j2ee:jndiName=%name%,plugin=cache,service=EJB}PassivatedCount}"
description="The number of pooled instances of this EJB 1.x or 2.x Entity Bean in the passivated state"
displayName="Passivated Count"
- defaultOn="true"
measurementType="trendsup"/>
<metric property="{{jboss.j2ee:jndiName=%name%,plugin=pool,service=EJB}PoolSize}"
description="The total number of currently pooled instances of this EJB 1.x or 2.x Entity Bean"
- displayName="Current Size"
- defaultOn="true"/>
+ displayName="Current Size"/>
<metric property="{{jboss.j2ee:jndiName=%name%,plugin=pool,service=EJB}MaxPoolSize}"
description="The maximum number of instances that are allowed to be pooled"
- displayName="Max Size"
- defaultOn="true"/>
+ displayName="Max Size"/>
</service>
@@ -2411,7 +2387,7 @@
<metric property="Session.sessionMaxAliveTime" displayName="Max Session alive time"
units="seconds" description="Maximum alive time of a Sessions" />
- <metric property="Vhost.name" displayName="Vhost" dataType="trait" defaultOn="true"
+ <metric property="Vhost.name" displayName="Vhost" dataType="trait"
description="Virtual hosts this app runs on"/>
</service>
@@ -2538,7 +2514,7 @@
<metric property="Session.sessionMaxAliveTime" displayName="Max Session alive time"
units="seconds" description="Maximum alive time of a Sessions" />
- <metric property="Vhost.name" displayName="Vhost" dataType="trait" defaultOn="true"
+ <metric property="Vhost.name" displayName="Vhost" dataType="trait"
description="Virtual hosts this app runs on"/>
<content name="file" displayName="WAR File" category="deployable" isCreationType="true">
diff --git a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
index b142a22..b2c71b9 100644
--- a/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jmx/src/main/resources/META-INF/rhq-plugin.xml
@@ -126,7 +126,6 @@
</plugin-configuration>
<metric displayName="Free Physical Memory"
- defaultOn="true"
displayType="summary"
category="performance"
property="FreePhysicalMemorySize"
@@ -147,7 +146,6 @@
measurementType="trendsup"
units="nanoseconds"/>
<metric displayName="Committed Virtual Memory"
- defaultOn="true"
category="utilization"
property="CommittedVirtualMemorySize"
description="Size of virtual memory used by this process"
@@ -208,23 +206,19 @@
</operation>
<metric displayName="Thread Count"
- defaultOn="true"
displayType="summary"
category="performance"
property="ThreadCount"
description="Number of active threads in the system"/>
<metric displayName="Peak Thread Count"
- defaultOn="true"
category="performance"
property="PeakThreadCount"
description="Peak count of active threads in the system"/>
<metric displayName="Total Started Thread Count"
- defaultOn="true"
category="performance"
property="TotalStartedThreadCount"
description="Count of threads started since system start"/>
<metric displayName="Daemon Thread Count"
- defaultOn="true"
category="performance"
property="DaemonThreadCount"
description="Count of threads marked as daemons in the system"/>
diff --git a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
index 282987e..491af1c 100644
--- a/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mod-cluster/src/main/resources/META-INF/rhq-plugin.xml
@@ -477,7 +477,7 @@
<metric property="Load" displayName="Load" category="utilization"
description="The current load of this metric as a percent of the metric's capacity." dataType="measurement"
- defaultOn="true" displayType="summary"/>
+ displayType="summary"/>
<resource-configuration>
<c:simple-property name="weight" type="integer" description="The significance of this load metric compared to the other metrics." />
diff --git a/modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml
index 6a96c19..9c3e148 100644
--- a/modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/mysql/src/main/resources/META-INF/rhq-plugin.xml
@@ -361,21 +361,21 @@
<c:simple-property name="tableName" readOnly="true" />
</plugin-configuration>
<!-- Summary Traits -->
- <metric property="Engine" displayType="summary" dataType="trait" description="Database Engine that created the Table" defaultOn="true"/>
- <metric property="Version" displayType="summary" dataType="trait" description="Version of the Table" defaultOn="true"/>
- <metric property="Row_format" displayType="summary" dataType="trait" description="Row Format" defaultOn="true"/>
- <metric property="Collation" displayType="summary" dataType="trait" description="Collation Character Set" defaultOn="true"/>
- <metric property="Comment" displayType="summary" dataType="trait" description="Table Creation Comment" defaultOn="true"/>
- <metric property="Create_options" displayType="summary" dataType="trait" description="Table Creation Options" defaultOn="true"/>
- <metric property="Create_time" displayType="summary" dataType="trait" description="Table Creation Time" defaultOn="true"/>
+ <metric property="Engine" displayType="summary" dataType="trait" description="Database Engine that created the Table" />
+ <metric property="Version" displayType="summary" dataType="trait" description="Version of the Table" />
+ <metric property="Row_format" displayType="summary" dataType="trait" description="Row Format" />
+ <metric property="Collation" displayType="summary" dataType="trait" description="Collation Character Set" />
+ <metric property="Comment" displayType="summary" dataType="trait" description="Table Creation Comment" />
+ <metric property="Create_options" displayType="summary" dataType="trait" description="Table Creation Options" />
+ <metric property="Create_time" displayType="summary" dataType="trait" description="Table Creation Time" />
<!-- Dynamic Metrics -->
- <metric property="Rows" displayType="summary" measurementType="dynamic" description="Number of Rows in the Table" defaultOn="true"/>
- <metric property="Avg_row_length" displayType="summary" measurementType="dynamic" units="bytes" description="Average Row Length(bytes)" defaultOn="true"/>
- <metric property="Data_length" displayType="summary" measurementType="dynamic" units="bytes" description="Table Data Size(bytes)" defaultOn="true"/>
- <metric property="Max_data_length" displayType="summary" measurementType="dynamic" units="bytes" description="Max Table Data Size(bytes)" defaultOn="true"/>
- <metric property="Index_length" displayType="summary" measurementType="dynamic" units="bytes" description="Table Index Size(bytes)" defaultOn="true"/>
- <metric property="Data_free" displayType="summary" measurementType="dynamic" units="bytes" description="Table Free Space(bytes)" defaultOn="true"/>
+ <metric property="Rows" displayType="summary" measurementType="dynamic" description="Number of Rows in the Table" />
+ <metric property="Avg_row_length" displayType="summary" measurementType="dynamic" units="bytes" description="Average Row Length(bytes)" />
+ <metric property="Data_length" displayType="summary" measurementType="dynamic" units="bytes" description="Table Data Size(bytes)" />
+ <metric property="Max_data_length" displayType="summary" measurementType="dynamic" units="bytes" description="Max Table Data Size(bytes)" />
+ <metric property="Index_length" displayType="summary" measurementType="dynamic" units="bytes" description="Table Index Size(bytes)" />
+ <metric property="Data_free" displayType="summary" measurementType="dynamic" units="bytes" description="Table Free Space(bytes)" />
</service>
</service>
<service name="User" class="MySqlUserComponent" discovery="MySqlUserDiscoveryComponent"
diff --git a/modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml
index a8ea1e3..5cca30b 100644
--- a/modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/onewire/src/main/resources/META-INF/rhq-plugin.xml
@@ -25,7 +25,7 @@
discovery="DS1820Discovery"
>
- <metric property="temperature" defaultOn="true" description="Temperature measured"
+ <metric property="temperature" description="Temperature measured"
displayType="summary" units="celsius"/>
</service>
diff --git a/modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml
index 11eb232..fea33f1 100644
--- a/modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/oracle/src/main/resources/META-INF/rhq-plugin.xml
@@ -33,13 +33,13 @@
<metric property="totalSize" displayType="summary" units="bytes"/>
- <metric property="logons cumulative" defaultOn="true"/>
+ <metric property="logons cumulative" />
<metric property="logons current" displayType="summary"/>
<metric property="opened cursors cumulative"/>
- <metric property="opened cursors current" defaultOn="true"/>
+ <metric property="opened cursors current" />
<metric property="user commits" displayType="summary"/>
<metric property="user rollbacks" displayType="summary"/>
- <metric property="user calls" defaultOn="true"/>
+ <metric property="user calls" />
<metric property="recursive calls"/>
<metric property="recursive cpu usage"/>
<metric property="session logical reads"/>
@@ -49,8 +49,8 @@
<metric property="DB time"/>
<metric property="cluster wait time"/>
<metric property="concurrency wait time"/>
- <metric property="application wait time" defaultOn="true"/>
- <metric property="user I/O wait time" defaultOn="true"/>
+ <metric property="application wait time" />
+ <metric property="user I/O wait time" />
<metric property="session connect time"/>
<metric property="process last non-idle time"/>
<!--<metric property="session uga memory" displayType="summary" units="bytes"/>
@@ -70,30 +70,30 @@
<metric property="global enqueue gets async"/>
<metric property="global enqueue get time"/>
<metric property="global enqueue releases"/>
- <metric property="physical read total IO requests" defaultOn="true"/>
+ <metric property="physical read total IO requests" />
<metric property="physical read total multi block requests"/>
- <metric property="physical read total bytes" defaultOn="true"/>
- <metric property="physical write total IO requests" defaultOn="true"/>
+ <metric property="physical read total bytes" />
+ <metric property="physical write total IO requests" />
<metric property="physical write total multi block requests"/>
- <metric property="physical write total bytes" defaultOn="true"/>
+ <metric property="physical write total bytes" />
<metric property="IPC CPU used by this session"/>
<metric property="gcs messages sent"/>
<metric property="ges messages sent"/>
<metric property="global enqueue CPU used by this session"/>
- <metric property="db block gets" defaultOn="true"/>
- <metric property="db block gets from cache" defaultOn="true"/>
- <metric property="db block gets direct" defaultOn="true"/>
+ <metric property="db block gets" />
+ <metric property="db block gets from cache" />
+ <metric property="db block gets direct" />
<metric property="consistent gets"/>
<metric property="consistent gets from cache"/>
<metric property="consistent gets - examination"/>
<metric property="consistent gets direct"/>
- <metric property="physical reads" defaultOn="true"/>
+ <metric property="physical reads" />
<metric property="physical reads cache"/>
<metric property="physical reads direct"/>
- <metric property="physical read IO requests" defaultOn="true"/>
+ <metric property="physical read IO requests" />
<metric property="physical read bytes"/>
- <metric property="db block changes" defaultOn="true"/>
- <metric property="consistent changes" defaultOn="true"/>
+ <metric property="db block changes" />
+ <metric property="consistent changes" />
<metric property="recovery blocks read"/>
<metric property="physical writes"/>
<metric property="physical writes direct"/>
@@ -367,15 +367,15 @@
<metric property="parse count (hard)"/>
<metric property="parse count (failures)"/>
<metric property="frame signature mismatch"/>
- <metric property="execute count" defaultOn="true"/>
+ <metric property="execute count" />
<metric property="bytes sent via SQL*Net to client"/>
<metric property="bytes received via SQL*Net from client"/>
<metric property="SQL*Net roundtrips to/from client"/>
<metric property="bytes sent via SQL*Net to dblink"/>
<metric property="bytes received via SQL*Net from dblink"/>
<metric property="SQL*Net roundtrips to/from dblink"/>
- <metric property="sorts (memory)" defaultOn="true"/>
- <metric property="sorts (disk)" defaultOn="true"/>
+ <metric property="sorts (memory)" />
+ <metric property="sorts (disk)" />
<metric property="sorts (rows)"/>
<metric property="OTC commit optimization attempts"/>
<metric property="OTC commit optimization hits"/>
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 fa07736..8cebdf0 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
@@ -53,67 +53,55 @@
property="Trait.hostname"
description="Name that this platform is known as"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric displayName="OS Name"
property="Trait.osname"
description="Name that the operating system is known as"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric displayName="OS Version"
property="Trait.osversion"
description="Version of the operating system"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric displayName="Architecture"
property="Trait.sysarch"
description="Hardware architecture of the platform"
dataType="trait"
- displayType="summary"
- defaultOn="true"/>
+ displayType="summary" />
'>
<!ENTITY nativeMetrics '
<metric displayName="Free Memory"
property="Native.MemoryInfo.free"
- defaultOn="true"
displayType="summary"
units="bytes"
description="The total free system memory"/>
<metric displayName="Used Memory"
property="Native.MemoryInfo.used"
- defaultOn="true"
displayType="summary"
units="bytes"
description="The total used system memory"/>
<metric displayName="Total Memory"
property="Native.MemoryInfo.total"
- defaultOn="true"
units="bytes"
- defaultInterval="1200000"
description="The total system memory"/>
<metric displayName="Free Swap Space"
property="Native.SwapInfo.free"
- defaultOn="true"
units="bytes"
description="The total free system swap"/>
<metric displayName="Used Swap Space"
property="Native.SwapInfo.used"
- defaultOn="true"
displayType="summary"
units="bytes"
description="The total used system swap"/>
<metric displayName="Total Swap Space"
property="Native.SwapInfo.total"
- defaultOn="true"
units="bytes"
- defaultInterval="1200000"
description="The total system swap"/>
'>
@@ -142,26 +130,18 @@
<metric displayName="Vendor"
property="CpuTrait.vendor"
dataType="trait"
- defaultOn="true"
- defaultInterval="3600000"
description="Vendor of this CPU"/>
<metric displayName="CPU Model"
property="CpuTrait.model"
dataType="trait"
- defaultOn="true"
- defaultInterval="3600000"
description="Model of this CPU"/>
<metric displayName="CPU Speed"
property="CpuTrait.mhz"
dataType="trait"
- defaultOn="true"
- defaultInterval="3600000"
description="Speed of this CPU in Mhz"/>
<metric displayName="Cache size"
property="CpuTrait.cacheSize"
dataType="trait"
- defaultOn="true"
- defaultInterval="3600000"
description="Cache Size of this CPU"/>
'>
@@ -335,14 +315,12 @@
property="distro.name"
description="name of the Linux distribution"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
<metric displayName="Distribution Version"
property="distro.version"
description="version of the Linux distribution"
dataType="trait"
- displayType="summary"
- defaultOn="true" />
+ displayType="summary" />
&syslogEventDefinition;
@@ -523,29 +501,29 @@
description="The total free bytes on filesystem"/>
<metric property="fileSystemUsage.usePercent" displayName="Used Percentage" units="percentage" displayType="summary"
description="The percentage of disk used"/>
- <metric property="fileSystemUsage.total" displayName="Capacity" units="kilobytes" dataType="trait" defaultOn="true"
+ <metric property="fileSystemUsage.total" displayName="Capacity" units="kilobytes" dataType="trait"
description="The total size of the filesystem"/>
<metric property="fileSystem.typeName" displayName="Volume Type" dataType="trait" displayType="summary"
description="The filesystem's generic type name"/>
<metric property="fileSystem.sysTypeName" displayName="Drive Type" dataType="trait" displayType="summary"
description="The filesystem's operating system-specific type name"/>
- <metric property="fileSystem.devName" displayName="name" dataType="trait" defaultOn="true"
+ <metric property="fileSystem.devName" displayName="name" dataType="trait"
description="The name of this device"/>
<metric property="fileSystemUsage.freeFiles" displayName="Free Files"
description="The number of free file nodes on the filesystem"/>
- <metric property="fileSystem.flags" displayName="Flags" dataType="trait" defaultOn="true"
+ <metric property="fileSystem.flags" displayName="Flags" dataType="trait"
description="The filesystem's flags"/>
- <metric property="fileSystemUsage.used" displayName="Used" units="kilobytes" defaultOn="true"
+ <metric property="fileSystemUsage.used" displayName="Used" units="kilobytes"
description="The total bytes used on the filesystem"/>
<metric property="fileSystemUsage.diskReads" displayName="Disk Reads" measurementType="trendsup" displayType="summary"
description="The number of physical disk reads"/>
<metric property="fileSystemUsage.diskWrites" displayName="Disk Writes" measurementType="trendsup" displayType="summary"
description="The number of physical disk writes"/>
- <metric property="fileSystemUsage.diskReadBytes" displayName="Disk Read Bytes" measurementType="trendsup" units="bytes" defaultOn="true"
+ <metric property="fileSystemUsage.diskReadBytes" displayName="Disk Read Bytes" measurementType="trendsup" units="bytes"
description="The number of physical disk bytes read"/>
- <metric property="fileSystemUsage.diskWriteBytes" displayName="Disk Write Bytes" measurementType="trendsup" units="bytes" defaultOn="true"
+ <metric property="fileSystemUsage.diskWriteBytes" displayName="Disk Write Bytes" measurementType="trendsup" units="bytes"
description="The number of physical disk bytes written"/>
- <metric property="fileSystemUsage.diskQueue" displayName="Disk Queue" defaultOn="true"
+ <metric property="fileSystemUsage.diskQueue" displayName="Disk Queue"
description="The number of I/Os currently in progress"/>
</service>
diff --git a/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
index 88df960..6d55124 100644
--- a/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/postgres/src/main/resources/META-INF/rhq-plugin.xml
@@ -391,10 +391,10 @@
<metric displayName="Total Size" property="total_size" measurementType="dynamic" displayType="summary" units="bytes"
description="The size in bytes of the data and all associated indexes and toast tables"/>
<metric displayName="Rows" property="rows" measurementType="dynamic"
- defaultOn="false" defaultInterval="600000"
+ defaultOn="false"
description="The count of rows in the table. Warning: This may be an expensive operation"/>
<metric displayName="Approximate rows" property="rows_approx" measurementType="dynamic"
- defaultOn="false" defaultInterval="300000"
+ defaultOn="false"
description="The approximate count of rows in the table. This is basically the number of rows of the last ANALYZE of the table. This metric is not expensive."/>
<!-- TODO GH: add metrics for data and index space used -->
diff --git a/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
index 3517bf6..69cbf8a 100644
--- a/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/rhq-agent/src/main/resources/META-INF/rhq-plugin.xml
@@ -197,13 +197,11 @@
dataType="trait"
displayType="detail"
defaultInterval="86400000"
- defaultOn="true"
description="The directory where the agent is installed" />
<metric property="NumberAgentRestarts"
displayName="Number of Agent Restarts"
description="Number of times the agent was restarted during the lifetime of its Java Virtual Machine"
- defaultOn="true"
displayType="detail"
units="none"
category="availability"
@@ -212,8 +210,6 @@
<metric property="AgentServerClockDifference"
displayName="Agent-Server Clock Difference"
description="Number of milliseconds the agent's clock differs from its server's clock"
- defaultInterval="1800000"
- defaultOn="true"
displayType="summary"
units="milliseconds"
category="performance"
@@ -230,7 +226,6 @@
<metric property="NumberTotalCommandsReceived"
displayName="Total Number Of Commands Received"
description="Total number of messages this agent has received from the RHQ Server"
- defaultOn="true"
displayType="summary"
category="throughput"
measurementType="trendsup" />
@@ -238,21 +233,18 @@
<metric property="NumberSuccessfulCommandsReceived"
displayName="Number of Commands Received Successfully"
description="Number of messages this agent has received from the RHQ Server and succesfully processed"
- defaultOn="true"
category="throughput"
measurementType="trendsup" />
<metric property="NumberFailedCommandsReceived"
displayName="Number of Commands Received but Failed "
description="Number of messages this agent has received from the RHQ Server but failed to process"
- defaultOn="true"
category="throughput"
measurementType="trendsup" />
<metric property="AverageExecutionTimeReceived"
displayName="Avg Execution Time Commands Received Successfully"
description="Average time it took to process incoming commands that are ultimately successful"
- defaultOn="true"
displayType="summary"
category="performance"
measurementType="dynamic"
@@ -261,7 +253,6 @@
<metric property="AverageExecutionTimeSent"
displayName="Avg Execution Time Commands Sent Successfully"
description="Average time it took to send commands that are ultimately successful"
- defaultOn="true"
displayType="summary"
category="performance"
measurementType="dynamic"
@@ -270,7 +261,6 @@
<metric property="NumberTotalCommandsSent"
displayName="Total Number of Commands Sent"
description="Total number of messages this agent has sent to the RHQ Server"
- defaultOn="true"
displayType="summary"
category="throughput"
measurementType="trendsup" />
@@ -278,21 +268,18 @@
<metric property="NumberSuccessfulCommandsSent"
displayName="Number of Commands Successfully Sent"
description="Number of messages this agent has sent to the RHQ Server successfully"
- defaultOn="true"
category="throughput"
measurementType="trendsup" />
<metric property="NumberFailedCommandsSent"
displayName="Number of Commands Sent but Failed"
description="Number of messages this agent has either tried, but failed, to send or were not processed succesfully by the RHQ Server"
- defaultOn="true"
category="throughput"
measurementType="trendsup" />
<metric property="NumberCommandsActiveSent"
displayName="Number Of Active Commands Being Sent"
description="The number of messages this agent is currently sending"
- defaultOn="true"
displayType="summary"
category="throughput"
measurementType="dynamic" />
@@ -300,7 +287,6 @@
<metric property="NumberCommandsInQueue"
displayName="Number of Commands In Queue"
description="Number of messages currently queued waiting to be sent to the RHQ Server"
- defaultOn="true"
displayType="summary"
category="throughput"
measurementType="dynamic" />
@@ -308,14 +294,12 @@
<metric property="NumberCommandsSpooled"
displayName="Number of Commands Spooled To Disk"
description="Number of messages spooled to disk waiting to be sent to the RHQ Server"
- defaultOn="true"
category="throughput"
measurementType="dynamic" />
<metric property="JVMFreeMemory"
displayName="JVM Free Memory"
description="The amount of free memory the agent JVM has in its heap"
- defaultOn="true"
units="bytes"
category="performance"
measurementType="dynamic" />
@@ -323,7 +307,6 @@
<metric property="JVMTotalMemory"
displayName="JVM Total Memory"
description="The amount of total memory the agent JVM has in its heap"
- defaultOn="true"
units="bytes"
category="performance"
measurementType="dynamic" />
@@ -331,7 +314,6 @@
<metric property="JVMActiveThreads"
displayName="JVM Active Threads"
description="The number of active threads currently running in the agent JVM"
- defaultOn="true"
category="performance"
measurementType="dynamic" />
@@ -750,16 +732,13 @@
<metric property="NumberOfPluginClassLoaders"
defaultOn="false"
displayType="detail"
- defaultInterval="3600000"
description="The total number of plugin classloaders currently created and actively managed."/>
<metric property="NumberOfDiscoveryClassLoaders"
defaultOn="false"
displayType="detail"
- defaultInterval="3600000"
description="The total number of discovery classloaders currently created and actively managed."/>
<metric property="NumberOfResourceClassLoaders"
displayType="summary"
- defaultInterval="600000"
description="The total number of individual resource classloaders currently created and assigned to resources."/>
</service>
diff --git a/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
index 9f0f6a3..18cae0e 100644
--- a/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/rhq-server/src/main/resources/META-INF/rhq-plugin.xml
@@ -128,19 +128,19 @@
<metric property="FullAvailabilityReports" displayType="summary" measurementType="trendsup"
description="The number of full availability reports received and processed by this RHQ Server since it was started"/>
- <metric property="PurgedAlerts" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedAlerts" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of alerts purged by the last purge job"/>
- <metric property="PurgedAlertConditions" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedAlertConditions" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of alert conditions purged by the last purge job"/>
- <metric property="PurgedAlertNotifications" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedAlertNotifications" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of alert notifications purged by the last purge job"/>
- <metric property="PurgedAvailabilities" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedAvailabilities" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of availabilities purged by the last purge job"/>
- <metric property="PurgedCallTimeData" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedCallTimeData" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of call time data purged by the last purge job"/>
- <metric property="PurgedEvents" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedEvents" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of events purged by the last purge job"/>
- <metric property="PurgedMeasurementTraits" displayType="summary" measurementType="dynamic" category="utilization" defaultInterval="900000"
+ <metric property="PurgedMeasurementTraits" displayType="summary" measurementType="dynamic" category="utilization"
description="Number of traits purged by the last purge job"/>
</service>
diff --git a/modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml
index 016985e..851e830 100644
--- a/modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/script/src/main/resources/META-INF/rhq-plugin.xml
@@ -80,9 +80,7 @@
dataType="measurement"
displayName="The Measurement Name"
description="Describes what this measurement is actually telling you"
- defaultOn="true"
units="none"
- defaultInterval="300000"
displayType="summary"
category="performance" />
-->
diff --git a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
index 09ad1af..15caad5 100644
--- a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
@@ -442,7 +442,6 @@
property="VHost.name"
displayName="Virtual Hosts"
dataType="trait"
- defaultOn="true"
description="Virtual hosts this app runs on" />
<metric
@@ -705,14 +704,12 @@
displayName="Maximum Request Time"
description="Maximum time it took to process a request."
units="milliseconds"
- defaultOn="true"
category="performance" />
<metric
property="Catalina:type=GlobalRequestProcessor,name=%handler%%address%-%port%:requestCount"
displayName="Request count"
description="Total number of requests processed since last restart."
- defaultOn="true"
category="utilization"
measurementType="trendsup" />
@@ -720,7 +717,6 @@
property="Catalina:type=GlobalRequestProcessor,name=%handler%%address%-%port%:errorCount"
displayName="Error count"
description="Number of errors while processing since last restart."
- defaultOn="true"
category="utilization"
measurementType="trendsup" />
@@ -728,7 +724,6 @@
property="Catalina:type=ThreadPool,name=%handler%%address%-%port%:currentThreadsBusy"
displayName="Threadpool Threads Active"
description="Number of current busy threads."
- defaultOn="true"
category="utilization"
displayType="summary" />
@@ -736,7 +731,6 @@
property="Catalina:type=ThreadPool,name=%handler%%address%-%port%:currentThreadCount"
displayName="Threadpool Threads Allocated"
description="Number of current threads."
- defaultOn="true"
category="utilization"
displayType="summary" />
@@ -744,7 +738,6 @@
property="Catalina:type=ThreadPool,name=%handler%%address%-%port%:maxThreads"
displayName="Threadpool Max Threads"
description="Maximum number of threads that can be allocated for the ThreadPool."
- defaultOn="true"
category="utilization"
displayType="detail" />
diff --git a/modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml
index a066afc..4944199 100644
--- a/modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/twitter/src/main/resources/META-INF/rhq-plugin.xml
@@ -45,11 +45,11 @@
</operation>
<metric property="tweetCount" displayName="Tweet count" category="utilization" dataType="measurement"
- defaultOn="true" displayType="summary" measurementType="dynamic"
+ displayType="summary" measurementType="dynamic"
description="Number of new tweets since last poll"/>
<metric property="followerCount" displayName="Follower count" dataType="measurement"
- defaultOn="true" displayType="summary" measurementType="dynamic" defaultInterval="14400000"
+ displayType="summary" measurementType="dynamic" defaultInterval="14400000"
description="Number of followers" />
@@ -77,7 +77,7 @@
</plugin-configuration>
<metric property="tweetCount" displayName="Tweet count" category="utilization" dataType="measurement"
- defaultOn="true" displayType="summary" measurementType="dynamic"
+ displayType="summary" measurementType="dynamic"
description="Number of new tweets since last poll"/>
<event name="FeedEvent"/>
12 years, 6 months
[rhq] Branch 'release_jon3.x' - modules/enterprise
by John Sanda
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/AvailabilityManagerTest.java | 13 -
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/LdapGroupManagerBeanTest.java | 13 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java | 12 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java | 12 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java | 12 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestPluginServiceMBean.java | 25 ++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestServerPluginService.java | 113 ++++++++++
9 files changed, 169 insertions(+), 169 deletions(-)
New commits:
commit a6501e4e46a9d7f33ba5a0c3781293a36294eb96
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 14:45:39 2011 -0400
fixing compilation errors that resulted from itests refactoring
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 3fbc4f7..739b8d3 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
@@ -46,6 +46,7 @@ import org.rhq.enterprise.server.measurement.AvailabilityPoint;
import org.rhq.enterprise.server.resource.ResourceAvailabilityManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -73,7 +74,7 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
private Availability availability2;
private Availability availability3;
- private DriftServerPluginService driftServerPluginService;
+ private TestServerPluginService testServerPluginService;
@BeforeMethod
public void beforeMethod() {
@@ -86,10 +87,10 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
this.overlord = LookupUtil.getSubjectManager().getOverlord();
additionalResources = new ArrayList<Resource>();
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
- driftServerPluginService.startMasterPluginContainer();
+ testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testServerPluginService);
+ testServerPluginService.masterConfig.getPluginDirectory().mkdirs();
+ testServerPluginService.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)!
@@ -139,7 +140,7 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
finally {
unprepareScheduler();
unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
+ testServerPluginService.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
deleted file mode 100644
index b20155a..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginService.java
+++ /dev/null
@@ -1,113 +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.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
deleted file mode 100644
index 8473cf0..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/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.measurement.test;
-
-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/resource/group/test/LdapGroupManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
index 1b8974d..c4cfca5 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
@@ -27,17 +27,16 @@ import javax.persistence.Query;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
import org.rhq.core.domain.common.SystemConfiguration;
import org.rhq.core.domain.common.composite.SystemSetting;
import org.rhq.enterprise.server.RHQConstants;
-import org.rhq.enterprise.server.drift.DriftServerPluginService;
import org.rhq.enterprise.server.resource.group.LdapGroupManagerBean;
import org.rhq.enterprise.server.resource.group.LdapGroupManagerLocal;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.test.ldap.FakeLdapCtxFactory;
import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.test.TransactionCallback;
@@ -95,7 +94,7 @@ public class LdapGroupManagerBeanTest extends AbstractEJB3Test {
private LdapGroupManagerLocal ldapGroupManager = null;
private SystemManagerLocal systemManager = null;
- private DriftServerPluginService driftServerPluginService = null;
+ private TestServerPluginService testServerPluginService = null;
// private Subject overlord = null;
@@ -107,9 +106,9 @@ public class LdapGroupManagerBeanTest extends AbstractEJB3Test {
ldapGroupManager = LookupUtil.getLdapGroupManager();
//we need this because the drift plugins are referenced from the system settings that we use in our tests
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.startMasterPluginContainer();
+ testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testServerPluginService);
+ testServerPluginService.startMasterPluginContainer();
// get our Maven properties for LDAP testing
java.net.URL url = LdapGroupManagerBeanTest.class.getClassLoader().getResource("test-ldap.properties");
@@ -150,7 +149,7 @@ public class LdapGroupManagerBeanTest extends AbstractEJB3Test {
@AfterClass
public void tearDown() throws Exception {
unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
+ testServerPluginService.stopMasterPluginContainer();
}
/**
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java
index 5aeed8e..e3f52f5 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java
@@ -77,7 +77,6 @@ import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.enterprise.server.drift.DriftServerPluginService;
import org.rhq.enterprise.server.event.EventManagerLocal;
import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
@@ -85,6 +84,7 @@ import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.scheduler.SchedulerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
import org.rhq.enterprise.server.test.TestServerCommunicationsService;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -96,20 +96,20 @@ public class DataPurgeJobTest extends AbstractEJB3Test {
private int agentId;
private int resourceTypeId;
- private DriftServerPluginService driftServerPluginService;
+ private TestServerPluginService testServerPluginService;
@BeforeClass
public void setup() {
//we need this because the drift plugins are referenced from the system settings that we use in our tests
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.startMasterPluginContainer();
+ testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testServerPluginService);
+ testServerPluginService.startMasterPluginContainer();
}
@AfterClass
public void tearDown() throws Exception {
unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
+ testServerPluginService.stopMasterPluginContainer();
}
@BeforeMethod
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java
index 6349bf6..c5a0b2e 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java
@@ -73,7 +73,6 @@ import org.rhq.core.domain.sync.ImportConfiguration;
import org.rhq.core.domain.util.PageControl;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.authz.PermissionException;
-import org.rhq.enterprise.server.drift.DriftServerPluginService;
import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
@@ -83,6 +82,7 @@ import org.rhq.enterprise.server.sync.SynchronizationManagerLocal;
import org.rhq.enterprise.server.sync.SystemSettingsSynchronizer;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -105,7 +105,7 @@ public class SynchronizationManagerBeanTest extends AbstractEJB3Test {
public Properties systemSettings;
public ResourceType fakeType;
public Resource fakePlatform;
- public DriftServerPluginService driftServerPluginService;
+ public TestServerPluginService testServerPluginService;
}
private TestData testData;
@@ -151,9 +151,9 @@ public class SynchronizationManagerBeanTest extends AbstractEJB3Test {
}
//we need this because the drift plugins are referenced from the system settings that we use in our tests
- testData.driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(testData.driftServerPluginService);
- testData.driftServerPluginService.startMasterPluginContainer();
+ testData.testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testData.testServerPluginService);
+ testData.testServerPluginService.startMasterPluginContainer();
synchronizationManager = LookupUtil.getSynchronizationManager();
@@ -191,7 +191,7 @@ public class SynchronizationManagerBeanTest extends AbstractEJB3Test {
}
unprepareServerPluginService();
- testData.driftServerPluginService.stopMasterPluginContainer();
+ testData.testServerPluginService.stopMasterPluginContainer();
export = null;
testData = null;
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java
index 012dde7..8d27267 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java
@@ -30,30 +30,30 @@ import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.composite.SystemSetting;
import org.rhq.core.domain.common.composite.SystemSettings;
import org.rhq.enterprise.server.RHQConstants;
-import org.rhq.enterprise.server.drift.DriftServerPluginService;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.util.LookupUtil;
@Test
public class SystemManagerBeanTest extends AbstractEJB3Test {
private Subject overlord;
private SystemManagerLocal systemManager;
- private DriftServerPluginService driftServerPluginService;
+ private TestServerPluginService testServerPluginService;
@BeforeClass
public void setupServer() {
systemManager = LookupUtil.getSystemManager();
//we need this because the drift plugins are referenced from the system settings that we use in our tests
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.startMasterPluginContainer();
+ testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testServerPluginService);
+ testServerPluginService.startMasterPluginContainer();
}
@AfterClass
public void tearDownServer() throws Exception {
unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
+ testServerPluginService.stopMasterPluginContainer();
}
@BeforeMethod
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestPluginServiceMBean.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestPluginServiceMBean.java
new file mode 100644
index 0000000..c669b63
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestPluginServiceMBean.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.test;
+
+import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
+
+public interface TestPluginServiceMBean extends ServerPluginServiceManagement {
+}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestServerPluginService.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestServerPluginService.java
new file mode 100644
index 0000000..87a7655
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestServerPluginService.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.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 TestServerPluginService extends ServerPluginService implements TestPluginServiceMBean {
+
+ public TestMasterServerPluginContainer master;
+ public MasterServerPluginContainerConfiguration masterConfig;
+
+ public TestServerPluginService() {
+ // 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;
+ }
+ }
+}
12 years, 6 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/AvailabilityManagerTest.java | 13 -
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/LdapGroupManagerBeanTest.java | 13 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java | 12 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java | 12 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java | 12 -
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestPluginServiceMBean.java | 25 ++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestServerPluginService.java | 113 ++++++++++
9 files changed, 169 insertions(+), 169 deletions(-)
New commits:
commit 14c1938417da451cdcb799c998922022b50833e6
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 14:45:39 2011 -0400
fixing compilation errors that resulted from itests refactoring
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 3fbc4f7..739b8d3 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
@@ -46,6 +46,7 @@ import org.rhq.enterprise.server.measurement.AvailabilityPoint;
import org.rhq.enterprise.server.resource.ResourceAvailabilityManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -73,7 +74,7 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
private Availability availability2;
private Availability availability3;
- private DriftServerPluginService driftServerPluginService;
+ private TestServerPluginService testServerPluginService;
@BeforeMethod
public void beforeMethod() {
@@ -86,10 +87,10 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
this.overlord = LookupUtil.getSubjectManager().getOverlord();
additionalResources = new ArrayList<Resource>();
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
- driftServerPluginService.startMasterPluginContainer();
+ testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testServerPluginService);
+ testServerPluginService.masterConfig.getPluginDirectory().mkdirs();
+ testServerPluginService.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)!
@@ -139,7 +140,7 @@ public class AvailabilityManagerTest extends AbstractEJB3Test {
finally {
unprepareScheduler();
unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
+ testServerPluginService.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
deleted file mode 100644
index b20155a..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/DriftServerPluginService.java
+++ /dev/null
@@ -1,113 +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.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
deleted file mode 100644
index 8473cf0..0000000
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/measurement/test/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.measurement.test;
-
-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/resource/group/test/LdapGroupManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
index 1b8974d..c4cfca5 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/test/LdapGroupManagerBeanTest.java
@@ -27,17 +27,16 @@ import javax.persistence.Query;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
import org.rhq.core.domain.common.SystemConfiguration;
import org.rhq.core.domain.common.composite.SystemSetting;
import org.rhq.enterprise.server.RHQConstants;
-import org.rhq.enterprise.server.drift.DriftServerPluginService;
import org.rhq.enterprise.server.resource.group.LdapGroupManagerBean;
import org.rhq.enterprise.server.resource.group.LdapGroupManagerLocal;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.test.ldap.FakeLdapCtxFactory;
import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.test.TransactionCallback;
@@ -95,7 +94,7 @@ public class LdapGroupManagerBeanTest extends AbstractEJB3Test {
private LdapGroupManagerLocal ldapGroupManager = null;
private SystemManagerLocal systemManager = null;
- private DriftServerPluginService driftServerPluginService = null;
+ private TestServerPluginService testServerPluginService = null;
// private Subject overlord = null;
@@ -107,9 +106,9 @@ public class LdapGroupManagerBeanTest extends AbstractEJB3Test {
ldapGroupManager = LookupUtil.getLdapGroupManager();
//we need this because the drift plugins are referenced from the system settings that we use in our tests
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.startMasterPluginContainer();
+ testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testServerPluginService);
+ testServerPluginService.startMasterPluginContainer();
// get our Maven properties for LDAP testing
java.net.URL url = LdapGroupManagerBeanTest.class.getClassLoader().getResource("test-ldap.properties");
@@ -150,7 +149,7 @@ public class LdapGroupManagerBeanTest extends AbstractEJB3Test {
@AfterClass
public void tearDown() throws Exception {
unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
+ testServerPluginService.stopMasterPluginContainer();
}
/**
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java
index 5aeed8e..e3f52f5 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJobTest.java
@@ -77,7 +77,6 @@ import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.enterprise.server.drift.DriftServerPluginService;
import org.rhq.enterprise.server.event.EventManagerLocal;
import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
@@ -85,6 +84,7 @@ import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.scheduler.SchedulerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
import org.rhq.enterprise.server.test.TestServerCommunicationsService;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -96,20 +96,20 @@ public class DataPurgeJobTest extends AbstractEJB3Test {
private int agentId;
private int resourceTypeId;
- private DriftServerPluginService driftServerPluginService;
+ private TestServerPluginService testServerPluginService;
@BeforeClass
public void setup() {
//we need this because the drift plugins are referenced from the system settings that we use in our tests
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.startMasterPluginContainer();
+ testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testServerPluginService);
+ testServerPluginService.startMasterPluginContainer();
}
@AfterClass
public void tearDown() throws Exception {
unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
+ testServerPluginService.stopMasterPluginContainer();
}
@BeforeMethod
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java
index 6349bf6..c5a0b2e 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/sync/test/SynchronizationManagerBeanTest.java
@@ -73,7 +73,6 @@ import org.rhq.core.domain.sync.ImportConfiguration;
import org.rhq.core.domain.util.PageControl;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.authz.PermissionException;
-import org.rhq.enterprise.server.drift.DriftServerPluginService;
import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
@@ -83,6 +82,7 @@ import org.rhq.enterprise.server.sync.SynchronizationManagerLocal;
import org.rhq.enterprise.server.sync.SystemSettingsSynchronizer;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -105,7 +105,7 @@ public class SynchronizationManagerBeanTest extends AbstractEJB3Test {
public Properties systemSettings;
public ResourceType fakeType;
public Resource fakePlatform;
- public DriftServerPluginService driftServerPluginService;
+ public TestServerPluginService testServerPluginService;
}
private TestData testData;
@@ -151,9 +151,9 @@ public class SynchronizationManagerBeanTest extends AbstractEJB3Test {
}
//we need this because the drift plugins are referenced from the system settings that we use in our tests
- testData.driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(testData.driftServerPluginService);
- testData.driftServerPluginService.startMasterPluginContainer();
+ testData.testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testData.testServerPluginService);
+ testData.testServerPluginService.startMasterPluginContainer();
synchronizationManager = LookupUtil.getSynchronizationManager();
@@ -191,7 +191,7 @@ public class SynchronizationManagerBeanTest extends AbstractEJB3Test {
}
unprepareServerPluginService();
- testData.driftServerPluginService.stopMasterPluginContainer();
+ testData.testServerPluginService.stopMasterPluginContainer();
export = null;
testData = null;
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java
index 012dde7..8d27267 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/system/SystemManagerBeanTest.java
@@ -30,30 +30,30 @@ import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.composite.SystemSetting;
import org.rhq.core.domain.common.composite.SystemSettings;
import org.rhq.enterprise.server.RHQConstants;
-import org.rhq.enterprise.server.drift.DriftServerPluginService;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.TestServerPluginService;
import org.rhq.enterprise.server.util.LookupUtil;
@Test
public class SystemManagerBeanTest extends AbstractEJB3Test {
private Subject overlord;
private SystemManagerLocal systemManager;
- private DriftServerPluginService driftServerPluginService;
+ private TestServerPluginService testServerPluginService;
@BeforeClass
public void setupServer() {
systemManager = LookupUtil.getSystemManager();
//we need this because the drift plugins are referenced from the system settings that we use in our tests
- driftServerPluginService = new DriftServerPluginService();
- prepareCustomServerPluginService(driftServerPluginService);
- driftServerPluginService.startMasterPluginContainer();
+ testServerPluginService = new TestServerPluginService();
+ prepareCustomServerPluginService(testServerPluginService);
+ testServerPluginService.startMasterPluginContainer();
}
@AfterClass
public void tearDownServer() throws Exception {
unprepareServerPluginService();
- driftServerPluginService.stopMasterPluginContainer();
+ testServerPluginService.stopMasterPluginContainer();
}
@BeforeMethod
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestPluginServiceMBean.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestPluginServiceMBean.java
new file mode 100644
index 0000000..c669b63
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestPluginServiceMBean.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.test;
+
+import org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
+
+public interface TestPluginServiceMBean extends ServerPluginServiceManagement {
+}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestServerPluginService.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestServerPluginService.java
new file mode 100644
index 0000000..87a7655
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/TestServerPluginService.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.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 TestServerPluginService extends ServerPluginService implements TestPluginServiceMBean {
+
+ public TestMasterServerPluginContainer master;
+ public MasterServerPluginContainerConfiguration masterConfig;
+
+ public TestServerPluginService() {
+ // 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;
+ }
+ }
+}
12 years, 6 months
[rhq] Branch 'release_jon3.x' - modules/enterprise
by Jay Shaughnessy
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 ++++------
4 files changed, 147 insertions(+), 100 deletions(-)
New commits:
commit e3f2d0fb110f7bda3e4fbf4f14a6b829f1bcefbb
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);
- }
- */
-
}
12 years, 6 months
[rhq] Branch 'release_jon3.x' - 4 commits - modules/core modules/enterprise modules/plugins
by Jay Shaughnessy
modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 7
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypeRepository.java | 90 +++---
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/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/platform/src/main/resources/META-INF/rhq-plugin.xml | 6
9 files changed, 203 insertions(+), 129 deletions(-)
New commits:
commit c04dcee7d0505b241270534d7ca30a634697f858
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();
commit 4f0914816e9a39b1ae62f9f59881ae3e6ba22a13
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 3c4b754..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
@@ -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 89cb974ef54fd2dcf79a74b6ba466d85c831e657
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 743c094..3c4b754 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 882cb7bedc8cc221a717e5093991a6f48304eaee
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"
12 years, 6 months
[rhq] Branch 'release_jon3.x' - modules/enterprise
by John Sanda
modules/enterprise/server/itests/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit a7351d06f28688f7d1bbbc5850101f9b560b2a11
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 14:04:11 2011 -0400
upping module version
diff --git a/modules/enterprise/server/itests/pom.xml b/modules/enterprise/server/itests/pom.xml
index f512aed..d9d8677 100644
--- a/modules/enterprise/server/itests/pom.xml
+++ b/modules/enterprise/server/itests/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>
12 years, 6 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/itests/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit c4819a31902d353459ac49aa95d45ef9236619cf
Author: John Sanda <jsanda(a)redhat.com>
Date: Tue Nov 1 14:04:11 2011 -0400
upping module version
diff --git a/modules/enterprise/server/itests/pom.xml b/modules/enterprise/server/itests/pom.xml
index f512aed..d9d8677 100644
--- a/modules/enterprise/server/itests/pom.xml
+++ b/modules/enterprise/server/itests/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>
12 years, 6 months
[rhq] Branch 'release_jon3.x' - 4 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/pom.xml | 1
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
36 files changed, 3067 insertions(+), 1813 deletions(-)
New commits:
commit 62bc3e9330af52494db77e43ebbe656b71028d21
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 67c95af..541313b 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>
commit bcd034ffdc3d4883bada50bb801f202acacc4ff3
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 97168e68c88467c33a85f8f5e376c59545edb704
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 08b43b1..a83ff2b 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 424fa3cf665209465d0dd124a292845eaa05fa4a
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 d71e1b5..08b43b1 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