[rhq] 2 commits - modules/core modules/plugins pom.xml
by Jay Shaughnessy
modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java | 9 -
modules/core/plugin-container/pom.xml | 1
modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java | 13 +
modules/plugins/jboss-as-7/pom.xml | 22 ++
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java | 17 +-
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java | 84 ++++++----
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java | 45 +++--
pom.xml | 6
8 files changed, 138 insertions(+), 59 deletions(-)
New commits:
commit 11125dd1eb846cb9350bcf9b49c3176869e4e304
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jan 29 14:08:21 2014 -0500
AS7 i-test work, try to get these mf's working... I'm sure this won't solve
everything but hopefully gets us closer - I want to see what jenkins does now...
- allow superclass mock decls to get defined each time discovery resets
the mocks. (get rid of fake tests annotated with @ServerServicesSetup)
- generate consistent resource ids in the arquillian fake inventory to
avoid mismatch betweeen the PC and the fake server inv.
- do a better job of mvn clean for the as7 itest env
- report 0 byte content uploads to sys out
- remove some (seemingly?) unnecessary class-level annotations
- remove some (seemingly?) unnecessary test sleeps
- beef up the deployment upload method
diff --git a/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java b/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
index 0c66be8..a553a5d 100644
--- a/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
+++ b/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
@@ -154,7 +154,7 @@ public class FakeServerInventory {
private Resource platform;
private Map<String, Resource> resourceStore = new HashMap<String, Resource>();
- private int counter;
+ //private int counter;
private AtomicInteger metricScheduleCounter = new AtomicInteger(1); // used when creating measurement schedules
private boolean failing;
private boolean failUpgrade;
@@ -576,10 +576,11 @@ public class FakeServerInventory {
}
if (persisted == null) {
persisted = new Resource();
- if (agentSideResource.getId() != 0 && counter < agentSideResource.getId()) {
- counter = agentSideResource.getId() - 1;
+ if (agentSideResource.getId() != 0) {
+ persisted.setId(agentSideResource.getId());
+ } else {
+ persisted.setId(agentSideResource.getUuid().hashCode());
}
- persisted.setId(++counter);
persisted.setUuid(agentSideResource.getUuid());
persisted.setAgent(agentSideResource.getAgent());
persisted.setCurrentAvailability(agentSideResource.getCurrentAvailability());
diff --git a/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java b/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
index 74773c2..c7a2333 100644
--- a/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
+++ b/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
@@ -153,6 +153,17 @@ public abstract class AbstractAgentPluginTest extends Arquillian {
}
/**
+ * Superclass can override this to add additional mocked services to those already
+ * defined in this abstract base class. The base class will call for injection each
+ * time the mocks are reset.
+ *
+ * @param serverServices
+ */
+ protected void injectMocks(MockingServerServices serverServices) {
+ return;
+ }
+
+ /**
* Set up our fake server discovery ServerService, which will auto-import all Resources in reports it receives.
*
* @throws Exception if an error occurs
@@ -174,6 +185,8 @@ public abstract class AbstractAgentPluginTest extends Arquillian {
serverInventory.mergeInventoryReport(InventoryStatus.COMMITTED));
Mockito.when(serverServices.getDiscoveryServerService().getResourceSyncInfo(Mockito.any(int.class))).then(
serverInventory.getResourceSyncInfo());
+
+ injectMocks(this.serverServices);
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/modules/plugins/jboss-as-7/pom.xml b/modules/plugins/jboss-as-7/pom.xml
index bfeb587..28d33ff 100644
--- a/modules/plugins/jboss-as-7/pom.xml
+++ b/modules/plugins/jboss-as-7/pom.xml
@@ -448,17 +448,35 @@
</configuration>
</execution>
<execution>
- <id>delete</id>
+ <id>delete-post</id>
<phase>post-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
+ <echo>*** Deleting AS7 ${jboss7.home}...</echo>
<delete dir="${jboss7.home}" />
+ <echo>*** Deleting data ./data...</echo>
+ <delete dir="./data" />
</target>
</configuration>
</execution>
+ <execution>
+ <id>delete-clean</id>
+ <phase>clean</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <echo>*** Deleting AS7 ${jboss7.home}...</echo>
+ <delete dir="${jboss7.home}" />
+ <echo>*** Deleting data ./data...</echo>
+ <delete dir="./data" />
+ </target>
+ </configuration>
+ </execution>
</executions>
</plugin>
@@ -609,7 +627,7 @@
<skipITs>false</skipITs>
<includes>
<!-- only include integration tests; normal unit tests are handled above by surefire plugin -->
- <include>org/rhq/modules/plugins/jbossas7/itest/**/*Test.java</include>
+ <include>org/rhq/modules/plugins/jbossas7/itest/**/DeploymentTest.java</include>
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/StandaloneServerComponentTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/InterruptibleOperationsTest.java</include>-->
<!--<include>org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java</include>-->
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
index 2451743..000d08c 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseComponent.java
@@ -457,15 +457,28 @@ public class BaseComponent<T extends ResourceComponent<?>> implements AS7Compone
report.setErrorMessage("An error occured while the agent was preparing for content download");
return report;
}
+
+ long size = 0L;
try {
- contentServices.downloadPackageBitsForChildResource(cctx, resourceTypeName, details.getKey(), out);
+ size = contentServices.downloadPackageBitsForChildResource(cctx, resourceTypeName, details.getKey(),
+ out);
} catch (Exception e) {
uploadConnection.cancelUpload();
report.setStatus(CreateResourceStatus.FAILURE);
- report.setErrorMessage("An error occured while the agent was downloading the content");
+ report.setErrorMessage("An error occured while the agent was uploading the content for ["
+ + details.getKey() + "]");
return report;
}
+ if (0L == size) {
+ uploadConnection.cancelUpload();
+ report.setStatus(CreateResourceStatus.FAILURE);
+ report.setErrorMessage("An error occured (0 bytes) while the agent was uploading the content for ["
+ + details.getKey() + "]");
+ return report;
+
+ }
+
JsonNode uploadResult = uploadConnection.finishUpload();
if (verbose) {
getLog().info(uploadResult);
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java
index 05237ef..3747821 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentRuntimeResourcesTest.java
@@ -19,17 +19,14 @@
package org.rhq.modules.plugins.jbossas7.itest.standalone;
-import static java.lang.System.currentTimeMillis;
-import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.rhq.modules.plugins.jbossas7.itest.standalone.DeploymentTest.copyStreamAndReturnCount;
import static org.rhq.modules.plugins.jbossas7.itest.standalone.DeploymentTest.getMeasurementScheduleRequests;
import static org.rhq.modules.plugins.jbossas7.itest.standalone.DeploymentTest.getMissingMeasurements;
import static org.rhq.modules.plugins.jbossas7.itest.standalone.DeploymentTest.getTestDeploymentPackageDetails;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
+import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashSet;
@@ -40,6 +37,7 @@ import org.apache.commons.logging.LogFactory;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
+import org.testng.Assert;
import org.testng.annotations.Test;
import org.rhq.core.clientapi.agent.PluginContainerException;
@@ -59,15 +57,15 @@ import org.rhq.core.pc.util.FacetLockType;
import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
import org.rhq.test.arquillian.DiscoveredResources;
+import org.rhq.test.arquillian.MockingServerServices;
import org.rhq.test.arquillian.RunDiscovery;
-import org.rhq.test.arquillian.ServerServicesSetup;
/**
* This test ensures that "* Runtime" (JPA, Messaging, EJB3) child resources of a deployment get discovered.
*
* @author Thomas Segismont
*/
-@Test(groups = { "integration", "pc", "standalone" }, singleThreaded = true)
+@Test
public class DeploymentRuntimeResourcesTest extends AbstractJBossAS7PluginTest {
private static final Log LOG = LogFactory.getLog(DeploymentRuntimeResourcesTest.class);
@@ -100,39 +98,59 @@ public class DeploymentRuntimeResourcesTest extends AbstractJBossAS7PluginTest {
}
}
- @DiscoveredResources(plugin = PLUGIN_NAME, resourceType = "JBossAS7 Standalone Server")
- private Set<Resource> standaloneResources;
-
- @DiscoveredResources(plugin = PLUGIN_NAME, resourceType = "Deployment")
- private Set<Resource> deploymentResources;
+ protected void injectMocks(MockingServerServices serverServices) {
+ Mockito.when(
+ serverServices.getContentServerService().downloadPackageBitsGivenResource(Mockito.anyInt(),
+ Mockito.any(PackageDetailsKey.class), Mockito.any(OutputStream.class))).then(new Answer<Long>() {
+ @Override
+ public Long answer(InvocationOnMock invocation) throws Throwable {
+ OutputStream out = (OutputStream) invocation.getArguments()[invocation.getArguments().length - 1];
+ return copyStreamAndReturnCount(out);
+ }
+ });
- @ServerServicesSetup
- @Test(enabled = false)
- public void setupContentServices() {
Mockito.when(
serverServices.getContentServerService().downloadPackageBitsForChildResource(Mockito.anyInt(),
Mockito.anyString(), Mockito.any(PackageDetailsKey.class), Mockito.any(OutputStream.class))).then(
new Answer<Long>() {
@Override
public Long answer(InvocationOnMock invocation) throws Throwable {
- InputStream str = getClass().getClassLoader().getResourceAsStream(
- TestDeployments.JAVAEE6_TEST_APP.getResourcePath());
OutputStream out = (OutputStream) invocation.getArguments()[invocation.getArguments().length - 1];
- return copyStreamAndReturnCount(str, out);
+ return copyStreamAndReturnCount(out);
}
});
+ }
- Mockito.when(
- serverServices.getContentServerService().downloadPackageBitsGivenResource(Mockito.anyInt(),
- Mockito.any(PackageDetailsKey.class), Mockito.any(OutputStream.class))).then(new Answer<Long>() {
- @Override
- public Long answer(InvocationOnMock invocation) throws Throwable {
- InputStream str = getClass().getClassLoader().getResourceAsStream(
- TestDeployments.JAVAEE6_TEST_APP.getResourcePath());
- OutputStream out = (OutputStream) invocation.getArguments()[invocation.getArguments().length - 1];
- return copyStreamAndReturnCount(str, out);
+ @DiscoveredResources(plugin = PLUGIN_NAME, resourceType = "JBossAS7 Standalone Server")
+ private Set<Resource> standaloneResources;
+
+ @DiscoveredResources(plugin = PLUGIN_NAME, resourceType = "Deployment")
+ private Set<Resource> deploymentResources;
+
+ private long copyStreamAndReturnCount(OutputStream out) throws IOException {
+ if (null == out) {
+ System.out.println("**** Unexepected null output stream in mock code!!");
+ return 0L;
+ }
+
+ String path = TestDeployments.JAVAEE6_TEST_APP.getResourcePath();
+ InputStream in = getClass().getClassLoader().getResourceAsStream(path);
+
+ long cnt = 0;
+
+ try {
+ int data;
+ while ((data = in.read()) != -1) {
+ if (out != null) {
+ out.write(data);
+ }
+ cnt++;
}
- });
+ } finally {
+ in.close();
+ out.flush();
+ }
+ return cnt;
}
@Test(priority = 10)
@@ -174,7 +192,7 @@ public class DeploymentRuntimeResourcesTest extends AbstractJBossAS7PluginTest {
}
private void ensureAllRuntimeServicesAreFound() throws InterruptedException {
- long start = currentTimeMillis();
+ long start = System.currentTimeMillis();
boolean foundAllRuntimeServices = false;
do {
boolean runtimeServiceMissing = false;
@@ -187,10 +205,11 @@ public class DeploymentRuntimeResourcesTest extends AbstractJBossAS7PluginTest {
}
}
foundAllRuntimeServices = !runtimeServiceMissing;
- Thread.sleep(SECONDS.toMillis(5));
- } while (!foundAllRuntimeServices && (currentTimeMillis() - start) < MINUTES.toMillis(10));
- assertTrue(foundAllRuntimeServices, "Could not find all runtime services");
- Thread.sleep(MINUTES.toMillis(5));
+ //Thread.sleep(SECONDS.toMillis(5));
+ } while (!foundAllRuntimeServices
+ && (System.currentTimeMillis() - start) < java.util.concurrent.TimeUnit.MINUTES.toMillis(10));
+ Assert.assertTrue(foundAllRuntimeServices, "Could not find all runtime services");
+ //Thread.sleep(MINUTES.toMillis(5));
}
private boolean canGetMeasurementFacet(Set<Resource> resources) {
@@ -247,6 +266,7 @@ public class DeploymentRuntimeResourcesTest extends AbstractJBossAS7PluginTest {
}
@Test(priority = 99)
+ @RunDiscovery
public void testUndeploy() throws Exception {
Resource deploymentResource = getDeploymentResource();
DeleteResourceRequest request = new DeleteResourceRequest(0, deploymentResource.getId());
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
index 24add24..fbdc02b 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
@@ -67,12 +67,12 @@ import org.rhq.core.util.MessageDigestGenerator;
import org.rhq.modules.plugins.jbossas7.StandaloneASComponent;
import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
import org.rhq.test.arquillian.DiscoveredResources;
+import org.rhq.test.arquillian.MockingServerServices;
import org.rhq.test.arquillian.ResourceComponentInstances;
import org.rhq.test.arquillian.RunDiscovery;
-import org.rhq.test.arquillian.ServerServicesSetup;
/**
- *
+ *
*
* @author Lukas Krejci
*/
@@ -95,20 +95,16 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
private static TestDeployments DEPLOYMENT_TO_SERVE = TestDeployments.DEPLOYMENT_1;
- //this is no test method
- @ServerServicesSetup
- @Test(enabled = false)
- public void setupContentServices() {
+ @Override
+ protected void injectMocks(MockingServerServices serverServices) {
Mockito.when(
serverServices.getContentServerService().downloadPackageBitsForChildResource(Mockito.anyInt(),
Mockito.anyString(), Mockito.any(PackageDetailsKey.class), Mockito.any(OutputStream.class))).then(
new Answer<Long>() {
@Override
public Long answer(InvocationOnMock invocation) throws Throwable {
- InputStream str = getClass().getClassLoader().getResourceAsStream(
- DEPLOYMENT_TO_SERVE.getResourcePath());
OutputStream out = (OutputStream) invocation.getArguments()[invocation.getArguments().length - 1];
- return copyStreamAndReturnCount(str, out);
+ return copyStreamAndReturnCount(out);
}
});
@@ -117,10 +113,8 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
Mockito.any(PackageDetailsKey.class), Mockito.any(OutputStream.class))).then(new Answer<Long>() {
@Override
public Long answer(InvocationOnMock invocation) throws Throwable {
- InputStream str = getClass().getClassLoader()
- .getResourceAsStream(DEPLOYMENT_TO_SERVE.getResourcePath());
OutputStream out = (OutputStream) invocation.getArguments()[invocation.getArguments().length - 1];
- return copyStreamAndReturnCount(str, out);
+ return copyStreamAndReturnCount(out);
}
});
}
@@ -243,6 +237,7 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
}
@Test(priority = 16)
+ @RunDiscovery
public void testUndeploy() throws Exception {
Resource deployment = deploymentResources.iterator().next();
DeleteResourceRequest request = new DeleteResourceRequest(0, deployment.getId());
@@ -300,14 +295,28 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
}
}
- static long copyStreamAndReturnCount(InputStream in, OutputStream out) throws IOException {
- int data;
+ private long copyStreamAndReturnCount(OutputStream out) throws IOException {
+ if (null == out) {
+ System.out.println("**** Unexepected null output stream in mock code!!");
+ return 0L;
+ }
+
+ String path = DEPLOYMENT_TO_SERVE.getResourcePath();
+ InputStream in = getClass().getClassLoader().getResourceAsStream(path);
+
long cnt = 0;
- while ((data = in.read()) != -1) {
- if (out != null) {
- out.write(data);
+
+ try {
+ int data;
+ while ((data = in.read()) != -1) {
+ if (out != null) {
+ out.write(data);
+ }
+ cnt++;
}
- cnt++;
+ } finally {
+ in.close();
+ out.flush();
}
return cnt;
}
commit c86911c9850e81f498099395e509cc41f4a67dde
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jan 29 13:08:00 2014 -0500
move trove4j dep version to root pom
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index 5fad36b..c9d5d17 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -92,7 +92,6 @@
<dependency>
<groupId>net.sf.trove4j</groupId>
<artifactId>trove4j</artifactId>
- <version>3.0.3</version>
</dependency>
</dependencies>
diff --git a/pom.xml b/pom.xml
index dd797a1..fec00c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1036,6 +1036,12 @@
<artifactId>snakeyaml</artifactId>
<version>${cassandra.snakeyaml.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>net.sf.trove4j</groupId>
+ <artifactId>trove4j</artifactId>
+ <version>3.0.3</version>
+ </dependency>
</dependencies>
</dependencyManagement>
10 years, 3 months
[rhq] modules/enterprise
by Thomas Segismont
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
New commits:
commit 8fc26d558b65efe70d989c6bcb6223c46fb1a633
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Wed Jan 29 17:09:42 2014 +0100
Avoid unused variable creation
diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
index 4d4beab..a405b6c 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
@@ -2741,8 +2741,7 @@ public class AgentMain {
// The JBoss remoting HTTP transport can wait indefinitely for a response
// This ensures the client does not wait forever
- long clientSenderCommandTimeout = m_configuration.getClientSenderCommandTimeout();
- long timeout = clientSenderCommandTimeout;
+ long timeout = m_configuration.getClientSenderCommandTimeout();
if (timeout > 0) {
config.put("timeout", Long.toString(timeout));
}
10 years, 3 months
[rhq] modules/enterprise
by Thomas Segismont
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java | 11 +++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 9302f90bc0d81905bf62649666b7df0913acdac7
Author: Elias Ross <genman(a)noderunner.net>
Date: Wed Jan 29 17:02:42 2014 +0100
Bug 1053922 - Agent does not set HTTP connect or read timeout in JBoss remoting
diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
index b6cd741..4d4beab 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2013 Red Hat, Inc.
+ * Copyright (C) 2005-2014 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -16,6 +16,7 @@
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
package org.rhq.enterprise.agent;
import static java.util.concurrent.TimeUnit.SECONDS;
@@ -2738,6 +2739,14 @@ public class AgentMain {
config.put(HTTPSClientInvoker.IGNORE_HTTPS_HOST, "true");
}
+ // The JBoss remoting HTTP transport can wait indefinitely for a response
+ // This ensures the client does not wait forever
+ long clientSenderCommandTimeout = m_configuration.getClientSenderCommandTimeout();
+ long timeout = clientSenderCommandTimeout;
+ if (timeout > 0) {
+ config.put("timeout", Long.toString(timeout));
+ }
+
RemoteCommunicator remote_comm = new JBossRemotingRemoteCommunicator(uri, config);
if (withFailover) {
remote_comm.setFailureCallback(new FailoverFailureCallback(this));
10 years, 3 months
[rhq] Branch 'release/jon3.2.x' - modules/plugins
by Thomas Segismont
modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java | 26 ++++++++--
1 file changed, 23 insertions(+), 3 deletions(-)
New commits:
commit 80ab9efe5868ec5e12797a48166bbb3f251a8483
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Jan 27 22:12:25 2014 +0100
Bug 855926 - Apache plug-in throws NoClassDefFoundError or UnsatisfiedLinkError when Augeas is enabled but library can not be read
Log meaningful messages on failure to find/link Augeas lib
Catch NoClassDefFoundError and UnsatisfiedLinkError and report them
appropriately when checking for presence of Augeas in Apache plugin.
Also emit slightly more direct message if we do not support Augeas for
given version of Apache.
(cherry picked from commit f7f0011072dd56f1a081aa24351966656ff94f83)
Signed-off-by: Thomas Segismont <tsegismo(a)redhat.com>
diff --git a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
index de81e3e..6c43552 100644
--- a/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
+++ b/modules/plugins/apache/src/main/java/org/rhq/plugins/apache/ApacheServerComponent.java
@@ -113,7 +113,9 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
public static final String CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE =
"Configuration and child resource creation/deletion support for Apache is optional. "
+ "If you switched it on by enabling Augeas support in the connection settings of the Apache server resource and still get this message, "
- + "it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform.";
+ + "it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform."
+ + " Please refer to your agent's log for the precise exception that is causing this behavior. It will logged at error level only once "
+ + "per plugin container lifetime";
public static final String PLUGIN_CONFIG_PROP_SERVER_ROOT = "serverRoot";
public static final String PLUGIN_CONFIG_PROP_EXECUTABLE_PATH = "executablePath";
@@ -170,6 +172,7 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
private URL url;
private ApacheBinaryInfo binaryInfo;
private long availPingTime = -1;
+ private boolean augeasErrorLogged;
private Map<String, String> moduleNames;
@@ -1067,7 +1070,13 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
try {
ag = new Augeas();
} catch (Exception e) {
- LOG.error("Augeas is enabled in configuration but was not found on the system.", e);
+ logAugeasError(e);
+ throw new RuntimeException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ } catch (NoClassDefFoundError e) {
+ logAugeasError(e);
+ throw new RuntimeException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ } catch (UnsatisfiedLinkError e) {
+ logAugeasError(e);
throw new RuntimeException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
} finally {
if (ag != null) {
@@ -1081,7 +1090,11 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
String version = getVersion();
if (!version.startsWith("2.")) {
- LOG.error(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
+ if (!augeasErrorLogged) {
+ augeasErrorLogged = true;
+ LOG.error("Augeas is only supported with Apache version 2.x but version '" + version +
+ "' was detected.");
+ }
throw new RuntimeException(CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE);
}
return true;
@@ -1090,6 +1103,13 @@ public class ApacheServerComponent implements AugeasRHQComponent, ResourceCompon
}
}
+ private void logAugeasError(Throwable cause) {
+ if (!augeasErrorLogged) {
+ LOG.error("Augeas is enabled in configuration but was not found on the system.", cause);
+ augeasErrorLogged = true;
+ }
+ }
+
private String getVersion() {
String ret = resourceContext.getVersion();
if (ret == null) {
10 years, 3 months
[rhq] Changes to 'bug/991149'
by Thomas Segismont
New branch 'bug/991149' available with the following commits:
commit 2900e5d4f4f5a765b6aff174f9e67206a9f4d060
Author: Elias Ross <genman(a)noderunner.net>
Date: Thu Nov 21 15:45:20 2013 +0100
Bug 991149 - Refactor Plugin Container Services initialization
Since there have been other race conditions in the past (as documented in the
code in a few spots), it feels there is an overall design issue at fault:
Objects are initialized in arbitrary order, enforced by the use of 'listeners',
but this was done as a reaction to what bugs were found.
The solution employed here is to use constructors and immutability when
possible. Handles to other components should be done using object fields, not
an object registry/singleton pattern. I tried to eliminate the use of
PluginContainer.getInstance().getXXX(), since in many cases references could be
null depending on the order of how objects are initialized. It also makes clear
what objects really depend on what objects. The use of 'PC.getInstance()'
should probably be entirely removed, since it's bug-prone, but I'll leave the
rest of the cleanup for later.
Testability is generally improved, as test/mock instances can simply be
'injected' using the constructor, not by having to create methods
that get overridden.
10 years, 3 months
[rhq] Changes to 'bug/991149'
by Thomas Segismont
New branch 'bug/991149' available with the following commits:
commit 3107e780711ac6c2b92ae5e038b21f013cf75952
Author: Elias Ross <genman(a)noderunner.net>
Date: Thu Nov 21 15:45:20 2013 +0100
Bug 991149 - Refactor Plugin Container Services initialization
Since there have been other race conditions in the past (as documented in the
code in a few spots), it feels there is an overall design issue at fault:
Objects are initialized in arbitrary order, enforced by the use of 'listeners',
but this was done as a reaction to what bugs were found.
The solution employed here is to use constructors and immutability when
possible. Handles to other components should be done using object fields, not
an object registry/singleton pattern. I tried to eliminate the use of
PluginContainer.getInstance().getXXX(), since in many cases references could be
null depending on the order of how objects are initialized. It also makes clear
what objects really depend on what objects. The use of 'PC.getInstance()'
should probably be entirely removed, since it's bug-prone, but I'll leave the
rest of the cleanup for later.
Testability is generally improved, as test/mock instances can simply be
'injected' using the constructor, not by having to create methods
that get overridden.
10 years, 3 months
[rhq] Branch 'feature/embeddedagent' - 2 commits - modules/enterprise
by mazz
modules/enterprise/server/embeddedagent/pom.xml | 55 ++++++++++
modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentService.java | 26 ++++
modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentSubsystemAdd.java | 10 +
modules/enterprise/server/embeddedagent/src/main/resources/module/main/module.xml | 1
modules/enterprise/server/embeddedagent/src/main/scripts/module-assembly.xml | 6 +
modules/enterprise/server/embeddedagent/src/test/java/org/rhq/embeddedagent/extension/SubsystemParsingTestCase.java | 13 +-
6 files changed, 103 insertions(+), 8 deletions(-)
New commits:
commit 9a36d10aea8237c8058e75090100f914d747227c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Jan 28 17:13:02 2014 -0500
inject the server env service into our service so we can get things like data dir, hostname, etc
add the rhq-agent distro to the exported resource roots so we can get the config xml
diff --git a/modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentService.java b/modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentService.java
index 383f012..7860479 100644
--- a/modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentService.java
+++ b/modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentService.java
@@ -5,12 +5,16 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.jboss.as.server.ServerEnvironment;
import org.jboss.logging.Logger;
+import org.jboss.modules.Module;
+import org.jboss.modules.Resource;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
+import org.jboss.msc.value.InjectedValue;
public class AgentService implements Service<AgentService> {
@@ -20,11 +24,17 @@ public class AgentService implements Service<AgentService> {
private final Logger log = Logger.getLogger(AgentService.class);
/**
+ * Our subsystem add-step handler will inject this as a dependency for us.
+ * This service gives us information about the server, like the install directory, data directory, etc.
+ */
+ InjectedValue<ServerEnvironment> envServiceValue = new InjectedValue<ServerEnvironment>();
+
+ /**
* This service can be configured to be told explicitly about certain plugins to be
* enabled or disabled. This map holds that configuration. These aren't necessarily
* all the plugins that will be loaded, but they are those plugins this service was
* explicitly told about and indicates if they should be enabled or disabled.
- * TODO: For any plugin not specified will, by default, be WHAT? Disabled???
+ * TODO: For any plugin not specified will, by default, be WHAT? Disabled???
*/
private Map<String, Boolean> plugins = Collections.synchronizedMap(new HashMap<String, Boolean>());
@@ -95,4 +105,18 @@ public class AgentService implements Service<AgentService> {
log.info("Stopping the embedded agent now");
agentStarted.set(false);
}
+
+ /**
+ * Gets information about a file that is inside our module. Use this to
+ * obtain files locationed in the embedded agent, for example, pass in
+ * "conf/agent-configuration.xml" to get the config file.
+ *
+ * @param name name of the agent file
+ * @return object referencing the file from our module
+ */
+ private Resource getExportedResource(String name) {
+ Module module = Module.forClass(getClass());
+ Resource r = module.getExportedResource("rhq-agent", name);
+ return r;
+ }
}
diff --git a/modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentSubsystemAdd.java b/modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentSubsystemAdd.java
index 7541da1..f9d3291 100644
--- a/modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentSubsystemAdd.java
+++ b/modules/enterprise/server/embeddedagent/src/main/java/org/rhq/embeddedagent/extension/AgentSubsystemAdd.java
@@ -7,6 +7,8 @@ import org.jboss.as.controller.AbstractAddStepHandler;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.ServiceVerificationHandler;
+import org.jboss.as.server.ServerEnvironment;
+import org.jboss.as.server.ServerEnvironmentService;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.Property;
import org.jboss.logging.Logger;
@@ -62,8 +64,12 @@ class AgentSubsystemAdd extends AbstractAddStepHandler {
service.setPlugins(pluginsWithEnableFlag);
ServiceName name = AgentService.SERVICE_NAME;
- ServiceController<AgentService> controller = context.getServiceTarget().addService(name, service)
- .addListener(verificationHandler).setInitialMode(Mode.ACTIVE).install();
+ ServiceController<AgentService> controller = context.getServiceTarget() //
+ .addService(name, service) //
+ .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.envServiceValue) //
+ .addListener(verificationHandler) //
+ .setInitialMode(Mode.ACTIVE) //
+ .install();
newControllers.add(controller);
return;
}
diff --git a/modules/enterprise/server/embeddedagent/src/main/resources/module/main/module.xml b/modules/enterprise/server/embeddedagent/src/main/resources/module/main/module.xml
index c041115..2cc72ef 100644
--- a/modules/enterprise/server/embeddedagent/src/main/resources/module/main/module.xml
+++ b/modules/enterprise/server/embeddedagent/src/main/resources/module/main/module.xml
@@ -4,6 +4,7 @@
<resources>
<resource-root path="${project.build.finalName}.jar"/>
+ <resource-root path="rhq-agent"/>
<resource-root path="rhq-agent/lib/commons-httpclient-2.0.2.jar" /> <!-- agent seems to want this specific version -->
<resource-root path="rhq-agent/lib/commons-io-${commons-io.version}.jar" />
<resource-root path="rhq-agent/lib/commons-logging-${commons-logging.version}.jar" />
diff --git a/modules/enterprise/server/embeddedagent/src/test/java/org/rhq/embeddedagent/extension/SubsystemParsingTestCase.java b/modules/enterprise/server/embeddedagent/src/test/java/org/rhq/embeddedagent/extension/SubsystemParsingTestCase.java
index 40054b9..b33fb4f 100644
--- a/modules/enterprise/server/embeddedagent/src/test/java/org/rhq/embeddedagent/extension/SubsystemParsingTestCase.java
+++ b/modules/enterprise/server/embeddedagent/src/test/java/org/rhq/embeddedagent/extension/SubsystemParsingTestCase.java
@@ -16,16 +16,17 @@ import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.WRI
import java.util.ArrayList;
import java.util.List;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.subsystem.test.KernelServices;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.Property;
import org.jboss.msc.service.ServiceNotFoundException;
-import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Test;
@Test
public class SubsystemParsingTestCase extends SubsystemBaseParsingTestCase {
@@ -291,11 +292,13 @@ public class SubsystemParsingTestCase extends SubsystemBaseParsingTestCase {
Assert.assertEquals(plugins.get(2).getName(), "foo"); // foo plugin we added above
Assert.assertEquals(plugins.get(2).getValue().asBoolean(), true);
+ /* TODO: I think we need to mock the ServerEnvironmentService dependency before we can do this
// execute status
ModelNode statusOp = new ModelNode();
statusOp.get(OP).set(AgentSubsystemExtension.AGENT_STATUS_OP);
statusOp.get(OP_ADDR).set(agentSubsystemPath.toModelNode());
result = services.executeOperation(statusOp);
- Assert.assertEquals(checkResultAndGetContents(result).asString(), "STARTED");
+ Assert.assertTrue(checkResultAndGetContents(result).asBoolean());
+ */
}
}
commit 0f68e44f99567c21a4643814d514f3ccd28b8502
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Jan 28 15:29:31 2014 -0500
putting native libs in their proper place for EAP to find them
diff --git a/modules/enterprise/server/embeddedagent/pom.xml b/modules/enterprise/server/embeddedagent/pom.xml
index d20815b..c6118a6 100644
--- a/modules/enterprise/server/embeddedagent/pom.xml
+++ b/modules/enterprise/server/embeddedagent/pom.xml
@@ -54,6 +54,61 @@
</plugin>
<plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>rename-native-libs-and-reconfigure</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <echo>Must move native libraries so JBoss Modules can find them</echo>
+ <property name="agent.lib" location="${project.build.directory}/rhq-agent/lib"/>
+ <property name="module.lib" location="${project.build.directory}/module-lib"/>
+ <!-- Notice that the agent's "augeas" native libs are not copied.
+ I think its only used for some plugins we won't be using in embedded mode anyway. -->
+ <!-- TODO these should probably be "move", I don't think we need dup copies in agent lib anymore -->
+ <copy tofile="${module.lib}/linux-i686/libsigar.so" file="${agent.lib}/libsigar-x86-linux.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/linux-x86_64/libsigar.so" file="${agent.lib}/libsigar-amd64-linux.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/linux-ia64/libsigar.so" file="${agent.lib}/libsigar-ia64-linux.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/linux-ppc64/libsigar.so" file="${agent.lib}/libsigar-ppc64-linux.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/linux-ppc/libsigar.so" file="${agent.lib}/libsigar-ppc-linux.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/linux-s390x/libsigar.so" file="${agent.lib}/libsigar-s390x-linux.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/win-i686/sigar.dll" file="${agent.lib}/sigar-x86-winnt.dll" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/win-x86_64/sigar.dll" file="${agent.lib}/sigar-amd64-winnt.dll" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/hpux-ia64w/libsigar.sl" file="${agent.lib}/libsigar-ia64-hpux-11.sl" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/hpux-parisc/libsigar.sl" file="${agent.lib}/libsigar-pa-hpux-11.sl" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/aix-ppc/libsigar.so" file="${agent.lib}/libsigar-ppc-aix-5.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/aix-ppc64/libsigar.so" file="${agent.lib}/libsigar-ppc64-aix-5.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/solaris-i686/libsigar.so" file="${agent.lib}/libsigar-x86-solaris.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/solaris-x86_64/libsigar.so" file="${agent.lib}/libsigar-amd64-solaris.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/solaris-sparc/libsigar.so" file="${agent.lib}/libsigar-sparc-solaris.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/solaris-sparcv9/libsigar.so" file="${agent.lib}/libsigar-sparc64-solaris.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/freebsd-i686/libsigar.so" file="${agent.lib}/libsigar-x86-freebsd-6.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/freebsd-x86_64/libsigar.so" file="${agent.lib}/libsigar-amd64-freebsd-6.so" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/macosx-i686/libsigar.dylib" file="${agent.lib}/libsigar-universal-macosx.dylib" preservelastmodified="true"/>
+ <copy tofile="${module.lib}/macosx-x86_64/libsigar.dylib" file="${agent.lib}/libsigar-universal64-macosx.dylib" preservelastmodified="true"/>
+
+ <echo>Adjust default configuration</echo>
+ <property name="config.xml" location="${project.build.directory}/rhq-agent/conf/agent-configuration.xml"/>
+ <!-- because we are embedded, as can't have a prompt and ask user, so we will ensure the agent is always fully setup -->
+ <replaceregexp file="${config.xml}" flags="s"
+ match='<!--(\s*)<entry key="rhq.agent.configuration-setup-flag" value="false" />(\s*)-->'
+ replace='<entry key="rhq.agent.configuration-setup-flag" value="true" /> BOOO' />
+ <!-- we don't support agent auto-update while the agent is embedded -->
+ <replaceregexp file="${config.xml}"
+ match='<entry key="rhq.agent.agent-update.enabled" value="true" />'
+ replace='<entry key="rhq.agent.agent-update.enabled" value="false" /> BOOO' />
+
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
diff --git a/modules/enterprise/server/embeddedagent/src/main/scripts/module-assembly.xml b/modules/enterprise/server/embeddedagent/src/main/scripts/module-assembly.xml
index c526e5c..b9310c4 100644
--- a/modules/enterprise/server/embeddedagent/src/main/scripts/module-assembly.xml
+++ b/modules/enterprise/server/embeddedagent/src/main/scripts/module-assembly.xml
@@ -35,6 +35,12 @@
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
+ <fileSet>
+ <directory>${project.build.directory}/module-lib</directory>
+ <outputDirectory>/org/rhq/${artifactId}/main/lib</outputDirectory>
+ <fileMode>0755</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
</fileSets>
</assembly>
10 years, 3 months
[rhq] modules/enterprise
by Jiri Kremser
modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_cs.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_de.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ja.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ko.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_pt.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ru.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_zh.properties | 2 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java | 7 ++++---
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerLocal.java | 7 +++++++
10 files changed, 19 insertions(+), 11 deletions(-)
New commits:
commit d2aac70ae17ea051080a16a92a1ac666d909e520
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Tue Jan 28 16:03:50 2014 +0100
[BZ 1016833] - Alert notification sender, resource operation, relative resource type filter drop-down has not logical or usable ordering - Using the LinkedHashMap that preserves the ordering instead of java.util.HashMap. Also adding the plugin name to the drop-down list.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages.properties
index 2685411..686b9bb 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages.properties
@@ -1208,7 +1208,7 @@ view_alert_definition_notification_operation_editor_relative_ancestor_tooltip =
view_alert_definition_notification_operation_editor_relative_descendant = Then Filter By
view_alert_definition_notification_operation_editor_relative_descendant_filter_tooltip = A specific name to uniquely identify a resource when more than one resource of the selected type might exist. This is optional if there will only ever be one resource of the resource type in the selected type hierarchy.
view_alert_definition_notification_operation_editor_relative_descendant_loadFailed = Cannot get type descendants
-view_alert_definition_notification_operation_editor_relative_descendant_tooltip = The resource type to search for under the root type defined in the Start Search From selection.
+view_alert_definition_notification_operation_editor_relative_descendant_tooltip = The resource type to search for under the root type defined in the Start Search From selection. Members of this combobox are in form _plugin_ -> _type_.
view_alert_definition_notification_operation_editor_specific_pick_button = Pick
view_alert_definition_notification_operation_editor_specific_pick_error_invalid = Please pick a resource
view_alert_definition_notification_operation_editor_specific_pick_error_no_operation = Please pick a resource that has one or more operations
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_cs.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_cs.properties
index 1dd46b1..58da08b 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_cs.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_cs.properties
@@ -1226,7 +1226,7 @@ view_alert_definition_notification_operation_editor_relative_ancestor_tooltip =
view_alert_definition_notification_operation_editor_relative_descendant = Filtrovat čím
##view_alert_definition_notification_operation_editor_relative_descendant_filter_tooltip = A specific name to uniquely identify a resource when more than one resource of the selected type might exist. This is optional if there will only ever be one resource of the resource type in the selected type hierarchy.
view_alert_definition_notification_operation_editor_relative_descendant_loadFailed = Nelze získat typ potomků
-view_alert_definition_notification_operation_editor_relative_descendant_tooltip = Typ zdroje v němž hledat pomocí vyhledávacího formuláře
+view_alert_definition_notification_operation_editor_relative_descendant_tooltip = Typ zdroje v němž hledat pomocí vyhledávacího formuláře. Prvky tohoto comboboxu jsou ve tvaru _plugin_ -> _type_.
view_alert_definition_notification_operation_editor_specific_pick_button = Vybrat
view_alert_definition_notification_operation_editor_specific_pick_error_invalid = Prosím vyberte zdroj
view_alert_definition_notification_operation_editor_specific_pick_error_no_operation = Prosím vyberte zdroj, který má jednu nebo více operací
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_de.properties
index 36fcdcc..ea3bb5c 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_de.properties
@@ -1334,7 +1334,7 @@ view_alert_definition_notification_operation_editor_relative_ancestor_tooltip=W
view_alert_definition_notification_operation_editor_relative_descendant=dann filtern nach
view_alert_definition_notification_operation_editor_relative_descendant_filter_tooltip=Ein spezifischer Name zur eindeutigen Identifizierung einer Ressource, wenn mehr als eine Ressource des gewählten Typs vorhanden sein kann. Dies ist optional wenn stets nur eine Ressource des Ressourcentyps in der gewählten Typhierarchie existiert.
view_alert_definition_notification_operation_editor_relative_descendant_loadFailed=Erhalt von Typ Abkömmlingen nicht möglich
-view_alert_definition_notification_operation_editor_relative_descendant_tooltip=Der Ressourcentyp, nach dem unter dem in der Start Search From Auswahl (Suche starten von) definierten Root Typ gesucht werden soll.
+view_alert_definition_notification_operation_editor_relative_descendant_tooltip=Der Ressourcentyp, nach dem unter dem in der Start Search From Auswahl (Suche starten von) definierten Root Typ gesucht werden soll. Members of this combobox are in form _plugin_ -> _type_.
# #view_alert_definition_notification_operation_editor_relative_descendant_filter_tooltip = A specific name to uniquely identify a resource when more than one resource of the selected type might exist. This is optional if there will only ever be one resource of the resource type in the selected type hierarchy.
# #view_alert_definition_notification_operation_editor_relative_descendant_loadFailed = Cannot get type descendants
# #view_alert_definition_notification_operation_editor_relative_descendant_tooltip = The resource type to search for under the root type defined in the Start Search From selection.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ja.properties
index 4421ea7..646e4e9 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ja.properties
@@ -1349,7 +1349,7 @@ view_alert_definition_notification_operation_editor_relative_ancestor_tooltip=
view_alert_definition_notification_operation_editor_relative_descendant=次によるフィルター\:
view_alert_definition_notification_operation_editor_relative_descendant_filter_tooltip=選択したタイプのリソースが複数存在するときに、リソースを一意に識別する名前。選択したタイプ階層に、選択したタイプのリソースが 1 つのみ存在する場合は任意の設定です。
view_alert_definition_notification_operation_editor_relative_descendant_loadFailed=タイプの子孫を取得できません
-view_alert_definition_notification_operation_editor_relative_descendant_tooltip=「検索を開始」で定義される、ルートタイプの下で検索されるリソースタイプ。
+view_alert_definition_notification_operation_editor_relative_descendant_tooltip=「検索を開始」で定義される、ルートタイプの下で検索されるリソースタイプ。Members of this combobox are in form _plugin_ -> _type_.
view_alert_definition_notification_operation_editor_specific_pick_button=選択
view_alert_definition_notification_operation_editor_specific_pick_error_invalid=リソースを選択してください
view_alert_definition_notification_operation_editor_specific_pick_error_no_operation=1 つ以上の操作を持つリソースを選択してください
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ko.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ko.properties
index 1405896..ea2dbe1 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ko.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ko.properties
@@ -1092,7 +1092,7 @@ view_alert_definition_notification_operation_editor_mode_title = 리소스 선
view_alert_definition_notification_operation_editor_relative_ancestor = 검색 시작
view_alert_definition_notification_operation_editor_relative_descendant = 다음의 필터
view_alert_definition_notification_operation_editor_relative_descendant_loadFailed = 유형의 자손을 얻을 수 없습니다
-view_alert_definition_notification_operation_editor_relative_descendant_tooltip = 검색시작 유형에 정의된 경로 유형에서 찾기 리소스 유형
+view_alert_definition_notification_operation_editor_relative_descendant_tooltip = 검색시작 유형에 정의된 경로 유형에서 찾기 리소스 유형 Members of this combobox are in form _plugin_ -> _type_.
view_alert_definition_notification_operation_editor_specific_pick_button = 선택
view_alert_definition_notification_operation_editor_specific_pick_error_invalid = 리소스를 선택하십시오
view_alert_definition_notification_operation_editor_specific_pick_text = 리소스를 선택...
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_pt.properties
index 3fad466..d710475 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_pt.properties
@@ -1210,7 +1210,7 @@ view_alert_definition_notification_operation_editor_relative_ancestor_tooltip =
view_alert_definition_notification_operation_editor_relative_descendant = Ent\u00E3o procure por
view_alert_definition_notification_operation_editor_relative_descendant_filter_tooltip = Um nome especifico para identificar unicamente um recurso quando existir mais de um do mesmo tipo. Isso \u00E9 opcional, se definido, sempre ser\u00E1 um recurso do tipo slecionda na hierarquia.
view_alert_definition_notification_operation_editor_relative_descendant_loadFailed = N\u00E3o \u00E9 poss\u00EDvel obter os tipos de descendentes
-view_alert_definition_notification_operation_editor_relative_descendant_tooltip = Tipo do recurso a ser procurado a baixo do tipo raiz definido na sele\u00E7\u00E3o 'Inicia a Pesquesa a partir de'.
+view_alert_definition_notification_operation_editor_relative_descendant_tooltip = Tipo do recurso a ser procurado a baixo do tipo raiz definido na sele\u00E7\u00E3o 'Inicia a Pesquesa a partir de'. Members of this combobox are in form _plugin_ -> _type_.
view_alert_definition_notification_operation_editor_specific_pick_button = Selecionar
view_alert_definition_notification_operation_editor_specific_pick_error_invalid = Favor selecionar um recurso
view_alert_definition_notification_operation_editor_specific_pick_error_no_operation = Selecione um recurso que possua um ou mais opera\u00E7\u00F5es
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ru.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ru.properties
index f8a3a3b..97814e5 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ru.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_ru.properties
@@ -1126,7 +1126,7 @@
#view_alert_definition_notification_operation_editor_relative_descendant = Then Filter By
#view_alert_definition_notification_operation_editor_relative_descendant_filter_tooltip = A specific name to uniquely identify a resource when more than one resource of the selected type might exist. This is optional if there will only ever be one resource of the resource type in the selected type hierarchy.
#view_alert_definition_notification_operation_editor_relative_descendant_loadFailed = Cannot get type descendants
-#view_alert_definition_notification_operation_editor_relative_descendant_tooltip = The resource type to search for under the root type defined in the Start Search From selection.
+#view_alert_definition_notification_operation_editor_relative_descendant_tooltip = The resource type to search for under the root type defined in the Start Search From selection. Members of this combobox are in form _plugin_ -> _type_.
#view_alert_definition_notification_operation_editor_specific_pick_button = Pick
#view_alert_definition_notification_operation_editor_specific_pick_error_invalid = Please pick a resource
#view_alert_definition_notification_operation_editor_specific_pick_error_no_operation = Please pick a resource that has one or more operations
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_zh.properties
index 0b766eb..27ef9b7 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/coregui/client/Messages_zh.properties
@@ -1199,7 +1199,7 @@ view_alert_definition_notification_operation_editor_relative_ancestor_tooltip =
view_alert_definition_notification_operation_editor_relative_descendant = Then Filter By
view_alert_definition_notification_operation_editor_relative_descendant_filter_tooltip = A specific name to uniquely identify a resource when more than one resource of the selected type might exist. This is optional if there will only ever be one resource of the resource type in the selected type hierarchy.
view_alert_definition_notification_operation_editor_relative_descendant_loadFailed = Cannot get type descendants
-view_alert_definition_notification_operation_editor_relative_descendant_tooltip = The resource type to search for under the root type defined in the Start Search From selection.
+view_alert_definition_notification_operation_editor_relative_descendant_tooltip = The resource type to search for under the root type defined in the Start Search From selection. Members of this combobox are in form _plugin_ -> _type_.
view_alert_definition_notification_operation_editor_specific_pick_button = Pick
view_alert_definition_notification_operation_editor_specific_pick_error_invalid = \u9009\u62e9\u4e00\u4e2a\u8d44\u6e90
view_alert_definition_notification_operation_editor_specific_pick_error_no_operation = Please pick a resource that has one or more operations
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
index e9d686a..669790e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerBean.java
@@ -24,6 +24,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -516,12 +517,12 @@ public class ResourceTypeManagerBean implements ResourceTypeManagerLocal, Resour
return results;
}
- public HashMap<Integer, String> getResourceTypeDescendantsWithOperations(Subject subject, int resourceTypeId) {
+ public LinkedHashMap<Integer, String> getResourceTypeDescendantsWithOperations(Subject subject, int resourceTypeId) {
List<ResourceType> types = getAllResourceTypeDescendants(subject, resourceTypeId);
excludeThoseWithoutOperations(types);
- HashMap<Integer, String> results = new HashMap<Integer, String>(types.size());
+ LinkedHashMap<Integer, String> results = new LinkedHashMap<Integer, String>(types.size());
for (ResourceType type : types) {
- results.put(type.getId(), type.getName());
+ results.put(type.getId(), type.getPlugin() + " -> " + type.getName());
}
return results;
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerLocal.java
index f86e6d4..a732171 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerLocal.java
@@ -168,5 +168,12 @@ public interface ResourceTypeManagerLocal {
List<ResourceType> getAllResourceTypeAncestors(Subject subject, int resourceTypeId);
+ /**
+ *
+ * @param subject subject of the caller
+ * @param resourceTypeId resource type to begin with
+ * @return list of all {@link org.rhq.core.domain.resource.ResourceType}s of all descendants
+ * @deprecated This method is not currently being used at all
+ */
List<ResourceType> getAllResourceTypeDescendants(Subject subject, int resourceTypeId);
}
\ No newline at end of file
10 years, 3 months