[rhq] Branch 'bug/747925' - 17 commits - modules/cli-tests modules/common modules/core modules/enterprise modules/helpers modules/integration-tests modules/plugins modules/pom.xml modules/test-utils pom.xml release.sh
by mazz
modules/cli-tests/pom.xml | 2
modules/common/ant-bundle/pom.xml | 2
modules/common/drift/pom.xml | 2
modules/common/filetemplate-bundle/pom.xml | 2
modules/common/jboss-as/pom.xml | 2
modules/common/pom.xml | 2
modules/core/client-api/pom.xml | 2
modules/core/comm-api/pom.xml | 2
modules/core/dbutils/pom.xml | 2
modules/core/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-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java | 13
modules/core/plugin-validator/pom.xml | 2
modules/core/pom.xml | 2
modules/core/util/pom.xml | 2
modules/enterprise/agent/pom.xml | 2
modules/enterprise/agentupdate/pom.xml | 2
modules/enterprise/binding/pom.xml | 4
modules/enterprise/comm/pom.xml | 2
modules/enterprise/gui/base-perspective-jar/pom.xml | 2
modules/enterprise/gui/base-perspective-war/pom.xml | 2
modules/enterprise/gui/content_http-war/pom.xml | 2
modules/enterprise/gui/coregui/pom.xml | 2
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java | 16
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java | 17
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 | 32 -
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/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/jeeGen/pom.xml | 2
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/jndi-access/jndi-access-test/pom.xml | 2
modules/integration-tests/jndi-access/pom.xml | 2
modules/integration-tests/jndi-access/remote-server/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-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java | 138 ++++
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java | 129 +---
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java | 8
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java | 36 -
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java | 64 +-
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java | 35 -
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java | 300 ++++------
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java | 194 +++---
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
release.sh | 11
142 files changed, 686 insertions(+), 601 deletions(-)
New commits:
commit ae6302cb5128171a429c7bb440693ec89906af56
Merge: 0828271 94cc420
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Feb 28 11:52:01 2012 -0500
Merge remote-tracking branch 'origin/master' into bug/747925
commit 94cc4206c8525ca9b69469947dc5deab4633a13e
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Feb 27 18:19:28 2012 -0500
fix unit test failures for as7 configuration.
- needed to overload the execute behavior just for these tests.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java
index 1af2f2f..72166d5 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java
@@ -19,6 +19,7 @@
package org.rhq.modules.plugins.jbossas7;
import java.io.BufferedReader;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
@@ -31,6 +32,8 @@ import javax.xml.bind.util.ValidationEventCollector;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.node.ObjectNode;
@@ -42,6 +45,7 @@ import org.rhq.core.clientapi.descriptor.plugin.ServerDescriptor;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.modules.plugins.jbossas7.json.Address;
import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.Result;
/**
* Base class for configuration handling tests
@@ -53,7 +57,6 @@ public class AbstractConfigurationHandlingTest {
private Log log = LogFactory.getLog(getClass());
private PluginDescriptor pluginDescriptor;
-
void loadPluginDescriptor() throws Exception {
try {
URL descriptorUrl = this.getClass().getClassLoader().getResource(DESCRIPTOR_FILENAME);
@@ -102,8 +105,7 @@ public class AbstractConfigurationHandlingTest {
builder.append(line);
}
return builder.toString();
- }
- finally {
+ } finally {
reader.close();
}
}
@@ -114,6 +116,23 @@ public class AbstractConfigurationHandlingTest {
*
*/
protected class FakeConnection extends ASConnection {
+ private ObjectMapper mapper = new ObjectMapper();
+
+ @Override
+ public Result execute(Operation op) {
+ JsonNode json = executeRaw(op);
+ Result result = null;
+ try {
+ result = mapper.readValue(json, Result.class);
+ } catch (JsonParseException e) {
+ e.printStackTrace();
+ } catch (JsonMappingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return result;
+ }
JsonNode content;
@@ -127,11 +146,11 @@ public class AbstractConfigurationHandlingTest {
@Override
public JsonNode executeRaw(Operation operation) {
- if (content==null)
+ if (content == null)
throw new IllegalStateException("Content not yet set");
Address address = operation.getAddress();
- if (address!=null && !address.isEmpty()) {
+ if (address != null && !address.isEmpty()) {
// we need to clone the content and then for the result find the right sub-content to put into result and
// return this one.
@@ -139,17 +158,17 @@ public class AbstractConfigurationHandlingTest {
String[] parts = address.getPath().split("=");
String key = parts[0];
String val = parts[1];
- JsonNode result = content.get("result");
+ JsonNode result = content.get("result");
JsonNode keyNode = result.get(key);
JsonNode valNode = keyNode.get(val);
// clone the original content
ObjectMapper tmpMapper = new ObjectMapper();
JsonNode tmp = tmpMapper.createObjectNode();
- ((ObjectNode)tmp).putAll(((ObjectNode)content));
+ ((ObjectNode) tmp).putAll(((ObjectNode) content));
// replace the result with the sub-content
- ((ObjectNode)tmp).put("result",valNode);
+ ((ObjectNode) tmp).put("result", valNode);
return tmp;
}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
index 8e3704b..db086f6 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
@@ -18,14 +18,10 @@
*/
package org.rhq.modules.plugins.jbossas7;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.testng.annotations.BeforeSuite;
@@ -58,208 +54,172 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
}
public void test1() throws Exception {
- FakeConnection connection = new FakeConnection();
- ConfigurationDefinition definition = new ConfigurationDefinition("foo","Test1");
+ //create a fake connection so that we control the execute behavior
+ FakeConnection connection = new FakeConnection();
+ //create/mock a configuration definition. Remember definition shared between N configurations.
+ ConfigurationDefinition definition = new ConfigurationDefinition("foo", "Test1");
+ //?
definition.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
- definition.put(new PropertyDefinitionSimple("access-log", "Access-Log", false,
- PropertySimpleType.STRING));
- definition.put(new PropertyDefinitionSimple("rewrite", "Rewrite", false,
- PropertySimpleType.BOOLEAN));
- definition.put(new PropertyDefinitionSimple("notThere", "NotThere", false,
- PropertySimpleType.STRING));
- definition.put(new PropertyDefinitionList("alias", "Alias", true, new PropertyDefinitionSimple(
- "alias", "alias", true, PropertySimpleType.STRING)));
+ //Add a few properties that we will be testing/exercising
+ definition.put(new PropertyDefinitionSimple("access-log", "Access-Log", false, PropertySimpleType.STRING));
+ definition.put(new PropertyDefinitionSimple("rewrite", "Rewrite", false, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("notThere", "NotThere", false, PropertySimpleType.STRING));
+ definition.put(new PropertyDefinitionList("alias", "Alias", true, new PropertyDefinitionSimple("alias",
+ "alias", true, PropertySimpleType.STRING)));
-
- String resultString = " {\"outcome\" : \"success\", \"result\" : {\"alias\" : [\"example.com\",\"example2.com\"],"+
- " \"access-log\" : \"my.log\", \"rewrite\" : true}}";
+ //Construct the result string that we would expect back.
+ String resultString = " {\"outcome\" : \"success\", \"result\" : {\"alias\" : [\"example.com\",\"example2.com\"],"
+ + " \"access-log\" : \"my.log\", \"rewrite\" : true}}";
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ //deserialize string to ComplexResult.
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
+
+ //create json tree from result.
JsonNode json = mapper.valueToTree(result);
+ //add the created content to the fake connection so that we set the results to be returned.
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ //We pass in null here so that the fake connection will return the value passed into setContent().
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
- assert config.get("alias")!=null;
+ assert config.get("alias") != null;
assert config.get("alias") instanceof PropertyList;
PropertyList aliases = (PropertyList) config.get("alias");
List<Property> list = aliases.getList();
- assert list.size()==2;
- int count=2;
- for (Property p: list) {
+ assert list.size() == 2;
+ int count = 2;
+ for (Property p : list) {
PropertySimple ps = (PropertySimple) p;
if (ps.getStringValue().equals("example.com"))
count--;
if (ps.getStringValue().equals("example2.com"))
count--;
}
- assert count==0 : "Did not find all needed aliases";
+ assert count == 0 : "Did not find all needed aliases";
Property notThere = config.get("notThere");
- assert notThere !=null;
- assert ((PropertySimple)notThere).getStringValue()==null;
+ assert notThere != null;
+ assert ((PropertySimple) notThere).getStringValue() == null;
PropertySimple property = (PropertySimple) config.get("rewrite");
- assert property!=null;
+ assert property != null;
assert property.getBooleanValue();
property = (PropertySimple) config.get("access-log");
- assert property!=null && property.getStringValue()!=null;
+ assert property != null && property.getStringValue() != null;
assert property.getStringValue().equals("my.log");
}
public void test2() throws Exception {
- String resultString = "{\n" +
- " \"outcome\" : \"success\",\n" +
- " \"result\" : {\n" +
- " \"autoflush\" : true,\n" +
- " \"encoding\" : null,\n" +
- " \"formatter\" : \"%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n\",\n" +
- " \"level\" : \"INFO\",\n" +
- " \"file\" : {\n" +
- " \"path\" : \"server.log\",\n" +
- " \"relative-to\" : \"jboss.server.log.dir\"\n" +
- " },\n" +
- " \"suffix\" : \".yyyy-MM-dd\"\n" +
- " },\n" +
- " \"response-headers\" : null\n" +
- "}";
+ String resultString = "{\n" + " \"outcome\" : \"success\",\n" + " \"result\" : {\n"
+ + " \"autoflush\" : true,\n" + " \"encoding\" : null,\n"
+ + " \"formatter\" : \"%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n\",\n" + " \"level\" : \"INFO\",\n"
+ + " \"file\" : {\n" + " \"path\" : \"server.log\",\n"
+ + " \"relative-to\" : \"jboss.server.log.dir\"\n" + " },\n" + " \"suffix\" : \".yyyy-MM-dd\"\n"
+ + " },\n" + " \"response-headers\" : null\n" + "}";
FakeConnection connection = new FakeConnection();
- ConfigurationDefinition definition = new ConfigurationDefinition("foo","Test1");
+ ConfigurationDefinition definition = new ConfigurationDefinition("foo", "Test1");
PropertyDefinitionSimple propertyDefinition = new PropertyDefinitionSimple("autoflush", "Autoflush", false,
- PropertySimpleType.BOOLEAN);
+ PropertySimpleType.BOOLEAN);
propertyDefinition.setDefaultValue("true");
definition.put(propertyDefinition);
- propertyDefinition = new PropertyDefinitionSimple("encoding", "Encoding", false,
- PropertySimpleType.STRING);
+ propertyDefinition = new PropertyDefinitionSimple("encoding", "Encoding", false, PropertySimpleType.STRING);
propertyDefinition.setDefaultValue("HelloWorld");
definition.put(propertyDefinition);
- PropertyDefinitionSimple pathProperty = new PropertyDefinitionSimple("path","File path",true,PropertySimpleType.STRING);
- PropertyDefinitionSimple relativeToProperty = new PropertyDefinitionSimple("relative-to","Relative-To",true,PropertySimpleType.STRING);
- PropertyDefinitionMap fileMapDef = new PropertyDefinitionMap("file","Log file",true,pathProperty,relativeToProperty);
+ PropertyDefinitionSimple pathProperty = new PropertyDefinitionSimple("path", "File path", true,
+ PropertySimpleType.STRING);
+ PropertyDefinitionSimple relativeToProperty = new PropertyDefinitionSimple("relative-to", "Relative-To", true,
+ PropertySimpleType.STRING);
+ PropertyDefinitionMap fileMapDef = new PropertyDefinitionMap("file", "Log file", true, pathProperty,
+ relativeToProperty);
definition.put(fileMapDef);
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
- assert config!=null;
- assert config.get("autoflush")!=null : "Autoflush was null";
+ assert config != null;
+ assert config.get("autoflush") != null : "Autoflush was null";
assert config.getSimple("autoflush").getBooleanValue() : "Autoflush was false";
PropertyMap fileMap = (PropertyMap) config.get("file");
- assert fileMap!=null : "File Map was null";
+ assert fileMap != null : "File Map was null";
PropertySimple path = (PropertySimple) fileMap.get("path");
- assert path!=null : "File->path was null";
+ assert path != null : "File->path was null";
assert path.getStringValue().equals("server.log") : "File->path wrong";
-
}
-
public void test3() throws Exception {
- String resultString = "{\n" +
- " \"outcome\" : \"success\",\n" +
- " \"result\" : {\n" +
- " \"name\" : \"standard-sockets\",\n" +
- " \"default-interface\" : \"default\",\n" +
- " \"port-offset\" : \"0\",\n" +
- " \"socket-binding\" : {\n" +
- " \"jndi\" : {\n" +
- " \"name\" : \"jndi\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 1099,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : null,\n" +
- " \"multicast-port\" : null\n" +
- " },\n" +
- " \"jmx-connector-registry\" : {\n" +
- " \"name\" : \"jmx-connector-registry\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 1090,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : null,\n" +
- " \"multicast-port\" : null\n" +
- " },\n" +
- " \"jmx-connector-server\" : {\n" +
- " \"name\" : \"jmx-connector-server\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 1091,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : null,\n" +
- " \"multicast-port\" : null\n" +
- " },\n" +
- " \"http\" : {\n" +
- " \"name\" : \"http\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 8080,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : null,\n" +
- " \"multicast-port\" : null\n" +
- " },\n" +
- " \"https\" : {\n" +
- " \"name\" : \"https\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 8447,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : \"224.1.2.3\",\n" +
- " \"multicast-port\" : 18447\n" +
- " }"+
- " }\n" +
- " }\n" +
- "}";
+ String resultString = "{\n" + " \"outcome\" : \"success\",\n" + " \"result\" : {\n"
+ + " \"name\" : \"standard-sockets\",\n" + " \"default-interface\" : \"default\",\n"
+ + " \"port-offset\" : \"0\",\n" + " \"socket-binding\" : {\n" + " \"jndi\" : {\n"
+ + " \"name\" : \"jndi\",\n" + " \"interface\" : null,\n" + " \"port\" : 1099,\n"
+ + " \"fixed-port\" : null,\n" + " \"multicast-address\" : null,\n"
+ + " \"multicast-port\" : null\n" + " },\n" + " \"jmx-connector-registry\" : {\n"
+ + " \"name\" : \"jmx-connector-registry\",\n" + " \"interface\" : null,\n"
+ + " \"port\" : 1090,\n" + " \"fixed-port\" : null,\n"
+ + " \"multicast-address\" : null,\n" + " \"multicast-port\" : null\n" + " },\n"
+ + " \"jmx-connector-server\" : {\n" + " \"name\" : \"jmx-connector-server\",\n"
+ + " \"interface\" : null,\n" + " \"port\" : 1091,\n" + " \"fixed-port\" : null,\n"
+ + " \"multicast-address\" : null,\n" + " \"multicast-port\" : null\n" + " },\n"
+ + " \"http\" : {\n" + " \"name\" : \"http\",\n" + " \"interface\" : null,\n"
+ + " \"port\" : 8080,\n" + " \"fixed-port\" : null,\n"
+ + " \"multicast-address\" : null,\n" + " \"multicast-port\" : null\n" + " },\n"
+ + " \"https\" : {\n" + " \"name\" : \"https\",\n" + " \"interface\" : null,\n"
+ + " \"port\" : 8447,\n" + " \"fixed-port\" : null,\n"
+ + " \"multicast-address\" : \"224.1.2.3\",\n" + " \"multicast-port\" : 18447\n" + " }"
+ + " }\n" + " }\n" + "}";
ConfigurationDefinition definition = loadDescriptor("socketBinding");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
-
assert config != null;
PropertyList propertyList = (PropertyList) config.get("socket-binding");
- assert propertyList!=null;
+ assert propertyList != null;
List<Property> list = propertyList.getList();
- assert list.size()==5;
+ assert list.size() == 5;
for (Property prop : list) {
PropertyMap propMap2 = (PropertyMap) prop;
- Map<String,Property> map2 = propMap2.getMap();
- assert map2.size()==6;
+ Map<String, Property> map2 = propMap2.getMap();
+ assert map2.size() == 6;
assert map2.containsKey("port");
assert map2.containsKey("multicast-port");
assert map2.containsKey("multicast-address");
- if (((PropertySimple)map2.get("name")).getStringValue().equals("https")) {
- assert ((PropertySimple)map2.get("port")).getIntegerValue()==8447;
- assert ((PropertySimple)map2.get("multicast-port")).getIntegerValue()==18447;
+ if (((PropertySimple) map2.get("name")).getStringValue().equals("https")) {
+ assert ((PropertySimple) map2.get("port")).getIntegerValue() == 8447;
+ assert ((PropertySimple) map2.get("multicast-port")).getIntegerValue() == 18447;
}
}
}
-
public void test4() throws Exception {
String resultString = loadJsonFromFile("extensions.json");
@@ -267,31 +227,30 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test4");
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
assert config != null;
PropertyList extensions = (PropertyList) config.get("extension");
- assert extensions !=null;
+ assert extensions != null;
List<Property> extensionList = extensions.getList();
- assert extensionList.size()==22 : "Expected 22 extensions, got " + extensionList.size();
+ assert extensionList.size() == 22 : "Expected 22 extensions, got " + extensionList.size();
PropertyMap propertyMap = (PropertyMap) extensionList.get(0);
assert propertyMap != null;
PropertyMap starMap = (PropertyMap) propertyMap.get("*");
- assert starMap!=null;
+ assert starMap != null;
PropertySimple module = (PropertySimple) starMap.get("module");
- assert module!=null : "Module was null, but should not";
+ assert module != null : "Module was null, but should not";
String stringValue = module.getStringValue();
- assert stringValue!=null : "module property has no value";
+ assert stringValue != null : "module property has no value";
assert stringValue.equals("org.jboss.as.arquillian.service");
-
}
public void test5() throws Exception {
@@ -301,27 +260,27 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test5");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
assert config != null;
PropertyList locations = (PropertyList) config.get("schema-locations");
- assert locations!=null;
+ assert locations != null;
List<Property> list = locations.getList();
- assert list.size()==21 : "List does not contain 21 entries, but " + list.size();
+ assert list.size() == 21 : "List does not contain 21 entries, but " + list.size();
PropertyMap propertyMap = (PropertyMap) list.get(0);
- assert propertyMap !=null;
- Map<String,Property> map = propertyMap.getMap();
- assert map.size()==1;
+ assert propertyMap != null;
+ Map<String, Property> map = propertyMap.getMap();
+ assert map.size() == 1;
PropertySimple urnProp = (PropertySimple) map.get("*");
String stringValue = urnProp.getStringValue();
- assert stringValue!=null : "Location property has no value";
+ assert stringValue != null : "Location property has no value";
assert stringValue.endsWith(".xsd");
}
@@ -333,27 +292,27 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test6and7");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
assert config != null;
PropertySimple nameProperty = (PropertySimple) config.get("name");
- assert nameProperty !=null;
+ assert nameProperty != null;
String stringValue = nameProperty.getStringValue();
- assert stringValue!=null;
+ assert stringValue != null;
assert stringValue.equals("default");
Property criteria = config.get("criteria");
- assert criteria !=null;
+ assert criteria != null;
PropertySimple critProp = (PropertySimple) criteria;
stringValue = critProp.getStringValue();
- assert stringValue!=null;
+ assert stringValue != null;
}
@@ -364,27 +323,27 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test6and7");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
assert config != null;
PropertySimple nameProperty = (PropertySimple) config.get("name");
- assert nameProperty !=null;
+ assert nameProperty != null;
String stringValue = nameProperty.getStringValue();
- assert stringValue!=null;
+ assert stringValue != null;
assert stringValue.equals("public");
Property criteria = config.get("criteria");
- assert criteria !=null;
+ assert criteria != null;
PropertySimple critProp = (PropertySimple) criteria;
stringValue = critProp.getStringValue();
- assert stringValue!=null;
+ assert stringValue != null;
assert stringValue.equals("any-ipv4-address");
}
@@ -396,24 +355,25 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test8");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
- assert config!=null;
- assert config.getAllProperties().size()==8 : "Did not find 8 properties, but " + config.getAllProperties().size();
+ assert config != null;
+ assert config.getAllProperties().size() == 8 : "Did not find 8 properties, but "
+ + config.getAllProperties().size();
Property prop = config.get("bean-validation-enabled");
assert prop != null;
PropertySimple ps = (PropertySimple) prop;
assert ps.getBooleanValue();
prop = config.get("cached-connection-manager-error");
- assert prop!=null;
+ assert prop != null;
ps = (PropertySimple) prop;
- assert ps.getBooleanValue()==false;
+ assert ps.getBooleanValue() == false;
}
@@ -422,45 +382,43 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test9");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
- assert config!=null;
+ assert config != null;
Collection<Property> properties = config.getProperties();
- assert properties.size()==6 : "Got " + properties.size() + " props instead of 6: " + properties.toString();
+ assert properties.size() == 6 : "Got " + properties.size() + " props instead of 6: " + properties.toString();
PropertySimple simple = config.getSimple("check-interval");
- assert simple !=null;
+ assert simple != null;
Integer integerValue = simple.getIntegerValue();
- assert integerValue !=null : "check-interval was null";
- assert integerValue ==17 : "check-interval was not 17 but " + integerValue;
+ assert integerValue != null : "check-interval was null";
+ assert integerValue == 17 : "check-interval was not 17 but " + integerValue;
PropertySimple disabled = config.getSimple("disabled");
- assert disabled !=null : "disabled was null";
+ assert disabled != null : "disabled was null";
Boolean booleanValue = disabled.getBooleanValue();
- assert booleanValue !=null;
+ assert booleanValue != null;
assert booleanValue;
PropertySimple listings = config.getSimple("listings");
- assert listings !=null;
+ assert listings != null;
Boolean booleanValue1 = listings.getBooleanValue();
- assert booleanValue1 !=null;
+ assert booleanValue1 != null;
assert !booleanValue1;
PropertySimple simple1 = config.getSimple("max-depth");
- assert simple1 !=null;
+ assert simple1 != null;
Integer integerValue1 = simple1.getIntegerValue();
- assert integerValue1 !=null;
- assert integerValue1 ==3;
+ assert integerValue1 != null;
+ assert integerValue1 == 3;
PropertySimple simple2 = config.getSimple("default-virtual-server");
- assert simple2 !=null;
+ assert simple2 != null;
String stringValue = simple2.getStringValue();
- assert stringValue !=null;
+ assert stringValue != null;
assert stringValue.equals("default-host");
-
-
}
}
commit 80562eaf03271de823632c9c63439271126b13df
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Feb 27 17:19:23 2012 -0500
Fix copy paste mistake.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 7722312..ef4506c 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -134,7 +134,7 @@ public class ASConnection {
if ((json_to_send.indexOf(JSON_SERVER_CONFIG + EAP_PREFIX) > -1)
|| (json_to_send.indexOf(JSON_SERVER_CONFIG + EDG_PREFIX) > -1)
|| (json_to_send.indexOf(JSON_NAME + EAP_PREFIX) > -1)
- || (json_to_send.indexOf(JSON_NAME + EAP_PREFIX) > -1)) {
+ || (json_to_send.indexOf(JSON_NAME + EDG_PREFIX) > -1)) {
//delve into Operation and remove prefixes
Operation purgedOperation = purgeOperation(operation);
commit 8b2e5871114d8c08545befc8b9486129f82b2d34
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 16:17:07 2012 -0500
adding more context for unparsable json change.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 76a630a..7722312 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -382,6 +382,8 @@ public class ASConnection {
return failure;
}
//spinder 2/22/12: if unparsable JSON detected remove it. TODO: see if fixed with later version of jackson
+ //This needs to be in place until i)Jackson version where this is fixed or
+ // ii) fix for https://issues.jboss.org/browse/JBPAPP-8233
if (as7ResultSerialization.indexOf(UNPARSABLE_JSON) > -1) {
if (verbose) {
log.warn("------ Detected unparsable JSON <" + as7ResultSerialization + ">.");
commit c70a38dd3de2d8d4a1c25634ff3ceb83bd1a36bb
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 15:06:34 2012 -0500
Return failure Result for unexpected errors instead of null.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 00f61d2..76a630a 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -403,7 +403,15 @@ public class ASConnection {
return res;
} catch (IOException e) {
log.error(e.getMessage());
- return null;
+ if (verbose) {
+ log.error("----------- Operation execution unparsable. Request " + ":[" + op + "] Response:<" + node
+ + ">");
+ }
+ Result failure = new Result();
+ failure.setFailureDescription("Operation <" + op + "> returned unparsable JSON, <" + node + ">.");
+ return failure;
+ //don't return null.
+ //return null;
}
}
commit cf0c1af06a5d552413bdd404b320d01bfb5c1635
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 15:03:00 2012 -0500
Modifying connection class to handle 'failure-description' responses from AS7 as we were currently detecting as invalid json.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 812c5ff..00f61d2 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -57,6 +57,7 @@ public class ASConnection {
Authenticator passwordAuthenticator;
private String host;
private int port;
+ private String FAILURE_DESCRIPTION = "\"failure-description\"";
private String UNPARSABLE_JSON = ",\"server-groups\":null";
private static String EAP_PREFIX = AbstractBaseDiscovery.EAP_PREFIX;
private static String EDG_PREFIX = AbstractBaseDiscovery.EDG_PREFIX;
@@ -364,8 +365,22 @@ public class ASConnection {
Result res;
try {
+ //check for failure-description indicator, otherwise ObjectMapper will try to deserialize as json. Ex.
+ // {"outcome":"failed","failure-description":"JBAS014792: Unknown attribute number-of-timed-out-transactions","rolled-back":true}
String as7ResultSerialization = node.toString();
+ if (as7ResultSerialization.indexOf(FAILURE_DESCRIPTION) > -1) {
+ if (verbose) {
+ log.warn("------ Detected 'failure-description' when communicating with server."
+ + as7ResultSerialization);
+ }
+ Result failure = new Result();
+ int failIndex = as7ResultSerialization.indexOf(FAILURE_DESCRIPTION);
+ String failMessage = "";
+ failMessage = as7ResultSerialization.substring(failIndex + FAILURE_DESCRIPTION.length() + 1);
+ failure.setFailureDescription("Operation <" + op + "> returned <" + failMessage + ">");
+ return failure;
+ }
//spinder 2/22/12: if unparsable JSON detected remove it. TODO: see if fixed with later version of jackson
if (as7ResultSerialization.indexOf(UNPARSABLE_JSON) > -1) {
if (verbose) {
commit 1bf2f81404a399f823d3f1bf7b6b8b74144ac7fb
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 14:57:36 2012 -0500
Removing extra JSON segment returned with some results from AS7.
- Jackson libraries confused by extra JSON segment returned even though the returned string is valid JSON.
- We need to check out whether this is still a problem with later jackson versions.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 6249bbc..812c5ff 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -57,6 +57,7 @@ public class ASConnection {
Authenticator passwordAuthenticator;
private String host;
private int port;
+ private String UNPARSABLE_JSON = ",\"server-groups\":null";
private static String EAP_PREFIX = AbstractBaseDiscovery.EAP_PREFIX;
private static String EDG_PREFIX = AbstractBaseDiscovery.EDG_PREFIX;
private static String NAME = "name";
@@ -362,6 +363,23 @@ public class ASConnection {
}
Result res;
try {
+
+ String as7ResultSerialization = node.toString();
+
+ //spinder 2/22/12: if unparsable JSON detected remove it. TODO: see if fixed with later version of jackson
+ if (as7ResultSerialization.indexOf(UNPARSABLE_JSON) > -1) {
+ if (verbose) {
+ log.warn("------ Detected unparsable JSON <" + as7ResultSerialization + ">.");
+ }
+ String trimExtraJson = "";
+ int index = as7ResultSerialization.indexOf(UNPARSABLE_JSON);
+ trimExtraJson = as7ResultSerialization.substring(0, index)
+ + as7ResultSerialization.substring(index + UNPARSABLE_JSON.length());
+ res = (isComplex) ? mapper.readValue(trimExtraJson, ComplexResult.class) : mapper.readValue(
+ trimExtraJson, Result.class);
+ return res;
+ }
+
if (isComplex) {
res = mapper.readValue(node, ComplexResult.class);
} else {
commit 3869977299956619d02c36e0bbd179c50fe97e86
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 14:53:44 2012 -0500
[BZ 785128] unable to remove managed server. Have to remove EAP/EDG
prefixes when carrying out operations on the server now since we're
prepending EAP/EDG depending on EAP server used.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 6a7523f..6249bbc 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -28,6 +28,7 @@ import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
import java.net.URL;
+import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -36,6 +37,7 @@ import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.modules.plugins.jbossas7.json.Address;
import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
import org.rhq.modules.plugins.jbossas7.json.Operation;
import org.rhq.modules.plugins.jbossas7.json.Result;
@@ -55,6 +57,12 @@ public class ASConnection {
Authenticator passwordAuthenticator;
private String host;
private int port;
+ private static String EAP_PREFIX = AbstractBaseDiscovery.EAP_PREFIX;
+ private static String EDG_PREFIX = AbstractBaseDiscovery.EDG_PREFIX;
+ private static String NAME = "name";
+ private static String OPERATION_SERVER_CONFIG = "server-config=";
+ private static String JSON_SERVER_CONFIG = "{\"server-config\":\"";
+ private static String JSON_NAME = "\"name\":\"";
/**
* Construct an ASConnection object. The real "physical" connection is done in
@@ -119,9 +127,26 @@ public class ASConnection {
OutputStream out = conn.getOutputStream();
String json_to_send = mapper.writeValueAsString(operation);
+ //BZ:785128. removing artificial prefix for messages going back to the server.
+ //check for prefixed names
+ if ((json_to_send.indexOf(JSON_SERVER_CONFIG + EAP_PREFIX) > -1)
+ || (json_to_send.indexOf(JSON_SERVER_CONFIG + EDG_PREFIX) > -1)
+ || (json_to_send.indexOf(JSON_NAME + EAP_PREFIX) > -1)
+ || (json_to_send.indexOf(JSON_NAME + EAP_PREFIX) > -1)) {
+
+ //delve into Operation and remove prefixes
+ Operation purgedOperation = purgeOperation(operation);
+ if (verbose) {
+ log.warn("---------------- Purging EAP/EDG prefixes detected. Was <" + operation + "> but now <"
+ + purgedOperation + ">.");
+ }
+ operation = purgedOperation;
+ }
+
if (verbose) {
log.info("Json to send: " + json_to_send);
}
+
mapper.writeValue(out, operation);
out.flush();
@@ -236,6 +261,67 @@ public class ASConnection {
return null;
}
+ /** This operation purges the Operation passed in of EAP/EDG prefixes in the
+ * Address portion and in the AdditionalProperties section. The returned
+ * operation should be identical in every other way and should be used
+ * instead of the unpurged operation which will cause unrecognized property
+ * errors.
+ *
+ * @param operation to be purged.
+ * @return The same operation minus the prefixes.
+ */
+ private Operation purgeOperation(Operation operation) {
+ //purge prefixes from name
+ if (operation != null) {
+ boolean prefixLocated = false;
+
+ //Ex.
+ //Operation{operation='remove', address=Address{path: host=master,server-config=EAP server-six},
+ //additionalProperties={socket-binding-port-offset=0, name=EAP server-six, auto-start=false, group=,
+ //socket-binding-group=}}
+
+ //ADDRESS parsing
+ String path = operation.getAddress().getPath();
+ if (path.indexOf(OPERATION_SERVER_CONFIG + EAP_PREFIX) > -1
+ || path.indexOf(OPERATION_SERVER_CONFIG + EDG_PREFIX) > -1) {
+ int index = -1;
+ prefixLocated = true;
+ if ((index = path.indexOf(OPERATION_SERVER_CONFIG + EAP_PREFIX)) > -1) {
+ path = path.substring(0, index + OPERATION_SERVER_CONFIG.length())
+ + path.substring(index + OPERATION_SERVER_CONFIG.length() + EAP_PREFIX.length());
+ }
+ if ((index = path.indexOf(OPERATION_SERVER_CONFIG + EDG_PREFIX)) > -1) {
+ path = path.substring(0, index + OPERATION_SERVER_CONFIG.length())
+ + path.substring(index + OPERATION_SERVER_CONFIG.length() + EDG_PREFIX.length());
+ }
+ }
+
+ //ADDITIONAL-PROPERTIES parsing
+ Map<String, Object> additionalProperties = operation.getAdditionalProperties();
+ if ((additionalProperties != null) && !additionalProperties.isEmpty()
+ && additionalProperties.containsKey(NAME)) {
+ String contents = (String) additionalProperties.get(NAME);
+ if (contents.startsWith(EAP_PREFIX) || contents.startsWith(EDG_PREFIX)) {
+ prefixLocated = true;
+ if (contents.startsWith(EAP_PREFIX)) {
+ contents = contents.substring(EAP_PREFIX.length());
+ } else if (contents.startsWith(EDG_PREFIX)) {
+ contents = contents.substring(EDG_PREFIX.length());
+ }
+ additionalProperties.put(NAME, contents);
+ }
+ }
+
+ if (prefixLocated) {
+ //create new Operation to return.
+ Operation newOperation = new Operation(operation.getOperation(), new Address(path),
+ additionalProperties);
+ return newOperation;
+ }
+ }
+ return operation;
+ }
+
/**
* Execute the passed Operation and return its Result. This is a shortcut of
* #execute(Operation, false)
@@ -274,12 +360,13 @@ public class ASConnection {
failure.setFailureDescription("Operation [" + op + "] returned null");
return failure;
}
+ Result res;
try {
- Result res;
- if (isComplex)
+ if (isComplex) {
res = mapper.readValue(node, ComplexResult.class);
- else
+ } else {
res = mapper.readValue(node, Result.class);
+ }
return res;
} catch (IOException e) {
log.error(e.getMessage());
commit e3b17d4977e91bda9bf8362817bc68290f557683
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 14:30:06 2012 -0500
Use constants where possible for EAP/EDG identifiers.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
index dca0b8c..54ef7d4 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
@@ -50,6 +50,10 @@ public class AbstractBaseDiscovery {
protected Document hostXml;
protected final Log log = LogFactory.getLog(this.getClass());
private static final String JBOSS_EAP_PREFIX = "jboss-eap-";
+ public static final String EAP = "EAP";
+ public static final String EDG = "EDG";
+ public static final String EAP_PREFIX = EAP + " ";
+ public static final String EDG_PREFIX = EDG + " ";
private XPathFactory factory;
protected AbstractBaseDiscovery() {
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
index a0faeaa..f136483 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
@@ -178,11 +178,11 @@ public class BaseProcessDiscovery extends AbstractBaseDiscovery implements Resou
}
if (isEAP) {
- serverName = "EAP " + serverName;
- version = "EAP " + version;
+ serverName = EAP_PREFIX + serverName;
+ version = EAP_PREFIX + version;
} else if (isEDG) {
- serverName = "EDG " + serverName;
- version = "EDG " + version;
+ serverName = EDG_PREFIX + serverName;
+ version = EDG_PREFIX + version;
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
index 3d937c0..5feaab2 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
@@ -102,12 +102,12 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
String resourceName = serverInfo.name;
- if (hostInfo.productName.equalsIgnoreCase("eap")) {
- version = "EAP " + hostInfo.productVersion;
+ if (hostInfo.productName.equalsIgnoreCase(EAP)) {
+ version = EAP_PREFIX + hostInfo.productVersion;
resourceDescription = "Managed JBoss Enterprise Application Platform 6 server";
- resourceName = "EAP " + resourceName;
- } else if (hostInfo.productName.equalsIgnoreCase("EDG")) {
- version = "EDG " + hostInfo.productVersion;
+ resourceName = EAP_PREFIX + resourceName;
+ } else if (hostInfo.productName.equalsIgnoreCase(EDG)) {
+ version = EDG_PREFIX + hostInfo.productVersion;
resourceDescription = "Managed JBoss Enterprise Data Grid 6 server";
} else {
resourceDescription = "Managed AS7 server";
commit ce4b1a63105f7d67bf94a19445d731ab10bfc52e
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 14:09:03 2012 -0500
- ignore this diff. No functional changes just ide formatting.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
index c464e4b..dca0b8c 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
@@ -41,7 +41,7 @@ import org.rhq.core.system.ProcessInfo;
* in the area of processes and host.xml
* @author Heiko W. Rupp
*/
-public class AbstractBaseDiscovery {
+public class AbstractBaseDiscovery {
static final String DORG_JBOSS_BOOT_LOG_FILE = "-Dorg.jboss.boot.log.file=";
private static final String DJBOSS_SERVER_HOME_DIR = "-Djboss.home.dir";
static final int DEFAULT_MGMT_PORT = 9990;
@@ -52,8 +52,6 @@ public class AbstractBaseDiscovery {
private static final String JBOSS_EAP_PREFIX = "jboss-eap-";
private XPathFactory factory;
-
-
protected AbstractBaseDiscovery() {
synchronized (this) {
factory = XPathFactory.newInstance();
@@ -68,7 +66,7 @@ public class AbstractBaseDiscovery {
* @param isDomainMode Indiates if host.xml should be read (true) or standalone.xml (false)
*/
protected void readStandaloneOrHostXml(ProcessInfo processInfo, boolean isDomainMode) {
- String hostXmlFile = getHostXmlFileLocation(processInfo,isDomainMode);
+ String hostXmlFile = getHostXmlFileLocation(processInfo, isDomainMode);
readStandaloneOrHostXmlFromFile(hostXmlFile);
}
@@ -93,11 +91,11 @@ public class AbstractBaseDiscovery {
* @return The home dir if found or empty string otherwise
*/
String getHomeDirFromCommandLine(String[] commandLine) {
- for (String line: commandLine) {
- if (line.startsWith(DJBOSS_SERVER_HOME_DIR))
- return line.substring(DJBOSS_SERVER_HOME_DIR.length()+1);
- }
- return "";
+ for (String line : commandLine) {
+ if (line.startsWith(DJBOSS_SERVER_HOME_DIR))
+ return line.substring(DJBOSS_SERVER_HOME_DIR.length() + 1);
+ }
+ return "";
}
/**
@@ -107,7 +105,7 @@ public class AbstractBaseDiscovery {
*/
String getLogFileFromCommandLine(String[] commandLine) {
- for (String line: commandLine) {
+ for (String line : commandLine) {
if (line.startsWith(DORG_JBOSS_BOOT_LOG_FILE))
return line.substring(DORG_JBOSS_BOOT_LOG_FILE.length());
}
@@ -121,7 +119,7 @@ public class AbstractBaseDiscovery {
* @param commandLine Command line arguments of the process to
*/
protected HostPort getManagementPortFromHostXml(String[] commandLine) {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
String portString;
@@ -129,35 +127,29 @@ public class AbstractBaseDiscovery {
String socketBindingName;
- socketBindingName = obtainXmlPropertyViaXPath(
- "//management/management-interfaces/http-interface/socket-binding/@http");
- String socketInterface = obtainXmlPropertyViaXPath(
- "//management/management-interfaces/http-interface/socket/@interface");
+ socketBindingName = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/socket-binding/@http");
+ String socketInterface = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/socket/@interface");
if (!socketInterface.isEmpty()) {
- interfaceExpession = obtainXmlPropertyViaXPath(
- "//interfaces/interface[@name='" + socketInterface + "']/inet-address/@value");
- portString = obtainXmlPropertyViaXPath(
- "//management/management-interfaces/http-interface/socket/@port");
- }
- else if (socketBindingName.isEmpty()) {
+ interfaceExpession = obtainXmlPropertyViaXPath("//interfaces/interface[@name='" + socketInterface
+ + "']/inet-address/@value");
+ portString = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/socket/@port");
+ } else if (socketBindingName.isEmpty()) {
// old AS7.0, early 7.1 style
portString = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/@port");
- String interfaceName = obtainXmlPropertyViaXPath(
- "//management/management-interfaces/http-interface/@interface");
- interfaceExpession = obtainXmlPropertyViaXPath(
- "/server/interfaces/interface[@name='" + interfaceName + "']/inet-address/@value");
- }
- else {
+ String interfaceName = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/@interface");
+ interfaceExpession = obtainXmlPropertyViaXPath("/server/interfaces/interface[@name='" + interfaceName
+ + "']/inet-address/@value");
+ } else {
// later AS7.1 and EAP6 standalone.xml
- portString = obtainXmlPropertyViaXPath(
- "/server/socket-binding-group/socket-binding[@name='" + socketBindingName + "']/@port");
- String interfaceName = obtainXmlPropertyViaXPath(
- "/server/socket-binding-group/socket-binding[@name='" + socketBindingName + "']/@interface");
+ portString = obtainXmlPropertyViaXPath("/server/socket-binding-group/socket-binding[@name='"
+ + socketBindingName + "']/@port");
+ String interfaceName = obtainXmlPropertyViaXPath("/server/socket-binding-group/socket-binding[@name='"
+ + socketBindingName + "']/@interface");
// TODO the next may also be expressed differently
- interfaceExpession = obtainXmlPropertyViaXPath(
- "/server/interfaces/interface[@name='" + interfaceName + "']/inet-address/@value");
+ interfaceExpession = obtainXmlPropertyViaXPath("/server/interfaces/interface[@name='" + interfaceName
+ + "']/inet-address/@value");
}
HostPort hp = new HostPort();
@@ -167,17 +159,14 @@ public class AbstractBaseDiscovery {
else
hp.host = "localhost"; // Fallback
-
- if (portString!=null && !portString.isEmpty()) {
- String tmp = replaceDollarExpression(portString,commandLine, "9990");
+ if (portString != null && !portString.isEmpty()) {
+ String tmp = replaceDollarExpression(portString, commandLine, "9990");
hp.port = Integer.valueOf(tmp);
- }
- else
+ } else
hp.port = 9990; // Fallback to default
return hp;
}
-
/**
* Check if the passed value has an expression in the form of ${var} or ${var:default},
* try to resolve it. Resolution is done by looking at the command line to see if
@@ -194,15 +183,14 @@ public class AbstractBaseDiscovery {
return value;
// remove ${ }
- value = value.substring(2,value.length()-1);
+ value = value.substring(2, value.length() - 1);
String fallback = lastResort;
String expression;
if (value.contains(":")) {
int i = value.indexOf(":");
- expression = value.substring(0,i);
- fallback = value.substring(i+1);
- }
- else {
+ expression = value.substring(0, i);
+ fallback = value.substring(i + 1);
+ } else {
expression = value;
}
/*
@@ -214,7 +202,7 @@ public class AbstractBaseDiscovery {
* to find the management addresss
*/
- String ret=null;
+ String ret = null;
for (int i = 0, commandLineLength = commandLine.length; i < commandLineLength; i++) {
String line = commandLine[i];
if (expression.contains("address")) {
@@ -222,7 +210,7 @@ public class AbstractBaseDiscovery {
if (line.contains("="))
ret = line.substring(line.indexOf("=") + 1); // -bmanagement=1.2.3.4
else
- ret = commandLine[i+1]; // -bmanagement 1.2.3.4
+ ret = commandLine[i + 1]; // -bmanagement 1.2.3.4
break;
}
} else if (expression.contains("port")) {
@@ -233,7 +221,7 @@ public class AbstractBaseDiscovery {
}
}
- if (ret==null)
+ if (ret == null)
ret = fallback;
return ret;
@@ -246,7 +234,7 @@ public class AbstractBaseDiscovery {
* @return server name
*/
protected String findHostName() {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
String hostName = hostXml.getDocumentElement().getAttribute("name");
@@ -258,10 +246,9 @@ public class AbstractBaseDiscovery {
* @return host and port of the domain controller
*/
protected HostPort getDomainControllerFromHostXml() {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
-
// first check remote, as we can't distinguish between a missing local element or
// and empty one which is the default
String remoteHost = obtainXmlPropertyViaXPath("/host/domain-controller/remote/@host");
@@ -272,8 +259,7 @@ public class AbstractBaseDiscovery {
hp = new HostPort(false);
hp.host = remoteHost;
hp.port = Integer.parseInt(portString);
- }
- else {
+ } else {
hp = new HostPort(true);
hp.port = 9999;
}
@@ -283,7 +269,7 @@ public class AbstractBaseDiscovery {
}
String getManagementSecurtiyRealmFromHostXml() {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
String realm = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/@security-realm");
@@ -292,21 +278,24 @@ public class AbstractBaseDiscovery {
}
String getSecurityPropertyFileFromHostXml(String baseDir, AS7Mode mode, String realm) {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
- String fileName = obtainXmlPropertyViaXPath("//security-realms/security-realm[@name='" + realm + "']/authentication/properties/@path");
- String relDir = obtainXmlPropertyViaXPath("//security-realms/security-realm[@name='" + realm + "']/authentication/properties/@relative-to");
+ String fileName = obtainXmlPropertyViaXPath("//security-realms/security-realm[@name='" + realm
+ + "']/authentication/properties/@path");
+ String relDir = obtainXmlPropertyViaXPath("//security-realms/security-realm[@name='" + realm
+ + "']/authentication/properties/@relative-to");
String dmode;
- if (mode==AS7Mode.STANDALONE)
- dmode="server";
+ if (mode == AS7Mode.STANDALONE)
+ dmode = "server";
else
- dmode="domain";
+ dmode = "domain";
- String fullName ;
+ String fullName;
if (relDir.equals("jboss." + dmode + ".config.dir"))
- fullName = baseDir + File.separator + mode.getBaseDir() + File.separator + "configuration" + File.separator + fileName;
+ fullName = baseDir + File.separator + mode.getBaseDir() + File.separator + "configuration" + File.separator
+ + fileName;
else
fullName = relDir + File.separator + fileName;
@@ -323,7 +312,7 @@ public class AbstractBaseDiscovery {
protected String getHostXmlFileLocation(ProcessInfo processInfo, boolean isDomain) {
String home = processInfo.getEnvironmentVariable("jboss.home.dir");
- if (home==null)
+ if (home == null)
home = getHomeDirFromCommandLine(processInfo.getCommandLine());
StringBuilder builder = new StringBuilder(home);
if (isDomain)
@@ -341,7 +330,7 @@ public class AbstractBaseDiscovery {
protected String determineServerVersionFromHomeDir(String homeDir) {
String version;
- String tmp = homeDir.substring(homeDir.lastIndexOf("/")+1);
+ String tmp = homeDir.substring(homeDir.lastIndexOf("/") + 1);
if (tmp.startsWith(JBOSS_AS_PREFIX)) {
version = tmp.substring(JBOSS_AS_PREFIX.length());
} else if (tmp.startsWith(JBOSS_EAP_PREFIX)) {
@@ -362,10 +351,9 @@ public class AbstractBaseDiscovery {
*
*/
protected String obtainXmlPropertyViaXPath(String xpathExpression) {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
-
XPath xpath = factory.newXPath();
try {
XPathExpression expr = xpath.compile(xpathExpression);
@@ -379,7 +367,6 @@ public class AbstractBaseDiscovery {
}
}
-
/**
* Helper class that holds information about the host,port tuple
*/
@@ -401,11 +388,7 @@ public class AbstractBaseDiscovery {
@Override
public String toString() {
- return "HostPort{" +
- "host='" + host + '\'' +
- ", port=" + port +
- ", isLocal=" + isLocal +
- '}';
+ return "HostPort{" + "host='" + host + '\'' + ", port=" + port + ", isLocal=" + isLocal + '}';
}
}
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
index b46b108..6212650 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
@@ -44,8 +44,8 @@ public class HostControllerComponent extends BaseServerComponent implements Oper
}
@Override
- public OperationResult invokeOperation(String name,
- Configuration parameters) throws InterruptedException, Exception {
+ public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
+ Exception {
if (name.equals("start")) {
return startServer(AS7Mode.DOMAIN);
@@ -54,58 +54,55 @@ public class HostControllerComponent extends BaseServerComponent implements Oper
} else if (name.equals("shutdown")) {
// This is a bit trickier, as it needs to be executed on the level on /host=xx
- String domainHost = pluginConfiguration.getSimpleValue("domainHost","");
+ String domainHost = pluginConfiguration.getSimpleValue("domainHost", "");
if (domainHost.isEmpty()) {
OperationResult result = new OperationResult();
result.setErrorMessage("No domain host found - can not continue");
return result;
}
- Operation op = new Operation("shutdown","host",domainHost);
+ Operation op = new Operation("shutdown", "host", domainHost);
Result res = getASConnection().execute(op);
- return postProcessResult(name,res);
- }
- else if (name.equals("installRhqUser")) {
+ return postProcessResult(name, res);
+ } else if (name.equals("installRhqUser")) {
return installManagementUser(parameters, pluginConfiguration, AS7Mode.HOST);
}
-
// Defer other stuff to the base component for now
return super.invokeOperation(name, parameters);
}
-
@Override
public CreateResourceReport createResource(CreateResourceReport report) {
// If Content is to be deployed, call the deployContent method
- if (report.getPackageDetails()!=null)
+ if (report.getPackageDetails() != null)
return super.deployContent(report);
// TODO check for types of children -- this is server group only at the moment.
String name = report.getUserSpecifiedResourceName();
Address address = new Address(path);
- address.add("server-group",name);
- Operation op = new Operation("add",address);
+ address.add("server-group", name);
+ Operation op = new Operation("add", address);
Configuration rc = report.getResourceConfiguration();
- String profile = rc.getSimpleValue("profile","");
+ String profile = rc.getSimpleValue("profile", "");
if (profile.isEmpty()) {
report.setErrorMessage("No profile given");
report.setStatus(CreateResourceStatus.FAILURE);
return report;
}
- op.addAdditionalProperty("profile",profile);
- String socketBindingGroup = rc.getSimpleValue("socket-binding-group","");
+ op.addAdditionalProperty("profile", profile);
+ String socketBindingGroup = rc.getSimpleValue("socket-binding-group", "");
if (socketBindingGroup.isEmpty()) {
report.setErrorMessage("No socket-binding-group given");
report.setStatus(CreateResourceStatus.FAILURE);
return report;
}
- op.addAdditionalProperty("socket-binding-group",socketBindingGroup);
+ op.addAdditionalProperty("socket-binding-group", socketBindingGroup);
PropertySimple offset = rc.getSimple("socket-binding-port-offset");
- if (offset!=null && offset.getStringValue()!=null)
- op.addAdditionalProperty("socket-binding-port-offset",offset.getIntegerValue());
+ if (offset != null && offset.getStringValue() != null)
+ op.addAdditionalProperty("socket-binding-port-offset", offset.getIntegerValue());
// TODO add jvm info
Result res = getASConnection().execute(op);
@@ -113,8 +110,7 @@ public class HostControllerComponent extends BaseServerComponent implements Oper
report.setResourceKey(address.getPath());
report.setResourceName(name);
report.setStatus(CreateResourceStatus.SUCCESS);
- }
- else {
+ } else {
report.setErrorMessage(res.getFailureDescription());
report.setStatus(CreateResourceStatus.FAILURE);
report.setException(res.getRhqThrowable());
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
index 5890ca2..3d937c0 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
@@ -31,7 +31,6 @@ import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ProcessScanResult;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.modules.plugins.jbossas7.json.Address;
@@ -64,10 +63,9 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
String hostName = hcConfig.getSimpleValue("domainHost", "master"); // TODO good default?
HostInfo hostInfo = getHostInfo(hostName);
- if (hostInfo==null)
+ if (hostInfo == null)
return discoveredResources;
-
try {
// get the HostController, as this is an indicator for managed AS
@@ -85,7 +83,7 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
config.put(new PropertySimple("socket-binding-group", serverInfo.bindingGroup));
} else {
String group = resolveSocketBindingGroup(serverInfo.group);
- config.put(new PropertySimple("socket-binding-group",group));
+ config.put(new PropertySimple("socket-binding-group", group));
}
config.put(new PropertySimple("socket-binding-port-offset", serverInfo.portOffset));
@@ -95,8 +93,9 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
// get from the domain or other place as soon as the domain provides it.
//XXX hardcoded separators?
- String serverLog = hcConfig.getSimpleValue("baseDir","/tmp")+File.separator+"domain/servers/"+serverInfo.name+"/log/server.log";
- initLogEventSourcesConfigProp(serverLog,config);
+ String serverLog = hcConfig.getSimpleValue("baseDir", "/tmp") + File.separator + "domain/servers/"
+ + serverInfo.name + "/log/server.log";
+ initLogEventSourcesConfigProp(serverLog, config);
String version;
String resourceDescription;
@@ -107,43 +106,42 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
version = "EAP " + hostInfo.productVersion;
resourceDescription = "Managed JBoss Enterprise Application Platform 6 server";
resourceName = "EAP " + resourceName;
- }
- else if (hostInfo.productName.equalsIgnoreCase("EDG")) {
+ } else if (hostInfo.productName.equalsIgnoreCase("EDG")) {
version = "EDG " + hostInfo.productVersion;
resourceDescription = "Managed JBoss Enterprise Data Grid 6 server";
- }
- else {
+ } else {
resourceDescription = "Managed AS7 server";
version = hostInfo.releaseVersion;
}
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(discoveryContext.getResourceType(), // ResourceType
- hostName + "/" + serverInfo.name, // key
- resourceName, // Name
- version, // TODO get from Domain as soon as it is provided
- resourceDescription, // Description
- config, null);
+ hostName + "/" + serverInfo.name, // key
+ resourceName, // Name
+ version, // TODO get from Domain as soon as it is provided
+ resourceDescription, // Description
+ config, null);
// Add to return values
discoveredResources.add(detail);
log.info("Discovered new ... " + discoveryContext.getResourceType() + ", " + serverInfo);
}
} catch (Exception e) {
- log.warn("Discovery for a " + discoveryContext.getResourceType() + " failed for process " + " :" + e.getMessage());
+ log.warn("Discovery for a " + discoveryContext.getResourceType() + " failed for process " + " :"
+ + e.getMessage());
}
return discoveredResources;
}
private String resolveSocketBindingGroup(String serverGroup) {
- Address address = new Address("server-group",serverGroup);
- Operation operation = new ReadAttribute(address,"socket-binding-group");
+ Address address = new Address("server-group", serverGroup);
+ Operation operation = new ReadAttribute(address, "socket-binding-group");
Result result = parentComponent.getASConnection().execute(operation);
return (String) result.getResult();
}
private List<ServerInfo> getManagedServers(String domainHost) {
- Address address = new Address("host",domainHost);
- Operation operation = new ReadChildrenNames(address,"server-config");
+ Address address = new Address("host", domainHost);
+ Operation operation = new ReadChildrenNames(address, "server-config");
ASConnection connection = parentComponent.getASConnection();
Result res = connection.execute(operation);
List<String> servers = (List<String>) res.getResult();
@@ -153,15 +151,15 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
info.name = server;
ret.add(info);
- address= new Address("host",domainHost);
- address.add("server-config",server);
+ address = new Address("host", domainHost);
+ address.add("server-config", server);
operation = new ReadResource(address);
ComplexResult cres = connection.executeComplex(operation);
- Map<String,Object> map = cres.getResult();
+ Map<String, Object> map = cres.getResult();
info.group = (String) map.get("group");
- info.autoStart = (Boolean)map.get("auto-start");
+ info.autoStart = (Boolean) map.get("auto-start");
Integer offset = (Integer) map.get("socket-binding-port-offset");
- if (offset!=null)
+ if (offset != null)
info.portOffset = offset;
info.bindingGroup = (String) map.get("socket-binding-group");
}
@@ -170,7 +168,7 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
}
private HostInfo getHostInfo(String domainHost) {
- Address address = new Address("host",domainHost);
+ Address address = new Address("host", domainHost);
Operation operation = new ReadResource(address);
HostInfo info = new HostInfo();
@@ -178,11 +176,11 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
if (!cres.isSuccess())
return null;
- Map<String,Object> map = cres.getResult();
+ Map<String, Object> map = cres.getResult();
info.releaseCodeName = (String) map.get("release-codename");
- info.releaseVersion = (String)map.get("release-version");
+ info.releaseVersion = (String) map.get("release-version");
info.productName = (String) map.get("product-name");
- info.productVersion = (String)map.get("product-version");
+ info.productVersion = (String) map.get("product-version");
return info;
}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
index 2dcd49f..aefd5ee 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
@@ -18,21 +18,18 @@
*/
package org.rhq.modules.plugins.jbossas7;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.annotate.JsonAnyGetter;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.testng.annotations.Test;
import org.rhq.modules.plugins.jbossas7.json.Address;
import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
-import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
import org.rhq.modules.plugins.jbossas7.json.Result;
import org.rhq.modules.plugins.jbossas7.json.WriteAttribute;
@@ -42,28 +39,26 @@ import org.rhq.modules.plugins.jbossas7.json.WriteAttribute;
@Test
public class OperationJsonTest {
+ public void operationSerDeserTest() throws Exception {
- public void operationSerDeserTest() throws Exception{
-
- Address address= new Address();
- address.add("subsystem","web");
- address.add("connector","http");
-
- Operation operation = new WriteAttribute(address,"socket-binding","jndi");
+ Address address = new Address();
+ address.add("subsystem", "web");
+ address.add("connector", "http");
+ Operation operation = new WriteAttribute(address, "socket-binding", "jndi");
ObjectMapper mapper = new ObjectMapper();
String result = mapper.writeValueAsString(operation);
- Operation op = mapper.readValue(result,Operation.class);
- assert op!=null;
- assert op.getOperation()!=null : "op.operation was null!";
+ Operation op = mapper.readValue(result, Operation.class);
+ assert op != null;
+ assert op.getOperation() != null : "op.operation was null!";
assert op.getOperation().equals(operation.getOperation()) : "Operation is " + op.getOperation();
- assert op.getName()!=null : "op.getName is null";
- assert op.getName().equals("socket-binding") : "attribute name is " + op.getName() + " and not 'socket-binding'";
+ assert op.getName() != null : "op.getName is null";
+ assert op.getName().equals("socket-binding") : "attribute name is " + op.getName()
+ + " and not 'socket-binding'";
assert op.getValue().equals("jndi") : "attribute value is " + op.getValue();
- assert op.getAddress().size()==2 : "Address did not contain 2 parts, but " + op.getAddress().size();
-
+ assert op.getAddress().size() == 2 : "Address did not contain 2 parts, but " + op.getAddress().size();
}
@@ -72,23 +67,23 @@ public class OperationJsonTest {
String json = "{\"myKey\":\"myValue\"}";
ObjectMapper mapper = new ObjectMapper();
- PROPERTY_VALUE pv = mapper.readValue(json,PROPERTY_VALUE.class);
+ PROPERTY_VALUE pv = mapper.readValue(json, PROPERTY_VALUE.class);
assert pv.getKey().equals("myKey") : "Key is " + pv.getKey();
- assert pv.getValue().equals("myValue"): "Value is " + pv.getValue();
+ assert pv.getValue().equals("myValue") : "Value is " + pv.getValue();
}
public void anyPayloadTest() throws Exception {
- Address address= new Address();
- address.add("/server-group","newOne");
+ Address address = new Address();
+ address.add("/server-group", "newOne");
- Map<String,Object> props = new HashMap<String, Object>();
- props.put("profile","default");
- props.put("someBool",true);
+ Map<String, Object> props = new HashMap<String, Object>();
+ props.put("profile", "default");
+ props.put("someBool", true);
- Operation operation = new Operation("add",address,props);
- operation.addAdditionalProperty("foo","bar");
+ Operation operation = new Operation("add", address, props);
+ operation.addAdditionalProperty("foo", "bar");
ObjectMapper mapper = new ObjectMapper();
@@ -98,7 +93,7 @@ public class OperationJsonTest {
assert !result.contains("name") : "Result contains a name property but should not : " + result;
assert !result.contains("null") : "Result contains null values but should not : " + result;
- Operation op = mapper.readValue(result,Operation.class);
+ Operation op = mapper.readValue(result, Operation.class);
assert op.getOperation().equals(operation.getOperation()) : "Operation is " + op.getOperation();
assert op.getAdditionalProperties().containsKey("someBool") : "Key someBool not found ";
Object someBool = op.getAdditionalProperties().get("someBool");
@@ -107,11 +102,11 @@ public class OperationJsonTest {
}
public void addPropsTest() throws Exception {
- Address address= new Address();
- address.add("/server-group","newOne");
+ Address address = new Address();
+ address.add("/server-group", "newOne");
- Operation operation = new Operation("add",address);
- operation.addAdditionalProperty("foo","bar");
+ Operation operation = new Operation("add", address);
+ operation.addAdditionalProperty("foo", "bar");
ObjectMapper mapper = new ObjectMapper();
@@ -125,7 +120,7 @@ public class OperationJsonTest {
String resultString = "{\"outcome\" : \"success\", \"result\" : \"no metrics available\"}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("success");
@@ -137,18 +132,19 @@ public class OperationJsonTest {
String resultString = "{\"outcome\" : \"success\", \"result\" : \"DISABLED\"}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("success");
assert result.isSuccess();
}
+
public void simpleResultWithFailure() throws Exception {
String resultString = "{\"outcome\" : \"failed\", \"failure-description\" : [{ \"java.util.NoSuchElementException\" : \"No child 'profile' exists\" }]}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("failed");
@@ -156,7 +152,7 @@ public class OperationJsonTest {
assert result.getResult() == null;
assert result.getFailureDescription() != null;
-// assert result.getFailureDescription().size() == 1;
+ // assert result.getFailureDescription().size() == 1;
}
public void complexResult1() throws Exception {
@@ -164,18 +160,18 @@ public class OperationJsonTest {
String resultString = " {\"outcome\" : \"success\", \"result\" : {\"alias\" : [\"example.com\"], \"access-log\" : null, \"rewrite\" : null}}";
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
assert result != null;
assert result.getOutcome().equals("success");
assert result.isSuccess();
- assert result.getResult().size()==3;
+ assert result.getResult().size() == 3;
String rewrite = (String) result.getResult().get("rewrite");
assert rewrite == null;
List<String> aliases = (List<String>) result.getResult().get("alias");
assert aliases != null;
- assert aliases.size()==1;
+ assert aliases.size() == 1;
assert aliases.get(0).equals("example.com");
}
@@ -184,13 +180,13 @@ public class OperationJsonTest {
String resultString = "{\"outcome\":\"success\",\"result\":[\"standard-sockets\",\"messaging-sockets\"],\"response-headers\":null, \"rolled-back\" : false}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("success");
assert result.isSuccess();
List<String> stringList = (List<String>) result.getResult();
- assert stringList.size()==2;
+ assert stringList.size() == 2;
assert stringList.get(0).equals("standard-sockets");
assert stringList.get(1).equals("messaging-sockets");
assert !result.isRolledBack();
@@ -202,7 +198,7 @@ public class OperationJsonTest {
String resultString = "{\"outcome\":\"failed\", \"rolled-back\" : true}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("failed");
@@ -211,77 +207,69 @@ public class OperationJsonTest {
}
-
public void complexResult2() throws Exception {
-
- String resultString =
- "{\n" +
- " \"outcome\" : \"failed\",\n" +
- " \"result\" : {\n" +
- " \"server-groups\" : {\n" +
- " \"main-server-group\" : {\n" +
- " \"server-one\" : {\n" +
- " \"host\" : \"local\",\n" +
- " \"response\" : {\n" +
- " \"outcome\" : \"success\",\n" +
- " \"result\" : null,\n" +
- " \"compensating-operation\" : {\n" +
- " \"operation\" : \"add\",\n" +
- " \"address\" : [ {\n" +
- " \"subsystem\" : \"jms\"\n" +
- " }, {\n" +
- " \"queue\" : \"flubbr\"\n" +
- " } ],\n" +
- " \"durable\" : \"true\",\n" +
- " \"entries\" : [ \"PropertySimple[id=0, name=entries, value=flubbr, override=null]\" ]\n" +
- " }\n" +
- " }\n" +
- " },\n" +
- " \"server-two\" : {\n" +
- " \"host\" : \"local\",\n" +
- " \"response\" : {\n" +
- " \"outcome\" : \"success\",\n" +
- " \"result\" : null,\n" +
- " \"compensating-operation\" : {\n" +
- " \"operation\" : \"add\",\n" +
- " \"address\" : [ {\n" +
- " \"subsystem\" : \"jms\"\n" +
- " }, {\n" +
- " \"queue\" : \"flubbr\"\n" +
- " } ],\n" +
- " \"durable\" : \"true\",\n" +
- " \"entries\" : [ \"PropertySimple[id=0, name=entries, value=flubbr, override=null]\" ]\n" +
- " }\n" +
- " }\n" +
- " },\n" +
- " \"server-demo\" : {\n" +
- " \"host\" : \"local\",\n" +
- " \"response\" : {\n" +
- " \"outcome\" : \"failed\",\n" +
- " \"failure-description\" : \"No handler for add at address [\\n (\\\"host\\\" => \\\"local\\\"),\\n (\\\"server\\\" => \\\"server-demo\\\"),\\n (\\\"subsystem\\\" => \\\"jms\\\"),\\n (\\\"queue\\\" => \\\"flubbr\\\")\\n]\"\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " },\n" +
- " \"failure-description\" : \"Operation was not applied successfully to any servers\"\n" +
- "}";
+ String resultString = "{\n"
+ + " \"outcome\" : \"failed\",\n"
+ + " \"result\" : {\n"
+ + " \"server-groups\" : {\n"
+ + " \"main-server-group\" : {\n"
+ + " \"server-one\" : {\n"
+ + " \"host\" : \"local\",\n"
+ + " \"response\" : {\n"
+ + " \"outcome\" : \"success\",\n"
+ + " \"result\" : null,\n"
+ + " \"compensating-operation\" : {\n"
+ + " \"operation\" : \"add\",\n"
+ + " \"address\" : [ {\n"
+ + " \"subsystem\" : \"jms\"\n"
+ + " }, {\n"
+ + " \"queue\" : \"flubbr\"\n"
+ + " } ],\n"
+ + " \"durable\" : \"true\",\n"
+ + " \"entries\" : [ \"PropertySimple[id=0, name=entries, value=flubbr, override=null]\" ]\n"
+ + " }\n"
+ + " }\n"
+ + " },\n"
+ + " \"server-two\" : {\n"
+ + " \"host\" : \"local\",\n"
+ + " \"response\" : {\n"
+ + " \"outcome\" : \"success\",\n"
+ + " \"result\" : null,\n"
+ + " \"compensating-operation\" : {\n"
+ + " \"operation\" : \"add\",\n"
+ + " \"address\" : [ {\n"
+ + " \"subsystem\" : \"jms\"\n"
+ + " }, {\n"
+ + " \"queue\" : \"flubbr\"\n"
+ + " } ],\n"
+ + " \"durable\" : \"true\",\n"
+ + " \"entries\" : [ \"PropertySimple[id=0, name=entries, value=flubbr, override=null]\" ]\n"
+ + " }\n"
+ + " }\n"
+ + " },\n"
+ + " \"server-demo\" : {\n"
+ + " \"host\" : \"local\",\n"
+ + " \"response\" : {\n"
+ + " \"outcome\" : \"failed\",\n"
+ + " \"failure-description\" : \"No handler for add at address [\\n (\\\"host\\\" => \\\"local\\\"),\\n (\\\"server\\\" => \\\"server-demo\\\"),\\n (\\\"subsystem\\\" => \\\"jms\\\"),\\n (\\\"queue\\\" => \\\"flubbr\\\")\\n]\"\n"
+ + " }\n" + " }\n" + " }\n" + " }\n" + " },\n"
+ + " \"failure-description\" : \"Operation was not applied successfully to any servers\"\n" + "}";
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
assert !result.isSuccess() : "Result should be 'failed', but was not";
assert result.getFailureDescription().startsWith("Operation was not applied successfully to any servers");
assert result.getResult().containsKey("server-groups");
- Map<String,Object> sgs = (Map<String, Object>) result.getResult().get("server-groups");
+ Map<String, Object> sgs = (Map<String, Object>) result.getResult().get("server-groups");
assert sgs.containsKey("main-server-group");
- Map<String,Object> mainSg = (Map<String, Object>) sgs.get("main-server-group");
- assert mainSg.size()==3 : "Main server group does not have 3 servers, but " + mainSg.size();
- Map<String,Object> s3 = (Map<String, Object>) mainSg.get("server-demo");
- Map<String,Object> response = (Map<String, Object>) s3.get("response");
- assert response!=null;
+ Map<String, Object> mainSg = (Map<String, Object>) sgs.get("main-server-group");
+ assert mainSg.size() == 3 : "Main server group does not have 3 servers, but " + mainSg.size();
+ Map<String, Object> s3 = (Map<String, Object>) mainSg.get("server-demo");
+ Map<String, Object> response = (Map<String, Object>) s3.get("response");
+ assert response != null;
}
commit 1fbdb715bd02b7cd03581165dba66cc998264e8d
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Feb 27 16:47:01 2012 -0500
Fixing test to look for correct file name
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 5fa92b9..3b77daf 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
@@ -19,23 +19,7 @@
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;
@@ -49,6 +33,20 @@ 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;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.NonUniqueResultException;
+import java.io.File;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import static org.rhq.core.domain.resource.ResourceCategory.SERVER;
+import static org.rhq.enterprise.server.util.LookupUtil.getSubjectManager;
@Test(groups = "drift")
public class DriftServerTest extends AbstractEJB3Test {
@@ -87,7 +85,7 @@ public class DriftServerTest extends AbstractEJB3Test {
prepareCustomServerPluginService(driftServerPluginService);
driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
- File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.3.0-SNAPSHOT.jar");
+ File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.4.0-SNAPSHOT.jar");
assertTrue("Drift server plugin JAR file not found at" + jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
FileUtils.copyFileToDirectory(jpaDriftPlugin, driftServerPluginService.masterConfig.getPluginDirectory());
commit 2d5d9b00387a7761487ae6a5ca63fbf2e7ca732b
Author: John Sanda <jsanda(a)localhost.localdomain>
Date: Mon Feb 27 16:38:52 2012 -0500
[BZ 751752] Do not allow grouping by edit column
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java
index 3e33022..a3ca599 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java
@@ -18,10 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.templates;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EnumSet;
-
import com.smartgwt.client.data.Record;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ListGridFieldType;
@@ -39,7 +35,6 @@ import com.smartgwt.client.widgets.layout.SectionStackSection;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeGridField;
import com.smartgwt.client.widgets.tree.TreeNode;
-
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
@@ -50,11 +45,11 @@ import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.components.TitleBar;
import org.rhq.enterprise.gui.coregui.client.components.buttons.BackButton;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableSectionStack;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTreeGrid;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.EnumSet;
/**
* A tree view of all known ResourceTypes, which includes summaries of metric schedule and alert definition templates
@@ -215,6 +210,7 @@ public abstract class ResourceTypeTreeView extends LocatableVLayout implements B
.common_title_edit());
editField.setType(ListGridFieldType.IMAGE);
editField.setAlign(Alignment.CENTER);
+ editField.setCanGroupBy(false);
editField.addRecordClickHandler(new RecordClickHandler() {
public void onRecordClick(RecordClickEvent event) {
commit 5b2151eeda854460260df8a4e195fb34167c9edc
Author: John Sanda <jsanda(a)localhost.localdomain>
Date: Mon Feb 27 14:52:15 2012 -0500
[BZ 749801] Add a dummy value to allow user to undo selections
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
index d064680..6724d54 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/type/ResourceTypePluginTreeDataSource.java
@@ -18,11 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client.inventory.resource.type;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.DSResponse;
@@ -31,7 +26,6 @@ import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.types.DSDataFormat;
import com.smartgwt.client.types.DSProtocol;
import com.smartgwt.client.widgets.tree.TreeNode;
-
import org.rhq.core.domain.criteria.ResourceTypeCriteria;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
@@ -42,6 +36,11 @@ import org.rhq.enterprise.gui.coregui.client.Messages;
import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.ResourceTypeGWTServiceAsync;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+
/**
* @author Greg Hinkle
*/
@@ -94,7 +93,6 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
if (parentIdString != null) {
processResponse(request.getRequestId(), response);
} else {
-
ResourceTypeCriteria criteria = new ResourceTypeCriteria();
criteria.fetchParentResourceTypes(true);
criteria.setPageControl(PageControl.getUnlimitedInstance());
@@ -117,6 +115,11 @@ public class ResourceTypePluginTreeDataSource extends DataSource {
HashMap<String, PluginTreeNode> pluginNodes = new HashMap<String, PluginTreeNode>();
ArrayList<TreeNode> nodes = new ArrayList<TreeNode>();
+ // Add a dummy node so that if the user selects a plugin or resource type, he has
+ // the ability to undo the selection. This data source is used with a IPickTreeItem
+ // and that widget does not allow you to select the initial value once the user
+ // selects a value. See https://bugzilla.redhat.com/show_bug.cgi?id=749801.
+ nodes.add(new TreeNode(""));
for (ResourceType type : result) {
if (type.getParentResourceTypes() == null || type.getParentResourceTypes().isEmpty()) {
commit ed441c30282dbb9a48feadb8f338cf41babe2903
Merge: 4daf768 aab1084
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Feb 27 14:44:09 2012 -0500
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq
commit 4daf76814cf38969fb1873938b78a43d3119aaf6
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Feb 27 14:43:57 2012 -0500
[BZ 790152] remove e.printStackTrace - log it instead
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java
index b339190..a5f1838 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/content/RetrieveContentBitsRunner.java
@@ -24,6 +24,9 @@ package org.rhq.core.pc.content;
import java.io.InputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.clientapi.server.content.ContentServerService;
import org.rhq.core.clientapi.server.content.ContentServiceResponse;
import org.rhq.core.clientapi.server.content.RetrievePackageBitsRequest;
@@ -37,6 +40,8 @@ import org.rhq.core.util.MessageDigestGenerator;
* @author Jason Dobies
*/
public class RetrieveContentBitsRunner implements Runnable {
+ private final Log log = LogFactory.getLog(RetrieveContentBitsRunner.class);
+
// Attributes --------------------------------------------
private ContentManager contentManager;
@@ -93,7 +98,8 @@ public class RetrieveContentBitsRunner implements Runnable {
is.close();
}
} catch (Exception e) {
- e.printStackTrace();
+ log.warn("Error calculating SHA256 [" + request.getRequestId() + "][" + request.getPackageDetails()
+ + "]", e);
}
}
if ((pkgDetails != null) && ((pkgDetails.getMD5() == null) || (pkgDetails.getMD5().trim().length() == 0))) {
@@ -106,8 +112,9 @@ public class RetrieveContentBitsRunner implements Runnable {
is.close();
}
} catch (Exception e) {
- e.printStackTrace();
+ log.warn("Error calculating MD5 [" + request.getRequestId() + "][" + request.getPackageDetails()
+ + "]", e);
}
}
}
-}
\ No newline at end of file
+}
commit aab108463187d95c26ca45fac8ce5eb7bda59af5
Author: Hudson <jboss-qa-internal(a)redhat.com>
Date: Mon Feb 27 13:46:11 2012 -0500
development RHQ_4.4.0-SNAPSHOT
diff --git a/modules/cli-tests/pom.xml b/modules/cli-tests/pom.xml
index 3a5f116..5e496d6 100644
--- a/modules/cli-tests/pom.xml
+++ b/modules/cli-tests/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/common/ant-bundle/pom.xml b/modules/common/ant-bundle/pom.xml
index 81947ba..7ca19b5 100644
--- a/modules/common/ant-bundle/pom.xml
+++ b/modules/common/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/common/drift/pom.xml b/modules/common/drift/pom.xml
index 46ad40c..5deb920 100644
--- a/modules/common/drift/pom.xml
+++ b/modules/common/drift/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-common-drift</artifactId>
diff --git a/modules/common/filetemplate-bundle/pom.xml b/modules/common/filetemplate-bundle/pom.xml
index 89ecf98..48a3644 100644
--- a/modules/common/filetemplate-bundle/pom.xml
+++ b/modules/common/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-filetemplate-bundle-common</artifactId>
diff --git a/modules/common/jboss-as/pom.xml b/modules/common/jboss-as/pom.xml
index f328660..9bc3f98 100644
--- a/modules/common/jboss-as/pom.xml
+++ b/modules/common/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-jboss-as-common</artifactId>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index 9830cbb..0c76090 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index c0ca9be..39a5806 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/comm-api/pom.xml b/modules/core/comm-api/pom.xml
index ed0087f..11cae39 100644
--- a/modules/core/comm-api/pom.xml
+++ b/modules/core/comm-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index c2b8a1f..c1e900d 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index c125944..3380c46 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-domain</artifactId>
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 086b8fd..61ff8cf 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/native-system/pom.xml b/modules/core/native-system/pom.xml
index 3f28672..c7b165f 100644
--- a/modules/core/native-system/pom.xml
+++ b/modules/core/native-system/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index df1a188..9febe64 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index e38ad83..e78e26a 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-plugin-container</artifactId>
diff --git a/modules/core/plugin-validator/pom.xml b/modules/core/plugin-validator/pom.xml
index c143c00..6fca67e 100644
--- a/modules/core/plugin-validator/pom.xml
+++ b/modules/core/plugin-validator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 99a1950..8aea247 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/core/util/pom.xml b/modules/core/util/pom.xml
index a8e5ea6..9c08830 100644
--- a/modules/core/util/pom.xml
+++ b/modules/core/util/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-core-util</artifactId>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 0031cce..0759da1 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/agentupdate/pom.xml b/modules/enterprise/agentupdate/pom.xml
index daa2338..dd03d6f 100644
--- a/modules/enterprise/agentupdate/pom.xml
+++ b/modules/enterprise/agentupdate/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index 4b610cf..27e8334 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -3,10 +3,10 @@
<parent>
<artifactId>rhq-enterprise-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<artifactId>rhq-script-bindings</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Script Bindings</name>
<description>Abstraction of different facilities and default configurations for script bindings</description>
diff --git a/modules/enterprise/comm/pom.xml b/modules/enterprise/comm/pom.xml
index f8aa8f9..2185aa0 100644
--- a/modules/enterprise/comm/pom.xml
+++ b/modules/enterprise/comm/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-jar/pom.xml b/modules/enterprise/gui/base-perspective-jar/pom.xml
index 759d52d..3c48271 100644
--- a/modules/enterprise/gui/base-perspective-jar/pom.xml
+++ b/modules/enterprise/gui/base-perspective-jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/base-perspective-war/pom.xml b/modules/enterprise/gui/base-perspective-war/pom.xml
index 0066cdd..6974e1a 100644
--- a/modules/enterprise/gui/base-perspective-war/pom.xml
+++ b/modules/enterprise/gui/base-perspective-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml
index f2919fb..6637b6c 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-gui-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index fb53d14..33cd64b 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index 7f79832..eb4efa0 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index db45111..ac5cc39 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -8,7 +8,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml
index 8ea3d46..f51c70d 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/gui/rest-war/pom.xml b/modules/enterprise/gui/rest-war/pom.xml
index 7f5707c..a2b9bf3 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/pom.xml b/modules/enterprise/pom.xml
index eb6a9cf..baabc0f 100644
--- a/modules/enterprise/pom.xml
+++ b/modules/enterprise/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index 8424043..bcb4532 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml
index af3ecd8..97d515a 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml b/modules/enterprise/remoting/client-deps/pom.xml
index d3dcb79..fc2f25e 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 22619c3..ff2bee4 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml
index b225ea1..f648b5d 100644
--- a/modules/enterprise/remoting/webservices/pom.xml
+++ b/modules/enterprise/remoting/webservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/client-api/pom.xml b/modules/enterprise/server/client-api/pom.xml
index f200744..9f86d8c 100644
--- a/modules/enterprise/server/client-api/pom.xml
+++ b/modules/enterprise/server/client-api/pom.xml
@@ -5,13 +5,13 @@
<parent>
<artifactId>rhq-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-server-client-api</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Client API</name>
<description>The implementation of the client API when accessing the server locally</description>
diff --git a/modules/enterprise/server/container-lib/pom.xml b/modules/enterprise/server/container-lib/pom.xml
index 0974431..ca7d3a0 100644
--- a/modules/enterprise/server/container-lib/pom.xml
+++ b/modules/enterprise/server/container-lib/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index ea9c917..cd76044 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 429f446..2b60970 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/itests/pom.xml b/modules/enterprise/server/itests/pom.xml
index 54b193c..b6d255a 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.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index de9ceae..ac85d7d 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/alert-cli/pom.xml b/modules/enterprise/server/plugins/alert-cli/pom.xml
index d13ee76..691fadc 100644
--- a/modules/enterprise/server/plugins/alert-cli/pom.xml
+++ b/modules/enterprise/server/plugins/alert-cli/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>alert-cli</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Script Alert Plugin</name>
<description>An alert sender able to execute an arbitrary CLI script as a response to an alert</description>
diff --git a/modules/enterprise/server/plugins/alert-email/pom.xml b/modules/enterprise/server/plugins/alert-email/pom.xml
index d664a1b..40d0b98 100644
--- a/modules/enterprise/server/plugins/alert-email/pom.xml
+++ b/modules/enterprise/server/plugins/alert-email/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.server</groupId>
<artifactId>alert-email</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Email Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-irc/pom.xml b/modules/enterprise/server/plugins/alert-irc/pom.xml
index 0f46399..5d7930e 100644
--- a/modules/enterprise/server/plugins/alert-irc/pom.xml
+++ b/modules/enterprise/server/plugins/alert-irc/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-irc</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server IRC Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-log4j/pom.xml b/modules/enterprise/server/plugins/alert-log4j/pom.xml
index b06d1ec..3aaa2f9 100644
--- a/modules/enterprise/server/plugins/alert-log4j/pom.xml
+++ b/modules/enterprise/server/plugins/alert-log4j/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-log4j</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Log4J Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-microblog/pom.xml b/modules/enterprise/server/plugins/alert-microblog/pom.xml
index f6b00e3..25d4078 100644
--- a/modules/enterprise/server/plugins/alert-microblog/pom.xml
+++ b/modules/enterprise/server/plugins/alert-microblog/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-microblog</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Microblog Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-mobicents/pom.xml b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
index 76e49fa..b08d787 100644
--- a/modules/enterprise/server/plugins/alert-mobicents/pom.xml
+++ b/modules/enterprise/server/plugins/alert-mobicents/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-mobicents</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Mobicents Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-operations/pom.xml b/modules/enterprise/server/plugins/alert-operations/pom.xml
index 46c3d61..37a4846 100644
--- a/modules/enterprise/server/plugins/alert-operations/pom.xml
+++ b/modules/enterprise/server/plugins/alert-operations/pom.xml
@@ -2,14 +2,14 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-operations</artifactId>
<packaging>jar</packaging>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Opertions Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-roles/pom.xml b/modules/enterprise/server/plugins/alert-roles/pom.xml
index 311cfa9..2cfd59c 100644
--- a/modules/enterprise/server/plugins/alert-roles/pom.xml
+++ b/modules/enterprise/server/plugins/alert-roles/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-roles</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Roles Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-snmp/pom.xml b/modules/enterprise/server/plugins/alert-snmp/pom.xml
index ff7466d..a944f48 100644
--- a/modules/enterprise/server/plugins/alert-snmp/pom.xml
+++ b/modules/enterprise/server/plugins/alert-snmp/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-snmp</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server SNMP Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/alert-subject/pom.xml b/modules/enterprise/server/plugins/alert-subject/pom.xml
index 9ba1fb9..a22acff 100644
--- a/modules/enterprise/server/plugins/alert-subject/pom.xml
+++ b/modules/enterprise/server/plugins/alert-subject/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>alert-subject</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Subject Alert Plugin</name>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 0d36c31..5e28050 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/cobbler/pom.xml b/modules/enterprise/server/plugins/cobbler/pom.xml
index 1f6e1c4..eb74d2d 100644
--- a/modules/enterprise/server/plugins/cobbler/pom.xml
+++ b/modules/enterprise/server/plugins/cobbler/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>rhq-serverplugin-cobbler</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Cobbler Plugin</name>
diff --git a/modules/enterprise/server/plugins/disk/pom.xml b/modules/enterprise/server/plugins/disk/pom.xml
index 2f3e0ea..526e9ac 100644
--- a/modules/enterprise/server/plugins/disk/pom.xml
+++ b/modules/enterprise/server/plugins/disk/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/drift-rhq/pom.xml b/modules/enterprise/server/plugins/drift-rhq/pom.xml
index d2181f1..390916c 100644
--- a/modules/enterprise/server/plugins/drift-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/drift-rhq/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index a1a5025..fed59cf 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/groovy-script/pom.xml b/modules/enterprise/server/plugins/groovy-script/pom.xml
index fcae8eb..23a67f8 100644
--- a/modules/enterprise/server/plugins/groovy-script/pom.xml
+++ b/modules/enterprise/server/plugins/groovy-script/pom.xml
@@ -4,14 +4,14 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>groovy-script-server-plugin</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server Groovy Script Plugin</name>
diff --git a/modules/enterprise/server/plugins/jboss-software/pom.xml b/modules/enterprise/server/plugins/jboss-software/pom.xml
index 6fbaef6..fdd1bea 100644
--- a/modules/enterprise/server/plugins/jboss-software/pom.xml
+++ b/modules/enterprise/server/plugins/jboss-software/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/packagetype-cli/pom.xml b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
index d5862ec..c525ff8 100644
--- a/modules/enterprise/server/plugins/packagetype-cli/pom.xml
+++ b/modules/enterprise/server/plugins/packagetype-cli/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq</groupId>
<artifactId>packagetype-cli</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>RHQ Enterprise Server CLI Package Type Plugin</name>
diff --git a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
index 94a0f6c..2b862a7 100644
--- a/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/perspective/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/perspectives/core/pom.xml b/modules/enterprise/server/plugins/perspectives/core/pom.xml
index c3d755c..0f1367a 100644
--- a/modules/enterprise/server/plugins/perspectives/core/pom.xml
+++ b/modules/enterprise/server/plugins/perspectives/core/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index a51ac52..5283b98 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/plugins/url/pom.xml b/modules/enterprise/server/plugins/url/pom.xml
index ede0674..de0b02d 100644
--- a/modules/enterprise/server/plugins/url/pom.xml
+++ b/modules/enterprise/server/plugins/url/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 28f5f38..866241b 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/plugins/yum/pom.xml b/modules/enterprise/server/plugins/yum/pom.xml
index 4b19d90..effd4a6 100644
--- a/modules/enterprise/server/plugins/yum/pom.xml
+++ b/modules/enterprise/server/plugins/yum/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index 8cf8acc..08204aa 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index 3b23fc0..5fb22ec 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/sars/agent-sar/pom.xml b/modules/enterprise/server/sars/agent-sar/pom.xml
index 56f2f99..556dcad 100644
--- a/modules/enterprise/server/sars/agent-sar/pom.xml
+++ b/modules/enterprise/server/sars/agent-sar/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-sars-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/enterprise/server/sars/pom.xml b/modules/enterprise/server/sars/pom.xml
index bd52c46..3a16283 100644
--- a/modules/enterprise/server/sars/pom.xml
+++ b/modules/enterprise/server/sars/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index c2aca81..68d8d85 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/bundleGen/pom.xml b/modules/helpers/bundleGen/pom.xml
index 9be012c..b8bddc4 100644
--- a/modules/helpers/bundleGen/pom.xml
+++ b/modules/helpers/bundleGen/pom.xml
@@ -3,13 +3,13 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.rhq.helpers</groupId>
<artifactId>bundleGen</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<build>
<plugins>
diff --git a/modules/helpers/jeeGen/pom.xml b/modules/helpers/jeeGen/pom.xml
index df620a0..496d7ea 100644
--- a/modules/helpers/jeeGen/pom.xml
+++ b/modules/helpers/jeeGen/pom.xml
@@ -9,7 +9,7 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
diff --git a/modules/helpers/perftest-support/pom.xml b/modules/helpers/perftest-support/pom.xml
index 3b75eec..dd735f5 100644
--- a/modules/helpers/perftest-support/pom.xml
+++ b/modules/helpers/perftest-support/pom.xml
@@ -3,11 +3,11 @@
<parent>
<artifactId>rhq-helpers</artifactId>
<groupId>org.rhq.helpers</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>perftest-support</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<name>Performance Testing Support</name>
<description>To support performance testing, this is a basic tool to support extracting and later reimporting of
data from/to a database.
diff --git a/modules/helpers/pom.xml b/modules/helpers/pom.xml
index 1e75dca..797f302 100644
--- a/modules/helpers/pom.xml
+++ b/modules/helpers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/helpers/rtfilter/pom.xml b/modules/helpers/rtfilter/pom.xml
index c80f26a..761f3ec 100644
--- a/modules/helpers/rtfilter/pom.xml
+++ b/modules/helpers/rtfilter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq.helpers</groupId>
<artifactId>rhq-helpers</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/apache-plugin-test/pom.xml b/modules/integration-tests/apache-plugin-test/pom.xml
index 13241f0..fa3366b 100644
--- a/modules/integration-tests/apache-plugin-test/pom.xml
+++ b/modules/integration-tests/apache-plugin-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jboss-as-7-plugin-test/pom.xml b/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
index a1babd7..1929f5a 100644
--- a/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
+++ b/modules/integration-tests/jboss-as-7-plugin-test/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-integration-tests</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
diff --git a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
index ff9ee56..ad97b2c 100644
--- a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
+++ b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/pom.xml b/modules/integration-tests/jndi-access/pom.xml
index 6e9c673..2c3fc42 100644
--- a/modules/integration-tests/jndi-access/pom.xml
+++ b/modules/integration-tests/jndi-access/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>rhq-integration-tests</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/jndi-access/remote-server/pom.xml b/modules/integration-tests/jndi-access/remote-server/pom.xml
index 9046e6f..eec643e 100644
--- a/modules/integration-tests/jndi-access/remote-server/pom.xml
+++ b/modules/integration-tests/jndi-access/remote-server/pom.xml
@@ -4,7 +4,7 @@
<parent>
<artifactId>jndi-access-test-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/integration-tests/pom.xml b/modules/integration-tests/pom.xml
index 969b94a..dc29aef 100644
--- a/modules/integration-tests/pom.xml
+++ b/modules/integration-tests/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/aliases/pom.xml b/modules/plugins/aliases/pom.xml
index f581033..a544bd4 100644
--- a/modules/plugins/aliases/pom.xml
+++ b/modules/plugins/aliases/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/ant-bundle/pom.xml b/modules/plugins/ant-bundle/pom.xml
index b00a1ce..93214ba 100644
--- a/modules/plugins/ant-bundle/pom.xml
+++ b/modules/plugins/ant-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/apache/pom.xml b/modules/plugins/apache/pom.xml
index 16854fe..3b206d6 100644
--- a/modules/plugins/apache/pom.xml
+++ b/modules/plugins/apache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/augeas/pom.xml b/modules/plugins/augeas/pom.xml
index f8e88f8..95f8567 100644
--- a/modules/plugins/augeas/pom.xml
+++ b/modules/plugins/augeas/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/byteman/pom.xml b/modules/plugins/byteman/pom.xml
index 37101bb..34ca710 100644
--- a/modules/plugins/byteman/pom.xml
+++ b/modules/plugins/byteman/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cobbler/pom.xml b/modules/plugins/cobbler/pom.xml
index e7da655..b6351d9 100644
--- a/modules/plugins/cobbler/pom.xml
+++ b/modules/plugins/cobbler/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/cron/pom.xml b/modules/plugins/cron/pom.xml
index 148ad63..a98c22b 100644
--- a/modules/plugins/cron/pom.xml
+++ b/modules/plugins/cron/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/database/pom.xml b/modules/plugins/database/pom.xml
index a9be07c..a12cbb2 100644
--- a/modules/plugins/database/pom.xml
+++ b/modules/plugins/database/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/filetemplate-bundle/pom.xml b/modules/plugins/filetemplate-bundle/pom.xml
index 6e80698..11d5e6f 100644
--- a/modules/plugins/filetemplate-bundle/pom.xml
+++ b/modules/plugins/filetemplate-bundle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/grub/pom.xml b/modules/plugins/grub/pom.xml
index 131a98f..6233c99 100644
--- a/modules/plugins/grub/pom.xml
+++ b/modules/plugins/grub/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hadoop/pom.xml b/modules/plugins/hadoop/pom.xml
index f30d2fb..825fd23 100644
--- a/modules/plugins/hadoop/pom.xml
+++ b/modules/plugins/hadoop/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hibernate/pom.xml b/modules/plugins/hibernate/pom.xml
index 06c6470..05dd6ed 100644
--- a/modules/plugins/hibernate/pom.xml
+++ b/modules/plugins/hibernate/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<!-- Bypass the jopr-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. -->
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/hosts/pom.xml b/modules/plugins/hosts/pom.xml
index 9f0aedc..fc428f9 100644
--- a/modules/plugins/hosts/pom.xml
+++ b/modules/plugins/hosts/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/hudson/pom.xml b/modules/plugins/hudson/pom.xml
index fd0b274..aa19a71 100644
--- a/modules/plugins/hudson/pom.xml
+++ b/modules/plugins/hudson/pom.xml
@@ -6,12 +6,12 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-hudson-plugin</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RHQ Hudson Plugin</name>
diff --git a/modules/plugins/iis/pom.xml b/modules/plugins/iis/pom.xml
index c4c5587..8dc374d 100644
--- a/modules/plugins/iis/pom.xml
+++ b/modules/plugins/iis/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/irc/pom.xml b/modules/plugins/irc/pom.xml
index 506ffeb..bb971ba 100644
--- a/modules/plugins/irc/pom.xml
+++ b/modules/plugins/irc/pom.xml
@@ -5,7 +5,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as-5/pom.xml b/modules/plugins/jboss-as-5/pom.xml
index a8b8f5f..6ce116e 100644
--- a/modules/plugins/jboss-as-5/pom.xml
+++ b/modules/plugins/jboss-as-5/pom.xml
@@ -9,7 +9,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index 8220355..5ed832c2 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/jboss-as/pom.xml b/modules/plugins/jboss-as/pom.xml
index a49b17e..2c68452 100644
--- a/modules/plugins/jboss-as/pom.xml
+++ b/modules/plugins/jboss-as/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache-v3/pom.xml b/modules/plugins/jboss-cache-v3/pom.xml
index efad67d..b3e8d4e 100644
--- a/modules/plugins/jboss-cache-v3/pom.xml
+++ b/modules/plugins/jboss-cache-v3/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jboss-cache/pom.xml b/modules/plugins/jboss-cache/pom.xml
index 4ecbee4..02c8233 100644
--- a/modules/plugins/jboss-cache/pom.xml
+++ b/modules/plugins/jboss-cache/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/jmx/pom.xml b/modules/plugins/jmx/pom.xml
index bcf0cf1..6f40433 100644
--- a/modules/plugins/jmx/pom.xml
+++ b/modules/plugins/jmx/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/kickstart/pom.xml b/modules/plugins/kickstart/pom.xml
index bcbb309..5727123 100644
--- a/modules/plugins/kickstart/pom.xml
+++ b/modules/plugins/kickstart/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mod-cluster/pom.xml b/modules/plugins/mod-cluster/pom.xml
index 44fdea9..063fa13 100644
--- a/modules/plugins/mod-cluster/pom.xml
+++ b/modules/plugins/mod-cluster/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/mysql/pom.xml b/modules/plugins/mysql/pom.xml
index 4068435..9ae3127 100644
--- a/modules/plugins/mysql/pom.xml
+++ b/modules/plugins/mysql/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/netservices/pom.xml b/modules/plugins/netservices/pom.xml
index 0bdb176..a7799ee 100644
--- a/modules/plugins/netservices/pom.xml
+++ b/modules/plugins/netservices/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/oracle/pom.xml b/modules/plugins/oracle/pom.xml
index ab22ead..153d231 100644
--- a/modules/plugins/oracle/pom.xml
+++ b/modules/plugins/oracle/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pattern-generator/pom.xml b/modules/plugins/pattern-generator/pom.xml
index 269b169..ad3b050 100644
--- a/modules/plugins/pattern-generator/pom.xml
+++ b/modules/plugins/pattern-generator/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index e296f55..7ae42c1 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/platform/pom.xml b/modules/plugins/platform/pom.xml
index f22ac8a..f2e3d72 100644
--- a/modules/plugins/platform/pom.xml
+++ b/modules/plugins/platform/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/pom.xml b/modules/plugins/pom.xml
index 389b69c..070bce1 100644
--- a/modules/plugins/pom.xml
+++ b/modules/plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
diff --git a/modules/plugins/postfix/pom.xml b/modules/plugins/postfix/pom.xml
index 2582d6b..30622a8 100644
--- a/modules/plugins/postfix/pom.xml
+++ b/modules/plugins/postfix/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/postgres/pom.xml b/modules/plugins/postgres/pom.xml
index a3d5cae..e59115a 100644
--- a/modules/plugins/postgres/pom.xml
+++ b/modules/plugins/postgres/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-agent/pom.xml b/modules/plugins/rhq-agent/pom.xml
index 47f2f1c..f25730f 100644
--- a/modules/plugins/rhq-agent/pom.xml
+++ b/modules/plugins/rhq-agent/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/rhq-server/pom.xml b/modules/plugins/rhq-server/pom.xml
index 86b3f7a..92825e9 100644
--- a/modules/plugins/rhq-server/pom.xml
+++ b/modules/plugins/rhq-server/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/samba/pom.xml b/modules/plugins/samba/pom.xml
index f30db8f..1bc8bac 100644
--- a/modules/plugins/samba/pom.xml
+++ b/modules/plugins/samba/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script/pom.xml b/modules/plugins/script/pom.xml
index 94af3a5..9849343 100644
--- a/modules/plugins/script/pom.xml
+++ b/modules/plugins/script/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/script2/pom.xml b/modules/plugins/script2/pom.xml
index f89d6fc..9022495 100644
--- a/modules/plugins/script2/pom.xml
+++ b/modules/plugins/script2/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/snmptrapd/pom.xml b/modules/plugins/snmptrapd/pom.xml
index eec5fc5..25d8220 100644
--- a/modules/plugins/snmptrapd/pom.xml
+++ b/modules/plugins/snmptrapd/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>rhq-plugins-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/modules/plugins/sshd/pom.xml b/modules/plugins/sshd/pom.xml
index 4ef043f..5a91a77 100644
--- a/modules/plugins/sshd/pom.xml
+++ b/modules/plugins/sshd/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/sudoers/pom.xml b/modules/plugins/sudoers/pom.xml
index 95567bb..29bfbe3 100644
--- a/modules/plugins/sudoers/pom.xml
+++ b/modules/plugins/sudoers/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/tomcat/pom.xml b/modules/plugins/tomcat/pom.xml
index 7b9473d..eecfd66 100644
--- a/modules/plugins/tomcat/pom.xml
+++ b/modules/plugins/tomcat/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.on</groupId>
diff --git a/modules/plugins/twitter/pom.xml b/modules/plugins/twitter/pom.xml
index de46080..d0850e2 100644
--- a/modules/plugins/twitter/pom.xml
+++ b/modules/plugins/twitter/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/validate-all-plugins/pom.xml b/modules/plugins/validate-all-plugins/pom.xml
index fa35f4e..628eab4 100644
--- a/modules/plugins/validate-all-plugins/pom.xml
+++ b/modules/plugins/validate-all-plugins/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/plugins/virt/pom.xml b/modules/plugins/virt/pom.xml
index bb62eee..24830d0 100644
--- a/modules/plugins/virt/pom.xml
+++ b/modules/plugins/virt/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-plugins-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/pom.xml b/modules/pom.xml
index ba4d1b5..fb663df 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<groupId>org.rhq</groupId>
diff --git a/modules/test-utils/pom.xml b/modules/test-utils/pom.xml
index 0b19530..eb35e08 100644
--- a/modules/test-utils/pom.xml
+++ b/modules/test-utils/pom.xml
@@ -7,7 +7,7 @@
<parent>
<artifactId>rhq-modules-parent</artifactId>
<groupId>org.rhq</groupId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
</parent>
<artifactId>test-utils</artifactId>
diff --git a/pom.xml b/pom.xml
index e07cf64..3381fa2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
- <version>4.3.0-SNAPSHOT</version>
+ <version>4.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RHQ</name>
commit 30fd33737747ce87134cea2203f7b08ed2b0e526
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Feb 27 10:58:56 2012 -0600
Avoid merging remote branch into local code when using branching strategy because the branch does not exist yet remotely.
diff --git a/release.sh b/release.sh
index 51ff163..af311e1 100755
--- a/release.sh
+++ b/release.sh
@@ -360,9 +360,14 @@ run_release_version_and_tag_process()
[ "$?" -ne 0 ] && abort "Tagging failed"
fi
- echo "9) Merge any remote changes into the local branch to be able to push tag and version change. This will fail if the merge process requires manual merges."
- git pull origin "$BUILD_BRANCH"
- [ "$?" -ne 0 ] && abort "Merge with remote $BUILD_BRANCH failed."
+ if [ "$SCM_STRATEGY" = "tag" ];
+ then
+ echo "9) Merge any remote changes into the local branch to be able to push tag and version change. This will fail if the merge process requires manual merges."
+ git pull origin "$BUILD_BRANCH"
+ [ "$?" -ne 0 ] && abort "Merge with remote $BUILD_BRANCH failed."
+ else
+ echo "9) DID NOT execute this step because local branch was created. No need to merge back changes."
+ fi
echo "10) If everything went well so far than means all the changes can be pushed!!!"
git push origin "refs/heads/$BUILD_BRANCH"
12 years, 2 months
[rhq] Branch 'release-4.3.0.GA' - publish.sh
by snegrea
publish.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 133f576c3e9a1f954bd5e67c44cbeb81e93eb1c2
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Feb 28 10:44:19 2012 -0600
Turn off maven publishing. Not fully implemented ...
diff --git a/publish.sh b/publish.sh
index a1b1c1e..266f1d8 100755
--- a/publish.sh
+++ b/publish.sh
@@ -341,8 +341,8 @@ build_from_source()
#========================================================================================
publish_external_maven_repository()
{
- mvn -Ddbsetup-do-not-check-schema=true -Dmaven.test.skip=true -P publish $MAVEN_RELEASE_PERFORM_GOAL
- [ "$?" -ne 0 ] && abort "Release build failed. Please see above Maven output for details, fix any issues, then try again."
+ #mvn -Ddbsetup-do-not-check-schema=true -Dmaven.test.skip=true -P publish $MAVEN_RELEASE_PERFORM_GOAL
+ #[ "$?" -ne 0 ] && abort "Release build failed. Please see above Maven output for details, fix any issues, then try again."
}
12 years, 2 months
[rhq] Branch 'jshaughn/avail' - 7 commits - modules/core modules/enterprise
by Jay Shaughnessy
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 5
modules/enterprise/binding/src/test/java/org/rhq/bindings/TabularWriterTest.java | 126 ++++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java | 3
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java | 12
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/MeasurementMetadataManagerBean.java | 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBean.java | 38 +--
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java | 41 ++-
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java | 3
8 files changed, 122 insertions(+), 110 deletions(-)
New commits:
commit e48c0e156bed76588fc884eb2019058906a2e4e5
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Feb 28 11:22:08 2012 -0500
Ensure the new 'Availability Type' metric is created for both new types
and existing types (in a plugin upgrade).
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/MeasurementMetadataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/MeasurementMetadataManagerBean.java
index 1432f49..0039aa2 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/MeasurementMetadataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/metadata/MeasurementMetadataManagerBean.java
@@ -58,7 +58,7 @@ public class MeasurementMetadataManagerBean implements MeasurementMetadataManage
existingType = entityMgr.find(ResourceType.class, existingType.getId());
Set<MeasurementDefinition> existingDefinitions = existingType.getMetricDefinitions();
- // if necessary insert the mandatory AvailabilityScanPeriod metric
+ // if necessary insert the mandatory AvailabilityType metric
Set<MeasurementDefinition> newTypeMetricDefinitions = getMetricDefinitions(newType);
if (existingDefinitions.isEmpty()) {
@@ -150,7 +150,7 @@ public class MeasurementMetadataManagerBean implements MeasurementMetadataManage
// not needed see JBNADM-1639
}
- private Set<MeasurementDefinition> getMetricDefinitions(ResourceType newType) {
+ public static Set<MeasurementDefinition> getMetricDefinitions(ResourceType newType) {
Set<MeasurementDefinition> result = newType.getMetricDefinitions();
result = (null == result) ? new HashSet<MeasurementDefinition>(1) : result;
long period;
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 4346f69..f0dc7df 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
@@ -47,8 +47,8 @@ import org.rhq.core.domain.authz.Permission;
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.drift.DriftDefinitionTemplate;
import org.rhq.core.domain.resource.ProcessScan;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceSubCategory;
@@ -358,8 +358,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
ResourceType existingType;
try {
- existingType = resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(), resourceType
- .getPlugin());
+ existingType = resourceTypeManager.getResourceTypeByNameAndPlugin(resourceType.getName(),
+ resourceType.getPlugin());
} catch (NonUniqueResultException nure) {
log.debug("Found more than one existing ResourceType for " + resourceType);
// TODO: Delete the redundant ResourceTypes to get the DB into a valid state.
@@ -576,6 +576,9 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
// This is a subcategory of our parent where we are supposed to be grouped in.
linkSubCategoryToParents(resourceType);
+ // Ensure that the new type has any built-in metrics (like Availability Type)
+ MeasurementMetadataManagerBean.getMetricDefinitions(resourceType);
+
entityManager.persist(resourceType);
entityManager.flush();
}
@@ -619,8 +622,9 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
try {
boolean isExistingParent = originalExistingParentTypes.remove(newParentType);
if (existingType == null || !isExistingParent) {
- ResourceType realParentType = (ResourceType) entityManager.createNamedQuery(
- ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN).setParameter("name", newParentType.getName())
+ ResourceType realParentType = (ResourceType) entityManager
+ .createNamedQuery(ResourceType.QUERY_FIND_BY_NAME_AND_PLUGIN)
+ .setParameter("name", newParentType.getName())
.setParameter("plugin", newParentType.getPlugin()).getSingleResult();
ResourceType type = (existingType != null) ? existingType : newType;
if (existingType != null) {
@@ -788,8 +792,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
}
// Second, loop over the sub categories that need to be merged and update and persist them
- List<ResourceSubCategory> mergedSubCategories = new ArrayList<ResourceSubCategory>(existingType
- .getChildSubCategories());
+ List<ResourceSubCategory> mergedSubCategories = new ArrayList<ResourceSubCategory>(
+ existingType.getChildSubCategories());
mergedSubCategories.retainAll(subCategoriesFromNewType.values());
for (ResourceSubCategory existingSubCat : mergedSubCategories) {
updateSubCategory(existingSubCat, subCategoriesFromNewType.get(existingSubCat.getName()));
@@ -836,19 +840,19 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
}
// Second, loop over the sub categories that need to be merged and update and persist them
- List<ResourceSubCategory> mergedChildSubCategories = new ArrayList<ResourceSubCategory>(existingSubCat
- .getChildSubCategories());
+ List<ResourceSubCategory> mergedChildSubCategories = new ArrayList<ResourceSubCategory>(
+ existingSubCat.getChildSubCategories());
mergedChildSubCategories.retainAll(childSubCategoriesFromNewSubCat.values());
for (ResourceSubCategory existingChildSubCategory : mergedChildSubCategories) {
// recursively update childSubCategory
- updateSubCategory(existingChildSubCategory, childSubCategoriesFromNewSubCat.get(existingChildSubCategory
- .getName()));
+ updateSubCategory(existingChildSubCategory,
+ childSubCategoriesFromNewSubCat.get(existingChildSubCategory.getName()));
entityManager.merge(existingChildSubCategory);
}
// Persist all new definitions
- List<ResourceSubCategory> newChildSubCategories = new ArrayList<ResourceSubCategory>(newSubCategory
- .getChildSubCategories());
+ List<ResourceSubCategory> newChildSubCategories = new ArrayList<ResourceSubCategory>(
+ newSubCategory.getChildSubCategories());
newChildSubCategories.removeAll(existingSubCat.getChildSubCategories());
for (ResourceSubCategory newChildSubCategory : newChildSubCategories) {
log.info("Metadata update: Adding new child SubCategory [" + newChildSubCategory.getName()
@@ -868,8 +872,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
public void removeObsoleteSubCategories(Subject subject, ResourceType newType, ResourceType existingType) {
// Remove all definitions that are in the existing type but not in the new type
existingType = entityManager.find(ResourceType.class, existingType.getId());
- List<ResourceSubCategory> removedSubCategories = new ArrayList<ResourceSubCategory>(existingType
- .getChildSubCategories());
+ List<ResourceSubCategory> removedSubCategories = new ArrayList<ResourceSubCategory>(
+ existingType.getChildSubCategories());
removedSubCategories.removeAll(newType.getChildSubCategories());
for (ResourceSubCategory removedSubCat : removedSubCategories) {
// remove it from the resourceType too, so we dont try to persist it again
@@ -894,8 +898,8 @@ public class ResourceMetadataManagerBean implements ResourceMetadataManagerLocal
for (ResourceSubCategory existingSubCat : existingSubCategories) {
// Remove all definitions that are in the existing type but not in the new type
- List<ResourceSubCategory> removedChildSubCategories = new ArrayList<ResourceSubCategory>(existingSubCat
- .getChildSubCategories());
+ List<ResourceSubCategory> removedChildSubCategories = new ArrayList<ResourceSubCategory>(
+ existingSubCat.getChildSubCategories());
List<ResourceSubCategory> newChildSubCategories = mapOfNewSubCategories.get(existingSubCat.getName())
.getChildSubCategories();
removedChildSubCategories.removeAll(newChildSubCategories);
commit ba9b3f1b35eeb663bdd9ea3f19d43fa865958c40
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Feb 28 11:21:05 2012 -0500
Update test to make sure our new built-in 'Availability Type' metric
is created for new types.
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
index 7155c3d..835e79e 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/ResourceMetadataManagerBeanTest.java
@@ -141,7 +141,8 @@ public class ResourceMetadataManagerBeanTest extends MetadataBeanTest {
@Test(dependsOnMethods = { "persistNewTypes" }, groups = { "plugin.metadata", "NewPlugin" })
public void persistMeasurementDefinitions() throws Exception {
- assertResourceTypeAssociationEquals("ServerA", "TestPlugin", "metricDefinitions", asList("metric1", "metric2"));
+ assertResourceTypeAssociationEquals("ServerA", "TestPlugin", "metricDefinitions",
+ asList("metric1", "metric2", "_AvailabilityType_"));
}
@Test(dependsOnMethods = { "persistNewTypes" }, groups = { "plugin.metadata", "NewPlugin" })
commit 904fccdaf6549ff744938e1f4b408333e4e2e940
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Feb 27 17:10:04 2012 -0500
Fix db-upgrade format
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 82befc8..d945358 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -3996,9 +3996,10 @@
SET AVAILABILITY_TYPE = 2
WHERE AVAILABILITY_TYPE IS NULL
</statement>
- <schema-alterColumn table="RHQ_AVAILABILITY" column="AVAILABILITY_TYPE" nullable="FALSE"/>
- <schema-alterColumn table="RHQ_RESOURCE_AVAIL" column="AVAILABILITY_TYPE" nullable="FALSE"/>
</schema-directSQL>
+
+ <schema-alterColumn table="RHQ_AVAILABILITY" column="AVAILABILITY_TYPE" nullable="FALSE"/>
+ <schema-alterColumn table="RHQ_RESOURCE_AVAIL" column="AVAILABILITY_TYPE" nullable="FALSE"/>
</schemaSpec>
commit 4aab6f7abed90450842339e7a999e06cba5c74f5
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Feb 27 16:53:38 2012 -0500
Fix some new avail formatting for pretty print
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
index c75f804..3717ee5 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
@@ -824,9 +824,6 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote {
AlertConditionCategory category = condition.getCategory();
switch (category) {
case AVAILABILITY: {
- // TODO I18N
- str.append("Availability Change To");
- str.append(" [");
AlertConditionOperator operator = AlertConditionOperator.valueOf(condition.getName().toUpperCase());
String msg;
switch (operator) {
@@ -853,14 +850,11 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote {
break;
}
str.append(AlertI18NFactory.getMessage(msg));
- str.append("]");
break;
}
case AVAIL_DURATION: {
- // TODO I18N
- str.append("Availability Duration ");
AlertConditionOperator operator = AlertConditionOperator.valueOf(condition.getName().toUpperCase());
String msg;
switch (operator) {
@@ -875,10 +869,10 @@ public class AlertManagerBean implements AlertManagerLocal, AlertManagerRemote {
break;
}
str.append(AlertI18NFactory.getMessage(msg));
- str.append(" ");
+ str.append(" [");
- double value = condition.getThreshold();
- String formatted = MeasurementConverter.format(value, MeasurementUnits.MINUTES, false);
+ String value = condition.getOption();
+ String formatted = MeasurementConverter.format(value, MeasurementUnits.MINUTES);
str.append(formatted);
str.append("]");
commit 20ef1d8bdb17afcdabc3375035e9f4f5a151ab00
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Feb 27 16:53:07 2012 -0500
Update tests to handle some avail changes and also add new avail
category and condition types.
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java
index a4fe4b4..6cae5f9 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/alert/test/AlertManagerBeanTest.java
@@ -9,8 +9,8 @@ import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.alert.AlertCondition;
import org.rhq.core.domain.alert.AlertConditionCategory;
import org.rhq.core.domain.alert.AlertConditionLog;
+import org.rhq.core.domain.alert.AlertConditionOperator;
import org.rhq.core.domain.event.EventSeverity;
-import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.DataType;
import org.rhq.core.domain.measurement.MeasurementDefinition;
import org.rhq.core.domain.measurement.MeasurementUnits;
@@ -26,19 +26,50 @@ public class AlertManagerBeanTest {
private String pretty;
public void testPrettyPrintAVAILABILITY() {
- AlertCondition condition = createCondition(AlertConditionCategory.AVAILABILITY, null, null, null,
- AvailabilityType.UP.name(), null);
+ AlertCondition condition = createCondition(AlertConditionCategory.AVAILABILITY,
+ AlertConditionOperator.AVAIL_GOES_UP.name(), null, null, null, null);
pretty = getPrettyAlertConditionString(condition);
assert "Availability goes UP".equals(pretty) : pretty;
pretty = getShortPrettyAlertConditionString(condition);
assert "Avail goes UP".equals(pretty) : pretty;
- condition = createCondition(AlertConditionCategory.AVAILABILITY, null, null, null,
- AvailabilityType.DOWN.name(), null);
+ condition = createCondition(AlertConditionCategory.AVAILABILITY, AlertConditionOperator.AVAIL_GOES_DOWN.name(),
+ null, null, null, null);
pretty = getPrettyAlertConditionString(condition);
assert "Availability goes DOWN".equals(pretty) : pretty;
pretty = getShortPrettyAlertConditionString(condition);
assert "Avail goes DOWN".equals(pretty) : pretty;
+
+ condition = createCondition(AlertConditionCategory.AVAILABILITY,
+ AlertConditionOperator.AVAIL_GOES_DISABLED.name(), null, null, null, null);
+ pretty = getPrettyAlertConditionString(condition);
+ assert "Availability goes DISABLED".equals(pretty) : pretty;
+ pretty = getShortPrettyAlertConditionString(condition);
+ assert "Avail goes DISABLED".equals(pretty) : pretty;
+
+ condition = createCondition(AlertConditionCategory.AVAILABILITY,
+ AlertConditionOperator.AVAIL_GOES_UNKNOWN.name(), null, null, null, null);
+ pretty = getPrettyAlertConditionString(condition);
+ assert "Availability goes UNKNOWN".equals(pretty) : pretty;
+ pretty = getShortPrettyAlertConditionString(condition);
+ assert "Avail goes UNKNOWN".equals(pretty) : pretty;
+
+ }
+
+ public void testPrettyPrintAVAILABILITY_DURATION() {
+ AlertCondition condition = createCondition(AlertConditionCategory.AVAIL_DURATION,
+ AlertConditionOperator.AVAIL_DURATION_DOWN.name(), null, null, "2", null);
+ pretty = getPrettyAlertConditionString(condition);
+ assert "Availability stays DOWN [2m]".equals(pretty) : pretty;
+ pretty = getShortPrettyAlertConditionString(condition);
+ assert "Avail stays DOWN [2m]".equals(pretty) : pretty;
+
+ condition = createCondition(AlertConditionCategory.AVAIL_DURATION,
+ AlertConditionOperator.AVAIL_DURATION_NOT_UP.name(), null, null, "2", null);
+ pretty = getPrettyAlertConditionString(condition);
+ assert "Availability stays NOT UP [2m]".equals(pretty) : pretty;
+ pretty = getShortPrettyAlertConditionString(condition);
+ assert "Avail stays NOT UP [2m]".equals(pretty) : pretty;
}
public void testPrettyPrintTHRESHOLD() {
commit 23737de50f6ffab17c19cba29d4d9fa444c1ba67
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Feb 27 16:51:11 2012 -0500
I18N fix
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
index 6d01cb8..80d52d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
@@ -78,7 +78,8 @@ public class AlertFormatUtility {
break;
}
case AVAIL_DURATION: {
- str.append("Availability Duration [");
+ str.append(MSG.view_alert_definition_condition_editor_availabilityDuration());
+ str.append(" [");
AlertConditionOperator operator = AlertConditionOperator.valueOf(condition.getName().toUpperCase());
switch (operator) {
case AVAIL_DURATION_DOWN:
commit 05526b7365cada7e69a0a373c6f79430d395643e
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Feb 27 16:50:45 2012 -0500
Update tests to also pass on Windows
diff --git a/modules/enterprise/binding/src/test/java/org/rhq/bindings/TabularWriterTest.java b/modules/enterprise/binding/src/test/java/org/rhq/bindings/TabularWriterTest.java
index a69f7bf..2390b38 100644
--- a/modules/enterprise/binding/src/test/java/org/rhq/bindings/TabularWriterTest.java
+++ b/modules/enterprise/binding/src/test/java/org/rhq/bindings/TabularWriterTest.java
@@ -25,6 +25,7 @@ package org.rhq.bindings;
import static org.testng.Assert.assertEquals;
+import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
@@ -62,10 +63,10 @@ public class TabularWriterTest {
writer.print(users);
- assertLineEquals(1, "id password username", "Cannot print entity array header");
+ assertLineEquals(1, "id password username", "Cannot print entity array header", false);
// skip line 2 - its the separator "--------------"
- assertLineEquals(3, "1 rhqadmin rhqadmin", "Cannot print first entity array item");
- assertLineEquals(4, "222 pw name ", "Cannot print second entity array item");
+ assertLineEquals(3, "1 rhqadmin rhqadmin", "Cannot print first entity array item", false);
+ assertLineEquals(4, "222 pw name ", "Cannot print second entity array item", false);
}
/**
@@ -78,8 +79,8 @@ public class TabularWriterTest {
writer.print(obj);
// first two lines are the header and "----" separator
- assertLineEquals(3, "first string ", "Cannot print first string array item");
- assertLineEquals(4, "second string", "Cannot print first string array item");
+ assertLineEquals(3, "first string ", "Cannot print first string array item", false);
+ assertLineEquals(4, "second string", "Cannot print first string array item", false);
}
/**
@@ -91,7 +92,8 @@ public class TabularWriterTest {
Object obj = objArray;
writer.print(obj);
- String expected = "Array of java.lang.Integer\n123\n789\n";
+ String term = (File.separatorChar == '/') ? "\n" : "\r\n";
+ String expected = "Array of java.lang.Integer" + term + "123" + term + "789" + term;
String actual = stringWriter.toString();
assertEquals(actual, expected, "Could not print an object Integer array");
}
@@ -105,7 +107,8 @@ public class TabularWriterTest {
Object obj = primitiveArray;
writer.print(obj);
- String expected = "Array of byte\n" + (int) 'a' + '\n' + (int) 'b' + '\n' + (int) 'c' + '\n';
+ String term = (File.separatorChar == '/') ? "\n" : "\r\n";
+ String expected = "Array of byte" + term + (int) 'a' + term + (int) 'b' + term + (int) 'c' + term;
String actual = stringWriter.toString();
assertEquals(actual, expected, "Could not print a primitive byte array");
}
@@ -116,7 +119,7 @@ public class TabularWriterTest {
writer.print(value);
- String expected = "1\n";
+ String expected = (File.separatorChar == '/') ? "1\n" : "1\r\n";
String actual = stringWriter.toString();
assertEquals(actual, expected, "A byte or Byte should have its value printed as a String");
@@ -128,7 +131,7 @@ public class TabularWriterTest {
writer.print(value);
- String expected = "1\n";
+ String expected = (File.separatorChar == '/') ? "1\n" : "1\r\n";
String actual = stringWriter.toString();
assertEquals(actual, expected, "An int or Integer should have its value printed as a String");
@@ -141,7 +144,8 @@ public class TabularWriterTest {
writer.print(user);
assertNumberOfLinesPrintedIs(4);
- assertLineEquals(0, user.getClass().getSimpleName() + ":", "The simple class name should be the first line printed");
+ assertLineEquals(0, user.getClass().getSimpleName() + ":",
+ "The simple class name should be the first line printed");
}
@Test
@@ -166,12 +170,14 @@ public class TabularWriterTest {
int passwordLineNumber = 2;
String expectedPasswordLine = "\tpassword: " + user.getPassword();
- assertLineEquals(passwordLineNumber, expectedPasswordLine, "The password property should be the 3rd line printed");
+ assertLineEquals(passwordLineNumber, expectedPasswordLine,
+ "The password property should be the 3rd line printed");
int usernameLineNumber = 3;
String expectedUsernameLine = "\tusername: " + user.getUsername();
- assertLineEquals(usernameLineNumber, expectedUsernameLine, "The username property should be the 4th line printed");
+ assertLineEquals(usernameLineNumber, expectedUsernameLine,
+ "The username property should be the 4th line printed");
}
@Test
@@ -187,7 +193,8 @@ public class TabularWriterTest {
assertLineEquals(lineNumber, expectedLine, "The manager property should be the 3rd line printed");
}
- @Test(enabled = false) // TODO revisit
+ @Test(enabled = false)
+ // TODO revisit
public void oneToManyAssociationShouldPrintForEntity() {
User employee = new User(1, "rhq", "rhq");
@@ -199,8 +206,8 @@ public class TabularWriterTest {
int lineNumber = 2;
String expectedLine = "\temployees: " + company.getEmployees();
- assertLineEquals(lineNumber, expectedLine, "The employees property should be the 2nd line printed and the " +
- "toString() value of the collection should be displayed.");
+ assertLineEquals(lineNumber, expectedLine, "The employees property should be the 2nd line printed and the "
+ + "toString() value of the collection should be displayed.");
}
@Test
@@ -209,11 +216,8 @@ public class TabularWriterTest {
writer.print(resource);
- assertLineEquals(
- 1,
- "\t" + padResourceField("id") + ": " + resource.getId(),
- "Expected Resource.id to be the first property printed."
- );
+ assertLineEquals(1, "\t" + padResourceField("id") + ": " + resource.getId(),
+ "Expected Resource.id to be the first property printed.");
}
@Test
@@ -222,11 +226,8 @@ public class TabularWriterTest {
writer.print(resource);
- assertLineEquals(
- 2,
- "\t" + padResourceField("name") + ": " + resource.getName(),
- "Expected Resource.name to be second property printed"
- );
+ assertLineEquals(2, "\t" + padResourceField("name") + ": " + resource.getName(),
+ "Expected Resource.name to be second property printed");
}
@Test
@@ -235,11 +236,8 @@ public class TabularWriterTest {
writer.print(resource);
- assertLineEquals(
- 3,
- "\t" + padResourceField("version") + ": " + resource.getVersion(),
- "Expected Resource.version to be third property printed"
- );
+ assertLineEquals(3, "\t" + padResourceField("version") + ": " + resource.getVersion(),
+ "Expected Resource.version to be third property printed");
}
@Test
@@ -248,11 +246,9 @@ public class TabularWriterTest {
writer.print(resource);
- assertLineEquals(
- 4,
- "\t" + padResourceField("currentAvailability") + ": " + resource.getCurrentAvailability().getAvailabilityType(),
- "Expected short version of Resource.currentAvailability to be fourth property printed"
- );
+ assertLineEquals(4, "\t" + padResourceField("currentAvailability") + ": "
+ + resource.getCurrentAvailability().getAvailabilityType(),
+ "Expected short version of Resource.currentAvailability to be fourth property printed");
}
@Test
@@ -261,11 +257,8 @@ public class TabularWriterTest {
writer.print(resource);
- assertLineEquals(
- 4,
- "\t" + padResourceField("currentAvailability") + ": ",
- "Expected to see empty string for Resource.currentAvailability when property is null"
- );
+ assertLineEquals(4, "\t" + padResourceField("currentAvailability") + ": ",
+ "Expected to see empty string for Resource.currentAvailability when property is null");
}
@Test
@@ -274,47 +267,26 @@ public class TabularWriterTest {
writer.print(resource);
- assertLineEquals(
- 5,
- "\t" + padResourceField("resourceType") + ": " + resource.getResourceType().getName(),
- "Expected short version of Resource.resourceType to be the fifth property printed"
- );
+ assertLineEquals(5, "\t" + padResourceField("resourceType") + ": " + resource.getResourceType().getName(),
+ "Expected short version of Resource.resourceType to be the fifth property printed");
}
private Resource createResource() {
- return new ResourceBuilder().createServer()
- .usingDefaultResourceType()
- .withId(111)
- .withName("test-server")
- .withUuid("12345")
- .withVersion("1.0")
- .inInventory()
- .withCurrentAvailability(AvailabilityType.UP)
- .build();
+ return new ResourceBuilder().createServer().usingDefaultResourceType().withId(111).withName("test-server")
+ .withUuid("12345").withVersion("1.0").inInventory().withCurrentAvailability(AvailabilityType.UP).build();
}
private Resource createUncommittedResource() {
- return new ResourceBuilder().createServer()
- .usingDefaultResourceType()
- .withId(111)
- .withName("test-server")
- .withUuid("12345")
- .withVersion("1.0")
- .notInInventory()
- .build();
+ return new ResourceBuilder().createServer().usingDefaultResourceType().withId(111).withName("test-server")
+ .withUuid("12345").withVersion("1.0").notInInventory().build();
}
@Test
public void printCollectionOfUncommittedResource() {
- Resource parent = new ResourceBuilder().createServer()
- .usingDefaultResourceType()
- .withName("test-server")
- .withUuid("12345")
- .withVersion("1.0")
- .inInventory()
- .with(2).randomChildServices()
-// .notInInventory()
-// .included()
+ Resource parent = new ResourceBuilder().createServer().usingDefaultResourceType().withName("test-server")
+ .withUuid("12345").withVersion("1.0").inInventory().with(2).randomChildServices()
+ // .notInInventory()
+ // .included()
.build();
writer.print(parent.getChildResources());
@@ -322,13 +294,21 @@ public class TabularWriterTest {
void assertNumberOfLinesPrintedIs(int expectedNumberOfLines) {
String lines[] = getLines();
- assertEquals(lines.length, expectedNumberOfLines, "The actual lines printed were\n[\n" +
- stringWriter.toString() + "\n]");
+ assertEquals(lines.length, expectedNumberOfLines,
+ "The actual lines printed were\n[\n" + stringWriter.toString() + "\n]");
}
void assertLineEquals(int lineNumber, String expectedLine, String msg) {
+ assertLineEquals(lineNumber, expectedLine, msg, true);
+ }
+
+ void assertLineEquals(int lineNumber, String expectedLine, String msg, boolean addCR) {
String actualLine = getLines()[lineNumber];
+ if (addCR) {
+ expectedLine = (File.separatorChar == '/') ? expectedLine : (expectedLine + "\r");
+ }
+
assertEquals(actualLine, expectedLine, msg + " -- The actual output was \n[\n" + stringWriter + "\n].");
}
12 years, 2 months
[rhq] Changes to 'feature/arquillian-integration'
by lkrejci
New branch 'feature/arquillian-integration' available with the following commits:
commit 3e5ae62322a826c9570e534987aa4f72255fb871
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Feb 28 17:00:39 2012 +0100
RHQ's embedded PluginContainer is now accessible as an Arquillian container.
12 years, 2 months
[rhq] Branch 'bug/747925' - modules/enterprise
by mazz
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/MetadataBeanTest.java | 73 +++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest.java | 224 ++++++++++
modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/child1_plugin_v1.xml | 19
modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/child2_plugin_v1.xml | 19
modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/parent_plugin_v1.xml | 18
modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/parent_plugin_v2.xml | 18
6 files changed, 368 insertions(+), 3 deletions(-)
New commits:
commit 0828271307406c60c1c4da9a529dc02228be427c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Feb 28 10:09:50 2012 -0500
[BZ 747925] add more tests that simulate what the server does when it scans/registers plugins. this uses the actual scanner and deployer classes that the server does
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/MetadataBeanTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/MetadataBeanTest.java
index c93dd1f..bade273 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/MetadataBeanTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/MetadataBeanTest.java
@@ -3,6 +3,8 @@ package org.rhq.enterprise.server.resource.metadata;
import static org.rhq.core.clientapi.shared.PluginDescriptorUtil.loadPluginDescriptor;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
import java.net.URL;
import java.sql.Connection;
import java.util.ArrayList;
@@ -10,6 +12,8 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
import org.apache.commons.beanutils.MethodUtils;
import org.apache.commons.beanutils.PropertyUtils;
@@ -36,6 +40,7 @@ import org.rhq.core.domain.criteria.ResourceTypeCriteria;
import org.rhq.core.domain.plugin.Plugin;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.util.MessageDigestGenerator;
+import org.rhq.core.util.stream.StreamUtil;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.bundle.TestBundleServerPluginService;
import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
@@ -168,12 +173,11 @@ public class MetadataBeanTest extends AbstractEJB3Test {
return getClass().getResource(dir + "/" + descriptor);
}
- @SuppressWarnings("unused")
- private String getPluginWorkDir() throws Exception {
+ protected String getPluginWorkDir() throws Exception {
return getCurrentWorkingDir() + "/work";
}
- private String getCurrentWorkingDir() throws Exception {
+ protected String getCurrentWorkingDir() throws Exception {
return getClass().getResource(".").toURI().getPath();
}
@@ -250,4 +254,67 @@ public class MetadataBeanTest extends AbstractEJB3Test {
}
return false;
}
+
+ /**
+ * This actually creates a .jar file on the file system but doesn't register it.
+ *
+ * @param jarName the name to be given to the new jar file
+ * @param descriptorXmlFilename where the descriptor XML can be found on the test classloader
+ * @return the location of the new jar file
+ * @throws Exception
+ */
+ protected File createPluginJarFile(String jarName, String descriptorXmlFilename) throws Exception {
+ FileOutputStream stream = null;
+ JarOutputStream out = null;
+ InputStream in = null;
+
+ try {
+ String pluginDirPath = getPluginWorkDir();
+ File pluginDir = new File(pluginDirPath);
+ pluginDir.mkdirs();
+ File jarFile = new File(pluginDir, jarName);
+ jarFile.delete(); // in case some older file is hanging around, get rid of it
+ stream = new FileOutputStream(jarFile);
+ out = new JarOutputStream(stream);
+
+ // Add archive entry for the descriptor
+ JarEntry jarAdd = new JarEntry("META-INF/rhq-plugin.xml");
+ jarAdd.setTime(System.currentTimeMillis());
+ out.putNextEntry(jarAdd);
+
+ // Write the descriptor - note that we assume the xml file is in the test classloader
+ URL descriptorURL = getDescriptorURL(descriptorXmlFilename);
+ in = descriptorURL.openStream();
+ StreamUtil.copy(in, out, false);
+
+ return jarFile;
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ if (out != null) {
+ out.close();
+ }
+ if (stream != null) {
+ stream.close();
+ }
+ }
+ }
+
+ /**
+ * Tests can use this to let us know that a plugin has been deployed and needs to
+ * be cleaned up/removed at the end of the test.
+ *
+ * @param pluginName
+ */
+ protected void pluginDeployed(String pluginName) {
+ try {
+ PluginManagerLocal pluginMgr = LookupUtil.getPluginManager();
+ Plugin plugin = pluginMgr.getPlugin(pluginName);
+ if (plugin != null) {
+ this.pluginIds.add(plugin.getId());
+ }
+ } catch (Exception ignore) {
+ }
+ }
}
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest.java
new file mode 100644
index 0000000..a8a652d
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest.java
@@ -0,0 +1,224 @@
+package org.rhq.enterprise.server.resource.metadata;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.criteria.ResourceTypeCriteria;
+import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.enterprise.server.auth.SubjectManagerLocal;
+import org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner;
+import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
+import org.rhq.enterprise.server.util.LookupUtil;
+
+/**
+ * This test shows a plugin extended multiple times via the embedded extension model,
+ * but it tests starting with the server's plugin scanner service. This helps
+ * simulate more closely the full end-to-end agent plugin scanning and deployment
+ * mechanism during which resource types are registered.
+ *
+ * There is one parent plugin and two child plugins. This test makes sure multiple
+ * plugins can extend and be updated; it won't test a full comprehensive set of
+ * metadata being upgraded. See {@link PluginExtensionMetadataTest} for a
+ * comprehensive test showing all the different kinds of metadata being updated.
+ *
+ * @author John Mazzitelli
+ */
+@Test(groups = { "plugin.extension.scanning.metadata", "plugin.metadata" })
+public class PluginScanningExtensionMetadataTest extends MetadataBeanTest {
+
+ private static final String PLUGIN_NAME_PARENT = "PluginScanningExtensionMetadataParentTestPlugin";
+ private static final String PLUGIN_NAME_CHILD1 = "PluginScanningExtensionMetadataChild1TestPlugin";
+ private static final String PLUGIN_NAME_CHILD2 = "PluginScanningExtensionMetadataChild2TestPlugin";
+ private static final String TYPE_NAME_PARENT = "ParentServerA";
+ private static final String TYPE_NAME_CHILD1 = "Child1ServerA";
+ private static final String TYPE_NAME_CHILD2 = "Child2ServerA";
+
+ // names of things from the first version of the plugin metadata
+ private static final String OP_NAME = "A-op";
+ private static final int OP_TIMEOUT = 123456;
+ private static final String OP_DESC = "a op";
+
+ // names of things from the second, updated version of the plugin metadata
+ // updated operations
+ private static final String NEW_OP_NAME = "A-op-NEW";
+ private static final int NEW_OP_TIMEOUT = 987654;
+ private static final String NEW_OP_DESC = "a new op";
+
+ private SubjectManagerLocal subjectMgr;
+ private ResourceTypeManagerLocal resourceTypeMgr;
+
+ private List<File> createdJarFiles = new ArrayList<File>();
+ private PluginDeploymentScanner pluginScanner;
+
+ @BeforeMethod
+ public void prepareBeforeTestMethod() {
+ subjectMgr = LookupUtil.getSubjectManager();
+ resourceTypeMgr = LookupUtil.getResourceTypeManager();
+
+ // clean up any old previously generated jar files so they don't get in the way
+ if (!createdJarFiles.isEmpty()) {
+ for (File doomed : createdJarFiles) {
+ doomed.delete();
+ }
+ }
+ createdJarFiles.clear();
+ }
+
+ @AfterMethod(alwaysRun = true)
+ public void cleanUpAfterTestMethod() {
+ // clean up any generated jar files - we want to remove these so they don't get in the way of a future test run
+ if (!createdJarFiles.isEmpty()) {
+ for (File doomed : createdJarFiles) {
+ doomed.delete();
+ }
+ }
+ createdJarFiles.clear();
+ }
+
+ @Override
+ @Test(enabled = false)
+ // this method isn't a test method
+ public void preparePluginScannerService() {
+ if (this.pluginScanner == null) {
+ this.pluginScanner = new PluginDeploymentScanner();
+
+ String pluginDirPath = null;
+ try {
+ pluginDirPath = getPluginWorkDir();
+ } catch (Exception e) {
+ throw new RuntimeException("Cannot determine where to put the plugin jar files", e);
+ }
+ this.pluginScanner.setAgentPluginDir(new File(pluginDirPath)); // we don't want to scan for these
+ this.pluginScanner.setServerPluginDir(null); // we don't want to scan for these
+ this.pluginScanner.setScanPeriod(9999999L); // we want to manually scan - don't allow for auto-scan to happen
+ }
+ super.preparePluginScannerService(this.pluginScanner);
+
+ try {
+ this.pluginScanner.start();
+ } catch (Exception e) {
+ throw new RuntimeException(e); // should never really happen
+ }
+
+ }
+
+ public void testRegisterPlugins() throws Exception {
+ try {
+ registerParentPluginV1(); // create an initial type (called the parent)
+ registerChild1PluginV1(); // using plugin extension mechanism, create child #1 type that extends that parent type
+ registerChild2PluginV1(); // using plugin extension mechanism, create child #2 type that extends that parent type
+ registerParentPluginV2(); // update the parent type
+ checkChild1Plugin(); // check that the changes to the parent type propogated to the child #1
+ checkChild2Plugin(); // check that the changes to the parent type propogated to the child #2
+ } finally {
+ // let our superclass know about our plugins so it can clean them up
+ pluginDeployed(PLUGIN_NAME_PARENT);
+ pluginDeployed(PLUGIN_NAME_CHILD1);
+ pluginDeployed(PLUGIN_NAME_CHILD2);
+ }
+ }
+
+ private void registerParentPluginV1() throws Exception {
+ // register the plugin, load the new type and test to make sure its what we expect
+ createdJarFiles.add(createPluginJarFile("parent-plugin.jar", "parent_plugin_v1.xml"));
+ this.pluginScanner.startDeployment(); // first time we need to scan so call startDeployment which will call scanAndRegister
+ ResourceType resourceType = loadResourceTypeFully(TYPE_NAME_PARENT, PLUGIN_NAME_PARENT);
+ assert resourceType.getName().equals(TYPE_NAME_PARENT);
+ assert resourceType.getPlugin().equals(PLUGIN_NAME_PARENT);
+ assertVersion1(resourceType);
+ }
+
+ private void registerChild1PluginV1() throws Exception {
+ // register the plugin, load the new type and test to make sure its what we expect
+ createdJarFiles.add(createPluginJarFile("child1-plugin.jar", "child1_plugin_v1.xml"));
+ this.pluginScanner.scanAndRegister();
+ ResourceType resourceType = loadResourceTypeFully(TYPE_NAME_CHILD1, PLUGIN_NAME_CHILD1);
+ assert resourceType.getName().equals(TYPE_NAME_CHILD1);
+ assert resourceType.getPlugin().equals(PLUGIN_NAME_CHILD1);
+ assertVersion1(resourceType);
+
+ // in our child #1 plugin, our extended type is actually a child of child #1 plugin's root type
+ // here we want to make sure that hierarchy remains intact with our extended type - the parent
+ // of our extended type should be this child #1 root type
+ assert resourceType.getParentResourceTypes() != null;
+ assert resourceType.getParentResourceTypes().size() == 1;
+ assert resourceType.getParentResourceTypes().iterator().next().getName().equals("OuterServerA");
+ }
+
+ private void registerChild2PluginV1() throws Exception {
+ // register the plugin, load the new type and test to make sure its what we expect
+ createdJarFiles.add(createPluginJarFile("child2-plugin.jar", "child2_plugin_v1.xml"));
+ this.pluginScanner.scanAndRegister();
+ ResourceType resourceType = loadResourceTypeFully(TYPE_NAME_CHILD2, PLUGIN_NAME_CHILD2);
+ assert resourceType.getName().equals(TYPE_NAME_CHILD2);
+ assert resourceType.getPlugin().equals(PLUGIN_NAME_CHILD2);
+ assertVersion1(resourceType);
+ }
+
+ private void registerParentPluginV2() throws Exception {
+ // register the plugin, load the new type and test to make sure its what we expect
+ createdJarFiles.add(createPluginJarFile("parent-plugin.jar", "parent_plugin_v2.xml"));
+ this.pluginScanner.scanAndRegister();
+ ResourceType resourceType = loadResourceTypeFully(TYPE_NAME_PARENT, PLUGIN_NAME_PARENT);
+ assert resourceType.getName().equals(TYPE_NAME_PARENT);
+ assert resourceType.getPlugin().equals(PLUGIN_NAME_PARENT);
+ assertVersion2(resourceType);
+ }
+
+ private void checkChild1Plugin() throws Exception {
+ // load the child #1 type and test to make sure it has been updated to what we expect
+ ResourceType resourceType = loadResourceTypeFully(TYPE_NAME_CHILD1, PLUGIN_NAME_CHILD1);
+ assert resourceType.getName().equals(TYPE_NAME_CHILD1);
+ assert resourceType.getPlugin().equals(PLUGIN_NAME_CHILD1);
+ assertVersion2(resourceType);
+
+ // in our child #1 plugin, our extended type is actually a child of child #1 plugin's root type
+ // here we want to make sure that hierarchy remains intact with our extended type - the parent
+ // of our extended type should be this child #1 root type
+ assert resourceType.getParentResourceTypes() != null;
+ assert resourceType.getParentResourceTypes().size() == 1;
+ assert resourceType.getParentResourceTypes().iterator().next().getName().equals("OuterServerA");
+ }
+
+ private void checkChild2Plugin() throws Exception {
+ // load the child #2 type and test to make sure it has been updated to what we expect
+ ResourceType resourceType = loadResourceTypeFully(TYPE_NAME_CHILD2, PLUGIN_NAME_CHILD2);
+ assert resourceType.getName().equals(TYPE_NAME_CHILD2);
+ assert resourceType.getPlugin().equals(PLUGIN_NAME_CHILD2);
+ assertVersion2(resourceType);
+ }
+
+ private void assertVersion1(ResourceType resourceType) {
+ assert resourceType.getOperationDefinitions().size() == 1;
+ OperationDefinition op = resourceType.getOperationDefinitions().iterator().next();
+ assert op.getName().equals(OP_NAME);
+ assert op.getTimeout().intValue() == OP_TIMEOUT;
+ assert op.getDescription().equals(OP_DESC);
+ }
+
+ private void assertVersion2(ResourceType resourceType) {
+ assert resourceType.getOperationDefinitions().size() == 1;
+ OperationDefinition op = resourceType.getOperationDefinitions().iterator().next();
+ assert op.getName().equals(NEW_OP_NAME);
+ assert op.getTimeout().intValue() == NEW_OP_TIMEOUT;
+ assert op.getDescription().equals(NEW_OP_DESC);
+ }
+
+ private ResourceType loadResourceTypeFully(String typeName, String typePlugin) {
+ ResourceTypeCriteria c = new ResourceTypeCriteria();
+ c.addFilterName(typeName);
+ c.addFilterPluginName(typePlugin);
+ c.setStrict(true);
+ c.fetchParentResourceTypes(true);
+ c.fetchOperationDefinitions(true);
+ List<ResourceType> t = resourceTypeMgr.findResourceTypesByCriteria(subjectMgr.getOverlord(), c);
+ ResourceType resourceType = t.get(0);
+ return resourceType;
+ }
+}
diff --git a/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/child1_plugin_v1.xml b/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/child1_plugin_v1.xml
new file mode 100644
index 0000000..e006bc9
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/child1_plugin_v1.xml
@@ -0,0 +1,19 @@
+<plugin name="PluginScanningExtensionMetadataChild1TestPlugin"
+ version="1.0"
+ displayName="Plugin Scanning Extension Metadata Child 1 Test Plugin"
+ package="org.rhq.plugins.test.child1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <server name="OuterServerA">
+ <server name="Child1ServerA"
+ description="Child 1 Server type that extends Parent Server type"
+ discovery="Child1DiscoveryComponent"
+ class="Child1Component"
+ sourcePlugin="PluginScanningExtensionMetadataParentTestPlugin"
+ sourceType="ParentServerA">
+ </server>
+ </server>
+
+</plugin>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/child2_plugin_v1.xml b/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/child2_plugin_v1.xml
new file mode 100644
index 0000000..18436bc
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/child2_plugin_v1.xml
@@ -0,0 +1,19 @@
+<plugin name="PluginScanningExtensionMetadataChild2TestPlugin"
+ version="1.0"
+ displayName="Plugin Scanning Extension Metadata Child 2 Test Plugin"
+ package="org.rhq.plugins.test.child2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+
+ <server name="Child2ServerA"
+ description="Child 2 Server type that extends Parent Server type"
+ discovery="Child2DiscoveryComponent"
+ class="Child2Component"
+ sourcePlugin="PluginScanningExtensionMetadataParentTestPlugin"
+ sourceType="ParentServerA">
+ </server>
+
+
+</plugin>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/parent_plugin_v1.xml b/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/parent_plugin_v1.xml
new file mode 100644
index 0000000..1622baa
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/parent_plugin_v1.xml
@@ -0,0 +1,18 @@
+<plugin name="PluginScanningExtensionMetadataParentTestPlugin"
+ version="1.0"
+ displayName="Plugin Scanning Extension Metadata Parent Test Plugin"
+ package="org.rhq.plugins.test.parent"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <server name="ParentServerA"
+ description="Parent Server type that can be extended by a Child Server type"
+ discovery="ParentDiscoveryComponent"
+ class="ParentComponent">
+
+ <operation name="A-op" timeout="123456" description="a op"></operation>
+
+ </server>
+
+</plugin>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/parent_plugin_v2.xml b/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/parent_plugin_v2.xml
new file mode 100644
index 0000000..b119590
--- /dev/null
+++ b/modules/enterprise/server/jar/src/test/resources/org/rhq/enterprise/server/resource/metadata/PluginScanningExtensionMetadataTest/parent_plugin_v2.xml
@@ -0,0 +1,18 @@
+<plugin name="PluginScanningExtensionMetadataParentTestPlugin"
+ version="2.0"
+ displayName="Plugin Scanning Extension Metadata Parent Test Plugin"
+ package="org.rhq.plugins.test.parent"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <server name="ParentServerA"
+ description="Parent Server type that can be extended by a Child Server type"
+ discovery="ParentDiscoveryComponent"
+ class="ParentComponent">
+
+ <operation name="A-op-NEW" timeout="987654" description="a new op"></operation>
+
+ </server>
+
+</plugin>
\ No newline at end of file
12 years, 2 months
[rhq] 9 commits - modules/plugins
by Simeon Pinder
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java | 138 ++++
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java | 129 +---
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java | 8
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java | 36 -
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java | 64 +-
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java | 35 -
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java | 300 ++++------
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java | 194 +++---
8 files changed, 490 insertions(+), 414 deletions(-)
New commits:
commit 94cc4206c8525ca9b69469947dc5deab4633a13e
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Feb 27 18:19:28 2012 -0500
fix unit test failures for as7 configuration.
- needed to overload the execute behavior just for these tests.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java
index 1af2f2f..72166d5 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/AbstractConfigurationHandlingTest.java
@@ -19,6 +19,7 @@
package org.rhq.modules.plugins.jbossas7;
import java.io.BufferedReader;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
@@ -31,6 +32,8 @@ import javax.xml.bind.util.ValidationEventCollector;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.node.ObjectNode;
@@ -42,6 +45,7 @@ import org.rhq.core.clientapi.descriptor.plugin.ServerDescriptor;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.modules.plugins.jbossas7.json.Address;
import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.Result;
/**
* Base class for configuration handling tests
@@ -53,7 +57,6 @@ public class AbstractConfigurationHandlingTest {
private Log log = LogFactory.getLog(getClass());
private PluginDescriptor pluginDescriptor;
-
void loadPluginDescriptor() throws Exception {
try {
URL descriptorUrl = this.getClass().getClassLoader().getResource(DESCRIPTOR_FILENAME);
@@ -102,8 +105,7 @@ public class AbstractConfigurationHandlingTest {
builder.append(line);
}
return builder.toString();
- }
- finally {
+ } finally {
reader.close();
}
}
@@ -114,6 +116,23 @@ public class AbstractConfigurationHandlingTest {
*
*/
protected class FakeConnection extends ASConnection {
+ private ObjectMapper mapper = new ObjectMapper();
+
+ @Override
+ public Result execute(Operation op) {
+ JsonNode json = executeRaw(op);
+ Result result = null;
+ try {
+ result = mapper.readValue(json, Result.class);
+ } catch (JsonParseException e) {
+ e.printStackTrace();
+ } catch (JsonMappingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return result;
+ }
JsonNode content;
@@ -127,11 +146,11 @@ public class AbstractConfigurationHandlingTest {
@Override
public JsonNode executeRaw(Operation operation) {
- if (content==null)
+ if (content == null)
throw new IllegalStateException("Content not yet set");
Address address = operation.getAddress();
- if (address!=null && !address.isEmpty()) {
+ if (address != null && !address.isEmpty()) {
// we need to clone the content and then for the result find the right sub-content to put into result and
// return this one.
@@ -139,17 +158,17 @@ public class AbstractConfigurationHandlingTest {
String[] parts = address.getPath().split("=");
String key = parts[0];
String val = parts[1];
- JsonNode result = content.get("result");
+ JsonNode result = content.get("result");
JsonNode keyNode = result.get(key);
JsonNode valNode = keyNode.get(val);
// clone the original content
ObjectMapper tmpMapper = new ObjectMapper();
JsonNode tmp = tmpMapper.createObjectNode();
- ((ObjectNode)tmp).putAll(((ObjectNode)content));
+ ((ObjectNode) tmp).putAll(((ObjectNode) content));
// replace the result with the sub-content
- ((ObjectNode)tmp).put("result",valNode);
+ ((ObjectNode) tmp).put("result", valNode);
return tmp;
}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
index 8e3704b..db086f6 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
@@ -18,14 +18,10 @@
*/
package org.rhq.modules.plugins.jbossas7;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.testng.annotations.BeforeSuite;
@@ -58,208 +54,172 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
}
public void test1() throws Exception {
- FakeConnection connection = new FakeConnection();
- ConfigurationDefinition definition = new ConfigurationDefinition("foo","Test1");
+ //create a fake connection so that we control the execute behavior
+ FakeConnection connection = new FakeConnection();
+ //create/mock a configuration definition. Remember definition shared between N configurations.
+ ConfigurationDefinition definition = new ConfigurationDefinition("foo", "Test1");
+ //?
definition.setConfigurationFormat(ConfigurationFormat.STRUCTURED);
- definition.put(new PropertyDefinitionSimple("access-log", "Access-Log", false,
- PropertySimpleType.STRING));
- definition.put(new PropertyDefinitionSimple("rewrite", "Rewrite", false,
- PropertySimpleType.BOOLEAN));
- definition.put(new PropertyDefinitionSimple("notThere", "NotThere", false,
- PropertySimpleType.STRING));
- definition.put(new PropertyDefinitionList("alias", "Alias", true, new PropertyDefinitionSimple(
- "alias", "alias", true, PropertySimpleType.STRING)));
+ //Add a few properties that we will be testing/exercising
+ definition.put(new PropertyDefinitionSimple("access-log", "Access-Log", false, PropertySimpleType.STRING));
+ definition.put(new PropertyDefinitionSimple("rewrite", "Rewrite", false, PropertySimpleType.BOOLEAN));
+ definition.put(new PropertyDefinitionSimple("notThere", "NotThere", false, PropertySimpleType.STRING));
+ definition.put(new PropertyDefinitionList("alias", "Alias", true, new PropertyDefinitionSimple("alias",
+ "alias", true, PropertySimpleType.STRING)));
-
- String resultString = " {\"outcome\" : \"success\", \"result\" : {\"alias\" : [\"example.com\",\"example2.com\"],"+
- " \"access-log\" : \"my.log\", \"rewrite\" : true}}";
+ //Construct the result string that we would expect back.
+ String resultString = " {\"outcome\" : \"success\", \"result\" : {\"alias\" : [\"example.com\",\"example2.com\"],"
+ + " \"access-log\" : \"my.log\", \"rewrite\" : true}}";
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ //deserialize string to ComplexResult.
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
+
+ //create json tree from result.
JsonNode json = mapper.valueToTree(result);
+ //add the created content to the fake connection so that we set the results to be returned.
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ //We pass in null here so that the fake connection will return the value passed into setContent().
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
- assert config.get("alias")!=null;
+ assert config.get("alias") != null;
assert config.get("alias") instanceof PropertyList;
PropertyList aliases = (PropertyList) config.get("alias");
List<Property> list = aliases.getList();
- assert list.size()==2;
- int count=2;
- for (Property p: list) {
+ assert list.size() == 2;
+ int count = 2;
+ for (Property p : list) {
PropertySimple ps = (PropertySimple) p;
if (ps.getStringValue().equals("example.com"))
count--;
if (ps.getStringValue().equals("example2.com"))
count--;
}
- assert count==0 : "Did not find all needed aliases";
+ assert count == 0 : "Did not find all needed aliases";
Property notThere = config.get("notThere");
- assert notThere !=null;
- assert ((PropertySimple)notThere).getStringValue()==null;
+ assert notThere != null;
+ assert ((PropertySimple) notThere).getStringValue() == null;
PropertySimple property = (PropertySimple) config.get("rewrite");
- assert property!=null;
+ assert property != null;
assert property.getBooleanValue();
property = (PropertySimple) config.get("access-log");
- assert property!=null && property.getStringValue()!=null;
+ assert property != null && property.getStringValue() != null;
assert property.getStringValue().equals("my.log");
}
public void test2() throws Exception {
- String resultString = "{\n" +
- " \"outcome\" : \"success\",\n" +
- " \"result\" : {\n" +
- " \"autoflush\" : true,\n" +
- " \"encoding\" : null,\n" +
- " \"formatter\" : \"%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n\",\n" +
- " \"level\" : \"INFO\",\n" +
- " \"file\" : {\n" +
- " \"path\" : \"server.log\",\n" +
- " \"relative-to\" : \"jboss.server.log.dir\"\n" +
- " },\n" +
- " \"suffix\" : \".yyyy-MM-dd\"\n" +
- " },\n" +
- " \"response-headers\" : null\n" +
- "}";
+ String resultString = "{\n" + " \"outcome\" : \"success\",\n" + " \"result\" : {\n"
+ + " \"autoflush\" : true,\n" + " \"encoding\" : null,\n"
+ + " \"formatter\" : \"%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n\",\n" + " \"level\" : \"INFO\",\n"
+ + " \"file\" : {\n" + " \"path\" : \"server.log\",\n"
+ + " \"relative-to\" : \"jboss.server.log.dir\"\n" + " },\n" + " \"suffix\" : \".yyyy-MM-dd\"\n"
+ + " },\n" + " \"response-headers\" : null\n" + "}";
FakeConnection connection = new FakeConnection();
- ConfigurationDefinition definition = new ConfigurationDefinition("foo","Test1");
+ ConfigurationDefinition definition = new ConfigurationDefinition("foo", "Test1");
PropertyDefinitionSimple propertyDefinition = new PropertyDefinitionSimple("autoflush", "Autoflush", false,
- PropertySimpleType.BOOLEAN);
+ PropertySimpleType.BOOLEAN);
propertyDefinition.setDefaultValue("true");
definition.put(propertyDefinition);
- propertyDefinition = new PropertyDefinitionSimple("encoding", "Encoding", false,
- PropertySimpleType.STRING);
+ propertyDefinition = new PropertyDefinitionSimple("encoding", "Encoding", false, PropertySimpleType.STRING);
propertyDefinition.setDefaultValue("HelloWorld");
definition.put(propertyDefinition);
- PropertyDefinitionSimple pathProperty = new PropertyDefinitionSimple("path","File path",true,PropertySimpleType.STRING);
- PropertyDefinitionSimple relativeToProperty = new PropertyDefinitionSimple("relative-to","Relative-To",true,PropertySimpleType.STRING);
- PropertyDefinitionMap fileMapDef = new PropertyDefinitionMap("file","Log file",true,pathProperty,relativeToProperty);
+ PropertyDefinitionSimple pathProperty = new PropertyDefinitionSimple("path", "File path", true,
+ PropertySimpleType.STRING);
+ PropertyDefinitionSimple relativeToProperty = new PropertyDefinitionSimple("relative-to", "Relative-To", true,
+ PropertySimpleType.STRING);
+ PropertyDefinitionMap fileMapDef = new PropertyDefinitionMap("file", "Log file", true, pathProperty,
+ relativeToProperty);
definition.put(fileMapDef);
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
- assert config!=null;
- assert config.get("autoflush")!=null : "Autoflush was null";
+ assert config != null;
+ assert config.get("autoflush") != null : "Autoflush was null";
assert config.getSimple("autoflush").getBooleanValue() : "Autoflush was false";
PropertyMap fileMap = (PropertyMap) config.get("file");
- assert fileMap!=null : "File Map was null";
+ assert fileMap != null : "File Map was null";
PropertySimple path = (PropertySimple) fileMap.get("path");
- assert path!=null : "File->path was null";
+ assert path != null : "File->path was null";
assert path.getStringValue().equals("server.log") : "File->path wrong";
-
}
-
public void test3() throws Exception {
- String resultString = "{\n" +
- " \"outcome\" : \"success\",\n" +
- " \"result\" : {\n" +
- " \"name\" : \"standard-sockets\",\n" +
- " \"default-interface\" : \"default\",\n" +
- " \"port-offset\" : \"0\",\n" +
- " \"socket-binding\" : {\n" +
- " \"jndi\" : {\n" +
- " \"name\" : \"jndi\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 1099,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : null,\n" +
- " \"multicast-port\" : null\n" +
- " },\n" +
- " \"jmx-connector-registry\" : {\n" +
- " \"name\" : \"jmx-connector-registry\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 1090,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : null,\n" +
- " \"multicast-port\" : null\n" +
- " },\n" +
- " \"jmx-connector-server\" : {\n" +
- " \"name\" : \"jmx-connector-server\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 1091,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : null,\n" +
- " \"multicast-port\" : null\n" +
- " },\n" +
- " \"http\" : {\n" +
- " \"name\" : \"http\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 8080,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : null,\n" +
- " \"multicast-port\" : null\n" +
- " },\n" +
- " \"https\" : {\n" +
- " \"name\" : \"https\",\n" +
- " \"interface\" : null,\n" +
- " \"port\" : 8447,\n" +
- " \"fixed-port\" : null,\n" +
- " \"multicast-address\" : \"224.1.2.3\",\n" +
- " \"multicast-port\" : 18447\n" +
- " }"+
- " }\n" +
- " }\n" +
- "}";
+ String resultString = "{\n" + " \"outcome\" : \"success\",\n" + " \"result\" : {\n"
+ + " \"name\" : \"standard-sockets\",\n" + " \"default-interface\" : \"default\",\n"
+ + " \"port-offset\" : \"0\",\n" + " \"socket-binding\" : {\n" + " \"jndi\" : {\n"
+ + " \"name\" : \"jndi\",\n" + " \"interface\" : null,\n" + " \"port\" : 1099,\n"
+ + " \"fixed-port\" : null,\n" + " \"multicast-address\" : null,\n"
+ + " \"multicast-port\" : null\n" + " },\n" + " \"jmx-connector-registry\" : {\n"
+ + " \"name\" : \"jmx-connector-registry\",\n" + " \"interface\" : null,\n"
+ + " \"port\" : 1090,\n" + " \"fixed-port\" : null,\n"
+ + " \"multicast-address\" : null,\n" + " \"multicast-port\" : null\n" + " },\n"
+ + " \"jmx-connector-server\" : {\n" + " \"name\" : \"jmx-connector-server\",\n"
+ + " \"interface\" : null,\n" + " \"port\" : 1091,\n" + " \"fixed-port\" : null,\n"
+ + " \"multicast-address\" : null,\n" + " \"multicast-port\" : null\n" + " },\n"
+ + " \"http\" : {\n" + " \"name\" : \"http\",\n" + " \"interface\" : null,\n"
+ + " \"port\" : 8080,\n" + " \"fixed-port\" : null,\n"
+ + " \"multicast-address\" : null,\n" + " \"multicast-port\" : null\n" + " },\n"
+ + " \"https\" : {\n" + " \"name\" : \"https\",\n" + " \"interface\" : null,\n"
+ + " \"port\" : 8447,\n" + " \"fixed-port\" : null,\n"
+ + " \"multicast-address\" : \"224.1.2.3\",\n" + " \"multicast-port\" : 18447\n" + " }"
+ + " }\n" + " }\n" + "}";
ConfigurationDefinition definition = loadDescriptor("socketBinding");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
-
assert config != null;
PropertyList propertyList = (PropertyList) config.get("socket-binding");
- assert propertyList!=null;
+ assert propertyList != null;
List<Property> list = propertyList.getList();
- assert list.size()==5;
+ assert list.size() == 5;
for (Property prop : list) {
PropertyMap propMap2 = (PropertyMap) prop;
- Map<String,Property> map2 = propMap2.getMap();
- assert map2.size()==6;
+ Map<String, Property> map2 = propMap2.getMap();
+ assert map2.size() == 6;
assert map2.containsKey("port");
assert map2.containsKey("multicast-port");
assert map2.containsKey("multicast-address");
- if (((PropertySimple)map2.get("name")).getStringValue().equals("https")) {
- assert ((PropertySimple)map2.get("port")).getIntegerValue()==8447;
- assert ((PropertySimple)map2.get("multicast-port")).getIntegerValue()==18447;
+ if (((PropertySimple) map2.get("name")).getStringValue().equals("https")) {
+ assert ((PropertySimple) map2.get("port")).getIntegerValue() == 8447;
+ assert ((PropertySimple) map2.get("multicast-port")).getIntegerValue() == 18447;
}
}
}
-
public void test4() throws Exception {
String resultString = loadJsonFromFile("extensions.json");
@@ -267,31 +227,30 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test4");
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
assert config != null;
PropertyList extensions = (PropertyList) config.get("extension");
- assert extensions !=null;
+ assert extensions != null;
List<Property> extensionList = extensions.getList();
- assert extensionList.size()==22 : "Expected 22 extensions, got " + extensionList.size();
+ assert extensionList.size() == 22 : "Expected 22 extensions, got " + extensionList.size();
PropertyMap propertyMap = (PropertyMap) extensionList.get(0);
assert propertyMap != null;
PropertyMap starMap = (PropertyMap) propertyMap.get("*");
- assert starMap!=null;
+ assert starMap != null;
PropertySimple module = (PropertySimple) starMap.get("module");
- assert module!=null : "Module was null, but should not";
+ assert module != null : "Module was null, but should not";
String stringValue = module.getStringValue();
- assert stringValue!=null : "module property has no value";
+ assert stringValue != null : "module property has no value";
assert stringValue.equals("org.jboss.as.arquillian.service");
-
}
public void test5() throws Exception {
@@ -301,27 +260,27 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test5");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
assert config != null;
PropertyList locations = (PropertyList) config.get("schema-locations");
- assert locations!=null;
+ assert locations != null;
List<Property> list = locations.getList();
- assert list.size()==21 : "List does not contain 21 entries, but " + list.size();
+ assert list.size() == 21 : "List does not contain 21 entries, but " + list.size();
PropertyMap propertyMap = (PropertyMap) list.get(0);
- assert propertyMap !=null;
- Map<String,Property> map = propertyMap.getMap();
- assert map.size()==1;
+ assert propertyMap != null;
+ Map<String, Property> map = propertyMap.getMap();
+ assert map.size() == 1;
PropertySimple urnProp = (PropertySimple) map.get("*");
String stringValue = urnProp.getStringValue();
- assert stringValue!=null : "Location property has no value";
+ assert stringValue != null : "Location property has no value";
assert stringValue.endsWith(".xsd");
}
@@ -333,27 +292,27 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test6and7");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
assert config != null;
PropertySimple nameProperty = (PropertySimple) config.get("name");
- assert nameProperty !=null;
+ assert nameProperty != null;
String stringValue = nameProperty.getStringValue();
- assert stringValue!=null;
+ assert stringValue != null;
assert stringValue.equals("default");
Property criteria = config.get("criteria");
- assert criteria !=null;
+ assert criteria != null;
PropertySimple critProp = (PropertySimple) criteria;
stringValue = critProp.getStringValue();
- assert stringValue!=null;
+ assert stringValue != null;
}
@@ -364,27 +323,27 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test6and7");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
assert config != null;
PropertySimple nameProperty = (PropertySimple) config.get("name");
- assert nameProperty !=null;
+ assert nameProperty != null;
String stringValue = nameProperty.getStringValue();
- assert stringValue!=null;
+ assert stringValue != null;
assert stringValue.equals("public");
Property criteria = config.get("criteria");
- assert criteria !=null;
+ assert criteria != null;
PropertySimple critProp = (PropertySimple) criteria;
stringValue = critProp.getStringValue();
- assert stringValue!=null;
+ assert stringValue != null;
assert stringValue.equals("any-ipv4-address");
}
@@ -396,24 +355,25 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test8");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
- assert config!=null;
- assert config.getAllProperties().size()==8 : "Did not find 8 properties, but " + config.getAllProperties().size();
+ assert config != null;
+ assert config.getAllProperties().size() == 8 : "Did not find 8 properties, but "
+ + config.getAllProperties().size();
Property prop = config.get("bean-validation-enabled");
assert prop != null;
PropertySimple ps = (PropertySimple) prop;
assert ps.getBooleanValue();
prop = config.get("cached-connection-manager-error");
- assert prop!=null;
+ assert prop != null;
ps = (PropertySimple) prop;
- assert ps.getBooleanValue()==false;
+ assert ps.getBooleanValue() == false;
}
@@ -422,45 +382,43 @@ public class ConfigurationLoadingTest extends AbstractConfigurationHandlingTest
ConfigurationDefinition definition = loadDescriptor("test9");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
FakeConnection connection = new FakeConnection();
connection.setContent(json);
- ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,connection,null);
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition, connection, null);
Configuration config = delegate.loadResourceConfiguration();
- assert config!=null;
+ assert config != null;
Collection<Property> properties = config.getProperties();
- assert properties.size()==6 : "Got " + properties.size() + " props instead of 6: " + properties.toString();
+ assert properties.size() == 6 : "Got " + properties.size() + " props instead of 6: " + properties.toString();
PropertySimple simple = config.getSimple("check-interval");
- assert simple !=null;
+ assert simple != null;
Integer integerValue = simple.getIntegerValue();
- assert integerValue !=null : "check-interval was null";
- assert integerValue ==17 : "check-interval was not 17 but " + integerValue;
+ assert integerValue != null : "check-interval was null";
+ assert integerValue == 17 : "check-interval was not 17 but " + integerValue;
PropertySimple disabled = config.getSimple("disabled");
- assert disabled !=null : "disabled was null";
+ assert disabled != null : "disabled was null";
Boolean booleanValue = disabled.getBooleanValue();
- assert booleanValue !=null;
+ assert booleanValue != null;
assert booleanValue;
PropertySimple listings = config.getSimple("listings");
- assert listings !=null;
+ assert listings != null;
Boolean booleanValue1 = listings.getBooleanValue();
- assert booleanValue1 !=null;
+ assert booleanValue1 != null;
assert !booleanValue1;
PropertySimple simple1 = config.getSimple("max-depth");
- assert simple1 !=null;
+ assert simple1 != null;
Integer integerValue1 = simple1.getIntegerValue();
- assert integerValue1 !=null;
- assert integerValue1 ==3;
+ assert integerValue1 != null;
+ assert integerValue1 == 3;
PropertySimple simple2 = config.getSimple("default-virtual-server");
- assert simple2 !=null;
+ assert simple2 != null;
String stringValue = simple2.getStringValue();
- assert stringValue !=null;
+ assert stringValue != null;
assert stringValue.equals("default-host");
-
-
}
}
commit 80562eaf03271de823632c9c63439271126b13df
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Feb 27 17:19:23 2012 -0500
Fix copy paste mistake.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 7722312..ef4506c 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -134,7 +134,7 @@ public class ASConnection {
if ((json_to_send.indexOf(JSON_SERVER_CONFIG + EAP_PREFIX) > -1)
|| (json_to_send.indexOf(JSON_SERVER_CONFIG + EDG_PREFIX) > -1)
|| (json_to_send.indexOf(JSON_NAME + EAP_PREFIX) > -1)
- || (json_to_send.indexOf(JSON_NAME + EAP_PREFIX) > -1)) {
+ || (json_to_send.indexOf(JSON_NAME + EDG_PREFIX) > -1)) {
//delve into Operation and remove prefixes
Operation purgedOperation = purgeOperation(operation);
commit 8b2e5871114d8c08545befc8b9486129f82b2d34
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 16:17:07 2012 -0500
adding more context for unparsable json change.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 76a630a..7722312 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -382,6 +382,8 @@ public class ASConnection {
return failure;
}
//spinder 2/22/12: if unparsable JSON detected remove it. TODO: see if fixed with later version of jackson
+ //This needs to be in place until i)Jackson version where this is fixed or
+ // ii) fix for https://issues.jboss.org/browse/JBPAPP-8233
if (as7ResultSerialization.indexOf(UNPARSABLE_JSON) > -1) {
if (verbose) {
log.warn("------ Detected unparsable JSON <" + as7ResultSerialization + ">.");
commit c70a38dd3de2d8d4a1c25634ff3ceb83bd1a36bb
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 15:06:34 2012 -0500
Return failure Result for unexpected errors instead of null.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 00f61d2..76a630a 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -403,7 +403,15 @@ public class ASConnection {
return res;
} catch (IOException e) {
log.error(e.getMessage());
- return null;
+ if (verbose) {
+ log.error("----------- Operation execution unparsable. Request " + ":[" + op + "] Response:<" + node
+ + ">");
+ }
+ Result failure = new Result();
+ failure.setFailureDescription("Operation <" + op + "> returned unparsable JSON, <" + node + ">.");
+ return failure;
+ //don't return null.
+ //return null;
}
}
commit cf0c1af06a5d552413bdd404b320d01bfb5c1635
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 15:03:00 2012 -0500
Modifying connection class to handle 'failure-description' responses from AS7 as we were currently detecting as invalid json.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 812c5ff..00f61d2 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -57,6 +57,7 @@ public class ASConnection {
Authenticator passwordAuthenticator;
private String host;
private int port;
+ private String FAILURE_DESCRIPTION = "\"failure-description\"";
private String UNPARSABLE_JSON = ",\"server-groups\":null";
private static String EAP_PREFIX = AbstractBaseDiscovery.EAP_PREFIX;
private static String EDG_PREFIX = AbstractBaseDiscovery.EDG_PREFIX;
@@ -364,8 +365,22 @@ public class ASConnection {
Result res;
try {
+ //check for failure-description indicator, otherwise ObjectMapper will try to deserialize as json. Ex.
+ // {"outcome":"failed","failure-description":"JBAS014792: Unknown attribute number-of-timed-out-transactions","rolled-back":true}
String as7ResultSerialization = node.toString();
+ if (as7ResultSerialization.indexOf(FAILURE_DESCRIPTION) > -1) {
+ if (verbose) {
+ log.warn("------ Detected 'failure-description' when communicating with server."
+ + as7ResultSerialization);
+ }
+ Result failure = new Result();
+ int failIndex = as7ResultSerialization.indexOf(FAILURE_DESCRIPTION);
+ String failMessage = "";
+ failMessage = as7ResultSerialization.substring(failIndex + FAILURE_DESCRIPTION.length() + 1);
+ failure.setFailureDescription("Operation <" + op + "> returned <" + failMessage + ">");
+ return failure;
+ }
//spinder 2/22/12: if unparsable JSON detected remove it. TODO: see if fixed with later version of jackson
if (as7ResultSerialization.indexOf(UNPARSABLE_JSON) > -1) {
if (verbose) {
commit 1bf2f81404a399f823d3f1bf7b6b8b74144ac7fb
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 14:57:36 2012 -0500
Removing extra JSON segment returned with some results from AS7.
- Jackson libraries confused by extra JSON segment returned even though the returned string is valid JSON.
- We need to check out whether this is still a problem with later jackson versions.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 6249bbc..812c5ff 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -57,6 +57,7 @@ public class ASConnection {
Authenticator passwordAuthenticator;
private String host;
private int port;
+ private String UNPARSABLE_JSON = ",\"server-groups\":null";
private static String EAP_PREFIX = AbstractBaseDiscovery.EAP_PREFIX;
private static String EDG_PREFIX = AbstractBaseDiscovery.EDG_PREFIX;
private static String NAME = "name";
@@ -362,6 +363,23 @@ public class ASConnection {
}
Result res;
try {
+
+ String as7ResultSerialization = node.toString();
+
+ //spinder 2/22/12: if unparsable JSON detected remove it. TODO: see if fixed with later version of jackson
+ if (as7ResultSerialization.indexOf(UNPARSABLE_JSON) > -1) {
+ if (verbose) {
+ log.warn("------ Detected unparsable JSON <" + as7ResultSerialization + ">.");
+ }
+ String trimExtraJson = "";
+ int index = as7ResultSerialization.indexOf(UNPARSABLE_JSON);
+ trimExtraJson = as7ResultSerialization.substring(0, index)
+ + as7ResultSerialization.substring(index + UNPARSABLE_JSON.length());
+ res = (isComplex) ? mapper.readValue(trimExtraJson, ComplexResult.class) : mapper.readValue(
+ trimExtraJson, Result.class);
+ return res;
+ }
+
if (isComplex) {
res = mapper.readValue(node, ComplexResult.class);
} else {
commit 3869977299956619d02c36e0bbd179c50fe97e86
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 14:53:44 2012 -0500
[BZ 785128] unable to remove managed server. Have to remove EAP/EDG
prefixes when carrying out operations on the server now since we're
prepending EAP/EDG depending on EAP server used.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
index 6a7523f..6249bbc 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ASConnection.java
@@ -28,6 +28,7 @@ import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
import java.net.URL;
+import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -36,6 +37,7 @@ import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.modules.plugins.jbossas7.json.Address;
import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
import org.rhq.modules.plugins.jbossas7.json.Operation;
import org.rhq.modules.plugins.jbossas7.json.Result;
@@ -55,6 +57,12 @@ public class ASConnection {
Authenticator passwordAuthenticator;
private String host;
private int port;
+ private static String EAP_PREFIX = AbstractBaseDiscovery.EAP_PREFIX;
+ private static String EDG_PREFIX = AbstractBaseDiscovery.EDG_PREFIX;
+ private static String NAME = "name";
+ private static String OPERATION_SERVER_CONFIG = "server-config=";
+ private static String JSON_SERVER_CONFIG = "{\"server-config\":\"";
+ private static String JSON_NAME = "\"name\":\"";
/**
* Construct an ASConnection object. The real "physical" connection is done in
@@ -119,9 +127,26 @@ public class ASConnection {
OutputStream out = conn.getOutputStream();
String json_to_send = mapper.writeValueAsString(operation);
+ //BZ:785128. removing artificial prefix for messages going back to the server.
+ //check for prefixed names
+ if ((json_to_send.indexOf(JSON_SERVER_CONFIG + EAP_PREFIX) > -1)
+ || (json_to_send.indexOf(JSON_SERVER_CONFIG + EDG_PREFIX) > -1)
+ || (json_to_send.indexOf(JSON_NAME + EAP_PREFIX) > -1)
+ || (json_to_send.indexOf(JSON_NAME + EAP_PREFIX) > -1)) {
+
+ //delve into Operation and remove prefixes
+ Operation purgedOperation = purgeOperation(operation);
+ if (verbose) {
+ log.warn("---------------- Purging EAP/EDG prefixes detected. Was <" + operation + "> but now <"
+ + purgedOperation + ">.");
+ }
+ operation = purgedOperation;
+ }
+
if (verbose) {
log.info("Json to send: " + json_to_send);
}
+
mapper.writeValue(out, operation);
out.flush();
@@ -236,6 +261,67 @@ public class ASConnection {
return null;
}
+ /** This operation purges the Operation passed in of EAP/EDG prefixes in the
+ * Address portion and in the AdditionalProperties section. The returned
+ * operation should be identical in every other way and should be used
+ * instead of the unpurged operation which will cause unrecognized property
+ * errors.
+ *
+ * @param operation to be purged.
+ * @return The same operation minus the prefixes.
+ */
+ private Operation purgeOperation(Operation operation) {
+ //purge prefixes from name
+ if (operation != null) {
+ boolean prefixLocated = false;
+
+ //Ex.
+ //Operation{operation='remove', address=Address{path: host=master,server-config=EAP server-six},
+ //additionalProperties={socket-binding-port-offset=0, name=EAP server-six, auto-start=false, group=,
+ //socket-binding-group=}}
+
+ //ADDRESS parsing
+ String path = operation.getAddress().getPath();
+ if (path.indexOf(OPERATION_SERVER_CONFIG + EAP_PREFIX) > -1
+ || path.indexOf(OPERATION_SERVER_CONFIG + EDG_PREFIX) > -1) {
+ int index = -1;
+ prefixLocated = true;
+ if ((index = path.indexOf(OPERATION_SERVER_CONFIG + EAP_PREFIX)) > -1) {
+ path = path.substring(0, index + OPERATION_SERVER_CONFIG.length())
+ + path.substring(index + OPERATION_SERVER_CONFIG.length() + EAP_PREFIX.length());
+ }
+ if ((index = path.indexOf(OPERATION_SERVER_CONFIG + EDG_PREFIX)) > -1) {
+ path = path.substring(0, index + OPERATION_SERVER_CONFIG.length())
+ + path.substring(index + OPERATION_SERVER_CONFIG.length() + EDG_PREFIX.length());
+ }
+ }
+
+ //ADDITIONAL-PROPERTIES parsing
+ Map<String, Object> additionalProperties = operation.getAdditionalProperties();
+ if ((additionalProperties != null) && !additionalProperties.isEmpty()
+ && additionalProperties.containsKey(NAME)) {
+ String contents = (String) additionalProperties.get(NAME);
+ if (contents.startsWith(EAP_PREFIX) || contents.startsWith(EDG_PREFIX)) {
+ prefixLocated = true;
+ if (contents.startsWith(EAP_PREFIX)) {
+ contents = contents.substring(EAP_PREFIX.length());
+ } else if (contents.startsWith(EDG_PREFIX)) {
+ contents = contents.substring(EDG_PREFIX.length());
+ }
+ additionalProperties.put(NAME, contents);
+ }
+ }
+
+ if (prefixLocated) {
+ //create new Operation to return.
+ Operation newOperation = new Operation(operation.getOperation(), new Address(path),
+ additionalProperties);
+ return newOperation;
+ }
+ }
+ return operation;
+ }
+
/**
* Execute the passed Operation and return its Result. This is a shortcut of
* #execute(Operation, false)
@@ -274,12 +360,13 @@ public class ASConnection {
failure.setFailureDescription("Operation [" + op + "] returned null");
return failure;
}
+ Result res;
try {
- Result res;
- if (isComplex)
+ if (isComplex) {
res = mapper.readValue(node, ComplexResult.class);
- else
+ } else {
res = mapper.readValue(node, Result.class);
+ }
return res;
} catch (IOException e) {
log.error(e.getMessage());
commit e3b17d4977e91bda9bf8362817bc68290f557683
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 14:30:06 2012 -0500
Use constants where possible for EAP/EDG identifiers.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
index dca0b8c..54ef7d4 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
@@ -50,6 +50,10 @@ public class AbstractBaseDiscovery {
protected Document hostXml;
protected final Log log = LogFactory.getLog(this.getClass());
private static final String JBOSS_EAP_PREFIX = "jboss-eap-";
+ public static final String EAP = "EAP";
+ public static final String EDG = "EDG";
+ public static final String EAP_PREFIX = EAP + " ";
+ public static final String EDG_PREFIX = EDG + " ";
private XPathFactory factory;
protected AbstractBaseDiscovery() {
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
index a0faeaa..f136483 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseProcessDiscovery.java
@@ -178,11 +178,11 @@ public class BaseProcessDiscovery extends AbstractBaseDiscovery implements Resou
}
if (isEAP) {
- serverName = "EAP " + serverName;
- version = "EAP " + version;
+ serverName = EAP_PREFIX + serverName;
+ version = EAP_PREFIX + version;
} else if (isEDG) {
- serverName = "EDG " + serverName;
- version = "EDG " + version;
+ serverName = EDG_PREFIX + serverName;
+ version = EDG_PREFIX + version;
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
index 3d937c0..5feaab2 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
@@ -102,12 +102,12 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
String resourceName = serverInfo.name;
- if (hostInfo.productName.equalsIgnoreCase("eap")) {
- version = "EAP " + hostInfo.productVersion;
+ if (hostInfo.productName.equalsIgnoreCase(EAP)) {
+ version = EAP_PREFIX + hostInfo.productVersion;
resourceDescription = "Managed JBoss Enterprise Application Platform 6 server";
- resourceName = "EAP " + resourceName;
- } else if (hostInfo.productName.equalsIgnoreCase("EDG")) {
- version = "EDG " + hostInfo.productVersion;
+ resourceName = EAP_PREFIX + resourceName;
+ } else if (hostInfo.productName.equalsIgnoreCase(EDG)) {
+ version = EDG_PREFIX + hostInfo.productVersion;
resourceDescription = "Managed JBoss Enterprise Data Grid 6 server";
} else {
resourceDescription = "Managed AS7 server";
commit ce4b1a63105f7d67bf94a19445d731ab10bfc52e
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Sat Feb 25 14:09:03 2012 -0500
- ignore this diff. No functional changes just ide formatting.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
index c464e4b..dca0b8c 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AbstractBaseDiscovery.java
@@ -41,7 +41,7 @@ import org.rhq.core.system.ProcessInfo;
* in the area of processes and host.xml
* @author Heiko W. Rupp
*/
-public class AbstractBaseDiscovery {
+public class AbstractBaseDiscovery {
static final String DORG_JBOSS_BOOT_LOG_FILE = "-Dorg.jboss.boot.log.file=";
private static final String DJBOSS_SERVER_HOME_DIR = "-Djboss.home.dir";
static final int DEFAULT_MGMT_PORT = 9990;
@@ -52,8 +52,6 @@ public class AbstractBaseDiscovery {
private static final String JBOSS_EAP_PREFIX = "jboss-eap-";
private XPathFactory factory;
-
-
protected AbstractBaseDiscovery() {
synchronized (this) {
factory = XPathFactory.newInstance();
@@ -68,7 +66,7 @@ public class AbstractBaseDiscovery {
* @param isDomainMode Indiates if host.xml should be read (true) or standalone.xml (false)
*/
protected void readStandaloneOrHostXml(ProcessInfo processInfo, boolean isDomainMode) {
- String hostXmlFile = getHostXmlFileLocation(processInfo,isDomainMode);
+ String hostXmlFile = getHostXmlFileLocation(processInfo, isDomainMode);
readStandaloneOrHostXmlFromFile(hostXmlFile);
}
@@ -93,11 +91,11 @@ public class AbstractBaseDiscovery {
* @return The home dir if found or empty string otherwise
*/
String getHomeDirFromCommandLine(String[] commandLine) {
- for (String line: commandLine) {
- if (line.startsWith(DJBOSS_SERVER_HOME_DIR))
- return line.substring(DJBOSS_SERVER_HOME_DIR.length()+1);
- }
- return "";
+ for (String line : commandLine) {
+ if (line.startsWith(DJBOSS_SERVER_HOME_DIR))
+ return line.substring(DJBOSS_SERVER_HOME_DIR.length() + 1);
+ }
+ return "";
}
/**
@@ -107,7 +105,7 @@ public class AbstractBaseDiscovery {
*/
String getLogFileFromCommandLine(String[] commandLine) {
- for (String line: commandLine) {
+ for (String line : commandLine) {
if (line.startsWith(DORG_JBOSS_BOOT_LOG_FILE))
return line.substring(DORG_JBOSS_BOOT_LOG_FILE.length());
}
@@ -121,7 +119,7 @@ public class AbstractBaseDiscovery {
* @param commandLine Command line arguments of the process to
*/
protected HostPort getManagementPortFromHostXml(String[] commandLine) {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
String portString;
@@ -129,35 +127,29 @@ public class AbstractBaseDiscovery {
String socketBindingName;
- socketBindingName = obtainXmlPropertyViaXPath(
- "//management/management-interfaces/http-interface/socket-binding/@http");
- String socketInterface = obtainXmlPropertyViaXPath(
- "//management/management-interfaces/http-interface/socket/@interface");
+ socketBindingName = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/socket-binding/@http");
+ String socketInterface = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/socket/@interface");
if (!socketInterface.isEmpty()) {
- interfaceExpession = obtainXmlPropertyViaXPath(
- "//interfaces/interface[@name='" + socketInterface + "']/inet-address/@value");
- portString = obtainXmlPropertyViaXPath(
- "//management/management-interfaces/http-interface/socket/@port");
- }
- else if (socketBindingName.isEmpty()) {
+ interfaceExpession = obtainXmlPropertyViaXPath("//interfaces/interface[@name='" + socketInterface
+ + "']/inet-address/@value");
+ portString = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/socket/@port");
+ } else if (socketBindingName.isEmpty()) {
// old AS7.0, early 7.1 style
portString = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/@port");
- String interfaceName = obtainXmlPropertyViaXPath(
- "//management/management-interfaces/http-interface/@interface");
- interfaceExpession = obtainXmlPropertyViaXPath(
- "/server/interfaces/interface[@name='" + interfaceName + "']/inet-address/@value");
- }
- else {
+ String interfaceName = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/@interface");
+ interfaceExpession = obtainXmlPropertyViaXPath("/server/interfaces/interface[@name='" + interfaceName
+ + "']/inet-address/@value");
+ } else {
// later AS7.1 and EAP6 standalone.xml
- portString = obtainXmlPropertyViaXPath(
- "/server/socket-binding-group/socket-binding[@name='" + socketBindingName + "']/@port");
- String interfaceName = obtainXmlPropertyViaXPath(
- "/server/socket-binding-group/socket-binding[@name='" + socketBindingName + "']/@interface");
+ portString = obtainXmlPropertyViaXPath("/server/socket-binding-group/socket-binding[@name='"
+ + socketBindingName + "']/@port");
+ String interfaceName = obtainXmlPropertyViaXPath("/server/socket-binding-group/socket-binding[@name='"
+ + socketBindingName + "']/@interface");
// TODO the next may also be expressed differently
- interfaceExpession = obtainXmlPropertyViaXPath(
- "/server/interfaces/interface[@name='" + interfaceName + "']/inet-address/@value");
+ interfaceExpession = obtainXmlPropertyViaXPath("/server/interfaces/interface[@name='" + interfaceName
+ + "']/inet-address/@value");
}
HostPort hp = new HostPort();
@@ -167,17 +159,14 @@ public class AbstractBaseDiscovery {
else
hp.host = "localhost"; // Fallback
-
- if (portString!=null && !portString.isEmpty()) {
- String tmp = replaceDollarExpression(portString,commandLine, "9990");
+ if (portString != null && !portString.isEmpty()) {
+ String tmp = replaceDollarExpression(portString, commandLine, "9990");
hp.port = Integer.valueOf(tmp);
- }
- else
+ } else
hp.port = 9990; // Fallback to default
return hp;
}
-
/**
* Check if the passed value has an expression in the form of ${var} or ${var:default},
* try to resolve it. Resolution is done by looking at the command line to see if
@@ -194,15 +183,14 @@ public class AbstractBaseDiscovery {
return value;
// remove ${ }
- value = value.substring(2,value.length()-1);
+ value = value.substring(2, value.length() - 1);
String fallback = lastResort;
String expression;
if (value.contains(":")) {
int i = value.indexOf(":");
- expression = value.substring(0,i);
- fallback = value.substring(i+1);
- }
- else {
+ expression = value.substring(0, i);
+ fallback = value.substring(i + 1);
+ } else {
expression = value;
}
/*
@@ -214,7 +202,7 @@ public class AbstractBaseDiscovery {
* to find the management addresss
*/
- String ret=null;
+ String ret = null;
for (int i = 0, commandLineLength = commandLine.length; i < commandLineLength; i++) {
String line = commandLine[i];
if (expression.contains("address")) {
@@ -222,7 +210,7 @@ public class AbstractBaseDiscovery {
if (line.contains("="))
ret = line.substring(line.indexOf("=") + 1); // -bmanagement=1.2.3.4
else
- ret = commandLine[i+1]; // -bmanagement 1.2.3.4
+ ret = commandLine[i + 1]; // -bmanagement 1.2.3.4
break;
}
} else if (expression.contains("port")) {
@@ -233,7 +221,7 @@ public class AbstractBaseDiscovery {
}
}
- if (ret==null)
+ if (ret == null)
ret = fallback;
return ret;
@@ -246,7 +234,7 @@ public class AbstractBaseDiscovery {
* @return server name
*/
protected String findHostName() {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
String hostName = hostXml.getDocumentElement().getAttribute("name");
@@ -258,10 +246,9 @@ public class AbstractBaseDiscovery {
* @return host and port of the domain controller
*/
protected HostPort getDomainControllerFromHostXml() {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
-
// first check remote, as we can't distinguish between a missing local element or
// and empty one which is the default
String remoteHost = obtainXmlPropertyViaXPath("/host/domain-controller/remote/@host");
@@ -272,8 +259,7 @@ public class AbstractBaseDiscovery {
hp = new HostPort(false);
hp.host = remoteHost;
hp.port = Integer.parseInt(portString);
- }
- else {
+ } else {
hp = new HostPort(true);
hp.port = 9999;
}
@@ -283,7 +269,7 @@ public class AbstractBaseDiscovery {
}
String getManagementSecurtiyRealmFromHostXml() {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
String realm = obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/@security-realm");
@@ -292,21 +278,24 @@ public class AbstractBaseDiscovery {
}
String getSecurityPropertyFileFromHostXml(String baseDir, AS7Mode mode, String realm) {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
- String fileName = obtainXmlPropertyViaXPath("//security-realms/security-realm[@name='" + realm + "']/authentication/properties/@path");
- String relDir = obtainXmlPropertyViaXPath("//security-realms/security-realm[@name='" + realm + "']/authentication/properties/@relative-to");
+ String fileName = obtainXmlPropertyViaXPath("//security-realms/security-realm[@name='" + realm
+ + "']/authentication/properties/@path");
+ String relDir = obtainXmlPropertyViaXPath("//security-realms/security-realm[@name='" + realm
+ + "']/authentication/properties/@relative-to");
String dmode;
- if (mode==AS7Mode.STANDALONE)
- dmode="server";
+ if (mode == AS7Mode.STANDALONE)
+ dmode = "server";
else
- dmode="domain";
+ dmode = "domain";
- String fullName ;
+ String fullName;
if (relDir.equals("jboss." + dmode + ".config.dir"))
- fullName = baseDir + File.separator + mode.getBaseDir() + File.separator + "configuration" + File.separator + fileName;
+ fullName = baseDir + File.separator + mode.getBaseDir() + File.separator + "configuration" + File.separator
+ + fileName;
else
fullName = relDir + File.separator + fileName;
@@ -323,7 +312,7 @@ public class AbstractBaseDiscovery {
protected String getHostXmlFileLocation(ProcessInfo processInfo, boolean isDomain) {
String home = processInfo.getEnvironmentVariable("jboss.home.dir");
- if (home==null)
+ if (home == null)
home = getHomeDirFromCommandLine(processInfo.getCommandLine());
StringBuilder builder = new StringBuilder(home);
if (isDomain)
@@ -341,7 +330,7 @@ public class AbstractBaseDiscovery {
protected String determineServerVersionFromHomeDir(String homeDir) {
String version;
- String tmp = homeDir.substring(homeDir.lastIndexOf("/")+1);
+ String tmp = homeDir.substring(homeDir.lastIndexOf("/") + 1);
if (tmp.startsWith(JBOSS_AS_PREFIX)) {
version = tmp.substring(JBOSS_AS_PREFIX.length());
} else if (tmp.startsWith(JBOSS_EAP_PREFIX)) {
@@ -362,10 +351,9 @@ public class AbstractBaseDiscovery {
*
*/
protected String obtainXmlPropertyViaXPath(String xpathExpression) {
- if (hostXml==null)
+ if (hostXml == null)
throw new IllegalArgumentException(CALL_READ_STANDALONE_OR_HOST_XML_FIRST);
-
XPath xpath = factory.newXPath();
try {
XPathExpression expr = xpath.compile(xpathExpression);
@@ -379,7 +367,6 @@ public class AbstractBaseDiscovery {
}
}
-
/**
* Helper class that holds information about the host,port tuple
*/
@@ -401,11 +388,7 @@ public class AbstractBaseDiscovery {
@Override
public String toString() {
- return "HostPort{" +
- "host='" + host + '\'' +
- ", port=" + port +
- ", isLocal=" + isLocal +
- '}';
+ return "HostPort{" + "host='" + host + '\'' + ", port=" + port + ", isLocal=" + isLocal + '}';
}
}
}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
index b46b108..6212650 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/HostControllerComponent.java
@@ -44,8 +44,8 @@ public class HostControllerComponent extends BaseServerComponent implements Oper
}
@Override
- public OperationResult invokeOperation(String name,
- Configuration parameters) throws InterruptedException, Exception {
+ public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
+ Exception {
if (name.equals("start")) {
return startServer(AS7Mode.DOMAIN);
@@ -54,58 +54,55 @@ public class HostControllerComponent extends BaseServerComponent implements Oper
} else if (name.equals("shutdown")) {
// This is a bit trickier, as it needs to be executed on the level on /host=xx
- String domainHost = pluginConfiguration.getSimpleValue("domainHost","");
+ String domainHost = pluginConfiguration.getSimpleValue("domainHost", "");
if (domainHost.isEmpty()) {
OperationResult result = new OperationResult();
result.setErrorMessage("No domain host found - can not continue");
return result;
}
- Operation op = new Operation("shutdown","host",domainHost);
+ Operation op = new Operation("shutdown", "host", domainHost);
Result res = getASConnection().execute(op);
- return postProcessResult(name,res);
- }
- else if (name.equals("installRhqUser")) {
+ return postProcessResult(name, res);
+ } else if (name.equals("installRhqUser")) {
return installManagementUser(parameters, pluginConfiguration, AS7Mode.HOST);
}
-
// Defer other stuff to the base component for now
return super.invokeOperation(name, parameters);
}
-
@Override
public CreateResourceReport createResource(CreateResourceReport report) {
// If Content is to be deployed, call the deployContent method
- if (report.getPackageDetails()!=null)
+ if (report.getPackageDetails() != null)
return super.deployContent(report);
// TODO check for types of children -- this is server group only at the moment.
String name = report.getUserSpecifiedResourceName();
Address address = new Address(path);
- address.add("server-group",name);
- Operation op = new Operation("add",address);
+ address.add("server-group", name);
+ Operation op = new Operation("add", address);
Configuration rc = report.getResourceConfiguration();
- String profile = rc.getSimpleValue("profile","");
+ String profile = rc.getSimpleValue("profile", "");
if (profile.isEmpty()) {
report.setErrorMessage("No profile given");
report.setStatus(CreateResourceStatus.FAILURE);
return report;
}
- op.addAdditionalProperty("profile",profile);
- String socketBindingGroup = rc.getSimpleValue("socket-binding-group","");
+ op.addAdditionalProperty("profile", profile);
+ String socketBindingGroup = rc.getSimpleValue("socket-binding-group", "");
if (socketBindingGroup.isEmpty()) {
report.setErrorMessage("No socket-binding-group given");
report.setStatus(CreateResourceStatus.FAILURE);
return report;
}
- op.addAdditionalProperty("socket-binding-group",socketBindingGroup);
+ op.addAdditionalProperty("socket-binding-group", socketBindingGroup);
PropertySimple offset = rc.getSimple("socket-binding-port-offset");
- if (offset!=null && offset.getStringValue()!=null)
- op.addAdditionalProperty("socket-binding-port-offset",offset.getIntegerValue());
+ if (offset != null && offset.getStringValue() != null)
+ op.addAdditionalProperty("socket-binding-port-offset", offset.getIntegerValue());
// TODO add jvm info
Result res = getASConnection().execute(op);
@@ -113,8 +110,7 @@ public class HostControllerComponent extends BaseServerComponent implements Oper
report.setResourceKey(address.getPath());
report.setResourceName(name);
report.setStatus(CreateResourceStatus.SUCCESS);
- }
- else {
+ } else {
report.setErrorMessage(res.getFailureDescription());
report.setStatus(CreateResourceStatus.FAILURE);
report.setException(res.getRhqThrowable());
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
index 5890ca2..3d937c0 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ManagedASDiscovery.java
@@ -31,7 +31,6 @@ import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.pluginapi.event.log.LogFileEventResourceComponentHelper;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.ProcessScanResult;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.modules.plugins.jbossas7.json.Address;
@@ -64,10 +63,9 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
String hostName = hcConfig.getSimpleValue("domainHost", "master"); // TODO good default?
HostInfo hostInfo = getHostInfo(hostName);
- if (hostInfo==null)
+ if (hostInfo == null)
return discoveredResources;
-
try {
// get the HostController, as this is an indicator for managed AS
@@ -85,7 +83,7 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
config.put(new PropertySimple("socket-binding-group", serverInfo.bindingGroup));
} else {
String group = resolveSocketBindingGroup(serverInfo.group);
- config.put(new PropertySimple("socket-binding-group",group));
+ config.put(new PropertySimple("socket-binding-group", group));
}
config.put(new PropertySimple("socket-binding-port-offset", serverInfo.portOffset));
@@ -95,8 +93,9 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
// get from the domain or other place as soon as the domain provides it.
//XXX hardcoded separators?
- String serverLog = hcConfig.getSimpleValue("baseDir","/tmp")+File.separator+"domain/servers/"+serverInfo.name+"/log/server.log";
- initLogEventSourcesConfigProp(serverLog,config);
+ String serverLog = hcConfig.getSimpleValue("baseDir", "/tmp") + File.separator + "domain/servers/"
+ + serverInfo.name + "/log/server.log";
+ initLogEventSourcesConfigProp(serverLog, config);
String version;
String resourceDescription;
@@ -107,43 +106,42 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
version = "EAP " + hostInfo.productVersion;
resourceDescription = "Managed JBoss Enterprise Application Platform 6 server";
resourceName = "EAP " + resourceName;
- }
- else if (hostInfo.productName.equalsIgnoreCase("EDG")) {
+ } else if (hostInfo.productName.equalsIgnoreCase("EDG")) {
version = "EDG " + hostInfo.productVersion;
resourceDescription = "Managed JBoss Enterprise Data Grid 6 server";
- }
- else {
+ } else {
resourceDescription = "Managed AS7 server";
version = hostInfo.releaseVersion;
}
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(discoveryContext.getResourceType(), // ResourceType
- hostName + "/" + serverInfo.name, // key
- resourceName, // Name
- version, // TODO get from Domain as soon as it is provided
- resourceDescription, // Description
- config, null);
+ hostName + "/" + serverInfo.name, // key
+ resourceName, // Name
+ version, // TODO get from Domain as soon as it is provided
+ resourceDescription, // Description
+ config, null);
// Add to return values
discoveredResources.add(detail);
log.info("Discovered new ... " + discoveryContext.getResourceType() + ", " + serverInfo);
}
} catch (Exception e) {
- log.warn("Discovery for a " + discoveryContext.getResourceType() + " failed for process " + " :" + e.getMessage());
+ log.warn("Discovery for a " + discoveryContext.getResourceType() + " failed for process " + " :"
+ + e.getMessage());
}
return discoveredResources;
}
private String resolveSocketBindingGroup(String serverGroup) {
- Address address = new Address("server-group",serverGroup);
- Operation operation = new ReadAttribute(address,"socket-binding-group");
+ Address address = new Address("server-group", serverGroup);
+ Operation operation = new ReadAttribute(address, "socket-binding-group");
Result result = parentComponent.getASConnection().execute(operation);
return (String) result.getResult();
}
private List<ServerInfo> getManagedServers(String domainHost) {
- Address address = new Address("host",domainHost);
- Operation operation = new ReadChildrenNames(address,"server-config");
+ Address address = new Address("host", domainHost);
+ Operation operation = new ReadChildrenNames(address, "server-config");
ASConnection connection = parentComponent.getASConnection();
Result res = connection.execute(operation);
List<String> servers = (List<String>) res.getResult();
@@ -153,15 +151,15 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
info.name = server;
ret.add(info);
- address= new Address("host",domainHost);
- address.add("server-config",server);
+ address = new Address("host", domainHost);
+ address.add("server-config", server);
operation = new ReadResource(address);
ComplexResult cres = connection.executeComplex(operation);
- Map<String,Object> map = cres.getResult();
+ Map<String, Object> map = cres.getResult();
info.group = (String) map.get("group");
- info.autoStart = (Boolean)map.get("auto-start");
+ info.autoStart = (Boolean) map.get("auto-start");
Integer offset = (Integer) map.get("socket-binding-port-offset");
- if (offset!=null)
+ if (offset != null)
info.portOffset = offset;
info.bindingGroup = (String) map.get("socket-binding-group");
}
@@ -170,7 +168,7 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
}
private HostInfo getHostInfo(String domainHost) {
- Address address = new Address("host",domainHost);
+ Address address = new Address("host", domainHost);
Operation operation = new ReadResource(address);
HostInfo info = new HostInfo();
@@ -178,11 +176,11 @@ public class ManagedASDiscovery extends AbstractBaseDiscovery implements Resourc
if (!cres.isSuccess())
return null;
- Map<String,Object> map = cres.getResult();
+ Map<String, Object> map = cres.getResult();
info.releaseCodeName = (String) map.get("release-codename");
- info.releaseVersion = (String)map.get("release-version");
+ info.releaseVersion = (String) map.get("release-version");
info.productName = (String) map.get("product-name");
- info.productVersion = (String)map.get("product-version");
+ info.productVersion = (String) map.get("product-version");
return info;
}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
index 2dcd49f..aefd5ee 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/OperationJsonTest.java
@@ -18,21 +18,18 @@
*/
package org.rhq.modules.plugins.jbossas7;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.annotate.JsonAnyGetter;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.testng.annotations.Test;
import org.rhq.modules.plugins.jbossas7.json.Address;
import org.rhq.modules.plugins.jbossas7.json.ComplexResult;
-import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.PROPERTY_VALUE;
import org.rhq.modules.plugins.jbossas7.json.Result;
import org.rhq.modules.plugins.jbossas7.json.WriteAttribute;
@@ -42,28 +39,26 @@ import org.rhq.modules.plugins.jbossas7.json.WriteAttribute;
@Test
public class OperationJsonTest {
+ public void operationSerDeserTest() throws Exception {
- public void operationSerDeserTest() throws Exception{
-
- Address address= new Address();
- address.add("subsystem","web");
- address.add("connector","http");
-
- Operation operation = new WriteAttribute(address,"socket-binding","jndi");
+ Address address = new Address();
+ address.add("subsystem", "web");
+ address.add("connector", "http");
+ Operation operation = new WriteAttribute(address, "socket-binding", "jndi");
ObjectMapper mapper = new ObjectMapper();
String result = mapper.writeValueAsString(operation);
- Operation op = mapper.readValue(result,Operation.class);
- assert op!=null;
- assert op.getOperation()!=null : "op.operation was null!";
+ Operation op = mapper.readValue(result, Operation.class);
+ assert op != null;
+ assert op.getOperation() != null : "op.operation was null!";
assert op.getOperation().equals(operation.getOperation()) : "Operation is " + op.getOperation();
- assert op.getName()!=null : "op.getName is null";
- assert op.getName().equals("socket-binding") : "attribute name is " + op.getName() + " and not 'socket-binding'";
+ assert op.getName() != null : "op.getName is null";
+ assert op.getName().equals("socket-binding") : "attribute name is " + op.getName()
+ + " and not 'socket-binding'";
assert op.getValue().equals("jndi") : "attribute value is " + op.getValue();
- assert op.getAddress().size()==2 : "Address did not contain 2 parts, but " + op.getAddress().size();
-
+ assert op.getAddress().size() == 2 : "Address did not contain 2 parts, but " + op.getAddress().size();
}
@@ -72,23 +67,23 @@ public class OperationJsonTest {
String json = "{\"myKey\":\"myValue\"}";
ObjectMapper mapper = new ObjectMapper();
- PROPERTY_VALUE pv = mapper.readValue(json,PROPERTY_VALUE.class);
+ PROPERTY_VALUE pv = mapper.readValue(json, PROPERTY_VALUE.class);
assert pv.getKey().equals("myKey") : "Key is " + pv.getKey();
- assert pv.getValue().equals("myValue"): "Value is " + pv.getValue();
+ assert pv.getValue().equals("myValue") : "Value is " + pv.getValue();
}
public void anyPayloadTest() throws Exception {
- Address address= new Address();
- address.add("/server-group","newOne");
+ Address address = new Address();
+ address.add("/server-group", "newOne");
- Map<String,Object> props = new HashMap<String, Object>();
- props.put("profile","default");
- props.put("someBool",true);
+ Map<String, Object> props = new HashMap<String, Object>();
+ props.put("profile", "default");
+ props.put("someBool", true);
- Operation operation = new Operation("add",address,props);
- operation.addAdditionalProperty("foo","bar");
+ Operation operation = new Operation("add", address, props);
+ operation.addAdditionalProperty("foo", "bar");
ObjectMapper mapper = new ObjectMapper();
@@ -98,7 +93,7 @@ public class OperationJsonTest {
assert !result.contains("name") : "Result contains a name property but should not : " + result;
assert !result.contains("null") : "Result contains null values but should not : " + result;
- Operation op = mapper.readValue(result,Operation.class);
+ Operation op = mapper.readValue(result, Operation.class);
assert op.getOperation().equals(operation.getOperation()) : "Operation is " + op.getOperation();
assert op.getAdditionalProperties().containsKey("someBool") : "Key someBool not found ";
Object someBool = op.getAdditionalProperties().get("someBool");
@@ -107,11 +102,11 @@ public class OperationJsonTest {
}
public void addPropsTest() throws Exception {
- Address address= new Address();
- address.add("/server-group","newOne");
+ Address address = new Address();
+ address.add("/server-group", "newOne");
- Operation operation = new Operation("add",address);
- operation.addAdditionalProperty("foo","bar");
+ Operation operation = new Operation("add", address);
+ operation.addAdditionalProperty("foo", "bar");
ObjectMapper mapper = new ObjectMapper();
@@ -125,7 +120,7 @@ public class OperationJsonTest {
String resultString = "{\"outcome\" : \"success\", \"result\" : \"no metrics available\"}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("success");
@@ -137,18 +132,19 @@ public class OperationJsonTest {
String resultString = "{\"outcome\" : \"success\", \"result\" : \"DISABLED\"}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("success");
assert result.isSuccess();
}
+
public void simpleResultWithFailure() throws Exception {
String resultString = "{\"outcome\" : \"failed\", \"failure-description\" : [{ \"java.util.NoSuchElementException\" : \"No child 'profile' exists\" }]}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("failed");
@@ -156,7 +152,7 @@ public class OperationJsonTest {
assert result.getResult() == null;
assert result.getFailureDescription() != null;
-// assert result.getFailureDescription().size() == 1;
+ // assert result.getFailureDescription().size() == 1;
}
public void complexResult1() throws Exception {
@@ -164,18 +160,18 @@ public class OperationJsonTest {
String resultString = " {\"outcome\" : \"success\", \"result\" : {\"alias\" : [\"example.com\"], \"access-log\" : null, \"rewrite\" : null}}";
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
assert result != null;
assert result.getOutcome().equals("success");
assert result.isSuccess();
- assert result.getResult().size()==3;
+ assert result.getResult().size() == 3;
String rewrite = (String) result.getResult().get("rewrite");
assert rewrite == null;
List<String> aliases = (List<String>) result.getResult().get("alias");
assert aliases != null;
- assert aliases.size()==1;
+ assert aliases.size() == 1;
assert aliases.get(0).equals("example.com");
}
@@ -184,13 +180,13 @@ public class OperationJsonTest {
String resultString = "{\"outcome\":\"success\",\"result\":[\"standard-sockets\",\"messaging-sockets\"],\"response-headers\":null, \"rolled-back\" : false}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("success");
assert result.isSuccess();
List<String> stringList = (List<String>) result.getResult();
- assert stringList.size()==2;
+ assert stringList.size() == 2;
assert stringList.get(0).equals("standard-sockets");
assert stringList.get(1).equals("messaging-sockets");
assert !result.isRolledBack();
@@ -202,7 +198,7 @@ public class OperationJsonTest {
String resultString = "{\"outcome\":\"failed\", \"rolled-back\" : true}";
ObjectMapper mapper = new ObjectMapper();
- Result result = mapper.readValue(resultString,Result.class);
+ Result result = mapper.readValue(resultString, Result.class);
assert result != null;
assert result.getOutcome().equals("failed");
@@ -211,77 +207,69 @@ public class OperationJsonTest {
}
-
public void complexResult2() throws Exception {
-
- String resultString =
- "{\n" +
- " \"outcome\" : \"failed\",\n" +
- " \"result\" : {\n" +
- " \"server-groups\" : {\n" +
- " \"main-server-group\" : {\n" +
- " \"server-one\" : {\n" +
- " \"host\" : \"local\",\n" +
- " \"response\" : {\n" +
- " \"outcome\" : \"success\",\n" +
- " \"result\" : null,\n" +
- " \"compensating-operation\" : {\n" +
- " \"operation\" : \"add\",\n" +
- " \"address\" : [ {\n" +
- " \"subsystem\" : \"jms\"\n" +
- " }, {\n" +
- " \"queue\" : \"flubbr\"\n" +
- " } ],\n" +
- " \"durable\" : \"true\",\n" +
- " \"entries\" : [ \"PropertySimple[id=0, name=entries, value=flubbr, override=null]\" ]\n" +
- " }\n" +
- " }\n" +
- " },\n" +
- " \"server-two\" : {\n" +
- " \"host\" : \"local\",\n" +
- " \"response\" : {\n" +
- " \"outcome\" : \"success\",\n" +
- " \"result\" : null,\n" +
- " \"compensating-operation\" : {\n" +
- " \"operation\" : \"add\",\n" +
- " \"address\" : [ {\n" +
- " \"subsystem\" : \"jms\"\n" +
- " }, {\n" +
- " \"queue\" : \"flubbr\"\n" +
- " } ],\n" +
- " \"durable\" : \"true\",\n" +
- " \"entries\" : [ \"PropertySimple[id=0, name=entries, value=flubbr, override=null]\" ]\n" +
- " }\n" +
- " }\n" +
- " },\n" +
- " \"server-demo\" : {\n" +
- " \"host\" : \"local\",\n" +
- " \"response\" : {\n" +
- " \"outcome\" : \"failed\",\n" +
- " \"failure-description\" : \"No handler for add at address [\\n (\\\"host\\\" => \\\"local\\\"),\\n (\\\"server\\\" => \\\"server-demo\\\"),\\n (\\\"subsystem\\\" => \\\"jms\\\"),\\n (\\\"queue\\\" => \\\"flubbr\\\")\\n]\"\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " },\n" +
- " \"failure-description\" : \"Operation was not applied successfully to any servers\"\n" +
- "}";
+ String resultString = "{\n"
+ + " \"outcome\" : \"failed\",\n"
+ + " \"result\" : {\n"
+ + " \"server-groups\" : {\n"
+ + " \"main-server-group\" : {\n"
+ + " \"server-one\" : {\n"
+ + " \"host\" : \"local\",\n"
+ + " \"response\" : {\n"
+ + " \"outcome\" : \"success\",\n"
+ + " \"result\" : null,\n"
+ + " \"compensating-operation\" : {\n"
+ + " \"operation\" : \"add\",\n"
+ + " \"address\" : [ {\n"
+ + " \"subsystem\" : \"jms\"\n"
+ + " }, {\n"
+ + " \"queue\" : \"flubbr\"\n"
+ + " } ],\n"
+ + " \"durable\" : \"true\",\n"
+ + " \"entries\" : [ \"PropertySimple[id=0, name=entries, value=flubbr, override=null]\" ]\n"
+ + " }\n"
+ + " }\n"
+ + " },\n"
+ + " \"server-two\" : {\n"
+ + " \"host\" : \"local\",\n"
+ + " \"response\" : {\n"
+ + " \"outcome\" : \"success\",\n"
+ + " \"result\" : null,\n"
+ + " \"compensating-operation\" : {\n"
+ + " \"operation\" : \"add\",\n"
+ + " \"address\" : [ {\n"
+ + " \"subsystem\" : \"jms\"\n"
+ + " }, {\n"
+ + " \"queue\" : \"flubbr\"\n"
+ + " } ],\n"
+ + " \"durable\" : \"true\",\n"
+ + " \"entries\" : [ \"PropertySimple[id=0, name=entries, value=flubbr, override=null]\" ]\n"
+ + " }\n"
+ + " }\n"
+ + " },\n"
+ + " \"server-demo\" : {\n"
+ + " \"host\" : \"local\",\n"
+ + " \"response\" : {\n"
+ + " \"outcome\" : \"failed\",\n"
+ + " \"failure-description\" : \"No handler for add at address [\\n (\\\"host\\\" => \\\"local\\\"),\\n (\\\"server\\\" => \\\"server-demo\\\"),\\n (\\\"subsystem\\\" => \\\"jms\\\"),\\n (\\\"queue\\\" => \\\"flubbr\\\")\\n]\"\n"
+ + " }\n" + " }\n" + " }\n" + " }\n" + " },\n"
+ + " \"failure-description\" : \"Operation was not applied successfully to any servers\"\n" + "}";
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
assert !result.isSuccess() : "Result should be 'failed', but was not";
assert result.getFailureDescription().startsWith("Operation was not applied successfully to any servers");
assert result.getResult().containsKey("server-groups");
- Map<String,Object> sgs = (Map<String, Object>) result.getResult().get("server-groups");
+ Map<String, Object> sgs = (Map<String, Object>) result.getResult().get("server-groups");
assert sgs.containsKey("main-server-group");
- Map<String,Object> mainSg = (Map<String, Object>) sgs.get("main-server-group");
- assert mainSg.size()==3 : "Main server group does not have 3 servers, but " + mainSg.size();
- Map<String,Object> s3 = (Map<String, Object>) mainSg.get("server-demo");
- Map<String,Object> response = (Map<String, Object>) s3.get("response");
- assert response!=null;
+ Map<String, Object> mainSg = (Map<String, Object>) sgs.get("main-server-group");
+ assert mainSg.size() == 3 : "Main server group does not have 3 servers, but " + mainSg.size();
+ Map<String, Object> s3 = (Map<String, Object>) mainSg.get("server-demo");
+ Map<String, Object> response = (Map<String, Object>) s3.get("response");
+ assert response != null;
}
12 years, 2 months
[rhq] Branch 'jsanda/drift-mongodb' - modules/enterprise
by John Sanda
modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java | 126 +++++++++-
1 file changed, 123 insertions(+), 3 deletions(-)
New commits:
commit 7e13b7ca4ea11fae724ba182f18a2fe1a70eef57
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Feb 27 21:54:10 2012 -0500
Adding test to verify file content is persisted in the db
diff --git a/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java b/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java
index bf2897c..c5eff1a 100644
--- a/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java
+++ b/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java
@@ -28,19 +28,23 @@ import org.rhq.core.domain.drift.DriftFile;
import org.rhq.core.domain.drift.dto.DriftFileDTO;
import org.rhq.core.util.MessageDigestGenerator;
import org.rhq.core.util.ZipUtil;
+import org.rhq.core.util.file.FileUtil;
+import org.rhq.core.util.stream.StreamUtil;
import org.rhq.enterprise.server.plugin.pc.drift.DriftChangeSetSummary;
import org.rhq.enterprise.server.plugins.drift.mongodb.dao.ChangeSetDAO;
import org.rhq.enterprise.server.plugins.drift.mongodb.dao.FileDAO;
import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSet;
import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSetEntry;
+import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import java.io.File;
-import java.io.FileOutputStream;
+import java.io.*;
import java.util.List;
import java.util.Random;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
import static java.util.Arrays.asList;
import static org.apache.commons.io.IOUtils.write;
@@ -52,6 +56,7 @@ import static org.rhq.core.domain.drift.DriftChangeSetCategory.DRIFT;
import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.normal;
import static org.rhq.test.AssertUtils.assertPropertiesMatch;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
public class MongoDBDriftServerTest extends MongoDBTest {
@@ -67,12 +72,28 @@ public class MongoDBDriftServerTest extends MongoDBTest {
random = new Random();
}
+ @AfterClass
+ public void cleanUp() throws Exception {
+ File tmpDir = new File(System.getProperty("java.io.tmpdir"));
+ File[] dirs = tmpDir.listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.startsWith("changeset_content");
+ }
+ });
+ if (dirs != null) {
+ for (File dir : dirs) {
+ FileUtil.purge(dir, true);
+ }
+ }
+ }
+
@BeforeMethod
public void initTest() {
clearCollections("changesets", "fs.files", "fs.chunks");
File basedir = getBaseDir();
- basedir.delete();
+ FileUtil.purge(basedir, true);
getBaseDir().mkdirs();
driftServer = new TestMongoDBDriftServer();
@@ -319,7 +340,42 @@ public class MongoDBDriftServerTest extends MongoDBTest {
assertPropertiesMatch("The change set summary is wrong", expectedSummary, actualSummary);
}
+
+ @Test
+ public void persistChangeSetFileContent() throws Exception {
+ int size = 1024;
+ File file1 = createRandomFile(getBaseDir(), size);
+ File file2 = createRandomFile(getBaseDir(), size);
+
+ driftServer.saveChangeSetFiles(null, createChangeSetContentZipFile(file1, file2));
+ assertFileContentPersisted(file1, file2);
+ }
+
+ private void assertFileContentPersisted(File... expectedFiles) throws Exception {
+ FileDAO fileDAO = new FileDAO(ds.getDB());
+
+ for (File expectedFile : expectedFiles) {
+ InputStream inputStream = fileDAO.findOne(expectedFile.getName());
+ assertNotNull(inputStream, "Failed to find file in database with id " + expectedFile.getName());
+ File actualFile = new File(getBaseDir(), "actualContent");
+ actualFile.delete();
+ StreamUtil.copy(inputStream, new FileOutputStream(actualFile));
+ assertEquals(sha256(actualFile), sha256(expectedFile), "The SHA-256 hash in the database does not " +
+ "match that of " + expectedFile.getPath());
+ }
+ }
+
+ /**
+ * Generates a change set zip file. This zip file contains a single entry, the change
+ * set report or meta data. The file is named changeset.zip and is written to
+ * {@link #getBaseDir() basedir}.
+ *
+ * @param headers The change set headers
+ * @param fileEntries The entries that will comprise this change set
+ * @return The zip file as a {@link File} object
+ * @throws Exception
+ */
protected File createChangeSetZipFile(Headers headers, FileEntry... fileEntries) throws Exception {
ChangeSetWriter writer = newChangeSetWriter(headers);
for (FileEntry entry : fileEntries) {
@@ -334,6 +390,33 @@ public class MongoDBDriftServerTest extends MongoDBTest {
}
/**
+ * Generates a change set content zip file. This zip file contains the bits of each of
+ * the specified file. The zip file is named changeset_content_<timestamp>.zip
+ * and is written to {@link #getBaseDir() basedir}.
+ *
+ * @param files The files to include in the content zip file
+ * @return The zip file as a {@link File} object
+ * @throws Exception
+ */
+ protected File createChangeSetContentZipFile(File... files) throws Exception {
+ long timestamp = System.currentTimeMillis();
+ File contentDir = new File(getBaseDir(), "content_" + timestamp);
+ contentDir.mkdirs();
+
+ File zipFile = new File(getBaseDir(), "changeset_content_" + timestamp + ".zip");
+ ZipOutputStream zipStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile)));
+ for (File file : files) {
+ FileInputStream fis = new FileInputStream(file);
+ zipStream.putNextEntry(new ZipEntry(file.getName()));
+ StreamUtil.copy(fis, zipStream, false);
+ fis.close();
+ }
+ zipStream.close();
+
+ return zipFile;
+ }
+
+ /**
* Initializes a {@link ChangeSetWriter} that will write to a file returned from
* {@link #getChangeSetFile()}
*
@@ -379,7 +462,24 @@ public class MongoDBDriftServerTest extends MongoDBTest {
protected String sha256(String string) {
return digestGenerator.calcDigestString(string);
}
+
+ protected String sha256(byte[] bytes) throws Exception {
+ return digestGenerator.calcDigestString(bytes);
+ }
+
+ protected String sha256(File file) throws Exception {
+ return digestGenerator.calcDigestString(file);
+ }
+ /**
+ * Generates a file of random bytes.
+ *
+ * @param dir The directory to which the file will be written
+ * @param fileName The name of the file to be created
+ * @param numBytes The size of the file in bytes
+ * @return The generated file as a {@link File} object
+ * @throws Exception
+ */
protected File createRandomFile(File dir, String fileName, int numBytes) throws Exception {
File file = new File(dir, fileName);
FileOutputStream stream = new FileOutputStream(file);
@@ -391,6 +491,26 @@ public class MongoDBDriftServerTest extends MongoDBTest {
return file;
}
+ /**
+ * Generates a file of random bytes where the name of the file is the SHA-256 hash of
+ * those bytes.
+ *
+ * @param dir The directory to which the file will be written
+ * @param numBytes The size of the file in bytes
+ * @return The generated file as a {@link File} object
+ * @throws Exception
+ */
+ protected File createRandomFile(File dir, int numBytes) throws Exception {
+ byte[] bytes = new byte[numBytes];
+ random.nextBytes(bytes);
+ File file = new File(dir, sha256(bytes));
+ FileOutputStream stream = new FileOutputStream(file);
+ write(bytes, stream);
+ stream.close();
+
+ return file;
+ }
+
private static class TestMongoDBDriftServer extends MongoDBDriftServer {
public DriftAgentService driftAgentService;
12 years, 2 months
[rhq] Branch 'jsanda/drift-mongodb' - modules/enterprise
by John Sanda
modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java | 296 ++++++++--
modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBTest.java | 28
modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOTest.java | 21
3 files changed, 277 insertions(+), 68 deletions(-)
New commits:
commit 6cbe9ad5477817b7181f5ce13ee397156feb50cc
Author: John Sanda <jsanda(a)localhost.localdomain>
Date: Mon Feb 27 10:32:09 2012 -0500
Adding more tests for persisting a change set
Two new test methods have been added. One tests persisting an initial
change set where the content is already in the db. The other test
involves persisting a drift change set with a changed file and a removed
file, and the new version of the file is not in the db.
This commit also includes some refactoring test set up/helper methods.
diff --git a/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java b/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java
index 242da58..bf2897c 100644
--- a/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java
+++ b/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBDriftServerTest.java
@@ -18,73 +18,77 @@
*/
package org.rhq.enterprise.server.plugins.drift.mongodb;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import com.google.code.morphia.Datastore;
-import com.google.code.morphia.Morphia;
-import com.google.code.morphia.query.Query;
-import com.mongodb.Mongo;
-
-import org.bson.types.ObjectId;
import org.jmock.Expectations;
import org.rhq.common.drift.ChangeSetWriter;
import org.rhq.common.drift.ChangeSetWriterImpl;
import org.rhq.common.drift.FileEntry;
import org.rhq.common.drift.Headers;
import org.rhq.core.clientapi.agent.drift.DriftAgentService;
-import org.rhq.core.domain.drift.DriftCategory;
-import org.rhq.core.domain.drift.DriftChangeSetCategory;
-import org.rhq.core.domain.drift.DriftConfigurationDefinition;
import org.rhq.core.domain.drift.DriftFile;
import org.rhq.core.domain.drift.dto.DriftFileDTO;
import org.rhq.core.util.MessageDigestGenerator;
import org.rhq.core.util.ZipUtil;
+import org.rhq.enterprise.server.plugin.pc.drift.DriftChangeSetSummary;
import org.rhq.enterprise.server.plugins.drift.mongodb.dao.ChangeSetDAO;
import org.rhq.enterprise.server.plugins.drift.mongodb.dao.FileDAO;
import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSet;
import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSetEntry;
-import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBFile;
-import org.rhq.test.JMockTest;
-import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.List;
+import java.util.Random;
+
import static java.util.Arrays.asList;
-import static org.rhq.common.drift.FileEntry.addedFileEntry;
+import static org.apache.commons.io.IOUtils.write;
import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_CHANGED;
+import static org.rhq.core.domain.drift.DriftCategory.FILE_REMOVED;
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.DriftHandlingMode.normal;
-import static org.rhq.core.domain.drift.DriftConfigurationDefinition.DriftHandlingMode.plannedChanges;
+import static org.rhq.test.AssertUtils.assertPropertiesMatch;
import static org.testng.Assert.assertEquals;
public class MongoDBDriftServerTest extends MongoDBTest {
- MessageDigestGenerator digestGenerator;
+ private MessageDigestGenerator digestGenerator;
+
+ private Random random;
+
+ private TestMongoDBDriftServer driftServer;
@BeforeClass
public void initClass() throws Exception {
digestGenerator = new MessageDigestGenerator(MessageDigestGenerator.SHA_256);
+ random = new Random();
}
@BeforeMethod
public void initTest() {
- Query deleteAll = ds.createQuery(MongoDBChangeSet.class);
- ds.delete(deleteAll);
+ clearCollections("changesets", "fs.files", "fs.chunks");
File basedir = getBaseDir();
basedir.delete();
getBaseDir().mkdirs();
+
+ driftServer = new TestMongoDBDriftServer();
+ driftServer.setConnection(connection);
+ driftServer.setMorphia(morphia);
+ driftServer.setDatastore(ds);
+ driftServer.setChangeSetDAO(new ChangeSetDAO(morphia, connection, "rhqtest"));
+ driftServer.setFileDAO(new FileDAO(ds.getDB()));
}
@Test
- public void persistChangeSetWithContentNotInDB() throws Exception {
+ public void persistInitialChangeSetWithContentNotInDB() throws Exception {
int driftDefId = 1;
- final String driftDefName = "saveInitialChangeSet";
+ final String driftDefName = "saveInitialChangeSetWithContentNotInDB";
final int resourceId = 1;
-
+
final Headers headers = new Headers();
headers.setBasedir(getBaseDir().getAbsolutePath());
headers.setDriftDefinitionId(driftDefId);
@@ -92,21 +96,16 @@ public class MongoDBDriftServerTest extends MongoDBTest {
headers.setResourceId(resourceId);
headers.setType(COVERAGE);
headers.setVersion(0);
-
- long timestamp = System.currentTimeMillis();
- long size = 1024;
-
+
+ String file1SHA = sha256("1a2b3c4d");
+ String file2SHA = sha256("1a2b3c4d");
+
File changeSetZip = createChangeSetZipFile(headers,
- addedFileEntry("1.txt", sha256("1a2b3c4d"), timestamp, size));
-
- TestMongoDBDriftServer driftServer = new TestMongoDBDriftServer();
- driftServer.setConnection(connection);
- driftServer.setMorphia(morphia);
- driftServer.setDatastore(ds);
- driftServer.setChangeSetDAO(new ChangeSetDAO(morphia, connection, "rhqtest"));
- driftServer.setFileDAO(new FileDAO(ds.getDB()));
-
- final List<? extends DriftFile> missingContent = asList(new TestDriftFile(sha256("1a2b3c4d")));
+ addedFileEntry("1.bin", file1SHA),
+ addedFileEntry("2.bin", file2SHA));
+
+ final List<? extends DriftFile> missingContent = asList(new TestDriftFile(file1SHA),
+ new TestDriftFile(file2SHA));
final DriftAgentService driftAgentService = context.mock(DriftAgentService.class);
context.checking(new Expectations() {{
@@ -116,18 +115,18 @@ public class MongoDBDriftServerTest extends MongoDBTest {
with(missingContent));
}});
driftServer.setDriftAgentService(driftAgentService);
-
+
// We can pass null for the subject because MongoDBDriftServer currently does not
// use the subject argument.
- driftServer.saveChangeSet(null, resourceId, changeSetZip);
-
+ DriftChangeSetSummary actualSummary = driftServer.saveChangeSet(null, resourceId, changeSetZip);
+
// verify that the change set was persisted
ChangeSetDAO changeSetDAO = new ChangeSetDAO(morphia, connection, "rhqtest");
List<MongoDBChangeSet> changeSets = changeSetDAO.find().asList();
-
+
assertEquals(changeSets.size(), 1, "Expected to find one change set in the database.");
MongoDBChangeSet actual = changeSets.get(0);
-
+
MongoDBChangeSet expected = new MongoDBChangeSet();
// Need to set the id to actual.id. Since ids are random, we cannot use a canned
// value. We have to set it the same value that is in the database.
@@ -139,14 +138,188 @@ public class MongoDBDriftServerTest extends MongoDBTest {
expected.setVersion(0);
expected.setDriftHandlingMode(normal);
- MongoDBChangeSetEntry entry = new MongoDBChangeSetEntry("1.txt", FILE_ADDED);
- entry.setNewFileHash(sha256("1a2b3c4d"));
- expected.add(entry);
-
+ MongoDBChangeSetEntry entry1 = new MongoDBChangeSetEntry("1.bin", FILE_ADDED);
+ entry1.setNewFileHash(file1SHA);
+ expected.add(entry1);
+
+ MongoDBChangeSetEntry entry2 = new MongoDBChangeSetEntry("2.bin", FILE_ADDED);
+ entry2.setNewFileHash(file2SHA);
+ expected.add(entry2);
+
String[] ignore = new String[] {"id", "objectId", "ctime"};
assertChangeSetMatches("Failed to persist change set", expected, actual, ignore);
+
+ DriftChangeSetSummary expectedSummary = new DriftChangeSetSummary();
+ expectedSummary.setCategory(COVERAGE);
+ expectedSummary.setResourceId(resourceId);
+ expectedSummary.setDriftDefinitionName(driftDefName);
+ expectedSummary.setCreatedTime(actual.getCtime());
+
+ assertPropertiesMatch("The change set summary is wrong", expectedSummary, actualSummary);
}
-
+
+ @Test
+ public void persistInitialChangeSetWithContentInDB() throws Exception {
+ int driftDefId = 1;
+ final String driftDefName = "saveInitialChangeSetWithContentInDB";
+ final int resourceId = 1;
+
+ final Headers headers = new Headers();
+ headers.setBasedir(getBaseDir().getAbsolutePath());
+ headers.setDriftDefinitionId(driftDefId);
+ headers.setDriftDefinitionName(driftDefName);
+ headers.setResourceId(resourceId);
+ headers.setType(COVERAGE);
+ headers.setVersion(0);
+
+ String file1SHA = sha256("1a2b3c4d");
+ String file2SHA = sha256("1a2b3c4d");
+
+ // store content in the database
+ File file1 = createRandomFile(getBaseDir(), file1SHA, 1024);
+ File file2 = createRandomFile(getBaseDir(), file2SHA, 1024);
+
+ FileDAO fileDAO = new FileDAO(ds.getDB());
+ fileDAO.save(file1);
+ fileDAO.save(file2);
+
+ File changeSetZip = createChangeSetZipFile(headers,
+ addedFileEntry("1.bin", file1SHA),
+ addedFileEntry("2.bin", file2SHA));
+
+
+ final DriftAgentService driftAgentService = context.mock(DriftAgentService.class);
+ context.checking(new Expectations() {{
+ exactly(1).of(driftAgentService).ackChangeSet(resourceId, driftDefName);
+ }});
+ driftServer.setDriftAgentService(driftAgentService);
+
+ // We can pass null for the subject because MongoDBDriftServer currently does not
+ // use the subject argument.
+ DriftChangeSetSummary actualSummary = driftServer.saveChangeSet(null, resourceId, changeSetZip);
+
+ // verify that the change set was persisted
+ ChangeSetDAO changeSetDAO = new ChangeSetDAO(morphia, connection, "rhqtest");
+ List<MongoDBChangeSet> changeSets = changeSetDAO.find().asList();
+
+ assertEquals(changeSets.size(), 1, "Expected to find one change set in the database.");
+ MongoDBChangeSet actual = changeSets.get(0);
+
+ MongoDBChangeSet expected = new MongoDBChangeSet();
+ // Need to set the id to actual.id. Since ids are random, we cannot use a canned
+ // value. We have to set it the same value that is in the database.
+ expected.setId(actual.getId());
+ expected.setDriftDefinitionId(driftDefId);
+ expected.setResourceId(resourceId);
+ expected.setDriftDefinitionName(driftDefName);
+ expected.setCategory(COVERAGE);
+ expected.setVersion(0);
+ expected.setDriftHandlingMode(normal);
+
+ MongoDBChangeSetEntry entry1 = new MongoDBChangeSetEntry("1.bin", FILE_ADDED);
+ entry1.setNewFileHash(file1SHA);
+ expected.add(entry1);
+
+ MongoDBChangeSetEntry entry2 = new MongoDBChangeSetEntry("2.bin", FILE_ADDED);
+ entry2.setNewFileHash(file2SHA);
+ expected.add(entry2);
+
+ String[] ignore = new String[] {"id", "objectId", "ctime"};
+ assertChangeSetMatches("Failed to persist change set", expected, actual, ignore);
+
+ DriftChangeSetSummary expectedSummary = new DriftChangeSetSummary();
+ expectedSummary.setCategory(COVERAGE);
+ expectedSummary.setResourceId(resourceId);
+ expectedSummary.setDriftDefinitionName(driftDefName);
+ expectedSummary.setCreatedTime(actual.getCtime());
+
+ assertPropertiesMatch("The change set summary is wrong", expectedSummary, actualSummary);
+ }
+
+ @Test
+ public void persistChangeSetWithSomeContentInDB() throws Exception {
+ int driftDefId = 1;
+ final String driftDefName = "saveChangeSetWithSomeContentInDB";
+ final int resourceId = 1;
+
+ final Headers headers = new Headers();
+ headers.setBasedir(getBaseDir().getAbsolutePath());
+ headers.setDriftDefinitionId(driftDefId);
+ headers.setDriftDefinitionName(driftDefName);
+ headers.setResourceId(resourceId);
+ headers.setType(DRIFT);
+ headers.setVersion(1);
+
+ String oldFile1SHA = sha256("1a2b3c4d");
+ String newFile1SHA = sha256("2a3b4c5d");
+ String file2SHA = sha256("1a2b3c4d");
+
+ // store content in the database
+ File oldFile1 = createRandomFile(getBaseDir(), oldFile1SHA, 1024);
+ File file2 = createRandomFile(getBaseDir(), file2SHA, 1024);
+
+ FileDAO fileDAO = new FileDAO(ds.getDB());
+ fileDAO.save(oldFile1);
+ fileDAO.save(file2);
+
+ File changeSetZip = createChangeSetZipFile(headers,
+ changedFileEntry("1.bin", oldFile1SHA, newFile1SHA),
+ removedFileEntry("2.bin", file2SHA));
+
+ final List<? extends DriftFile> missingContent = asList(new TestDriftFile(newFile1SHA));
+ final DriftAgentService driftAgentService = context.mock(DriftAgentService.class);
+ context.checking(new Expectations() {{
+ exactly(1).of(driftAgentService).ackChangeSet(resourceId, driftDefName);
+ exactly(1).of(driftAgentService).requestDriftFiles(with(resourceId), with(any(Headers.class)),
+ with(missingContent));
+ }});
+ driftServer.setDriftAgentService(driftAgentService);
+
+ // We can pass null for the subject because MongoDBDriftServer currently does not
+ // use the subject argument.
+ DriftChangeSetSummary actualSummary = driftServer.saveChangeSet(null, resourceId, changeSetZip);
+
+ // verify that the change set was persisted
+ ChangeSetDAO changeSetDAO = new ChangeSetDAO(morphia, connection, "rhqtest");
+ List<MongoDBChangeSet> changeSets = changeSetDAO.find().asList();
+
+ assertEquals(changeSets.size(), 1, "Expected to find one change set in the database.");
+ MongoDBChangeSet actual = changeSets.get(0);
+
+ MongoDBChangeSet expected = new MongoDBChangeSet();
+ // Need to set the id to actual.id. Since ids are random, we cannot use a canned
+ // value. We have to set it the same value that is in the database.
+ expected.setId(actual.getId());
+ expected.setDriftDefinitionId(driftDefId);
+ expected.setResourceId(resourceId);
+ expected.setDriftDefinitionName(driftDefName);
+ expected.setCategory(DRIFT);
+ expected.setVersion(1);
+ expected.setDriftHandlingMode(normal);
+
+ MongoDBChangeSetEntry entry1 = new MongoDBChangeSetEntry("1.bin", FILE_CHANGED);
+ entry1.setOldFileHash(oldFile1SHA);
+ entry1.setNewFileHash(newFile1SHA);
+ expected.add(entry1);
+
+ MongoDBChangeSetEntry entry2 = new MongoDBChangeSetEntry("2.bin", FILE_REMOVED);
+ entry2.setOldFileHash(file2SHA);
+ expected.add(entry2);
+
+ String[] ignore = new String[] {"id", "objectId", "ctime"};
+ assertChangeSetMatches("Failed to persist change set", expected, actual, ignore);
+
+ DriftChangeSetSummary expectedSummary = new DriftChangeSetSummary();
+ expectedSummary.setCategory(DRIFT);
+ expectedSummary.setResourceId(resourceId);
+ expectedSummary.setDriftDefinitionName(driftDefName);
+ expectedSummary.setCreatedTime(actual.getCtime());
+ expectedSummary.addDriftPathname("1.bin");
+ expectedSummary.addDriftPathname("2.bin");
+
+ assertPropertiesMatch("The change set summary is wrong", expectedSummary, actualSummary);
+ }
+
protected File createChangeSetZipFile(Headers headers, FileEntry... fileEntries) throws Exception {
ChangeSetWriter writer = newChangeSetWriter(headers);
for (FileEntry entry : fileEntries) {
@@ -187,13 +360,34 @@ public class MongoDBDriftServerTest extends MongoDBTest {
return new File("target", getClass().getSimpleName());
}
+ protected FileEntry addedFileEntry(String path, String sha256) {
+ long timestamp = System.currentTimeMillis();
+ long size = 1024;
+ return FileEntry.addedFileEntry(path, sha256, timestamp, size);
+ }
+
+ protected FileEntry changedFileEntry(String path, String oldSHA, String newSHA) {
+ long timestamp = System.currentTimeMillis();
+ long size = 1024;
+ return FileEntry.changedFileEntry(path, oldSHA, newSHA, timestamp, size);
+ }
+
+ protected FileEntry removedFileEntry(String path, String oldSHA) {
+ return FileEntry.removedFileEntry(path, oldSHA);
+ }
+
protected String sha256(String string) {
return digestGenerator.calcDigestString(string);
}
- protected DriftFileDTO newDriftFile(String hash) {
- DriftFileDTO file = new DriftFileDTO();
- file.setHashId(hash);
+ protected File createRandomFile(File dir, String fileName, int numBytes) throws Exception {
+ File file = new File(dir, fileName);
+ FileOutputStream stream = new FileOutputStream(file);
+ byte[] bytes = new byte[numBytes];
+ random.nextBytes(bytes);
+ write(bytes, stream);
+ stream.close();
+
return file;
}
diff --git a/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBTest.java b/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBTest.java
index 847ccbd..d4a381a 100644
--- a/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBTest.java
+++ b/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/MongoDBTest.java
@@ -1,16 +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.plugins.drift.mongodb;
import com.google.code.morphia.Datastore;
import com.google.code.morphia.Morphia;
-import com.google.code.morphia.query.Query;
import com.mongodb.Mongo;
-import org.rhq.enterprise.server.plugins.drift.mongodb.dao.ChangeSetDAO;
import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSet;
import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSetEntry;
import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBFile;
import org.rhq.test.JMockTest;
import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
import java.util.ArrayList;
import java.util.List;
@@ -42,6 +58,12 @@ public class MongoDBTest extends JMockTest {
ds = morphia.createDatastore(connection, "rhqtest");
}
+ protected void clearCollections(String... collections) {
+ for (String collection : collections) {
+ ds.getDB().getCollection(collection).drop();
+ }
+ }
+
/**
* Verifies that the actual list of change sets match the expected list of change sets.
* The order of the lists is expected to be the same.
diff --git a/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOTest.java b/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOTest.java
index aaee50c..5b1b768 100644
--- a/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOTest.java
+++ b/modules/enterprise/server/plugins/drift-mongodb/src/test/java/org/rhq/enterprise/server/plugins/drift/mongodb/dao/ChangeSetDAOTest.java
@@ -19,31 +19,25 @@
package org.rhq.enterprise.server.plugins.drift.mongodb.dao;
-import java.util.List;
-
-import com.google.code.morphia.query.Query;
import org.rhq.core.domain.criteria.GenericDriftChangeSetCriteria;
+import org.rhq.core.domain.criteria.GenericDriftCriteria;
+import org.rhq.core.domain.drift.DriftChangeSetCategory;
import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.plugins.drift.mongodb.MongoDBTest;
+import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSet;
+import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSetEntry;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import org.rhq.core.domain.criteria.GenericDriftCriteria;
-import org.rhq.core.domain.drift.DriftChangeSetCategory;
-import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSet;
-import org.rhq.enterprise.server.plugins.drift.mongodb.entities.MongoDBChangeSetEntry;
+import java.util.List;
import static java.util.Arrays.asList;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_ADDED;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_CHANGED;
-import static org.rhq.core.domain.drift.DriftCategory.FILE_REMOVED;
+import static org.rhq.core.domain.drift.DriftCategory.*;
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.DriftHandlingMode.normal;
import static org.rhq.test.AssertUtils.assertCollectionMatchesNoOrder;
-import static org.rhq.test.AssertUtils.assertPropertiesMatch;
import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
public class ChangeSetDAOTest extends MongoDBTest {
@@ -52,8 +46,7 @@ public class ChangeSetDAOTest extends MongoDBTest {
@BeforeMethod
public void initDAO() {
- Query deleteAll = ds.createQuery(MongoDBChangeSet.class);
- ds.delete(deleteAll);
+ clearCollections("changesets");
dao = new ChangeSetDAO(morphia, connection, "rhqtest");
}
12 years, 2 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/itests/src/test/java/org/rhq/enterprise/server/drift/DriftServerTest.java | 32 ++++------
1 file changed, 15 insertions(+), 17 deletions(-)
New commits:
commit 1fbdb715bd02b7cd03581165dba66cc998264e8d
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Feb 27 16:47:01 2012 -0500
Fixing test to look for correct file name
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 5fa92b9..3b77daf 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
@@ -19,23 +19,7 @@
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;
@@ -49,6 +33,20 @@ 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;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.NonUniqueResultException;
+import java.io.File;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import static org.rhq.core.domain.resource.ResourceCategory.SERVER;
+import static org.rhq.enterprise.server.util.LookupUtil.getSubjectManager;
@Test(groups = "drift")
public class DriftServerTest extends AbstractEJB3Test {
@@ -87,7 +85,7 @@ public class DriftServerTest extends AbstractEJB3Test {
prepareCustomServerPluginService(driftServerPluginService);
driftServerPluginService.masterConfig.getPluginDirectory().mkdirs();
- File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.3.0-SNAPSHOT.jar");
+ File jpaDriftPlugin = new File("../plugins/drift-rhq/target/rhq-serverplugin-drift-4.4.0-SNAPSHOT.jar");
assertTrue("Drift server plugin JAR file not found at" + jpaDriftPlugin.getPath(), jpaDriftPlugin.exists());
FileUtils.copyFileToDirectory(jpaDriftPlugin, driftServerPluginService.masterConfig.getPluginDirectory());
12 years, 2 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java | 16 +++-------
1 file changed, 6 insertions(+), 10 deletions(-)
New commits:
commit 2d5d9b00387a7761487ae6a5ca63fbf2e7ca732b
Author: John Sanda <jsanda(a)localhost.localdomain>
Date: Mon Feb 27 16:38:52 2012 -0500
[BZ 751752] Do not allow grouping by edit column
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java
index 3e33022..a3ca599 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/templates/ResourceTypeTreeView.java
@@ -18,10 +18,6 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.templates;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EnumSet;
-
import com.smartgwt.client.data.Record;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ListGridFieldType;
@@ -39,7 +35,6 @@ import com.smartgwt.client.widgets.layout.SectionStackSection;
import com.smartgwt.client.widgets.tree.TreeGrid;
import com.smartgwt.client.widgets.tree.TreeGridField;
import com.smartgwt.client.widgets.tree.TreeNode;
-
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.enterprise.gui.coregui.client.BookmarkableView;
@@ -50,11 +45,11 @@ import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.components.TitleBar;
import org.rhq.enterprise.gui.coregui.client.components.buttons.BackButton;
import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableSectionStack;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTreeGrid;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
-import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
+import org.rhq.enterprise.gui.coregui.client.util.selenium.*;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.EnumSet;
/**
* A tree view of all known ResourceTypes, which includes summaries of metric schedule and alert definition templates
@@ -215,6 +210,7 @@ public abstract class ResourceTypeTreeView extends LocatableVLayout implements B
.common_title_edit());
editField.setType(ListGridFieldType.IMAGE);
editField.setAlign(Alignment.CENTER);
+ editField.setCanGroupBy(false);
editField.addRecordClickHandler(new RecordClickHandler() {
public void onRecordClick(RecordClickEvent event) {
12 years, 2 months