[rhq] 3 commits - modules/core
by mazz
modules/core/arquillian-integration/archive/pom.xml | 6
modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginArchiveImpl.java | 28 ++
modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginDescriptorContainer.java | 16 +
modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/LateMeasurementRescheduleTest.java | 105 ++++++++++
modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/ReadOnlyScheduleSetTest.java | 6
modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/SingleResourceDiscoveryComponent.java | 30 ++
modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/measurement/BZ821058DiscoveryComponent.java | 51 ----
modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/measurement/BZ834019ResourceComponent.java | 38 +++
modules/core/plugin-container-itest/src/test/resources/arquillian.xml | 1
modules/core/plugin-container-itest/src/test/resources/bz821058-rhq-plugin.xml | 5
modules/core/plugin-container-itest/src/test/resources/single-metric-rhq-plugin.xml | 21 ++
modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementCollectorRunner.java | 2
modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java | 24 ++
13 files changed, 273 insertions(+), 60 deletions(-)
New commits:
commit b48676a8552e723f2fce366b00d438dbf2484693
Merge: 5e823b9 00c0ee0
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jun 29 17:48:02 2012 -0400
Merge branch 'master' of ssh://git.fedorahosted.org/git/rhq/rhq.git
commit 5e823b969b8cc830432cfc2e055ed3292464c4d8
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jun 29 17:47:26 2012 -0400
[BZ 834019] enhancement to the arquillian stuff so we can have code that can templatize reusable plugin descriptors. this also has a reusable discovery component. This includes LateMeasurementRescheduleTest that will hopefully, eventually test this BZ but the actual test method is essentially a stub right now
diff --git a/modules/core/arquillian-integration/archive/pom.xml b/modules/core/arquillian-integration/archive/pom.xml
index f92cc5e..edf6add 100644
--- a/modules/core/arquillian-integration/archive/pom.xml
+++ b/modules/core/arquillian-integration/archive/pom.xml
@@ -25,6 +25,12 @@
<dependency>
<groupId>org.rhq</groupId>
+ <artifactId>rhq-core-util</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
<artifactId>rhq-core-client-api</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginArchiveImpl.java b/modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginArchiveImpl.java
index ed19397..3d31785 100644
--- a/modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginArchiveImpl.java
+++ b/modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginArchiveImpl.java
@@ -3,7 +3,9 @@
*/
package org.rhq.test.shrinkwrap;
+import java.io.ByteArrayInputStream;
import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -41,6 +43,7 @@ import org.jboss.shrinkwrap.impl.base.container.ContainerBase;
import org.jboss.shrinkwrap.impl.base.path.BasicPath;
import org.rhq.core.clientapi.agent.metadata.PluginDependencyGraph;
+import org.rhq.core.util.stream.StreamUtil;
/**
* @author Lukas Krejci
@@ -122,6 +125,31 @@ public class RhqAgentPluginArchiveImpl extends ContainerBase<RhqAgentPluginArchi
}
@Override
+ public RhqAgentPluginArchive setPluginDescriptorFromTemplate(String resourceName,
+ Map<String, String> replacementValues) throws IllegalArgumentException {
+
+ Validate.notNull(resourceName, "resourceName should be specified");
+ Validate.notNull(replacementValues, "replacementValues should be specified");
+
+ // get the template text and replace all tokens with their replacement values
+ String templateXml = new String(StreamUtil.slurp(new ClassLoaderAsset(resourceName).openStream()));
+ for (Map.Entry<String, String> entry : replacementValues.entrySet()) {
+ templateXml = templateXml.replace(entry.getKey(), entry.getValue());
+ }
+
+ // Make a new descriptor file with the new template content (with variables replaced) in a tmp directory.
+ File newDescriptorFile;
+ try {
+ newDescriptorFile = File.createTempFile(resourceName.replace(".xml", ""), ".xml");
+ StreamUtil.copy(new ByteArrayInputStream(templateXml.getBytes()), new FileOutputStream(newDescriptorFile));
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+
+ return setPluginDescriptor(newDescriptorFile);
+ }
+
+ @Override
public RhqAgentPluginArchive setPluginDescriptor(String resourceName) throws IllegalArgumentException {
Validate.notNull(resourceName, "ResourceName should be specified");
return setPluginDescriptor(new ClassLoaderAsset(resourceName));
diff --git a/modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginDescriptorContainer.java b/modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginDescriptorContainer.java
index 309b341..ff5bdf1 100644
--- a/modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginDescriptorContainer.java
+++ b/modules/core/arquillian-integration/archive/src/main/java/org/rhq/test/shrinkwrap/RhqAgentPluginDescriptorContainer.java
@@ -7,6 +7,7 @@ import java.io.File;
import java.net.URL;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ArchivePath;
@@ -36,6 +37,21 @@ public interface RhqAgentPluginDescriptorContainer<T extends Archive<T>> {
ArchivePath getRequiredPluginsPath();
/**
+ * Sets the plugin descriptor using the plugin descriptor template resource, making
+ * a copy of that resource and replacing templatized variables in that file with
+ * replacement values that are passed into this method.
+ * The {@link ClassLoader} is used to obtain the plugin descriptor template resource, but
+ * it is assumed to be a file on the file system.
+ *
+ * @param resourceName the name of the plugin descriptor template resource as accessible by the class loader
+ * @param replacementValues map with keys of template replacement variable names with their replacement values
+ * @return the archive itself
+ * @throws IllegalArgumentException if resourceName or replacementValues is null
+ */
+ T setPluginDescriptorFromTemplate(String resourceName, Map<String, String> replacementValues)
+ throws IllegalArgumentException;
+
+ /**
* Sets the plugin descriptor using the resource name. The {@link ClassLoader} is
* used to obtain the resource.
*
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/LateMeasurementRescheduleTest.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/LateMeasurementRescheduleTest.java
new file mode 100644
index 0000000..518d5da
--- /dev/null
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/LateMeasurementRescheduleTest.java
@@ -0,0 +1,105 @@
+package org.rhq.core.pc.measurement;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+
+import java.util.HashMap;
+import java.util.Set;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.TargetsContainer;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.arquillian.testng.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+
+import org.rhq.core.clientapi.server.discovery.InventoryReport;
+import org.rhq.core.domain.resource.InventoryStatus;
+import org.rhq.core.pc.PluginContainer;
+import org.rhq.core.pc.inventory.ResourceContainer;
+import org.rhq.plugins.test.SingleResourceDiscoveryComponent;
+import org.rhq.plugins.test.measurement.BZ834019ResourceComponent;
+import org.rhq.test.arquillian.AfterDiscovery;
+import org.rhq.test.arquillian.BeforeDiscovery;
+import org.rhq.test.arquillian.FakeServerInventory;
+import org.rhq.test.arquillian.MockingServerServices;
+import org.rhq.test.arquillian.ResourceComponentInstances;
+import org.rhq.test.arquillian.ResourceContainers;
+import org.rhq.test.arquillian.RunDiscovery;
+import org.rhq.test.shrinkwrap.RhqAgentPluginArchive;
+
+/**
+ * Test for BZ 834019.
+ */
+@RunDiscovery
+public class LateMeasurementRescheduleTest extends Arquillian {
+
+ @Deployment(name = "SingleMetricPlugin")
+ @TargetsContainer("connected-pc-with-metric-collection")
+ public static RhqAgentPluginArchive getTestPlugin() {
+ RhqAgentPluginArchive pluginJar = ShrinkWrap
+ .create(RhqAgentPluginArchive.class, "single-metric-plugin-1.0.jar");
+ HashMap<String, String> replacements = new HashMap<String, String>();
+ replacements.put("@@@discovery@@@", SingleResourceDiscoveryComponent.class.getName());
+ replacements.put("@@@class@@@", BZ834019ResourceComponent.class.getName());
+ return pluginJar.setPluginDescriptorFromTemplate("single-metric-rhq-plugin.xml", replacements).addClasses(
+ SingleResourceDiscoveryComponent.class, BZ834019ResourceComponent.class);
+ }
+
+ @ArquillianResource
+ private PluginContainer pluginContainer;
+
+ @ArquillianResource
+ public MockingServerServices serverServices;
+
+ private FakeServerInventory fakeServerInventory;
+ private FakeServerInventory.CompleteDiscoveryChecker discoveryCompleteChecker;
+
+ @ResourceContainers(plugin = "SingleMetricPlugin", resourceType = "SingleMetricServer")
+ private Set<ResourceContainer> containers;
+
+ @ResourceComponentInstances(plugin = "SingleMetricPlugin", resourceType = "SingleMetricServer")
+ private Set<BZ834019ResourceComponent> components;
+
+ @BeforeDiscovery(testMethods = "testBZ834019")
+ public void resetServerServices() throws Exception {
+ serverServices.resetMocks();
+ fakeServerInventory = new FakeServerInventory();
+ discoveryCompleteChecker = fakeServerInventory.createAsyncDiscoveryCompletionChecker(1);
+
+ // autoimport everything
+ when(serverServices.getDiscoveryServerService().mergeInventoryReport(any(InventoryReport.class))).then(
+ fakeServerInventory.mergeInventoryReport(InventoryStatus.COMMITTED));
+
+ // set up the metric schedules using the metric metadata to determine default intervals and enablement
+ when(serverServices.getDiscoveryServerService().postProcessNewlyCommittedResources(any(Set.class))).then(
+ fakeServerInventory.postProcessNewlyCommittedResources());
+ }
+
+ @AfterDiscovery
+ public void waitForAsyncDiscoveries() throws Exception {
+ if (discoveryCompleteChecker != null) {
+ discoveryCompleteChecker.waitForDiscoveryComplete(10000);
+ }
+ }
+
+ @Test(groups = "pc.itest.bz834019", priority = 20)
+ public void testBZ834019() throws Exception {
+ Assert.assertNotNull(pluginContainer);
+ Assert.assertTrue(pluginContainer.isStarted());
+
+ // make sure we have the resource container
+ Assert.assertEquals(containers.size(), 1, "missing container");
+
+ // make sure we have the resource component
+ Assert.assertEquals(components.size(), 1, "missing component");
+
+ assert containers.iterator().next().getResource().getInventoryStatus() == InventoryStatus.COMMITTED;
+
+ BZ834019ResourceComponent server = this.components.iterator().next();
+
+ // TODO do things to test BZ 834019
+ }
+}
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/ReadOnlyScheduleSetTest.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/ReadOnlyScheduleSetTest.java
index 8435114..d94e32f 100644
--- a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/ReadOnlyScheduleSetTest.java
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/measurement/ReadOnlyScheduleSetTest.java
@@ -19,7 +19,7 @@ import org.rhq.core.clientapi.server.discovery.InventoryReport;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.pc.PluginContainer;
import org.rhq.core.pc.inventory.ResourceContainer;
-import org.rhq.plugins.test.measurement.BZ821058DiscoveryComponent;
+import org.rhq.plugins.test.SingleResourceDiscoveryComponent;
import org.rhq.plugins.test.measurement.BZ821058ResourceComponent;
import org.rhq.test.arquillian.AfterDiscovery;
import org.rhq.test.arquillian.BeforeDiscovery;
@@ -40,8 +40,8 @@ public class ReadOnlyScheduleSetTest extends Arquillian {
@TargetsContainer("connected-pc-with-metric-collection")
public static RhqAgentPluginArchive getTestPlugin() {
RhqAgentPluginArchive pluginJar = ShrinkWrap.create(RhqAgentPluginArchive.class, "bz821058-plugin-1.0.jar");
- return pluginJar.setPluginDescriptor("bz821058-rhq-plugin.xml").addClasses(BZ821058DiscoveryComponent.class,
- BZ821058ResourceComponent.class);
+ return pluginJar.setPluginDescriptor("bz821058-rhq-plugin.xml").addClasses(
+ SingleResourceDiscoveryComponent.class, BZ821058ResourceComponent.class);
}
@ArquillianResource
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/SingleResourceDiscoveryComponent.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/SingleResourceDiscoveryComponent.java
new file mode 100644
index 0000000..fde1f91
--- /dev/null
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/SingleResourceDiscoveryComponent.java
@@ -0,0 +1,30 @@
+package org.rhq.plugins.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+public class SingleResourceDiscoveryComponent implements ResourceDiscoveryComponent<ResourceComponent<?>> {
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<ResourceComponent<?>> context)
+ throws InvalidPluginConfigurationException, Exception {
+
+ HashSet<DiscoveredResourceDetails> details = new HashSet<DiscoveredResourceDetails>(1);
+ ResourceType rt = context.getResourceType();
+ String key = "SingleResourceKey";
+ String name = "SingleResourceName";
+ String version = "1";
+ Configuration pc = context.getDefaultPluginConfiguration();
+ DiscoveredResourceDetails resource = new DiscoveredResourceDetails(rt, key, name, version, null, pc, null);
+ details.add(resource);
+
+ return details;
+ }
+}
\ No newline at end of file
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/measurement/BZ821058DiscoveryComponent.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/measurement/BZ821058DiscoveryComponent.java
deleted file mode 100644
index b9f49a4..0000000
--- a/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/measurement/BZ821058DiscoveryComponent.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2012 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-package org.rhq.plugins.test.measurement;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-
-public class BZ821058DiscoveryComponent implements ResourceDiscoveryComponent<ResourceComponent<?>> {
-
- @Override
- public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<ResourceComponent<?>> context)
- throws InvalidPluginConfigurationException, Exception {
-
- HashSet<DiscoveredResourceDetails> details = new HashSet<DiscoveredResourceDetails>(1);
- ResourceType rt = context.getResourceType();
- String key = "bz821058";
- String name = "bz821058";
- String version = "1";
- Configuration pc = context.getDefaultPluginConfiguration();
- DiscoveredResourceDetails resource = new DiscoveredResourceDetails(rt, key, name, version, null, pc, null);
- details.add(resource);
-
- return details;
- }
-
-}
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/measurement/BZ834019ResourceComponent.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/measurement/BZ834019ResourceComponent.java
new file mode 100644
index 0000000..6a3a93d
--- /dev/null
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/plugins/test/measurement/BZ834019ResourceComponent.java
@@ -0,0 +1,38 @@
+package org.rhq.plugins.test.measurement;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+
+public class BZ834019ResourceComponent implements ResourceComponent<ResourceComponent<?>>, MeasurementFacet {
+
+ @Override
+ public AvailabilityType getAvailability() {
+ return AvailabilityType.UP;
+ }
+
+ @Override
+ public void start(ResourceContext<ResourceComponent<?>> context) throws Exception {
+ }
+
+ @Override
+ public void stop() {
+ }
+
+ @Override
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
+ // TODO: do things to test BZ 834019
+ for (Iterator<MeasurementScheduleRequest> i = metrics.iterator(); i.hasNext();) {
+ MeasurementScheduleRequest metric = i.next();
+ report.addData(new MeasurementDataNumeric(metric, new Double(1.0)));
+ }
+ return;
+ }
+}
\ No newline at end of file
diff --git a/modules/core/plugin-container-itest/src/test/resources/arquillian.xml b/modules/core/plugin-container-itest/src/test/resources/arquillian.xml
index 92968b2..964e07e 100644
--- a/modules/core/plugin-container-itest/src/test/resources/arquillian.xml
+++ b/modules/core/plugin-container-itest/src/test/resources/arquillian.xml
@@ -10,6 +10,7 @@
<property name="insideAgent">true</property>
<property name="startManagementBean">false</property>
<property name="measurementCollectionInitialDelay">10</property> <!-- start collecting metrics after 10s -->
+ <property name="measurementCollectionThreadPoolSize">1</property> <!-- make testing easier by only having one thread collect -->
</configuration>
</container>
diff --git a/modules/core/plugin-container-itest/src/test/resources/bz821058-rhq-plugin.xml b/modules/core/plugin-container-itest/src/test/resources/bz821058-rhq-plugin.xml
index 730a656..c6adda6 100644
--- a/modules/core/plugin-container-itest/src/test/resources/bz821058-rhq-plugin.xml
+++ b/modules/core/plugin-container-itest/src/test/resources/bz821058-rhq-plugin.xml
@@ -3,15 +3,14 @@
<plugin name="bz821058Plugin"
displayName="Plugin to test BZ 821058"
description="This will help test that measurement facet is given a read-only schedule set."
- package="org.rhq.plugins.test.measurement"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin"
xmlns:c="urn:xmlns:rhq-configuration">
<server name="BZ821058Server"
- discovery="BZ821058DiscoveryComponent"
- class="BZ821058ResourceComponent">
+ discovery="org.rhq.plugins.test.SingleResourceDiscoveryComponent"
+ class="org.rhq.plugins.test.measurement.BZ821058ResourceComponent">
<metric property="metric1"
dataType="measurement"
diff --git a/modules/core/plugin-container-itest/src/test/resources/single-metric-rhq-plugin.xml b/modules/core/plugin-container-itest/src/test/resources/single-metric-rhq-plugin.xml
new file mode 100644
index 0000000..d67fafd
--- /dev/null
+++ b/modules/core/plugin-container-itest/src/test/resources/single-metric-rhq-plugin.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin name="SingleMetricPlugin"
+ displayName="Plugin that has a single server with a single enabled metric."
+ description="This will help test measurement collections by providing a server with an enabled metric."
+ version="1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <server name="SingleMetricServer"
+ discovery="@@@discovery@@@"
+ class="@@@class@@@">
+ <metric property="metric1"
+ dataType="measurement"
+ defaultOn="true"
+ displayType="summary"
+ defaultInterval="30000" />
+ </server>
+</plugin>
+
commit cd6c2fa4ce4f128f80145438499dbfc1223fac42
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jun 29 17:45:46 2012 -0400
[BZ 834019] the actual code fix to push out the new rescheduled metric - will later be checking in test code to help test this
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementCollectorRunner.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementCollectorRunner.java
index ac13b06..e9303b4 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementCollectorRunner.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementCollectorRunner.java
@@ -88,7 +88,7 @@ public class MeasurementCollectorRunner implements Callable<MeasurementReport>,
}
}
- this.measurementManager.reschedule(requests);
+ this.measurementManager.reschedule(requests, 31000L); // BZ 834019 - go to the next collection interval plus 31s to skew it
return report;
}
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java
index dc7d0ca..33895aa 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java
@@ -526,11 +526,31 @@ public class MeasurementManager extends AgentService implements MeasurementAgent
return nextScheduledSet;
}
+ /**
+ * Reschedules the given measurement schedules so the next collection occurs in the future.
+ * The next collection will be pushed out by the number of seconds of the schedule's collection
+ * interval.
+ *
+ * @param scheduledMeasurementInfos the schedules to reschedule
+ */
public synchronized void reschedule(Set<ScheduledMeasurementInfo> scheduledMeasurementInfos) {
+ reschedule(scheduledMeasurementInfos, 0);
+ }
+
+ /**
+ * Reschedules the given measurement schedules so the next collection occurs in the future.
+ * The next collection will be pushed out by the number of seconds of the schedule's collection
+ * interval plus (or minus) the given adjustment (which is provided in milliseconds).
+ *
+ * @param scheduledMeasurementInfos the schedules to reschedule
+ * @param adjustment the number of milliseconds to adjust the next collection time. If 0, the
+ * next collection time will be the number of seconds in the future as indicated
+ * by the schedule's interval.
+ */
+ public synchronized void reschedule(Set<ScheduledMeasurementInfo> scheduledMeasurementInfos, long adjustment) {
for (ScheduledMeasurementInfo scheduledMeasurement : scheduledMeasurementInfos) {
- // Iterate to next collection time
scheduledMeasurement.setNextCollection(scheduledMeasurement.getNextCollection()
- + scheduledMeasurement.getInterval());
+ + scheduledMeasurement.getInterval() + adjustment);
this.scheduledRequests.offer(scheduledMeasurement);
}
}
11 years, 5 months
[rhq] modules/plugins
by Simeon Pinder
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java | 2 +-
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 00c0ee04c4f78b893cbd2b727c587ae76d1cc2f0
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Jun 29 17:35:18 2012 -0400
i)fix problem in resource key ii)up the discovery lag for loadUpdateTemplatedResourceConfiguration to try to fix invalid resource ids
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
index 05ca0eb..7be0689 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
@@ -491,7 +491,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
ResourceType hostControllerType = new ResourceType("JBossAS7 Host Controller", PLUGIN_NAME,
ResourceCategory.SERVER, null);
Resource hostController = getResourceByTypeAndKey(platform, hostControllerType,
- "/tmp/jboss-as-6.0.0.GA/domain");
+ "/tmp/jboss-as-6.0.0/domain");
//profile=full-ha
ResourceType profileType = new ResourceType("Profile", PLUGIN_NAME, ResourceCategory.SERVICE, null);
String key = PROFILE;
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
index fe05def..908faff 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
@@ -58,7 +58,7 @@ public class TemplatedResourcesTest extends AbstractJBossAS7PluginTest {
assertNotNull(platform);
assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
- Thread.sleep(20 * 1000L);
+ Thread.sleep(40 * 1000L);
}
@Test(priority = 11)
11 years, 5 months
[rhq] 2 commits - modules/plugins
by Simeon Pinder
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java | 675 ++++++++
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java | 802 ----------
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java | 3
3 files changed, 677 insertions(+), 803 deletions(-)
New commits:
commit 7281ff782f83461ae81560adf82b83d3e08bf1db
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Jun 29 11:14:18 2012 -0400
-moved domain test into domain group and package
-added longer sleep to TemplatedResource test to attempt to fix test run failures.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
new file mode 100644
index 0000000..05ca0eb
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/domain/SecurityModuleOptionsTest.java
@@ -0,0 +1,675 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.rhq.modules.plugins.jbossas7.itest.domain;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Set;
+
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.testng.annotations.Test;
+
+import org.rhq.core.clientapi.agent.inventory.CreateResourceRequest;
+import org.rhq.core.clientapi.agent.inventory.CreateResourceResponse;
+import org.rhq.core.clientapi.agent.inventory.DeleteResourceRequest;
+import org.rhq.core.clientapi.agent.inventory.DeleteResourceResponse;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.domain.resource.DeleteResourceStatus;
+import org.rhq.core.domain.resource.InventoryStatus;
+import org.rhq.core.domain.resource.Resource;
+import org.rhq.core.domain.resource.ResourceCategory;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pc.configuration.ConfigurationManager;
+import org.rhq.core.pc.inventory.InventoryManager;
+import org.rhq.modules.plugins.jbossas7.ASConnection;
+import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent;
+import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent.Value;
+import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
+import org.rhq.modules.plugins.jbossas7.itest.standalone.StandaloneServerComponentTest;
+import org.rhq.modules.plugins.jbossas7.json.Address;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.Result;
+import org.rhq.test.arquillian.RunDiscovery;
+
+/**
+ * Test exercising the subsystem=security/SecurityDomain/[Authentication(Classic|Jaspi),
+ * Authorization, Mapping, Audit, Acl,
+ * Identity-Trust]
+ * @author Simeon Pinder
+ */
+@Test(groups = { "integration", "pc", "domain" }, singleThreaded = true)
+public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+
+ private static ASConnection con = null;
+ private static ObjectMapper mapper = null;
+
+ private static String TEST_DOMAIN = "testDomain";
+ private static String SECURITY_RESOURCE_TYPE = "Security";
+ private static String SECURITY_RESOURCE_KEY = "subsystem=security";
+ private static String SECURITY_DOMAIN_RESOURCE_KEY = "security-domain";
+ private static String PROFILE = "profile=full-ha";
+ private static String SECURITY_DOMAIN_RESOURCE_TYPE = "Security Domain";
+ private static String AUTH_CLASSIC_RESOURCE_TYPE = "Authentication (Classic)";
+ private static String AUTH_CLASSIC_RESOURCE_KEY = "authentication=classic";
+
+ private static Resource securityResource = null;
+
+ protected static String DC_HOST = System.getProperty("jboss.domain.bindAddress");
+ protected static int DC_HTTP_PORT = Integer.valueOf(System.getProperty("jboss.domain.httpManagementPort"));
+ protected static String DC_USER = AbstractJBossAS7PluginTest.MANAGEMENT_USERNAME;
+ protected static String DC_PASS = AbstractJBossAS7PluginTest.MANAGEMENT_PASSWORD;
+
+ ASConnection getASConnection() {
+ ASConnection connection = new ASConnection(DC_HOST, DC_HTTP_PORT, DC_USER, DC_PASS);
+ return connection;
+ }
+
+ public static final ResourceType RESOURCE_TYPE = new ResourceType(SECURITY_RESOURCE_TYPE, PLUGIN_NAME,
+ ResourceCategory.SERVICE, null);
+ private static final String RESOURCE_KEY = SECURITY_RESOURCE_KEY;
+ private static Resource testSecurityDomain = null;
+ private String testSecurityDomainKey = null;
+ private ConfigurationManager testConfigurationManager = null;
+
+ //Define some shared and reusable content
+ static HashMap<String, String> jsonMap = new HashMap<String, String>();
+ static {
+ jsonMap
+ .put(
+ "login-modules",
+ "[{\"flag\":\"required\", \"code\":\"Ldap\", \"module-options\":{\"bindDn\":\"uid=ldapSecureUser,ou=People,dc=redat,dc=com\", \"bindPw\":\"test126\", \"allowEmptyPasswords\":\"true\"}}]");
+ jsonMap
+ .put(
+ "policy-modules",
+ "[{\"flag\":\"requisite\", \"code\":\"LdapExtended\", \"module-options\":{\"policy\":\"module\", \"policy1\":\"module1\"}}]");
+ jsonMap
+ .put("mapping-modules",
+ "[{\"code\":\"Test\", \"type\":\"attribute\", \"module-options\":{\"mapping\":\"module\", \"mapping1\":\"module1\"}}]");
+ jsonMap.put("provider-modules",
+ "[{\"code\":\"Providers\", \"module-options\":{\"provider\":\"module\", \"provider1\":\"module1\"}}]");
+ jsonMap
+ .put("acl-modules",
+ "[{\"flag\":\"sufficient\", \"code\":\"ACL\", \"module-options\":{\"acl\":\"module\", \"acl1\":\"module1\"}}]");
+ jsonMap
+ .put("trust-modules",
+ "[{\"flag\":\"optional\", \"code\":\"TRUST\", \"module-options\":{\"trust\":\"module\", \"trust1\":\"module1\"}}]");
+ }
+
+ /* This first discovery is only so that we can leverage existing code to install the management user needed
+ * in next test.
+ */
+ @Test(priority = 10, groups = "discovery")
+ @RunDiscovery(discoverServices = true, discoverServers = true)
+ public void firstDiscovery() throws Exception {
+ Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
+ assertNotNull(platform);
+ assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
+
+ //now install mgmt users.
+ System.out.println("------ * Duplicating discovery for SecurityModule testing....");
+ installManagementUsers();
+ }
+
+ /** This method mass loads all the supported Module Option Types(Excluding authentication=jaspi, cannot co-exist with
+ * authentication=classic) into a single SecurityDomain. This is done as
+ * -i)creating all of the related hierarchy of types needed to exercise N Module Options Types and their associated
+ * Module Options instances would take too long to setup(N creates would signal N discovery runs before test could complete).
+ * -ii)setting the priority of this method lower than the discovery method means that we'll get all the same types in much
+ * less time.
+ *
+ * @throws Exception
+ */
+ @Test(priority = 11)
+ public void loadStandardModuleOptionTypes() throws Exception {
+ mapper = new ObjectMapper();
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+
+ //Adjust discovery depth to support deeper hierarchy depth of Module Option elements
+ setMaxDiscoveryDepthOverride(12);
+
+ //create new Security Domain
+ Address destination = new Address(PROFILE);
+ destination.addSegment(SECURITY_RESOURCE_KEY);
+ String securityDomainId = TEST_DOMAIN + "2";
+ destination.addSegment(SECURITY_DOMAIN_RESOURCE_KEY + "=" + securityDomainId);
+
+ ASConnection connection = getASConnection();
+ Result result = new Result();
+ Operation op = null;
+ //delete old one if present to setup clean slate
+ op = new Operation("remove", destination);
+ result = connection.execute(op);
+
+ //build/rebuild hierarchy
+ op = new Operation("add", destination);
+ result = connection.execute(op);
+ assert result.getOutcome().equals("success") : "Add of Security Domain has failed: "
+ + result.getFailureDescription();
+
+ //Ex. profile=standalone-ha,subsystem=security,security-domain
+ String addressPrefix = PROFILE + "," + SECURITY_RESOURCE_KEY + "," + SECURITY_DOMAIN_RESOURCE_KEY;
+
+ //loop over standard types and add base details for all of them to security domain
+ String address = "";
+ for (String attribute : jsonMap.keySet()) {
+ if (attribute.equals("policy-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",authorization=classic";
+ } else if (attribute.equals("acl-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",acl=classic";
+ } else if (attribute.equals("mapping-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",mapping=classic";
+ } else if (attribute.equals("trust-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",identity-trust=classic";
+ } else if (attribute.equals("provider-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",audit=classic";
+ } else if (attribute.equals("login-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",authentication=classic";
+ } else {
+ assert false : "An unknown attribute '" + attribute
+ + "' was found. Is there a new type to be supported?";
+ }
+ //build the operation to add the component
+ ////Load json map into ModuleOptionType
+ List<Value> moduleTypeValue = new ArrayList<Value>();
+ try {
+ // loading jsonMap contents for Ex. 'login-module'
+ JsonNode node = mapper.readTree(jsonMap.get(attribute));
+ Object obj = mapper.treeToValue(node, Object.class);
+ result.setResult(obj);
+ result.setOutcome("success");
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ //populate the Value component complete with module Options.
+ moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ op = ModuleOptionsComponent.createAddModuleOptionTypeOperation(new Address(address), attribute,
+ moduleTypeValue);
+ //submit the command
+ result = connection.execute(op);
+ }
+ }
+
+ /** Runs the second discovery run to load all the new types added.
+ *
+ * @throws Exception
+ */
+ @Test(priority = 12, groups = "discovery")
+ @RunDiscovery(discoverServices = true, discoverServers = true)
+ public void secondDiscovery() throws Exception {
+ Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
+ assertNotNull(platform);
+ assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
+
+ //Have thread sleep longer to discover deeper resource types.
+ //spinder 6/29/12: up this number if the resources are not being discovered.
+ Thread.sleep(180 * 1000L); // delay so that PC gets a chance to scan for resources
+ }
+
+ /** This test method exercises a number of things:
+ * - that the security-domain children loaded have been created successfully
+ * - that all of the supported Module Option Type children(excluding 'authentication=jaspi') have been
+ * discovered as AS7 types successfully.
+ * - that the correct child attribute was specified for each type //Ex. acl=classic -> acl-modules
+ * -
+ *
+ * @throws Exception
+ */
+ @Test(priority = 13)
+ public void testDiscoveredSecurityNodes() throws Exception {
+ //lazy-load configurationManager
+ if (testConfigurationManager == null) {
+ testConfigurationManager = this.pluginContainer.getConfigurationManager();
+ testConfigurationManager = pluginContainer.getConfigurationManager();
+ testConfigurationManager.initialize();
+ Thread.sleep(20 * 1000L);
+ }
+ //iterate through list of nodes and make sure they've all been discovered
+ ////Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,acl=classic
+ String attribute = null;
+ for (String jsonKey : jsonMap.keySet()) {
+ //Ex. policy-modules
+ attribute = jsonKey;
+ //spinder 6/26/12: Temporarily disable until figure out why NPE happens only for this type?
+ if (attribute.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
+ break;//
+ }
+ //Ex. name=acl-modules
+ //check the configuration for the Module Option Type Ex. 'Acl (Profile)' Resource. Should be able to verify components
+ Resource moduleOptionsTypeResource = getModuleOptionTypeResource(attribute);
+ //assert non-zero id returned
+ assert moduleOptionsTypeResource.getId() > 0 : "The resource was not properly initialized. Expected id >0 but got:"
+ + moduleOptionsTypeResource.getId();
+
+ //Now request the resource complete with resource config
+ Configuration loadedConfiguration = testConfigurationManager
+ .loadResourceConfiguration(moduleOptionsTypeResource.getId());
+ String code = null;
+ String type = null;
+ String flag = null;
+ //populate the associated attributes if it's supported.
+ for (String key : loadedConfiguration.getAllProperties().keySet()) {
+ Property property = loadedConfiguration.getAllProperties().get(key);
+ if (key.equals("code")) {
+ code = ((PropertySimple) property).getStringValue();
+ } else if (key.equals("flag")) {
+ flag = ((PropertySimple) property).getStringValue();
+ } else {//Ex. type.
+ type = ((PropertySimple) property).getStringValue();
+ }
+ }
+
+ //retrieve module options as well.
+ String jsonContent = jsonMap.get(attribute);
+ Result result = new Result();
+ try {
+ // loading jsonMap contents for Ex. 'login-module'
+ JsonNode node = mapper.readTree(jsonContent);
+ Object obj = mapper.treeToValue(node, Object.class);
+ result.setResult(obj);
+ result.setOutcome("success");
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ assert false;
+ } catch (IOException e) {
+ e.printStackTrace();
+ assert false;
+ }
+
+ //populate the Value component complete with module Options.
+ List<Value> moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ Value moduleOptionType = moduleTypeValue.get(0);
+ //Ex. retrieve the acl-modules component and assert values.
+ //always test 'code'
+ assert moduleOptionType.getCode().equals(code) : "Module Option 'code' value is not correct. Expected '"
+ + code + "' but was '" + moduleOptionType.getCode() + "'";
+ if (attribute.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
+ assert moduleOptionType.getType().equals(type) : "Mapping Module 'type' value is not correct. Expected '"
+ + type + "' but was '" + moduleOptionType.getType() + "'";
+ } else if (!attribute.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {//Audit has no second parameter
+ assert moduleOptionType.getFlag().equals(flag) : "Provider Module 'flag' value is not correct. Expected '"
+ + flag + "' but was '" + moduleOptionType.getFlag() + "'";
+ }
+
+ //Retrieve Module Options and test
+ //Ex. Module Options for (Acl Modules - Profile)
+ Resource moduleOptionsResource = getModuleOptionsResource(moduleOptionsTypeResource, attribute);
+ //assert non-zero id returned
+ assert moduleOptionsResource.getId() > 0 : "The resource was not properly initialized. Expected id > 0 but got:"
+ + moduleOptionsResource.getId();
+ //fetch configuration for module options
+ //Now request the resource complete with resource config
+ Configuration loadedOptionsConfiguration = testConfigurationManager
+ .loadResourceConfiguration(moduleOptionsResource.getId());
+ for (String key : loadedOptionsConfiguration.getAllProperties().keySet()) {
+ //retrieve the open map of Module Options
+ PropertyMap map = ((PropertyMap) loadedOptionsConfiguration.getAllProperties().get(key));
+ LinkedHashMap<String, Object> options = moduleOptionType.getOptions();
+ for (String optionKey : map.getMap().keySet()) {
+ PropertySimple property = (PropertySimple) map.getMap().get(optionKey);
+ //test the key
+ assert options.containsKey(optionKey) : "Unable to find expected option key '" + optionKey
+ + "'. Check hierarchy.";
+ //now the value.
+ String value = String.valueOf(options.get(optionKey));
+ assert value.equals(property.getStringValue()) : "Unable to find expected Module Option mapping. Key '"
+ + optionKey
+ + "' did not map to expected value '"
+ + value
+ + "' but was '"
+ + property.getStringValue() + "'.";
+ }
+ }
+ }
+ }
+
+ @Test(priority = 14)
+ public void testCreateSecurityDomain() throws Exception {
+ //get the root security resource
+ securityResource = getResource();
+
+ //plugin config
+ Configuration createPlugConfig = new Configuration();
+ createPlugConfig.put(new PropertySimple("path", SECURITY_DOMAIN_RESOURCE_KEY += "=" + TEST_DOMAIN));
+
+ //resource config
+ Configuration createResConfig = new Configuration();
+ createResConfig.put(new PropertySimple("name", TEST_DOMAIN));
+
+ CreateResourceRequest request = new CreateResourceRequest();
+ request.setParentResourceId(securityResource.getId());
+ request.setPluginConfiguration(createPlugConfig);
+ request.setPluginName(PLUGIN_NAME);
+ request.setResourceConfiguration(createResConfig);
+ request.setResourceName(TEST_DOMAIN);
+ request.setResourceTypeName(SECURITY_DOMAIN_RESOURCE_TYPE);
+
+ CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
+ request);
+
+ assert response.getStatus() == CreateResourceStatus.SUCCESS : "The Security Domain creation failed with an error mesasge: "
+ + response.getErrorMessage();
+ }
+
+ @Test(priority = 15)
+ public void testAuthenticationClassic() throws Exception {
+ //get the root security resource
+ securityResource = getResource();
+
+ //find TEST_DOMAIN 'security-domain'
+ Resource securityDomain = null;
+ Set<Resource> childResources = securityResource.getChildResources();
+ for (Resource r : childResources) {
+ if (r.getName().indexOf(TEST_DOMAIN) > -1) {
+ securityDomain = r;
+ }
+ }
+
+ //plugin config
+ Configuration createPlugConfig = new Configuration();
+ createPlugConfig.put(new PropertySimple("path", AUTH_CLASSIC_RESOURCE_KEY));
+
+ //resource config
+ Configuration createResConfig = new Configuration();
+ createResConfig.put(new PropertySimple("code", "Ldap"));
+ createResConfig.put(new PropertySimple("flag", "requisite"));
+
+ CreateResourceRequest request = new CreateResourceRequest();
+ request.setParentResourceId(securityDomain.getId());
+ request.setPluginConfiguration(createPlugConfig);
+ request.setPluginName(PLUGIN_NAME);
+ request.setResourceConfiguration(createResConfig);
+ request.setResourceName("Test - notUsed.");
+
+ request.setResourceTypeName(AUTH_CLASSIC_RESOURCE_TYPE);
+
+ CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
+ request);
+
+ assert response.getStatus() == CreateResourceStatus.SUCCESS : "The 'Authentication (Classic)' node creation failed with an error mesasge: "
+ + response.getErrorMessage();
+ }
+
+ @Test(priority = 16)
+ public void testDeleteSecurityDomain() throws Exception {
+ //get the root security resource
+ securityResource = getResource();
+ Resource found = null;
+ Set<Resource> childResources = securityResource.getChildResources();
+ for (Resource r : childResources) {
+ if (r.getName().indexOf(TEST_DOMAIN) > -1) {
+ found = r;
+ }
+ }
+
+ //plugin config
+ Configuration deletePlugConfig = new Configuration();
+ deletePlugConfig.put(new PropertySimple("path", SECURITY_DOMAIN_RESOURCE_KEY += "=" + TEST_DOMAIN));
+
+ //resource config
+ Configuration deleteResConfig = new Configuration();
+ deleteResConfig.put(new PropertySimple("name", TEST_DOMAIN));
+
+ DeleteResourceRequest request = new DeleteResourceRequest();
+ if (found != null) {
+ request.setResourceId(found.getId());
+ }
+ DeleteResourceResponse response = pluginContainer.getResourceFactoryManager().executeDeleteResourceImmediately(
+ request);
+
+ assert response.getStatus() == DeleteResourceStatus.SUCCESS : "The Security Domain deletion failed with an error mesasge: "
+ + response.getErrorMessage();
+ }
+
+ // public static void main(String[] args) {
+ // SecurityModuleOptionsTest setup = new SecurityModuleOptionsTest();
+ // try {
+ // setup.loadStandardModuleOptionTypes();
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // }
+ // }
+
+ private Resource getResource() {
+
+ InventoryManager im = pluginContainer.getInventoryManager();
+ Resource platform = im.getPlatform();
+ Resource server = getResourceByTypeAndKey(platform, StandaloneServerComponentTest.RESOURCE_TYPE,
+ StandaloneServerComponentTest.RESOURCE_KEY);
+ Resource bindings = getResourceByTypeAndKey(server, RESOURCE_TYPE, RESOURCE_KEY);
+ return bindings;
+ }
+
+ /** Automates hierarchy creation for Module Option type resources and their parents
+ *
+ * @param optionAttributeType
+ * @return
+ */
+ private Resource getModuleOptionTypeResource(String optionAttributeType) {
+ Resource moduleOptionResource = null;
+ String securityDomainId = SECURITY_DOMAIN_RESOURCE_KEY + "=" + TEST_DOMAIN + "2";
+ if (testSecurityDomain == null) {
+ InventoryManager im = pluginContainer.getInventoryManager();
+ Resource platform = im.getPlatform();
+ //host controller
+ ResourceType hostControllerType = new ResourceType("JBossAS7 Host Controller", PLUGIN_NAME,
+ ResourceCategory.SERVER, null);
+ Resource hostController = getResourceByTypeAndKey(platform, hostControllerType,
+ "/tmp/jboss-as-6.0.0.GA/domain");
+ //profile=full-ha
+ ResourceType profileType = new ResourceType("Profile", PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ String key = PROFILE;
+ Resource profile = getResourceByTypeAndKey(hostController, profileType, key);
+
+ //Security (Profile)
+ ResourceType securityType = new ResourceType("Security (Profile)", PLUGIN_NAME, ResourceCategory.SERVICE,
+ null);
+ key += "," + SECURITY_RESOURCE_KEY;
+ Resource security = getResourceByTypeAndKey(profile, securityType, key);
+
+ //Security Domain (Profile)
+ ResourceType domainType = new ResourceType("Security Domain (Profile)", PLUGIN_NAME,
+ ResourceCategory.SERVICE, null);
+ key += "," + securityDomainId;
+ testSecurityDomainKey = key;
+ testSecurityDomain = getResourceByTypeAndKey(security, domainType, key);
+ }
+
+ //acl=classic
+ String descriptorName = "";
+ String moduleAttribute = "";
+ //acl
+ if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Acl.getAttribute())) {
+ descriptorName = "ACL (Profile)";
+ moduleAttribute = "acl=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {
+ descriptorName = "Audit (Profile)";
+ moduleAttribute = "audit=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
+ descriptorName = "Authentication (Classic - Profile)";
+ moduleAttribute = "authentication=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authorization.getAttribute())) {
+ descriptorName = "Authorization (Profile)";
+ moduleAttribute = "authorization=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.IdentityTrust.getAttribute())) {
+ descriptorName = "Identity Trust (Profile)";
+ moduleAttribute = "identity-trust=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
+ descriptorName = "Mapping (Profile)";
+ moduleAttribute = "mapping=classic";
+ }
+ //Build the right Module Option Type. Ex. ACL (Profile), etc.
+ ResourceType moduleOptionType = new ResourceType(descriptorName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ ConfigurationDefinition cdef = new ConfigurationDefinition(descriptorName, null);
+ moduleOptionType.setResourceConfigurationDefinition(cdef);
+ //Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,identity-trust=classic
+ String moduleOptionTypeKey = testSecurityDomainKey += "," + moduleAttribute;
+
+ if (!testSecurityDomainKey.endsWith(securityDomainId)) {
+ moduleOptionTypeKey = testSecurityDomainKey.substring(0, testSecurityDomainKey.indexOf(securityDomainId)
+ + securityDomainId.length())
+ + "," + moduleAttribute;
+ }
+
+ moduleOptionResource = getResourceByTypeAndKey(testSecurityDomain, moduleOptionType, moduleOptionTypeKey);
+
+ return moduleOptionResource;
+ }
+
+ /** Automates hierarchy creation for Module Option type resources and their parents
+ *
+ * @param optionAttributeType
+ * @return
+ */
+ private Resource getModuleOptionsResource(Resource parent, String optionAttributeType) {
+ Resource moduleOptionsResource = null;
+ String descriptorName = "";
+ String moduleAttribute = "";
+ String moduleOptionsDescriptor = "";
+ if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Acl.getAttribute())) {
+ // descriptorName = "ACL Modules (Profile)";
+ descriptorName = "Acl Modules (Profile)";
+ moduleAttribute = "acl=classic";
+ moduleOptionsDescriptor = "Module Options (Acl - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {
+ descriptorName = "Provider Modules (Profile)";
+ moduleAttribute = "audit=classic";
+ moduleOptionsDescriptor = "Module Options (Provider Modules - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
+ descriptorName = "Login Modules (Classic - Profile)";
+ moduleAttribute = "authentication=classic";
+ moduleOptionsDescriptor = "Module Options (Classic - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authorization.getAttribute())) {
+ descriptorName = "Authorization Modules (Profile)";
+ moduleAttribute = "authorization=classic";
+ moduleOptionsDescriptor = "Module Options (Authorization - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.IdentityTrust.getAttribute())) {
+ descriptorName = "Identity Trust Modules (Profile)";
+ moduleAttribute = "identity-trust=classic";
+ moduleOptionsDescriptor = "Module Options (Identity Trust - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
+ descriptorName = "Mapping Modules (Profile)";
+ moduleAttribute = "mapping=classic";
+ moduleOptionsDescriptor = "Module Options (Mapping - Profile)";
+ }
+ //Build the right Module Option Type. Ex. ACL Modules (Profile), etc.
+ ResourceType modulesType = new ResourceType(descriptorName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ //Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,acl=classic,acl-modules:0
+ String sharedRoot = "profile=full-ha,subsystem=security,security-domain=testDomain2";
+ String moduleOptionTypeKey = sharedRoot += "," + moduleAttribute + ","
+ + optionAttributeType + ":0";
+ //Ex. Module Options Type children [ACL Modules (Profile),etc.]
+ Resource modulesInstance = getResourceByTypeAndKey(parent, modulesType, moduleOptionTypeKey);
+
+ //Module Options
+ ResourceType moduleOptionsType = new ResourceType(moduleOptionsDescriptor, PLUGIN_NAME,
+ ResourceCategory.SERVICE, null);
+ moduleOptionsResource = getResourceByTypeAndKey(modulesInstance, moduleOptionsType, moduleOptionTypeKey
+ + ",module-options");
+
+ return moduleOptionsResource;
+ }
+
+ private Resource getResource(Resource parentResource, String pluginDescriptorTypeName, String resourceKey) {
+ Resource resource = null;
+ if (((parentResource != null) & (pluginDescriptorTypeName != null) & (resourceKey != null))
+ & (((!pluginDescriptorTypeName.isEmpty()) & (!resourceKey.isEmpty())))) {
+ ResourceType resourceType = buildResourceType(pluginDescriptorTypeName);
+ resource = getResourceByTypeAndKey(parentResource, resourceType, resourceKey);
+ }
+ return resource;
+ }
+
+ private ResourceType buildResourceType(String pluginTypeName) {
+ ResourceType created = null;
+ if ((pluginTypeName != null) && (!pluginTypeName.isEmpty())) {
+ created = new ResourceType(pluginTypeName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ }
+ return created;
+ }
+
+ /** For each operation
+ * - will write verbose json and operation details to system.out if verboseOutput = true;
+ * - will execute the operation against running server if execute = true.
+ *
+ * @param op
+ * @param execute
+ * @param verboseOutput
+ * @return
+ */
+ public static Result exerciseOperation(Operation op, boolean execute, boolean verboseOutput) {
+ //display operation as AS7 plugin will build it
+ if (verboseOutput) {
+ System.out.println("\tOperation is:" + op);
+ }
+
+ String jsonToSend = "";
+ try {
+ jsonToSend = mapper.defaultPrettyPrintingWriter().writeValueAsString(op);
+ } catch (JsonGenerationException e) {
+ e.printStackTrace();
+ } catch (JsonMappingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ //As generated by jackson mapper
+ if (verboseOutput) {
+ System.out.println("@@@@ OUTBOUND JSON#\n" + jsonToSend + "#");
+ }
+
+ //Execute the operation
+ Result result = new Result();
+ if (execute) {
+ result = con.execute(op);
+ } else {
+ if (verboseOutput) {
+ System.out.println("**** NOTE: Execution disabled . NOT exercising write-attribute operation. **** ");
+ }
+ }
+ if (verboseOutput) {
+ //result wrapper details
+ System.out.println("\tResult:" + result);
+ //detailed results
+ System.out.println("\tValue:" + result.getResult());
+ System.out.println("-----------------------------------------------------\n");
+ }
+ return result;
+ }
+}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
deleted file mode 100644
index 452fdfb..0000000
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
+++ /dev/null
@@ -1,674 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2011 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.modules.plugins.jbossas7.itest.standalone;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Set;
-
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.map.DeserializationConfig;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.testng.annotations.Test;
-
-import org.rhq.core.clientapi.agent.inventory.CreateResourceRequest;
-import org.rhq.core.clientapi.agent.inventory.CreateResourceResponse;
-import org.rhq.core.clientapi.agent.inventory.DeleteResourceRequest;
-import org.rhq.core.clientapi.agent.inventory.DeleteResourceResponse;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.Property;
-import org.rhq.core.domain.configuration.PropertyMap;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
-import org.rhq.core.domain.resource.CreateResourceStatus;
-import org.rhq.core.domain.resource.DeleteResourceStatus;
-import org.rhq.core.domain.resource.InventoryStatus;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceCategory;
-import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.pc.configuration.ConfigurationManager;
-import org.rhq.core.pc.inventory.InventoryManager;
-import org.rhq.modules.plugins.jbossas7.ASConnection;
-import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent;
-import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent.Value;
-import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
-import org.rhq.modules.plugins.jbossas7.json.Address;
-import org.rhq.modules.plugins.jbossas7.json.Operation;
-import org.rhq.modules.plugins.jbossas7.json.Result;
-import org.rhq.test.arquillian.RunDiscovery;
-
-/**
- * Test exercising the subsystem=security/SecurityDomain/[Authentication(Classic|Jaspi),
- * Authorization, Mapping, Audit, Acl,
- * Identity-Trust]
- * @author Simeon Pinder
- */
-@Test(groups = { "integration", "pc", "standalone" }, singleThreaded = true)
-public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
-
- private static ASConnection con = null;
- private static ObjectMapper mapper = null;
-
- private static String TEST_DOMAIN = "testDomain";
- private static String SECURITY_RESOURCE_TYPE = "Security";
- private static String SECURITY_RESOURCE_KEY = "subsystem=security";
- private static String SECURITY_DOMAIN_RESOURCE_KEY = "security-domain";
- private static String PROFILE = "profile=full-ha";
- private static String SECURITY_DOMAIN_RESOURCE_TYPE = "Security Domain";
- private static String AUTH_CLASSIC_RESOURCE_TYPE = "Authentication (Classic)";
- private static String AUTH_CLASSIC_RESOURCE_KEY = "authentication=classic";
-
- private static Resource securityResource = null;
-
- protected static String DC_HOST = System.getProperty("jboss.domain.bindAddress");
- protected static int DC_HTTP_PORT = Integer.valueOf(System.getProperty("jboss.domain.httpManagementPort"));
- protected static String DC_USER = AbstractJBossAS7PluginTest.MANAGEMENT_USERNAME;
- protected static String DC_PASS = AbstractJBossAS7PluginTest.MANAGEMENT_PASSWORD;
-
- ASConnection getASConnection() {
- ASConnection connection = new ASConnection(DC_HOST, DC_HTTP_PORT, DC_USER, DC_PASS);
- return connection;
- }
-
- public static final ResourceType RESOURCE_TYPE = new ResourceType(SECURITY_RESOURCE_TYPE, PLUGIN_NAME,
- ResourceCategory.SERVICE, null);
- private static final String RESOURCE_KEY = SECURITY_RESOURCE_KEY;
- private static Resource testSecurityDomain = null;
- private String testSecurityDomainKey = null;
- private ConfigurationManager testConfigurationManager = null;
-
- //Define some shared and reusable content
- static HashMap<String, String> jsonMap = new HashMap<String, String>();
- static {
- jsonMap
- .put(
- "login-modules",
- "[{\"flag\":\"required\", \"code\":\"Ldap\", \"module-options\":{\"bindDn\":\"uid=ldapSecureUser,ou=People,dc=redat,dc=com\", \"bindPw\":\"test126\", \"allowEmptyPasswords\":\"true\"}}]");
- jsonMap
- .put(
- "policy-modules",
- "[{\"flag\":\"requisite\", \"code\":\"LdapExtended\", \"module-options\":{\"policy\":\"module\", \"policy1\":\"module1\"}}]");
- jsonMap
- .put("mapping-modules",
- "[{\"code\":\"Test\", \"type\":\"attribute\", \"module-options\":{\"mapping\":\"module\", \"mapping1\":\"module1\"}}]");
- jsonMap.put("provider-modules",
- "[{\"code\":\"Providers\", \"module-options\":{\"provider\":\"module\", \"provider1\":\"module1\"}}]");
- jsonMap
- .put("acl-modules",
- "[{\"flag\":\"sufficient\", \"code\":\"ACL\", \"module-options\":{\"acl\":\"module\", \"acl1\":\"module1\"}}]");
- jsonMap
- .put("trust-modules",
- "[{\"flag\":\"optional\", \"code\":\"TRUST\", \"module-options\":{\"trust\":\"module\", \"trust1\":\"module1\"}}]");
- }
-
- /* This first discovery is only so that we can leverage existing code to install the management user needed
- * in next test.
- */
- @Test(priority = 10, groups = "discovery")
- @RunDiscovery(discoverServices = true, discoverServers = true)
- public void firstDiscovery() throws Exception {
- Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
- assertNotNull(platform);
- assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
-
- //now install mgmt users.
- System.out.println("------ * Duplicating discovery for SecurityModule testing....");
- installManagementUsers();
- }
-
- /** This method mass loads all the supported Module Option Types(Excluding authentication=jaspi, cannot co-exist with
- * authentication=classic) into a single SecurityDomain. This is done as
- * -i)creating all of the related hierarchy of types needed to exercise N Module Options Types and their associated
- * Module Options instances would take too long to setup(N creates would signal N discovery runs before test could complete).
- * -ii)setting the priority of this method lower than the discovery method means that we'll get all the same types in much
- * less time.
- *
- * @throws Exception
- */
- @Test(priority = 11)
- public void loadStandardModuleOptionTypes() throws Exception {
- mapper = new ObjectMapper();
- mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-
- //Adjust discovery depth to support deeper hierarchy depth of Module Option elements
- setMaxDiscoveryDepthOverride(12);
-
- //create new Security Domain
- Address destination = new Address(PROFILE);
- destination.addSegment(SECURITY_RESOURCE_KEY);
- String securityDomainId = TEST_DOMAIN + "2";
- destination.addSegment(SECURITY_DOMAIN_RESOURCE_KEY + "=" + securityDomainId);
-
- ASConnection connection = getASConnection();
- Result result = new Result();
- Operation op = null;
- //delete old one if present to setup clean slate
- op = new Operation("remove", destination);
- result = connection.execute(op);
-
- //build/rebuild hierarchy
- op = new Operation("add", destination);
- result = connection.execute(op);
- assert result.getOutcome().equals("success") : "Add of Security Domain has failed: "
- + result.getFailureDescription();
-
- //Ex. profile=standalone-ha,subsystem=security,security-domain
- String addressPrefix = PROFILE + "," + SECURITY_RESOURCE_KEY + "," + SECURITY_DOMAIN_RESOURCE_KEY;
-
- //loop over standard types and add base details for all of them to security domain
- String address = "";
- for (String attribute : jsonMap.keySet()) {
- if (attribute.equals("policy-modules")) {
- address = addressPrefix + "=" + securityDomainId + ",authorization=classic";
- } else if (attribute.equals("acl-modules")) {
- address = addressPrefix + "=" + securityDomainId + ",acl=classic";
- } else if (attribute.equals("mapping-modules")) {
- address = addressPrefix + "=" + securityDomainId + ",mapping=classic";
- } else if (attribute.equals("trust-modules")) {
- address = addressPrefix + "=" + securityDomainId + ",identity-trust=classic";
- } else if (attribute.equals("provider-modules")) {
- address = addressPrefix + "=" + securityDomainId + ",audit=classic";
- } else if (attribute.equals("login-modules")) {
- address = addressPrefix + "=" + securityDomainId + ",authentication=classic";
- } else {
- assert false : "An unknown attribute '" + attribute
- + "' was found. Is there a new type to be supported?";
- }
- //build the operation to add the component
- ////Load json map into ModuleOptionType
- List<Value> moduleTypeValue = new ArrayList<Value>();
- try {
- // loading jsonMap contents for Ex. 'login-module'
- JsonNode node = mapper.readTree(jsonMap.get(attribute));
- Object obj = mapper.treeToValue(node, Object.class);
- result.setResult(obj);
- result.setOutcome("success");
- } catch (JsonProcessingException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- //populate the Value component complete with module Options.
- moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
- ModuleOptionsComponent.loadModuleOptionType(attribute));
- op = ModuleOptionsComponent.createAddModuleOptionTypeOperation(new Address(address), attribute,
- moduleTypeValue);
- //submit the command
- result = connection.execute(op);
- }
- }
-
- /** Runs the second discovery run to load all the new types added.
- *
- * @throws Exception
- */
- @Test(priority = 12, groups = "discovery")
- @RunDiscovery(discoverServices = true, discoverServers = true)
- public void secondDiscovery() throws Exception {
- Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
- assertNotNull(platform);
- assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
-
- //Have thread sleep longer to discover deeper resource types.
- //spinder 6/29/12: up this number if the resources are not being discovered.
- Thread.sleep(180 * 1000L); // delay so that PC gets a chance to scan for resources
- }
-
- /** This test method exercises a number of things:
- * - that the security-domain children loaded have been created successfully
- * - that all of the supported Module Option Type children(excluding 'authentication=jaspi') have been
- * discovered as AS7 types successfully.
- * - that the correct child attribute was specified for each type //Ex. acl=classic -> acl-modules
- * -
- *
- * @throws Exception
- */
- @Test(priority = 13)
- public void testDiscoveredSecurityNodes() throws Exception {
- //lazy-load configurationManager
- if (testConfigurationManager == null) {
- testConfigurationManager = this.pluginContainer.getConfigurationManager();
- testConfigurationManager = pluginContainer.getConfigurationManager();
- testConfigurationManager.initialize();
- Thread.sleep(20 * 1000L);
- }
- //iterate through list of nodes and make sure they've all been discovered
- ////Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,acl=classic
- String attribute = null;
- for (String jsonKey : jsonMap.keySet()) {
- //Ex. policy-modules
- attribute = jsonKey;
- //spinder 6/26/12: Temporarily disable until figure out why NPE happens only for this type?
- if (attribute.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
- break;//
- }
- //Ex. name=acl-modules
- //check the configuration for the Module Option Type Ex. 'Acl (Profile)' Resource. Should be able to verify components
- Resource moduleOptionsTypeResource = getModuleOptionTypeResource(attribute);
- //assert non-zero id returned
- assert moduleOptionsTypeResource.getId() > 0 : "The resource was not properly initialized. Expected id >0 but got:"
- + moduleOptionsTypeResource.getId();
-
- //Now request the resource complete with resource config
- Configuration loadedConfiguration = testConfigurationManager
- .loadResourceConfiguration(moduleOptionsTypeResource.getId());
- String code = null;
- String type = null;
- String flag = null;
- //populate the associated attributes if it's supported.
- for (String key : loadedConfiguration.getAllProperties().keySet()) {
- Property property = loadedConfiguration.getAllProperties().get(key);
- if (key.equals("code")) {
- code = ((PropertySimple) property).getStringValue();
- } else if (key.equals("flag")) {
- flag = ((PropertySimple) property).getStringValue();
- } else {//Ex. type.
- type = ((PropertySimple) property).getStringValue();
- }
- }
-
- //retrieve module options as well.
- String jsonContent = jsonMap.get(attribute);
- Result result = new Result();
- try {
- // loading jsonMap contents for Ex. 'login-module'
- JsonNode node = mapper.readTree(jsonContent);
- Object obj = mapper.treeToValue(node, Object.class);
- result.setResult(obj);
- result.setOutcome("success");
- } catch (JsonProcessingException e) {
- e.printStackTrace();
- assert false;
- } catch (IOException e) {
- e.printStackTrace();
- assert false;
- }
-
- //populate the Value component complete with module Options.
- List<Value> moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
- ModuleOptionsComponent.loadModuleOptionType(attribute));
- Value moduleOptionType = moduleTypeValue.get(0);
- //Ex. retrieve the acl-modules component and assert values.
- //always test 'code'
- assert moduleOptionType.getCode().equals(code) : "Module Option 'code' value is not correct. Expected '"
- + code + "' but was '" + moduleOptionType.getCode() + "'";
- if (attribute.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
- assert moduleOptionType.getType().equals(type) : "Mapping Module 'type' value is not correct. Expected '"
- + type + "' but was '" + moduleOptionType.getType() + "'";
- } else if (!attribute.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {//Audit has no second parameter
- assert moduleOptionType.getFlag().equals(flag) : "Provider Module 'flag' value is not correct. Expected '"
- + flag + "' but was '" + moduleOptionType.getFlag() + "'";
- }
-
- //Retrieve Module Options and test
- //Ex. Module Options for (Acl Modules - Profile)
- Resource moduleOptionsResource = getModuleOptionsResource(moduleOptionsTypeResource, attribute);
- //assert non-zero id returned
- assert moduleOptionsResource.getId() > 0 : "The resource was not properly initialized. Expected id > 0 but got:"
- + moduleOptionsResource.getId();
- //fetch configuration for module options
- //Now request the resource complete with resource config
- Configuration loadedOptionsConfiguration = testConfigurationManager
- .loadResourceConfiguration(moduleOptionsResource.getId());
- for (String key : loadedOptionsConfiguration.getAllProperties().keySet()) {
- //retrieve the open map of Module Options
- PropertyMap map = ((PropertyMap) loadedOptionsConfiguration.getAllProperties().get(key));
- LinkedHashMap<String, Object> options = moduleOptionType.getOptions();
- for (String optionKey : map.getMap().keySet()) {
- PropertySimple property = (PropertySimple) map.getMap().get(optionKey);
- //test the key
- assert options.containsKey(optionKey) : "Unable to find expected option key '" + optionKey
- + "'. Check hierarchy.";
- //now the value.
- String value = String.valueOf(options.get(optionKey));
- assert value.equals(property.getStringValue()) : "Unable to find expected Module Option mapping. Key '"
- + optionKey
- + "' did not map to expected value '"
- + value
- + "' but was '"
- + property.getStringValue() + "'.";
- }
- }
- }
- }
-
- @Test(priority = 14)
- public void testCreateSecurityDomain() throws Exception {
- //get the root security resource
- securityResource = getResource();
-
- //plugin config
- Configuration createPlugConfig = new Configuration();
- createPlugConfig.put(new PropertySimple("path", SECURITY_DOMAIN_RESOURCE_KEY += "=" + TEST_DOMAIN));
-
- //resource config
- Configuration createResConfig = new Configuration();
- createResConfig.put(new PropertySimple("name", TEST_DOMAIN));
-
- CreateResourceRequest request = new CreateResourceRequest();
- request.setParentResourceId(securityResource.getId());
- request.setPluginConfiguration(createPlugConfig);
- request.setPluginName(PLUGIN_NAME);
- request.setResourceConfiguration(createResConfig);
- request.setResourceName(TEST_DOMAIN);
- request.setResourceTypeName(SECURITY_DOMAIN_RESOURCE_TYPE);
-
- CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
- request);
-
- assert response.getStatus() == CreateResourceStatus.SUCCESS : "The Security Domain creation failed with an error mesasge: "
- + response.getErrorMessage();
- }
-
- @Test(priority = 15)
- public void testAuthenticationClassic() throws Exception {
- //get the root security resource
- securityResource = getResource();
-
- //find TEST_DOMAIN 'security-domain'
- Resource securityDomain = null;
- Set<Resource> childResources = securityResource.getChildResources();
- for (Resource r : childResources) {
- if (r.getName().indexOf(TEST_DOMAIN) > -1) {
- securityDomain = r;
- }
- }
-
- //plugin config
- Configuration createPlugConfig = new Configuration();
- createPlugConfig.put(new PropertySimple("path", AUTH_CLASSIC_RESOURCE_KEY));
-
- //resource config
- Configuration createResConfig = new Configuration();
- createResConfig.put(new PropertySimple("code", "Ldap"));
- createResConfig.put(new PropertySimple("flag", "requisite"));
-
- CreateResourceRequest request = new CreateResourceRequest();
- request.setParentResourceId(securityDomain.getId());
- request.setPluginConfiguration(createPlugConfig);
- request.setPluginName(PLUGIN_NAME);
- request.setResourceConfiguration(createResConfig);
- request.setResourceName("Test - notUsed.");
-
- request.setResourceTypeName(AUTH_CLASSIC_RESOURCE_TYPE);
-
- CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
- request);
-
- assert response.getStatus() == CreateResourceStatus.SUCCESS : "The 'Authentication (Classic)' node creation failed with an error mesasge: "
- + response.getErrorMessage();
- }
-
- @Test(priority = 16)
- public void testDeleteSecurityDomain() throws Exception {
- //get the root security resource
- securityResource = getResource();
- Resource found = null;
- Set<Resource> childResources = securityResource.getChildResources();
- for (Resource r : childResources) {
- if (r.getName().indexOf(TEST_DOMAIN) > -1) {
- found = r;
- }
- }
-
- //plugin config
- Configuration deletePlugConfig = new Configuration();
- deletePlugConfig.put(new PropertySimple("path", SECURITY_DOMAIN_RESOURCE_KEY += "=" + TEST_DOMAIN));
-
- //resource config
- Configuration deleteResConfig = new Configuration();
- deleteResConfig.put(new PropertySimple("name", TEST_DOMAIN));
-
- DeleteResourceRequest request = new DeleteResourceRequest();
- if (found != null) {
- request.setResourceId(found.getId());
- }
- DeleteResourceResponse response = pluginContainer.getResourceFactoryManager().executeDeleteResourceImmediately(
- request);
-
- assert response.getStatus() == DeleteResourceStatus.SUCCESS : "The Security Domain deletion failed with an error mesasge: "
- + response.getErrorMessage();
- }
-
- // public static void main(String[] args) {
- // SecurityModuleOptionsTest setup = new SecurityModuleOptionsTest();
- // try {
- // setup.loadStandardModuleOptionTypes();
- // } catch (Exception e) {
- // e.printStackTrace();
- // }
- // }
-
- private Resource getResource() {
-
- InventoryManager im = pluginContainer.getInventoryManager();
- Resource platform = im.getPlatform();
- Resource server = getResourceByTypeAndKey(platform, StandaloneServerComponentTest.RESOURCE_TYPE,
- StandaloneServerComponentTest.RESOURCE_KEY);
- Resource bindings = getResourceByTypeAndKey(server, RESOURCE_TYPE, RESOURCE_KEY);
- return bindings;
- }
-
- /** Automates hierarchy creation for Module Option type resources and their parents
- *
- * @param optionAttributeType
- * @return
- */
- private Resource getModuleOptionTypeResource(String optionAttributeType) {
- Resource moduleOptionResource = null;
- String securityDomainId = SECURITY_DOMAIN_RESOURCE_KEY + "=" + TEST_DOMAIN + "2";
- if (testSecurityDomain == null) {
- InventoryManager im = pluginContainer.getInventoryManager();
- Resource platform = im.getPlatform();
- //host controller
- ResourceType hostControllerType = new ResourceType("JBossAS7 Host Controller", PLUGIN_NAME,
- ResourceCategory.SERVER, null);
- Resource hostController = getResourceByTypeAndKey(platform, hostControllerType,
- "/tmp/jboss-as-6.0.0.GA/domain");
- //profile=full-ha
- ResourceType profileType = new ResourceType("Profile", PLUGIN_NAME, ResourceCategory.SERVICE, null);
- String key = PROFILE;
- Resource profile = getResourceByTypeAndKey(hostController, profileType, key);
-
- //Security (Profile)
- ResourceType securityType = new ResourceType("Security (Profile)", PLUGIN_NAME, ResourceCategory.SERVICE,
- null);
- key += "," + SECURITY_RESOURCE_KEY;
- Resource security = getResourceByTypeAndKey(profile, securityType, key);
-
- //Security Domain (Profile)
- ResourceType domainType = new ResourceType("Security Domain (Profile)", PLUGIN_NAME,
- ResourceCategory.SERVICE, null);
- key += "," + securityDomainId;
- testSecurityDomainKey = key;
- testSecurityDomain = getResourceByTypeAndKey(security, domainType, key);
- }
-
- //acl=classic
- String descriptorName = "";
- String moduleAttribute = "";
- //acl
- if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Acl.getAttribute())) {
- descriptorName = "ACL (Profile)";
- moduleAttribute = "acl=classic";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {
- descriptorName = "Audit (Profile)";
- moduleAttribute = "audit=classic";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
- descriptorName = "Authentication (Classic - Profile)";
- moduleAttribute = "authentication=classic";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authorization.getAttribute())) {
- descriptorName = "Authorization (Profile)";
- moduleAttribute = "authorization=classic";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.IdentityTrust.getAttribute())) {
- descriptorName = "Identity Trust (Profile)";
- moduleAttribute = "identity-trust=classic";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
- descriptorName = "Mapping (Profile)";
- moduleAttribute = "mapping=classic";
- }
- //Build the right Module Option Type. Ex. ACL (Profile), etc.
- ResourceType moduleOptionType = new ResourceType(descriptorName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
- ConfigurationDefinition cdef = new ConfigurationDefinition(descriptorName, null);
- moduleOptionType.setResourceConfigurationDefinition(cdef);
- //Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,identity-trust=classic
- String moduleOptionTypeKey = testSecurityDomainKey += "," + moduleAttribute;
-
- if (!testSecurityDomainKey.endsWith(securityDomainId)) {
- moduleOptionTypeKey = testSecurityDomainKey.substring(0, testSecurityDomainKey.indexOf(securityDomainId)
- + securityDomainId.length())
- + "," + moduleAttribute;
- }
-
- moduleOptionResource = getResourceByTypeAndKey(testSecurityDomain, moduleOptionType, moduleOptionTypeKey);
-
- return moduleOptionResource;
- }
-
- /** Automates hierarchy creation for Module Option type resources and their parents
- *
- * @param optionAttributeType
- * @return
- */
- private Resource getModuleOptionsResource(Resource parent, String optionAttributeType) {
- Resource moduleOptionsResource = null;
- String descriptorName = "";
- String moduleAttribute = "";
- String moduleOptionsDescriptor = "";
- if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Acl.getAttribute())) {
- // descriptorName = "ACL Modules (Profile)";
- descriptorName = "Acl Modules (Profile)";
- moduleAttribute = "acl=classic";
- moduleOptionsDescriptor = "Module Options (Acl - Profile)";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {
- descriptorName = "Provider Modules (Profile)";
- moduleAttribute = "audit=classic";
- moduleOptionsDescriptor = "Module Options (Provider Modules - Profile)";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
- descriptorName = "Login Modules (Classic - Profile)";
- moduleAttribute = "authentication=classic";
- moduleOptionsDescriptor = "Module Options (Classic - Profile)";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authorization.getAttribute())) {
- descriptorName = "Authorization Modules (Profile)";
- moduleAttribute = "authorization=classic";
- moduleOptionsDescriptor = "Module Options (Authorization - Profile)";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.IdentityTrust.getAttribute())) {
- descriptorName = "Identity Trust Modules (Profile)";
- moduleAttribute = "identity-trust=classic";
- moduleOptionsDescriptor = "Module Options (Identity Trust - Profile)";
- } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
- descriptorName = "Mapping Modules (Profile)";
- moduleAttribute = "mapping=classic";
- moduleOptionsDescriptor = "Module Options (Mapping - Profile)";
- }
- //Build the right Module Option Type. Ex. ACL Modules (Profile), etc.
- ResourceType modulesType = new ResourceType(descriptorName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
- //Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,acl=classic,acl-modules:0
- String sharedRoot = "profile=full-ha,subsystem=security,security-domain=testDomain2";
- String moduleOptionTypeKey = sharedRoot += "," + moduleAttribute + ","
- + optionAttributeType + ":0";
- //Ex. Module Options Type children [ACL Modules (Profile),etc.]
- Resource modulesInstance = getResourceByTypeAndKey(parent, modulesType, moduleOptionTypeKey);
-
- //Module Options
- ResourceType moduleOptionsType = new ResourceType(moduleOptionsDescriptor, PLUGIN_NAME,
- ResourceCategory.SERVICE, null);
- moduleOptionsResource = getResourceByTypeAndKey(modulesInstance, moduleOptionsType, moduleOptionTypeKey
- + ",module-options");
-
- return moduleOptionsResource;
- }
-
- private Resource getResource(Resource parentResource, String pluginDescriptorTypeName, String resourceKey) {
- Resource resource = null;
- if (((parentResource != null) & (pluginDescriptorTypeName != null) & (resourceKey != null))
- & (((!pluginDescriptorTypeName.isEmpty()) & (!resourceKey.isEmpty())))) {
- ResourceType resourceType = buildResourceType(pluginDescriptorTypeName);
- resource = getResourceByTypeAndKey(parentResource, resourceType, resourceKey);
- }
- return resource;
- }
-
- private ResourceType buildResourceType(String pluginTypeName) {
- ResourceType created = null;
- if ((pluginTypeName != null) && (!pluginTypeName.isEmpty())) {
- created = new ResourceType(pluginTypeName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
- }
- return created;
- }
-
- /** For each operation
- * - will write verbose json and operation details to system.out if verboseOutput = true;
- * - will execute the operation against running server if execute = true.
- *
- * @param op
- * @param execute
- * @param verboseOutput
- * @return
- */
- public static Result exerciseOperation(Operation op, boolean execute, boolean verboseOutput) {
- //display operation as AS7 plugin will build it
- if (verboseOutput) {
- System.out.println("\tOperation is:" + op);
- }
-
- String jsonToSend = "";
- try {
- jsonToSend = mapper.defaultPrettyPrintingWriter().writeValueAsString(op);
- } catch (JsonGenerationException e) {
- e.printStackTrace();
- } catch (JsonMappingException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- //As generated by jackson mapper
- if (verboseOutput) {
- System.out.println("@@@@ OUTBOUND JSON#\n" + jsonToSend + "#");
- }
-
- //Execute the operation
- Result result = new Result();
- if (execute) {
- result = con.execute(op);
- } else {
- if (verboseOutput) {
- System.out.println("**** NOTE: Execution disabled . NOT exercising write-attribute operation. **** ");
- }
- }
- if (verboseOutput) {
- //result wrapper details
- System.out.println("\tResult:" + result);
- //detailed results
- System.out.println("\tValue:" + result.getResult());
- System.out.println("-----------------------------------------------------\n");
- }
- return result;
- }
-}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
index 5d64977..fe05def 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/TemplatedResourcesTest.java
@@ -73,7 +73,7 @@ public class TemplatedResourcesTest extends AbstractJBossAS7PluginTest {
StandaloneServerComponentTest.RESOURCE_KEY);
inventoryManager.activateResource(server, platformContainer, false);
- Thread.sleep(20 * 1000L);
+ Thread.sleep(30 * 1000L);
for (ResourceData resourceData : testResourceData) {
ResourceType resourceType = new ResourceType(resourceData.resourceTypeName, PLUGIN_NAME,
@@ -100,6 +100,7 @@ public class TemplatedResourcesTest extends AbstractJBossAS7PluginTest {
for (Resource resourceUnderTest : foundResources) {
log.info(foundResources);
+ assert resourceUnderTest.getId() > 0 : "Resource not properly initialized. Id = 0. Try extending sleep after discovery.";
Configuration resourceUnderTestConfig = configurationManager
.loadResourceConfiguration(resourceUnderTest.getId());
commit 89fa0d623ae733febad51a61774782447bb07c41
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Jun 29 09:30:20 2012 -0400
Fix problem with test Resource discovery and cleaned up names and properties.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
index e3f88af..452fdfb 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
@@ -24,12 +24,15 @@ import static org.testng.Assert.assertNotNull;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Set;
+import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationConfig;
+import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.testng.annotations.Test;
@@ -39,6 +42,7 @@ import org.rhq.core.clientapi.agent.inventory.DeleteResourceRequest;
import org.rhq.core.clientapi.agent.inventory.DeleteResourceResponse;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyMap;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.resource.CreateResourceStatus;
@@ -67,27 +71,24 @@ import org.rhq.test.arquillian.RunDiscovery;
@Test(groups = { "integration", "pc", "standalone" }, singleThreaded = true)
public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
- private static String user = "rhqadmin";
- private static String pass = "as7";
- private static String host = "localhost";
private static ASConnection con = null;
private static ObjectMapper mapper = null;
- private ModuleOptionsComponent moc = null;
private static String TEST_DOMAIN = "testDomain";
- private static Resource securityResource = null;
private static String SECURITY_RESOURCE_TYPE = "Security";
private static String SECURITY_RESOURCE_KEY = "subsystem=security";
- private static String SECURITY_DOMAIN_RESOURCE_TYPE = "Security Domain";
private static String SECURITY_DOMAIN_RESOURCE_KEY = "security-domain";
+ private static String PROFILE = "profile=full-ha";
+ private static String SECURITY_DOMAIN_RESOURCE_TYPE = "Security Domain";
private static String AUTH_CLASSIC_RESOURCE_TYPE = "Authentication (Classic)";
private static String AUTH_CLASSIC_RESOURCE_KEY = "authentication=classic";
- private static String PROFILE = "profile=full-ha";
- protected static final String DC_HOST = System.getProperty("jboss.domain.bindAddress");
- protected static final int DC_HTTP_PORT = Integer.valueOf(System.getProperty("jboss.domain.httpManagementPort"));
- protected static final String DC_USER = AbstractJBossAS7PluginTest.MANAGEMENT_USERNAME;
- protected static final String DC_PASS = AbstractJBossAS7PluginTest.MANAGEMENT_PASSWORD;
+ private static Resource securityResource = null;
+
+ protected static String DC_HOST = System.getProperty("jboss.domain.bindAddress");
+ protected static int DC_HTTP_PORT = Integer.valueOf(System.getProperty("jboss.domain.httpManagementPort"));
+ protected static String DC_USER = AbstractJBossAS7PluginTest.MANAGEMENT_USERNAME;
+ protected static String DC_PASS = AbstractJBossAS7PluginTest.MANAGEMENT_PASSWORD;
ASConnection getASConnection() {
ASConnection connection = new ASConnection(DC_HOST, DC_HTTP_PORT, DC_USER, DC_PASS);
@@ -125,6 +126,21 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
"[{\"flag\":\"optional\", \"code\":\"TRUST\", \"module-options\":{\"trust\":\"module\", \"trust1\":\"module1\"}}]");
}
+ /* This first discovery is only so that we can leverage existing code to install the management user needed
+ * in next test.
+ */
+ @Test(priority = 10, groups = "discovery")
+ @RunDiscovery(discoverServices = true, discoverServers = true)
+ public void firstDiscovery() throws Exception {
+ Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
+ assertNotNull(platform);
+ assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
+
+ //now install mgmt users.
+ System.out.println("------ * Duplicating discovery for SecurityModule testing....");
+ installManagementUsers();
+ }
+
/** This method mass loads all the supported Module Option Types(Excluding authentication=jaspi, cannot co-exist with
* authentication=classic) into a single SecurityDomain. This is done as
* -i)creating all of the related hierarchy of types needed to exercise N Module Options Types and their associated
@@ -134,13 +150,13 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
*
* @throws Exception
*/
- @Test(priority = 10)
- public void testLoadStandardModuleOptionTypes() throws Exception {
+ @Test(priority = 11)
+ public void loadStandardModuleOptionTypes() throws Exception {
mapper = new ObjectMapper();
mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//Adjust discovery depth to support deeper hierarchy depth of Module Option elements
- setMaxDiscoveryDepthOverride(10);
+ setMaxDiscoveryDepthOverride(12);
//create new Security Domain
Address destination = new Address(PROFILE);
@@ -150,13 +166,16 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
ASConnection connection = getASConnection();
Result result = new Result();
+ Operation op = null;
//delete old one if present to setup clean slate
- Operation op = new Operation("remove", destination);
+ op = new Operation("remove", destination);
result = connection.execute(op);
//build/rebuild hierarchy
op = new Operation("add", destination);
result = connection.execute(op);
+ assert result.getOutcome().equals("success") : "Add of Security Domain has failed: "
+ + result.getFailureDescription();
//Ex. profile=standalone-ha,subsystem=security,security-domain
String addressPrefix = PROFILE + "," + SECURITY_RESOURCE_KEY + "," + SECURITY_DOMAIN_RESOURCE_KEY;
@@ -205,15 +224,20 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
}
}
- @Test(priority = 11, groups = "discovery")
+ /** Runs the second discovery run to load all the new types added.
+ *
+ * @throws Exception
+ */
+ @Test(priority = 12, groups = "discovery")
@RunDiscovery(discoverServices = true, discoverServers = true)
- public void initialDiscovery() throws Exception {
+ public void secondDiscovery() throws Exception {
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
assertNotNull(platform);
assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
- //Have thread sleep longer to discover deeper resource types.
- Thread.sleep(120 * 1000L); // delay so that PC gets a chance to scan for resources
+ //Have thread sleep longer to discover deeper resource types.
+ //spinder 6/29/12: up this number if the resources are not being discovered.
+ Thread.sleep(180 * 1000L); // delay so that PC gets a chance to scan for resources
}
/** This test method exercises a number of things:
@@ -225,7 +249,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
*
* @throws Exception
*/
- @Test(priority = 12)
+ @Test(priority = 13)
public void testDiscoveredSecurityNodes() throws Exception {
//lazy-load configurationManager
if (testConfigurationManager == null) {
@@ -246,13 +270,14 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
}
//Ex. name=acl-modules
//check the configuration for the Module Option Type Ex. 'Acl (Profile)' Resource. Should be able to verify components
- Resource aclResource = getModuleOptionResourceResource(attribute);
+ Resource moduleOptionsTypeResource = getModuleOptionTypeResource(attribute);
//assert non-zero id returned
- assert aclResource.getId() > 0 : "The resource was not properly initialized. Expected id >0 but got:"
- + aclResource.getId();
+ assert moduleOptionsTypeResource.getId() > 0 : "The resource was not properly initialized. Expected id >0 but got:"
+ + moduleOptionsTypeResource.getId();
//Now request the resource complete with resource config
- Configuration loadedConfiguration = testConfigurationManager.loadResourceConfiguration(aclResource.getId());
+ Configuration loadedConfiguration = testConfigurationManager
+ .loadResourceConfiguration(moduleOptionsTypeResource.getId());
String code = null;
String type = null;
String flag = null;
@@ -300,11 +325,40 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
assert moduleOptionType.getFlag().equals(flag) : "Provider Module 'flag' value is not correct. Expected '"
+ flag + "' but was '" + moduleOptionType.getFlag() + "'";
}
+
+ //Retrieve Module Options and test
+ //Ex. Module Options for (Acl Modules - Profile)
+ Resource moduleOptionsResource = getModuleOptionsResource(moduleOptionsTypeResource, attribute);
+ //assert non-zero id returned
+ assert moduleOptionsResource.getId() > 0 : "The resource was not properly initialized. Expected id > 0 but got:"
+ + moduleOptionsResource.getId();
+ //fetch configuration for module options
+ //Now request the resource complete with resource config
+ Configuration loadedOptionsConfiguration = testConfigurationManager
+ .loadResourceConfiguration(moduleOptionsResource.getId());
+ for (String key : loadedOptionsConfiguration.getAllProperties().keySet()) {
+ //retrieve the open map of Module Options
+ PropertyMap map = ((PropertyMap) loadedOptionsConfiguration.getAllProperties().get(key));
+ LinkedHashMap<String, Object> options = moduleOptionType.getOptions();
+ for (String optionKey : map.getMap().keySet()) {
+ PropertySimple property = (PropertySimple) map.getMap().get(optionKey);
+ //test the key
+ assert options.containsKey(optionKey) : "Unable to find expected option key '" + optionKey
+ + "'. Check hierarchy.";
+ //now the value.
+ String value = String.valueOf(options.get(optionKey));
+ assert value.equals(property.getStringValue()) : "Unable to find expected Module Option mapping. Key '"
+ + optionKey
+ + "' did not map to expected value '"
+ + value
+ + "' but was '"
+ + property.getStringValue() + "'.";
+ }
+ }
}
- //TODO spinder 6-26-12: retrieve the Module Options and test them too.
}
- @Test(priority = 13)
+ @Test(priority = 14)
public void testCreateSecurityDomain() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -332,7 +386,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+ response.getErrorMessage();
}
- @Test(priority = 14)
+ @Test(priority = 15)
public void testAuthenticationClassic() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -371,7 +425,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+ response.getErrorMessage();
}
- @Test(priority = 15)
+ @Test(priority = 16)
public void testDeleteSecurityDomain() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -405,7 +459,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
// public static void main(String[] args) {
// SecurityModuleOptionsTest setup = new SecurityModuleOptionsTest();
// try {
- // setup.testLoadStandardModuleOptionTypes();
+ // setup.loadStandardModuleOptionTypes();
// } catch (Exception e) {
// e.printStackTrace();
// }
@@ -421,12 +475,12 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
return bindings;
}
- /** Automates
+ /** Automates hierarchy creation for Module Option type resources and their parents
*
* @param optionAttributeType
* @return
*/
- private Resource getModuleOptionResourceResource(String optionAttributeType) {
+ private Resource getModuleOptionTypeResource(String optionAttributeType) {
Resource moduleOptionResource = null;
String securityDomainId = SECURITY_DOMAIN_RESOURCE_KEY + "=" + TEST_DOMAIN + "2";
if (testSecurityDomain == null) {
@@ -497,6 +551,60 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
return moduleOptionResource;
}
+ /** Automates hierarchy creation for Module Option type resources and their parents
+ *
+ * @param optionAttributeType
+ * @return
+ */
+ private Resource getModuleOptionsResource(Resource parent, String optionAttributeType) {
+ Resource moduleOptionsResource = null;
+ String descriptorName = "";
+ String moduleAttribute = "";
+ String moduleOptionsDescriptor = "";
+ if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Acl.getAttribute())) {
+ // descriptorName = "ACL Modules (Profile)";
+ descriptorName = "Acl Modules (Profile)";
+ moduleAttribute = "acl=classic";
+ moduleOptionsDescriptor = "Module Options (Acl - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {
+ descriptorName = "Provider Modules (Profile)";
+ moduleAttribute = "audit=classic";
+ moduleOptionsDescriptor = "Module Options (Provider Modules - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
+ descriptorName = "Login Modules (Classic - Profile)";
+ moduleAttribute = "authentication=classic";
+ moduleOptionsDescriptor = "Module Options (Classic - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authorization.getAttribute())) {
+ descriptorName = "Authorization Modules (Profile)";
+ moduleAttribute = "authorization=classic";
+ moduleOptionsDescriptor = "Module Options (Authorization - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.IdentityTrust.getAttribute())) {
+ descriptorName = "Identity Trust Modules (Profile)";
+ moduleAttribute = "identity-trust=classic";
+ moduleOptionsDescriptor = "Module Options (Identity Trust - Profile)";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
+ descriptorName = "Mapping Modules (Profile)";
+ moduleAttribute = "mapping=classic";
+ moduleOptionsDescriptor = "Module Options (Mapping - Profile)";
+ }
+ //Build the right Module Option Type. Ex. ACL Modules (Profile), etc.
+ ResourceType modulesType = new ResourceType(descriptorName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ //Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,acl=classic,acl-modules:0
+ String sharedRoot = "profile=full-ha,subsystem=security,security-domain=testDomain2";
+ String moduleOptionTypeKey = sharedRoot += "," + moduleAttribute + ","
+ + optionAttributeType + ":0";
+ //Ex. Module Options Type children [ACL Modules (Profile),etc.]
+ Resource modulesInstance = getResourceByTypeAndKey(parent, modulesType, moduleOptionTypeKey);
+
+ //Module Options
+ ResourceType moduleOptionsType = new ResourceType(moduleOptionsDescriptor, PLUGIN_NAME,
+ ResourceCategory.SERVICE, null);
+ moduleOptionsResource = getResourceByTypeAndKey(modulesInstance, moduleOptionsType, moduleOptionTypeKey
+ + ",module-options");
+
+ return moduleOptionsResource;
+ }
+
private Resource getResource(Resource parentResource, String pluginDescriptorTypeName, String resourceKey) {
Resource resource = null;
if (((parentResource != null) & (pluginDescriptorTypeName != null) & (resourceKey != null))
@@ -515,288 +623,52 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
return created;
}
- //##################################################################
- // /**The test reads the existing property values, deserializes them and writes the same
- // * contents back out to a running instance for all known ModuleOptionTypes.
- // *
- // * @throws Exception
- // */
- // public void testPopulateModuleOptionsAndTypes() throws Exception {
- //
- // //as7 node details.
- // String securityDomainId = "testDomain";
- // //TODO: spinder 6-6-12: this cannot run as a standalone itest until JIRA https://issues.jboss.org/browse/AS7-4951
- // // is addressed as there is no way to automate setup of the information being tested.
- // String address = "subsystem=security,security-domain=" + securityDomainId + ",authentication=classic";
- // boolean verboseOutput = true;
- // boolean executeOperation = true;
- // for (ModuleOptionType t : ModuleOptionType.values()) {
- // String attribute = t.getAttribute();
- // if (verboseOutput) {
- // System.out.println("======= Running with ModuleOptionType:" + t + " attribute:" + attribute + ":");
- // }
- // if (attribute.equals("policy-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",authorization=classic";
- // } else if (attribute.equals("acl-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",acl=classic";
- // } else if (attribute.equals("mapping-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",mapping=classic";
- // } else if (attribute.equals("trust-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",identity-trust=classic";
- // } else if (attribute.equals("provider-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",audit=classic";
- // } else if (attribute.equals("login-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",authentication=classic";
- // } else {
- // assert false : "An unknown attribute '" + attribute
- // + "' was found. Is there a new type to be supported?";
- // }
- //
- // //test operation- read property always available.
- // Operation op = null;
- //
- // //read the login-modules attribute
- // op = new ReadAttribute(new Address(address), attribute);
- // Result result = exerciseOperation(op, true, verboseOutput);
- // assert result.isSuccess() == true : "The operation '" + op + "' failed to read the resource."
- // + result.getFailureDescription();
- // //extract current results
- // Object rawResult = result.getResult();
- // assert rawResult != null : "Read of attribute'" + attribute + "' from address '" + address
- // + "' has returned no value. Are those values in the model?";
- //
- // List<Value> list2 = new ArrayList<Value>();
- // //populate the Value component complete with module Options.
- // list2 = moc.populateSecurityDomainModuleOptions(result,
- // ModuleOptionsComponent.loadModuleOptionType(attribute));
- // if (verboseOutput) {
- // if (rawResult != null) {
- // System.out.println("Raw Result is:" + rawResult + " and of type:" + rawResult.getClass());
- // } else {
- // System.out.println("Read of attribute'" + attribute + "' from address '" + address
- // + "' has returned no value. Are those values in the model?");
- // }
- // }
- // //write the login-modules attribute
- // op = new WriteAttribute(new Address(address));
- // op.addAdditionalProperty("name", attribute);//attribute to execute on
- // op.addAdditionalProperty("value", list2);
- //
- // //Now test the operation
- // result = exerciseOperation(op, executeOperation, verboseOutput);
- // assert ((result.isSuccess() == true) || (result.getOutcome() == null)) : "The operation '" + op
- // + "' failed to write the resource.." + result.getFailureDescription();
- //
- // //read the login-modules attribute
- // op = new ReadAttribute(new Address(address), attribute);
- // result = exerciseOperation(op, true, verboseOutput);
- // assert (result.isSuccess() == true) : "The operation '" + op + "' failed to read the resource."
- // + result.getFailureDescription();
- // }
- // if (verboseOutput) {
- // System.out.println("Successfully detected,read and wrote out attribute values for:");
- // for (ModuleOptionType type : ModuleOptionType.values()) {
- // System.out.println("\n" + type.ordinal() + " " + type.name());
- // }
- // }
- // }
- //
- // /**Attempts to create a new Authentication node(authentication=classic) with a
- // * 'login-modules' attribute complete with 'code':'Ldap' and 'flag':'required'
- // * and some sample 'module-options' values.
- // *
- // */
- // @Test(enabled = true)
- // public void testCreateSecurityDomainChildLoginModules() {
- // boolean execute = true;
- // boolean verboseOutput = false;
- // String address = "subsystem=security,security-domain=testDomain3,authentication=classic";
- // String attribute = ModuleOptionType.Authentication.getAttribute();
- //
- // //test operation- read property always available.
- // Operation op = null;
- //
- // //read the login-modules attribute
- // op = new ReadAttribute(new Address(address), attribute);
- // Result result = exerciseOperation(op, execute, verboseOutput);
- // assert result.isSuccess() == true : "The operation '" + op + "' failed to read the resource."
- // + result.getFailureDescription();
- //
- // //extract current results
- // Object rawResult = result.getResult();
- //
- // //#### Have to create new content for the new node.
- // List<Value> moduleTypeValue = new ArrayList<Value>();
- // try {
- // // loading 'login-module'
- // JsonNode node = mapper.readTree(jsonMap.get(attribute));
- // result.setResult(mapper.treeToValue(node, Object.class));
- // } catch (JsonProcessingException e) {
- // e.printStackTrace();
- // } catch (IOException e) {
- // e.printStackTrace();
- // }
- //
- // //populate the Value component complete with module Options.
- // moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
- // ModuleOptionsComponent.loadModuleOptionType(attribute));
- //
- // //add the login-modules attribute
- // op = ModuleOptionsComponent
- // .createAddModuleOptionTypeOperation(new Address(address), attribute, moduleTypeValue);
- //
- // result = exerciseOperation(op, execute, verboseOutput);
- // assert ((result.isSuccess() == true) || (result.getOutcome() == null)) : "The operation '" + op
- // + "' failed to write the resource.." + result.getFailureDescription();
- //
- // //read the login-modules attribute
- // op = new ReadAttribute(new Address(address), attribute);
- // result = exerciseOperation(op, execute, verboseOutput);
- // assert result.isSuccess() == true : "The operation '" + op + "' failed to read the resource."
- // + result.getFailureDescription();
- //
- // //exercise values retrieved from read
- // List<Value> serverResponse = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
- // ModuleOptionsComponent.loadModuleOptionType(attribute));
- // Value serverState = serverResponse.get(0);
- // assert serverState.getFlag().equals("required") : "Incorrect state retrieved for 'flag'. Expected 'required'.";
- // assert serverState.getCode().equals("Ldap") : "Incorrect state retrieved for 'code'. Expected 'Ldap'.";
- // LinkedHashMap<String, Object> options = serverState.getOptions();
- // assert options.size() == 3 : "Invalid number of module options returned. Expected 3.";
- // int found = 0;
- // for (String key : options.keySet()) {
- // if (key.equals("bindPw")) {
- // assert "test126".equals(options.get(key)) : "Module option value not correct for key '" + key + "'.";
- // found++;
- // } else if (key.equals("bindDn")) {
- // assert "uid=ldapSecureUser,ou=People,dc=redat,dc=com".equals(options.get(key)) : "Module option value not correct for key '"
- // + key + "'.";
- // found++;
- // } else if (key.equals("allowEmptyPasswords")) {
- // assert "true".equals(options.get(key)) : "Module option value not correct for key '" + key + "'.";
- // found++;
- // }
- // }
- // assert found == 3 : "All module options were not loaded.";
- //
- // //remove the original node to reset for next run.
- // op = new Remove(new Address(address));
- // result = exerciseOperation(op, execute, verboseOutput);
- // assert result.isSuccess() == true : "The operation '" + op + "' failed to remove the resource."
- // + result.getFailureDescription();
- // }
- //
- // /** For each operation
- // * - will write verbose json and operation details to system.out if verboseOutput = true;
- // * - will execute the operation against running server if execute = true.
- // *
- // * @param op
- // * @param execute
- // * @param verboseOutput
- // * @return
- // */
- // public static Result exerciseOperation(Operation op, boolean execute, boolean verboseOutput) {
- // //display operation as AS7 plugin will build it
- // if (verboseOutput) {
- // System.out.println("\tOperation is:" + op);
- // }
- //
- // String jsonToSend = "";
- // try {
- // jsonToSend = mapper.defaultPrettyPrintingWriter().writeValueAsString(op);
- // } catch (JsonGenerationException e) {
- // e.printStackTrace();
- // } catch (JsonMappingException e) {
- // e.printStackTrace();
- // } catch (IOException e) {
- // e.printStackTrace();
- // }
- // //As generated by jackson mapper
- // if (verboseOutput) {
- // System.out.println("@@@@ OUTBOUND JSON#\n" + jsonToSend + "#");
- // }
- //
- // //Execute the operation
- // Result result = new Result();
- // if (execute) {
- // result = con.execute(op);
- // } else {
- // if (verboseOutput) {
- // System.out.println("**** NOTE: Execution disabled . NOT exercising write-attribute operation. **** ");
- // }
- // }
- // if (verboseOutput) {
- // //result wrapper details
- // System.out.println("\tResult:" + result);
- // //detailed results
- // System.out.println("\tValue:" + result.getResult());
- // System.out.println("-----------------------------------------------------\n");
- // }
- // return result;
- // }
- //
- // @Test(priority = 10, groups = "discovery")
- // public void initialSetup() throws Exception {
- // String securityDomainId = TEST_DOMAIN + "1";
- // Result result = null;
- // Operation op = null;
- //
- // //create the initial securityDomain
- // op = new Operation("add", new Address("subsystem=security,security-domain=" + securityDomainId));
- // ASConnection connection = getASConnection();
- // con = connection;
- // mapper = new ObjectMapper();
- // mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
- //
- // moc = new ModuleOptionsComponent();
- // result = connection.execute(op);
- // System.out.println("#### Op is:" + op);
- // System.out.println("#### Result is:" + result);
- //
- // //iterate over jsonMap
- // for (String key : jsonMap.keySet()) {
- // String attribute = key;
- // String address = "";
- // if (attribute.equals("policy-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",authorization=classic";
- // } else if (attribute.equals("acl-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",acl=classic";
- // } else if (attribute.equals("mapping-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",mapping=classic";
- // } else if (attribute.equals("trust-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",identity-trust=classic";
- // } else if (attribute.equals("provider-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",audit=classic";
- // } else if (attribute.equals("login-modules")) {
- // address = "subsystem=security,security-domain=" + securityDomainId + ",authentication=classic";
- // } else {
- // assert false : "An unknown attribute '" + attribute
- // + "' was found. Is there a new type to be supported?";
- // }
- // //#### Have to create new content for the new node.
- // List<Value> moduleTypeValue = new ArrayList<Value>();
- //
- // try {
- // // loading 'login-module'
- // JsonNode node = mapper.readTree(jsonMap.get(attribute));
- // result.setResult(mapper.treeToValue(node, Object.class));
- // } catch (JsonProcessingException e) {
- // e.printStackTrace();
- // } catch (IOException e) {
- // e.printStackTrace();
- // }
- //
- // //populate the Value component complete with module Options.
- // moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
- // ModuleOptionsComponent.loadModuleOptionType(attribute));
- //
- // //add the login-modules attribute
- // op = ModuleOptionsComponent.createAddModuleOptionTypeOperation(new Address(address), attribute,
- // moduleTypeValue);
- //
- // result = exerciseOperation(op, true, true);
- // assert ((result.isSuccess() == true) || (result.getOutcome() == null)) : "The operation '" + op
- // + "' failed to write the resource.." + result.getFailureDescription();
- // }
- // }
+ /** For each operation
+ * - will write verbose json and operation details to system.out if verboseOutput = true;
+ * - will execute the operation against running server if execute = true.
+ *
+ * @param op
+ * @param execute
+ * @param verboseOutput
+ * @return
+ */
+ public static Result exerciseOperation(Operation op, boolean execute, boolean verboseOutput) {
+ //display operation as AS7 plugin will build it
+ if (verboseOutput) {
+ System.out.println("\tOperation is:" + op);
+ }
+
+ String jsonToSend = "";
+ try {
+ jsonToSend = mapper.defaultPrettyPrintingWriter().writeValueAsString(op);
+ } catch (JsonGenerationException e) {
+ e.printStackTrace();
+ } catch (JsonMappingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ //As generated by jackson mapper
+ if (verboseOutput) {
+ System.out.println("@@@@ OUTBOUND JSON#\n" + jsonToSend + "#");
+ }
+
+ //Execute the operation
+ Result result = new Result();
+ if (execute) {
+ result = con.execute(op);
+ } else {
+ if (verboseOutput) {
+ System.out.println("**** NOTE: Execution disabled . NOT exercising write-attribute operation. **** ");
+ }
+ }
+ if (verboseOutput) {
+ //result wrapper details
+ System.out.println("\tResult:" + result);
+ //detailed results
+ System.out.println("\tValue:" + result.getResult());
+ System.out.println("-----------------------------------------------------\n");
+ }
+ return result;
+ }
}
11 years, 5 months
[rhq] Branch 'bug/783603' - modules/core
by mazz
modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementReport.java | 20 +
modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/measurement/MeasurementCollectorRunnable.java | 54 ++-
modules/core/plugin-container/src/test/java/org/rhq/core/pc/CollectorThreadPoolTest.java | 153 +++++++++-
3 files changed, 201 insertions(+), 26 deletions(-)
New commits:
commit 7c9cbda06b11ac9740310190598d333f2e45d434
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Jun 27 17:22:39 2012 -0400
[BZ 783603] make sure the cached report in the runnable doesn't grow unbounded. when a metric is requested, make sure we remove it so it isn't cached and so it isn't reported again
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementReport.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementReport.java
index f812575..ff7392d 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementReport.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementReport.java
@@ -145,12 +145,20 @@ public class MeasurementReport implements Serializable {
* @param report the report that contains the measurements to add
* @param metrics the metrics whose measurement data (if found in the given report) should be added to this report.
* If null or empty, then all of the data in the given report will be added to this report.
+ * @param removeSourceData if true, any data that was transferred from <code>report</code> to this object will be removed
+ * from the original <code>report</code> that was passed into this method.
*/
- public synchronized void add(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) {
+ public synchronized void add(MeasurementReport report, Set<MeasurementScheduleRequest> metrics,
+ boolean removeSourceData) {
if (metrics == null || metrics.isEmpty()) {
measurementNumericData.addAll(report.measurementNumericData);
measurementTraitData.addAll(report.measurementTraitData);
callTimeData.addAll(report.callTimeData);
+ if (removeSourceData) {
+ report.measurementNumericData.clear();
+ report.measurementTraitData.clear();
+ report.callTimeData.clear();
+ }
} else {
// note that usually the metric set is very small (typically not more than around 5, probably normally around 1 or 2)
// so this loop isn't going to be performed with lots of iterations.
@@ -162,6 +170,9 @@ public class MeasurementReport implements Serializable {
MeasurementDataNumeric data = i.next();
if (data.getName().equals(metric.getName())) {
measurementNumericData.add(data);
+ if (removeSourceData) {
+ i.remove();
+ }
}
}
break;
@@ -172,6 +183,9 @@ public class MeasurementReport implements Serializable {
MeasurementDataTrait data = i.next();
if (data.getName().equals(metric.getName())) {
measurementTraitData.add(data);
+ if (removeSourceData) {
+ i.remove();
+ }
}
}
break;
@@ -180,6 +194,10 @@ public class MeasurementReport implements Serializable {
// There is only ever one calltime metric per resource so if we are being asked to
// add the calltime data, we can avoid doing any iterations and just use addAll API.
callTimeData.addAll(report.callTimeData);
+ if (removeSourceData) {
+ report.callTimeData.clear();
+ }
+
break;
}
default: {
diff --git a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/measurement/MeasurementCollectorRunnable.java b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/measurement/MeasurementCollectorRunnable.java
index 94c024b..bf303b9 100644
--- a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/measurement/MeasurementCollectorRunnable.java
+++ b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/measurement/MeasurementCollectorRunnable.java
@@ -7,6 +7,7 @@ import java.util.concurrent.FutureTask;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.locks.ReentrantLock;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -82,8 +83,10 @@ public class MeasurementCollectorRunnable implements Runnable {
/**
* The last known measurements for the resource that this collector is monitoring.
+ * You must synchronize access to this via the R/W lock.
*/
- private MeasurementReport lastReport = new MeasurementReport();
+ private MeasurementReport cachedReport = new MeasurementReport();
+ private ReentrantLock cachedReportLock = new ReentrantLock();
/**
* Accumulated report.
@@ -133,7 +136,7 @@ public class MeasurementCollectorRunnable implements Runnable {
this.initialDelay = initialDelay;
this.interval = interval;
this.threadPool = threadPool;
- this.lastReport = new MeasurementReport();
+ this.cachedReport = new MeasurementReport();
this.facetId = measured.toString();
}
@@ -144,8 +147,16 @@ public class MeasurementCollectorRunnable implements Runnable {
* their {@link MeasurementFacet#getValues()} method should simply be calling this method.
*/
public void getLastValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
- this.requestedMetrics.addAll(metrics);
- report.add(this.lastReport, metrics);
+ requestedMetrics.addAll(metrics);
+ cachedReportLock.lock();
+ try {
+ // For all metrics being requested, take their cached values last collected and transfer them to the given report.
+ // Note that we only remove the metrics that were being requested, leaving any cached data intact so they can
+ // be retreived later when they are requested.
+ report.add(cachedReport, metrics, true);
+ } finally {
+ cachedReportLock.unlock();
+ }
}
/**
@@ -154,11 +165,11 @@ public class MeasurementCollectorRunnable implements Runnable {
* to start the measurement checking that this object performs.
*/
public void start() {
- boolean isStarted = this.started.getAndSet(true);
+ boolean isStarted = started.getAndSet(true);
if (!isStarted) {
task.cancel(true);
task = threadPool.scheduleWithFixedDelay(this, initialDelay, interval, TimeUnit.MILLISECONDS);
- log.debug("measurement collector started: " + this.facetId);
+ log.debug("measurement collector started: " + facetId);
}
}
@@ -168,9 +179,18 @@ public class MeasurementCollectorRunnable implements Runnable {
* to stop the measurement checking that this object performs.
*/
public void stop() {
- this.started.set(false);
- this.task.cancel(true);
- this.requestedMetrics.clear();
+ started.set(false);
+ task.cancel(true);
+
+ cachedReportLock.lock();
+ try {
+ cachedReport = new MeasurementReport();
+ } finally {
+ cachedReportLock.unlock();
+ }
+
+ requestedMetrics.clear();
+
log.debug("measurement collector stopped: " + facetId);
}
@@ -183,12 +203,22 @@ public class MeasurementCollectorRunnable implements Runnable {
log.debug("measurement collector is collecting now: " + facetId);
ClassLoader originalClassloader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(this.contextClassloader);
+ Thread.currentThread().setContextClassLoader(contextClassloader);
try {
- this.measured.getValues(lastReport, requestedMetrics);
+ // collect the new data for all metrics previous requested in the past
+ MeasurementReport newData = new MeasurementReport();
+ measured.getValues(newData, requestedMetrics);
if (log.isDebugEnabled()) {
- log.debug("measurement collector last report: " + lastReport);
+ log.debug("measurement collector latest data: " + newData);
+ }
+
+ // put the new data in our cached report (lastReport)
+ cachedReportLock.lock();
+ try {
+ cachedReport.add(newData, null, false);
+ } finally {
+ cachedReportLock.unlock();
}
} catch (Exception e) {
log.warn("measurement collector failed to get values", e);
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/CollectorThreadPoolTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/CollectorThreadPoolTest.java
index f3a6310..238d1ef 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/CollectorThreadPoolTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/CollectorThreadPoolTest.java
@@ -173,38 +173,136 @@ public class CollectorThreadPoolTest {
runnable.start();
Thread.sleep(1000L);
- report = new MeasurementReport();
- runnable.getLastValues(report, allMetrics); // we are asking for all metrics, and we should have collected them all
- assert 1000 == report.getCollectionTime();
- assert !report.getNumericData().isEmpty();
- assert !report.getTraitData().isEmpty();
- assert !report.getCallTimeData().isEmpty();
-
// now we only ask for individual metrics, not all of them at once
report = new MeasurementReport();
runnable.getLastValues(report, onlyNumericMetric);
assert 1000 == report.getCollectionTime();
- assert !report.getNumericData().isEmpty();
+ assert report.getNumericData().size() == 1;
assert report.getTraitData().isEmpty() : "we didn't ask for the trait data";
assert report.getCallTimeData().isEmpty() : "we didn't ask for the calltime data";
+ // that numeric data should be gone now - if we ask for it again, we shouldn't get it
+ report = new MeasurementReport();
+ runnable.getLastValues(report, onlyNumericMetric);
+ assert 1000 == report.getCollectionTime();
+ assert report.getNumericData().isEmpty() : "the numeric data should have already been retrieved and removed";
+
+ // now ask for the trait data
report = new MeasurementReport();
runnable.getLastValues(report, onlyTraitMetric);
assert 1000 == report.getCollectionTime();
assert report.getNumericData().isEmpty() : "we didn't ask for the numeric data";
- assert !report.getTraitData().isEmpty();
+ assert report.getTraitData().size() == 1;
assert report.getCallTimeData().isEmpty() : "we didn't ask for the calltime data";
+ report = new MeasurementReport();
+ runnable.getLastValues(report, onlyTraitMetric);
+ assert 1000 == report.getCollectionTime();
+ assert report.getTraitData().isEmpty() : "the trait data should have already been retrieved and removed";
+
+ // now ask for the calltime data
report = new MeasurementReport();
runnable.getLastValues(report, onlyCalltimeMetric);
assert 1000 == report.getCollectionTime();
assert report.getNumericData().isEmpty() : "we didn't ask for the numeric data";
assert report.getTraitData().isEmpty() : "we didn't ask for the trait data";
- assert !report.getCallTimeData().isEmpty();
+ assert report.getCallTimeData().size() == 1;
+ report = new MeasurementReport();
+ runnable.getLastValues(report, onlyCalltimeMetric);
+ assert 1000 == report.getCollectionTime();
+ assert report.getCallTimeData().isEmpty() : "the calltime data should have already been retrieved and removed";
runnable.stop();
}
+ @Test(enabled = false)
+ // TODO re-enable this test - it passes
+ public void testMultipleCollectionPeriods() throws Exception {
+ TestMultipleMeasumentFacet component = new TestMultipleMeasumentFacet();
+ Set<MeasurementScheduleRequest> allMetrics = new HashSet<MeasurementScheduleRequest>();
+ allMetrics.add(component.getNumericMetricSchedule());
+ allMetrics.add(component.getTraitMetricSchedule());
+ allMetrics.add(component.getCalltimeMetricSchedule());
+
+ // 123 is too small - the minimum is 60000 so the runnable will bump up our interval to that min value
+ MeasurementCollectorRunnable runnable = new MeasurementCollectorRunnable(component, 0L, 123L, null,
+ this.threadPool.getExecutor());
+
+ runnable.getLastValues(new MeasurementReport(), allMetrics); // prime the pump so we begin collecting everything immediately
+ runnable.start();
+ Thread.sleep(1000L);
+
+ MeasurementReport report = new MeasurementReport();
+ runnable.getLastValues(report, allMetrics);
+ assert 1000L == report.getCollectionTime();
+ assert report.getCallTimeData().size() == 1;
+ assert report.getNumericData().size() == 1;
+ MeasurementDataNumeric nextNumeric = report.getNumericData().iterator().next();
+ assert nextNumeric.getValue() == (double) 1;
+ assert report.getTraitData().size() == 1;
+ MeasurementDataTrait nextTrait = report.getTraitData().iterator().next();
+ assert nextTrait.getValue().equals("1");
+
+ // wait for the next collection interval to occur
+ // don't wait forever, if this fails, we need a way to break the loop. Don't want longer than 75 seconds
+ int loopCount = 0;
+ report = new MeasurementReport();
+ report.setCollectionTime(1000L);
+ System.out.print("CollectorThreadPoolTest.testMultipleCollectionPeriods() waiting");
+ while (loopCount++ < 75 && report.getCollectionTime() == 1000L) {
+ System.out.print('.');
+ Thread.sleep(1000L);
+ runnable.getLastValues(report, allMetrics);
+ }
+ System.out.println("done.");
+
+ assert 1001L == report.getCollectionTime();
+ assert report.getCallTimeData().size() == 1 : report.getCallTimeData();
+ assert report.getNumericData().size() == 1 : report.getNumericData();
+ nextNumeric = report.getNumericData().iterator().next();
+ assert nextNumeric.getValue() == (double) 2 : nextNumeric;
+ assert report.getTraitData().size() == 1 : report.getTraitData();
+ nextTrait = report.getTraitData().iterator().next();
+ assert nextTrait.getValue().equals("2") : nextTrait;
+ }
+
+ public void testLotsOfDataMeasurements() throws Exception {
+ TestLotsOfDataMeasurementFacet component = new TestLotsOfDataMeasurementFacet();
+ Set<MeasurementScheduleRequest> allMetrics = new HashSet<MeasurementScheduleRequest>();
+ allMetrics.add(component.getNumericMetricSchedule());
+ allMetrics.add(component.getTraitMetricSchedule());
+ allMetrics.add(component.getCalltimeMetricSchedule());
+
+ MeasurementCollectorRunnable runnable = new MeasurementCollectorRunnable(component, 0L, 123L, null,
+ this.threadPool.getExecutor());
+
+ runnable.getLastValues(new MeasurementReport(), allMetrics); // prime the pump so we begin collecting everything immediately
+ runnable.start();
+ Thread.sleep(1000L);
+
+ // this tests to make sure we can have multiple data points for a single metric
+ MeasurementReport report = new MeasurementReport();
+ runnable.getLastValues(report, allMetrics);
+ assert 1000L == report.getCollectionTime();
+ assert report.getCallTimeData().size() == 1;
+ CallTimeData nextCalltime = report.getCallTimeData().iterator().next();
+ assert nextCalltime.getValues().size() == 2;
+ assert report.getNumericData().size() == 3;
+ MeasurementDataNumeric nextNumeric = report.getNumericData().iterator().next();
+ assert nextNumeric.getValue() == (double) 1;
+ assert report.getTraitData().size() == 3;
+ MeasurementDataTrait nextTrait = report.getTraitData().iterator().next();
+ assert nextTrait.getValue().equals("1");
+
+ // make sure all the data has been flushed now
+ report = new MeasurementReport();
+ runnable.getLastValues(report, allMetrics);
+ assert 1000L == report.getCollectionTime();
+ assert report.getNumericData().isEmpty();
+ assert report.getTraitData().isEmpty();
+ assert report.getCallTimeData().isEmpty();
+ }
+
protected class TestAvailabilityFacet implements AvailabilityFacet {
private AvailabilityType[] avail;
@@ -248,14 +346,15 @@ public class CollectorThreadPoolTest {
return new MeasurementScheduleRequest(3, "calltime", 30000L, true, DataType.CALLTIME);
}
- private long collectionTime = 1000;
- private int counter = 0;
+ public long collectionTime = 999;
+ public int counter = 0;
@Override
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
counter++;
+ collectionTime++;
log("TestMultipleMeasumentFacet.getValues [" + counter + "]: " + metrics);
- report.setCollectionTime(collectionTime++);
+ report.setCollectionTime(collectionTime);
for (MeasurementScheduleRequest request : metrics) {
if (request.getDataType() == DataType.CALLTIME) {
CallTimeData data = new CallTimeData(request);
@@ -271,6 +370,34 @@ public class CollectorThreadPoolTest {
}
}
}
+ }
+ protected class TestLotsOfDataMeasurementFacet extends TestMultipleMeasumentFacet {
+ @Override
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
+ counter++;
+ collectionTime++;
+ log("TestLotsOfDataMeasurementFacet.getValues [" + counter + "]: " + metrics);
+ report.setCollectionTime(collectionTime);
+ for (MeasurementScheduleRequest request : metrics) {
+ if (request.getDataType() == DataType.CALLTIME) {
+ CallTimeData data = new CallTimeData(request);
+ data.addCallData("dest1", new Date(collectionTime - 900), (long) counter);
+ data.addCallData("dest2", new Date(collectionTime), (long) counter);
+ report.addData(data);
+ } else if (request.getName().equals(NUMERIC_METRIC_NAME)) {
+ report.addData(new MeasurementDataNumeric(collectionTime - 900, request, (double) counter));
+ report.addData(new MeasurementDataNumeric(collectionTime - 800, request, (double) counter));
+ report.addData(new MeasurementDataNumeric(collectionTime, request, (double) counter));
+ } else if (request.getName().equals(TRAIT_METRIC_NAME)) {
+ report.addData(new MeasurementDataTrait(collectionTime - 900, request, "" + counter));
+ report.addData(new MeasurementDataTrait(collectionTime - 800, request, "" + counter));
+ report.addData(new MeasurementDataTrait(collectionTime, request, "" + counter));
+ } else {
+ log.info("bad test - unknown metric: " + request);
+ throw new IllegalStateException("bad test - unknown metric: " + request);
+ }
+ }
+ }
}
}
11 years, 5 months
[rhq] Branch 'bug/783603' - 7 commits - modules/core modules/enterprise modules/plugins pom.xml
by mazz
modules/core/client-api/pom.xml | 437 +-
modules/enterprise/gui/coregui/pom.xml | 773 +--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java | 2
modules/enterprise/server/jar/pom.xml | 2108 +++++-----
modules/enterprise/server/xml-schemas/pom.xml | 465 +-
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java | 24
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java | 81
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/WebservicesComponent.java | 55
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 10
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java | 17
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java | 2
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java | 285 +
modules/plugins/perftest/pom.xml | 472 +-
pom.xml | 5
14 files changed, 2507 insertions(+), 2229 deletions(-)
New commits:
commit e22de0378827499b95d0bb953aeb2e58a35c3ea5
Merge: a1c3d0e 8e3709f
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Jun 27 15:17:49 2012 -0400
Merge remote-tracking branch 'origin/master' into bug/783603
commit 8e3709f8d7a7ffce5b44322a656836be13a7a652
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jun 27 13:24:00 2012 -0400
[Bug 835113 - EJB2 MDBs are DOWN in JON UI]
Restructure getAvailability() and getManagedComponent() to remove
ambiguity in UNKNOWN runState handling as well as provide consistent
Exception throwing/handling, and ManagedComponent refresh. Simplify the
override point for getManagedComponent.
Remove Ejb2BeanComponent's special-handling for UNKNOWN runState, previously committed for
this fix, in favor of the new base handling.
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java
index c4ae68f..95ba080 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java
@@ -27,9 +27,7 @@ import java.util.Set;
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.RunState;
-import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jbossas5.util.Ejb2BeanUtils;
/**
@@ -40,27 +38,15 @@ import org.rhq.plugins.jbossas5.util.Ejb2BeanUtils;
public class Ejb2BeanComponent extends AbstractEjbBeanComponent {
private static final ComponentType MDB_COMPONENT_TYPE = new ComponentType("EJB", "MDB");
+
@Override
- protected AvailabilityType getAvailabilityForRunState(RunState runState) {
- AvailabilityType avail;
- if (MDB_COMPONENT_TYPE.equals(getComponentType())) {
- // This is a workaround for if BZ 835113.
- avail = (runState == RunState.RUNNING || runState == RunState.UNKNOWN) ?
- AvailabilityType.UP : AvailabilityType.DOWN;
- } else {
- avail = super.getAvailabilityForRunState(runState);
+ protected ManagedComponent getManagedComponent(ManagementView mv) throws Exception {
+ if (null == mv) {
+ throw new IllegalArgumentException("managementView can not be null");
}
- return avail;
- }
- @Override
- protected ManagedComponent getManagedComponent() {
if (MDB_COMPONENT_TYPE.equals(getComponentType())) {
try {
- //we need to reload the management view here, because the MDBs might have changed since
- //the last call, because the @object-id is part of their names.
- ManagementView mv = getConnection().getManagementView();
-
Set<ManagedComponent> mdbs = mv.getComponentsForType(MDB_COMPONENT_TYPE);
for (ManagedComponent mdb : mdbs) {
@@ -73,7 +59,7 @@ public class Ejb2BeanComponent extends AbstractEjbBeanComponent {
throw new IllegalStateException(e);
}
} else {
- return super.getManagedComponent();
+ return super.getManagedComponent(mv);
}
return null;
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
index a44cfc8..da0b24b 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
@@ -104,19 +104,21 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
*/
private static final long AVAIL_REFRESH_INTERVAL = 1000 * 60 * 15; // 15 minutes
+ private long availRefreshInterval = AVAIL_REFRESH_INTERVAL;
+
/**
* The ManagedComponent is fetched from the server in {@link #getManagedComponent} throughout
* the life cycle of this resource component. For example during metrics collections
- * when getValues is invoked, getManagedComponent is called. Any time getManagedComponent
+ * when getValues() is invoked, getManagedComponent() is called. Any time getManagedComponent()
* is called the lastComponentRefresh timestamp is updated. This timestamp is used in
* {@link #getAvailability} to determine whether or not a component is needed to
* perform an availability check.
*/
private long lastComponentRefresh = 0L;
- private long availRefreshInterval = AVAIL_REFRESH_INTERVAL;
-
- private RunState runState = RunState.UNKNOWN;
+ // The last known runState for the component. This is used to determine the result of getAvailability(). We
+ // do *not* cache the entire ManagedComponent because it is potentially a huge object that would eat too much memory.
+ private RunState runState;
private String componentName;
private ComponentType componentType;
@@ -124,20 +126,19 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
// ResourceComponent Implementation --------------------------------------------
public AvailabilityType getAvailability() {
- if (lastComponentRefresh == 0) {
- // The managed component has not been refreshed at all yet.
- getManagedComponent();
- } else {
- long timeSinceComponentRefresh = System.currentTimeMillis() - lastComponentRefresh;
- if (timeSinceComponentRefresh > availRefreshInterval) {
- if (log.isDebugEnabled()) {
- log.debug("The availability refresh interval for [resourceKey: "
- + getResourceContext().getResourceKey() + ", type: " + componentType + ", name: " + componentName
- + "] has been exceeded by " + (timeSinceComponentRefresh - availRefreshInterval)
- + " ms. Reloading managed component...");
- }
- getManagedComponent();
+ long timeSinceComponentRefresh = System.currentTimeMillis() - lastComponentRefresh;
+ boolean refresh = timeSinceComponentRefresh > availRefreshInterval;
+
+ if (refresh) {
+ if (lastComponentRefresh > 0L && log.isDebugEnabled()) {
+ log.debug("The availability refresh interval for [resourceKey: "
+ + getResourceContext().getResourceKey() + ", type: " + componentType + ", name: " + componentName
+ + "] has been exceeded by " + (timeSinceComponentRefresh - availRefreshInterval)
+ + " ms. Reloading managed component...");
}
+
+ ManagedComponent managedComponent = getManagedComponent();
+ runState = managedComponent.getRunState();
}
return getAvailabilityForRunState(runState);
@@ -146,11 +147,14 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
protected AvailabilityType getAvailabilityForRunState(RunState runState) {
if (runState == RunState.RUNNING) {
return AvailabilityType.UP;
+
} else {
if (log.isDebugEnabled()) {
- log.debug(componentType + " component '" + componentName + "' was not running - state was [" + runState
- + "].");
+ log.debug("Returning DOWN avail for " + componentType + " component '" + componentName
+ + "' with runState [" + runState
+ + "].");
}
+
return AvailabilityType.DOWN;
}
}
@@ -438,29 +442,58 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
return componentName;
}
+ /**
+ * This method should most likely not be overridden. Instead, override {@link #getManagedComponent(ManagementView)}.
+ * <br/><br/>
+ * IMPORTANT!!! The returned ManagedComponent SHOULD NOT be cached in the instance. It is potentially a memory hog.
+ *
+ * @return The ManagedComponent
+ * @throws RuntimeException if fetching the ManagementView or getting the component fails
+ * @throws IllegalStateException if the managedComponent is null/not found
+ */
+ @NotNull
protected ManagedComponent getManagedComponent() {
ManagedComponent managedComponent;
+
try {
ManagementView managementView = getConnection().getManagementView();
- managedComponent = managementView.getComponent(this.componentName, this.componentType);
+ managedComponent = getManagedComponent(managementView);
} catch (Exception e) {
- runState = RunState.UNKNOWN;
throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent ["
+ this.componentName + "].", e);
}
+
+ // Even if not found, update the refresh time. It will avoid too many costly, and potentially fruitless, fetches
+ lastComponentRefresh = System.currentTimeMillis();
+
if (managedComponent == null) {
- runState = RunState.UNKNOWN;
throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named ["
+ this.componentName + "].");
}
+
if (log.isTraceEnabled()) {
log.trace("Retrieved " + toString(managedComponent) + ".");
}
- lastComponentRefresh = System.currentTimeMillis();
- runState = managedComponent.getRunState();
+
return managedComponent;
}
+ /**
+ * This is an override point. When actually fetching the managed component, this entry point should not be
+ * used. Instead, access should be via {@link #getManagedComponent()}.
+ *
+ * @param managementView
+ * @return the ManagedComponent. Null if not found.
+ * @Throws Exception if there is a problem getting the component.
+ */
+ protected ManagedComponent getManagedComponent(ManagementView managementView) throws Exception {
+ if (null == managementView) {
+ throw new IllegalArgumentException("managementView can not be null");
+ }
+
+ return managementView.getComponent(this.componentName, this.componentType);
+ }
+
@NotNull
private OperationDefinition getOperationDefinition(String operationName) {
ResourceType resourceType = getResourceContext().getResourceType();
commit 4699b70c9bde96b1c95c89e7e9b32e6ff73ad860
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed Jun 27 15:55:28 2012 +0200
formatting only
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 834ad85..6f6a937 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -1,285 +1,288 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ </parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <packaging>jar</packaging>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <packaging>jar</packaging>
- <name>RHQ Client API</name>
- <description>Server and Client APIs for invoking operations on the RHQ plugin container</description>
+ <name>RHQ Client API</name>
+ <description>Server and Client APIs for invoking operations on the RHQ plugin container</description>
- <dependencies>
+ <dependencies>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-comm-api</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-comm-api</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-common-drift</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-common-drift</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- TODO: This is a fix for the Javac bug requiring annotations to be
available when compiling dependent classes; it is fixed in JDK 6. -->
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>hibernate-all</artifactId>
- <version>1.0.0.Alpha9</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>hibernate-all</artifactId>
+ <version>1.0.0.Alpha9</version>
+ <scope>provided</scope>
<!-- set scope to 'provided', so Hibernate annotations can be used in the entities -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>jboss-ejb3-all</artifactId>
- <version>1.0.0.Alpha9</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>jboss-ejb3-all</artifactId>
+ <version>1.0.0.Alpha9</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
<!--<scope>test</scope> not sure about this -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>commons-jxpath</groupId>
- <artifactId>commons-jxpath</artifactId>
- <version>1.3</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>com.sun.tools.xjc.maven2</groupId>
- <artifactId>maven-jaxb-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.sun.tools.xjc.maven2</groupId>
+ <artifactId>maven-jaxb-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
<configuration>
- <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ <includes>
+ <include>org/rhq/core/clientapi/shared/**</include>
+ </includes>
</configuration>
- </plugin>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-xjc-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
<configuration>
- <source>1.6</source>
+ <sources>
+ <source>${basedir}/target/generated-sources/xjc</source>
+ </sources>
</configuration>
- </plugin>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <configuration>
- <includes>
- <include>org/rhq/core/clientapi/shared/**</include>
- </includes>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <profiles>
+
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/lib</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
+ <artifactId>maven-antrun-plugin</artifactId>
<executions>
+
<execution>
- <id>add-xjc-source</id>
- <phase>generate-sources</phase>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${rhq.deploymentDir}"/>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/>
+ </target>
+ </configuration>
<goals>
- <goal>add-source</goal>
+ <goal>run</goal>
</goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
<configuration>
- <sources>
- <source>${basedir}/target/generated-sources/xjc</source>
- </sources>
+ <target>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}"/>
+ </target>
</configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
+
</executions>
</plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>dev</id>
-
- <properties>
- <rhq.rootDir>../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/lib</rhq.deploymentDir>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <mkdir dir="${rhq.deploymentDir}" />
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Updating ${deployment.file}...</echo>
- <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Deleting ${deployment.file}...</echo>
- <delete file="${deployment.file}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
+ </plugins>
+ </build>
+ </profile>
<profile>
<id>cobertura</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.cobertura</groupId>
- <artifactId>cobertura</artifactId>
- <version>${cobertura.version}</version>
- </dependency>
- </dependencies>
- <executions>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>${cobertura.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
<execution>
- <id>cobertura-instrument</id>
- <phase>process-test-classes</phase>
- <configuration>
- <target>
+ <id>cobertura-instrument</id>
+ <phase>process-test-classes</phase>
+ <configuration>
+ <target>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/cobertura/backup" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
- <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
+ <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- create a properties file and save there location of cobertura data file-->
- <touch file="target/classes/cobertura.properties" />
- <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <touch file="target/classes/cobertura.properties"/>
+ <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
- <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser" todir="${project.build.directory}/classes">
- <fileset dir="${project.build.directory}/classes">
- <include name="**/*.class" />
+ <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
+ todir="${project.build.directory}/classes">
+ <fileset dir="${project.build.directory}/classes">
+ <include name="**/*.class"/>
</fileset>
</cobertura-instrument>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
<execution>
- <id>cobertura-report</id>
- <phase>prepare-package</phase>
- <configuration>
- <target>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <id>cobertura-report</id>
+ <phase>prepare-package</phase>
+ <configuration>
+ <target>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/site/cobertura" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
- <copy toDir="target/classes" verbose="true" overwrite="true">
+ <copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- delete backup folder-->
- <delete dir="target/cobertura/backup" />
+ <delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
- <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura">
+ <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
+ destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.java" />
+ <include name="**/*.java"/>
</fileset>
- </cobertura-report>
+ </cobertura-report>
<!-- delete cobertura.properties file -->
- <delete file="target/classes/cobertura.properties" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <delete file="target/classes/cobertura.properties"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 29662c8..e3aca30 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -1,33 +1,34 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
<groupId>org.rhq</groupId>
- <artifactId>rhq-coregui</artifactId>
- <packaging>war</packaging>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-coregui</artifactId>
+ <packaging>war</packaging>
- <name>RHQ Enterprise Core GUI</name>
- <description>the RHQ Enterprise Core GUI webapp</description>
+ <name>RHQ Enterprise Core GUI</name>
+ <description>the RHQ Enterprise Core GUI webapp</description>
- <properties>
+ <properties>
<!-- dependency versions -->
- <gwt.version>2.4.0</gwt.version>
- <smartgwt.version>3.0</smartgwt.version>
+ <gwt.version>2.4.0</gwt.version>
+ <smartgwt.version>3.0</smartgwt.version>
<!-- If this is too much memory to allocate to your gwt:debug process then override this property in
in your settings.xml -->
- <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs>
- <gwt-plugin.localWorkers>4</gwt-plugin.localWorkers>
+ <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs>
+ <gwt-plugin.localWorkers>4</gwt-plugin.localWorkers>
- <coreGuiParams />
- <coreGuiRunTarget>'http://localhost:7080/coregui/CoreGUI.html${coreGuiParams}'</coreGuiRunTarget>
+ <coreGuiParams/>
+ <coreGuiRunTarget>'http://localhost:7080/coregui/CoreGUI.html${coreGuiParams}'</coreGuiRunTarget>
<!--
This property is substituted, by the resource plugin during the resources phase, as the
@@ -52,201 +53,201 @@
Multiple agents can be specified as a comma-delimited list, as demonstrated by the default
value below.
-->
- <gwt.userAgent>ie8,ie9,gecko1_8,safari,opera</gwt.userAgent>
+ <gwt.userAgent>ie8,ie9,gecko1_8,safari,opera</gwt.userAgent>
<!-- Change this to "true" via the mvn command line or your ~/.m2/settings.xml to speed
up gwt compilation. -->
- <gwt.draftCompile>false</gwt.draftCompile>
+ <gwt.draftCompile>false</gwt.draftCompile>
<!-- Change this to "true" via the mvn command line or your ~/.m2/settings.xml to generate report -->
- <gwt.soyc>false</gwt.soyc>
+ <gwt.soyc>false</gwt.soyc>
<!-- Change this to "DETAILED" via the mvn command line or your ~/.m2/settings.xml to
make sure GWT-generated JavaScript code is not obfuscated. -->
- <gwt.style>PRETTY</gwt.style>
+ <gwt.style>PRETTY</gwt.style>
<!-- Comma-separated list of the locales that should be included during GWT compilation. The specified locales
should each have two corresponding message bundle properties files under
src/main/resources/org/rhq/enterprise/gui/coregui/client/. For example, the "ja" locale has
Messages_ja.properties and MessageConstants_ja.properties. -->
- <gwt.locale>en,de,ja,pt,zh,ru,cs</gwt.locale>
+ <gwt.locale>en,de,ja,pt,zh,ru,cs</gwt.locale>
<!-- The locale that GWT should fallback to if the user specified an unsupported locale via the 'locale' query
string parameter. -->
- <gwt.fallback.locale>en</gwt.fallback.locale>
-
- <enable.tags>true</enable.tags>
- </properties>
+ <gwt.fallback.locale>en</gwt.fallback.locale>
+
+ <enable.tags>true</enable.tags>
+ </properties>
- <dependencies>
+ <dependencies>
<!-- ============= Internal Deps ============= -->
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
<!-- by rhq.ear (as ejb-jar) -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
<!-- by rhq.ear (as ejb-jar) -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-util</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-util</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
<!-- by rhq.ear -->
- </dependency>
+ </dependency>
<!-- =============== 3rd Party Deps =============== -->
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-servlet</artifactId>
- <version>${gwt.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
- <version>${gwt.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- This is so we can compile custom GWT Generators to be called during gwt compilation.
Is is not needed at runtime and so is not included in the WAR. -->
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-dev</artifactId>
- <version>${gwt.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>com.smartgwt</groupId>
- <artifactId>smartgwt</artifactId>
- <version>${smartgwt.version}</version>
- </dependency>
+ <dependency>
+ <groupId>com.smartgwt</groupId>
+ <artifactId>smartgwt</artifactId>
+ <version>${smartgwt.version}</version>
+ </dependency>
<!-- the GWT graphing library (note, this provides jquery 1.3.2. If we get rid of GFlot we will need
to provide jquery explcitly for jquery.sparkline support. See CoreGUI.gwt.xml for the jquery.sparkline
declaration and coregui/webapp/js for the lib inclusion.) -->
- <dependency>
- <groupId>ca.nanometrics</groupId>
- <artifactId>gflot</artifactId>
- <version>1.0.0</version>
- </dependency>
+ <dependency>
+ <groupId>ca.nanometrics</groupId>
+ <artifactId>gflot</artifactId>
+ <version>1.0.0</version>
+ </dependency>
<!-- for file uploads -->
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.3.1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.opensymphony.quartz</groupId>
- <artifactId>quartz</artifactId>
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope>
+ <scope>provided</scope>
<!-- by JBossAS itself, which the container buildNodes has packaged with 1.6.5 -->
- </dependency>
+ </dependency>
<!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
- <dependency>
- <groupId>hibernate-annotations</groupId>
- <artifactId>hibernate-annotations</artifactId>
+ <dependency>
+ <groupId>hibernate-annotations</groupId>
+ <artifactId>hibernate-annotations</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
<!-- transitive dependency needed for JspC -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
<!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
<!-- needed for EJB3 annotations (e.g. ApplicationException) -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3x</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
<!-- Needed due to JDK 1.5 bug. -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-annotations-ejb3</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
- <version>3.0.1-native-2.0.4.GA</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <dependency>
+ <groupId>jboss.jbossws</groupId>
+ <artifactId>jboss-jaxws</artifactId>
+ <version>3.0.1-native-2.0.4.GA</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <finalName>coregui</finalName>
+ <build>
+ <finalName>coregui</finalName>
- <resources>
- <resource>
- <targetPath>${project.build.directory}/generated-sources/gwt</targetPath>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
+ <resources>
+ <resource>
+ <targetPath>${project.build.directory}/generated-sources/gwt</targetPath>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
<!--
Do NOT include java files here, because otherwise the java files from
resources would end up in WEB-INF/classes which definitely not something
@@ -259,110 +260,110 @@
need to replace the ${...} place-holders with the build-provided values
in there.
-->
- <includes>
- <include>**/*.gwt.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </resource>
- </resources>
-
-
- <plugins>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>gwt-maven-plugin</artifactId>
- <version>2.4.0</version>
- <configuration>
- <noServer>true</noServer>
- <inplace>false</inplace>
+ <includes>
+ <include>**/*.gwt.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </resource>
+ </resources>
+
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <version>2.4.0</version>
+ <configuration>
+ <noServer>true</noServer>
+ <inplace>false</inplace>
<!-- <logLevel>INFO' -bindAddress 0.0.0.0 -logLevel 'INFO</logLevel> -->
- <logLevel>INFO</logLevel>
- <runTarget>${coreGuiRunTarget}</runTarget>
- <extraJvmArgs>${gwt-plugin.extraJvmArgs}</extraJvmArgs>
- <localWorkers>${gwt-plugin.localWorkers}</localWorkers>
- <draftCompile>${gwt.draftCompile}</draftCompile>
- <soyc>${gwt.soyc}</soyc>
- <buildOutputDirectory>target/gwtclasses</buildOutputDirectory>
- <hostedWebapp>target/hostedWar</hostedWebapp>
- <debugSuspend>false</debugSuspend>
- <servicePattern>**/gwt/*GWTService.java</servicePattern>
- <i18nMessagesBundle>org.rhq.enterprise.gui.coregui.client.Messages</i18nMessagesBundle>
- <i18nConstantsWithLookupBundle>org.rhq.enterprise.gui.coregui.client.MessageConstants</i18nConstantsWithLookupBundle>
- <compileSourcesArtifact>org.rhq:rhq-core-domain</compileSourcesArtifact>
- <style>${gwt.style}</style>
- <strict>true</strict>
+ <logLevel>INFO</logLevel>
+ <runTarget>${coreGuiRunTarget}</runTarget>
+ <extraJvmArgs>${gwt-plugin.extraJvmArgs}</extraJvmArgs>
+ <localWorkers>${gwt-plugin.localWorkers}</localWorkers>
+ <draftCompile>${gwt.draftCompile}</draftCompile>
+ <soyc>${gwt.soyc}</soyc>
+ <buildOutputDirectory>target/gwtclasses</buildOutputDirectory>
+ <hostedWebapp>target/hostedWar</hostedWebapp>
+ <debugSuspend>false</debugSuspend>
+ <servicePattern>**/gwt/*GWTService.java</servicePattern>
+ <i18nMessagesBundle>org.rhq.enterprise.gui.coregui.client.Messages</i18nMessagesBundle>
+ <i18nConstantsWithLookupBundle>org.rhq.enterprise.gui.coregui.client.MessageConstants</i18nConstantsWithLookupBundle>
+ <compileSourcesArtifact>org.rhq:rhq-core-domain</compileSourcesArtifact>
+ <style>${gwt.style}</style>
+ <strict>true</strict>
<!-- compiles gwt artifacts like symbolMap outside of war so it doesnt get packaged -->
- <deploy>${project.build.directory}/gwt-deploy</deploy>
- </configuration>
-
- <executions>
- <execution>
- <id>gwt-goals</id>
- <goals>
- <goal>compile</goal>
- <goal>generateAsync</goal>
- <goal>i18n</goal>
- </goals>
- </execution>
- <execution>
+ <deploy>${project.build.directory}/gwt-deploy</deploy>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>gwt-goals</id>
+ <goals>
+ <goal>compile</goal>
+ <goal>generateAsync</goal>
+ <goal>i18n</goal>
+ </goals>
+ </execution>
+ <execution>
<!-- This id is what does the trick, don't change it. For this to work maven 2.2.0 and later is needed. -->
- <id>default-cli</id>
- <goals>
- <goal>debug</goal>
- </goals>
- <configuration>
- <module>org.rhq.enterprise.gui.coregui.CoreGUI</module>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Build-Number>${buildNumber}</Build-Number>
- </manifestEntries>
- </archive>
- <webResources>
- <resource>
- <filtering>false</filtering>
- <directory>${basedir}/src/main/webapp</directory>
- </resource>
- </webResources>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-gwt-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources/gwt</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <id>default-cli</id>
+ <goals>
+ <goal>debug</goal>
+ </goals>
+ <configuration>
+ <module>org.rhq.enterprise.gui.coregui.CoreGUI</module>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Build-Number>${buildNumber}</Build-Number>
+ </manifestEntries>
+ </archive>
+ <webResources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>${basedir}/src/main/webapp</directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-gwt-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/generated-sources/gwt</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<!--
<plugin>
@@ -406,36 +407,36 @@
</executions>
</plugin>
-->
- </plugins>
+ </plugins>
- </build>
+ </build>
- <profiles>
- <profile>
- <id>dev</id>
+ <profiles>
+ <profile>
+ <id>dev</id>
- <properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
- <rhq.deploymentDir>
- ${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
+ <rhq.deploymentDir>
+ ${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}
</rhq.deploymentDir>
- </properties>
+ </properties>
- <build>
- <plugins>
+ <build>
+ <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
- <execution>
- <id>deploy-classes</id>
- <phase>compile</phase>
- <configuration>
- <target>
+ <execution>
+ <id>deploy-classes</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
<!--
<property name="classes.dir" location="${rhq.deploymentDir}/WEB-INF/classes" />
<echo>*** Copying updated files from target/${project.buildNodes.finalName}/WEB-INF/classes to ${classes.dir}...</echo>
@@ -443,126 +444,126 @@
<fileset dir="war/WEB-INF/classes" />
</copy>
-->
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from
- src${file.separator}main${file.separator}webapp${file.separator} to
- ${deployment.dir}${file.separator}...
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Copying updated files from
+ src${file.separator}main${file.separator}webapp${file.separator} to
+ ${deployment.dir}${file.separator}...
</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="${basedir}/src/main/webapp" />
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>deploy</id>
- <phase>package</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from
- target${file.separator}${project.build.finalName}${file.separator} to
- ${deployment.dir}${file.separator}...
+ <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
+ <fileset dir="${basedir}/src/main/webapp"/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Copying updated files from
+ target${file.separator}${project.build.finalName}${file.separator} to
+ ${deployment.dir}${file.separator}...
</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="${basedir}/target/${project.build.finalName}" />
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
- <delete dir="${deployment.dir}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
+ <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
+ <fileset dir="${basedir}/target/${project.build.finalName}"/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
+ <delete dir="${deployment.dir}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
<!-- Change the runTarget to not have single quotes. The quotes work for linux but not win -->
- <profile>
- <id>windows</id>
- <activation>
- <os>
- <family>Windows</family>
- </os>
- </activation>
- <properties>
- <coreGuiRunTarget>http://localhost:7080/coregui/CoreGUI.html${coreGuiParams}</coreGuiRunTarget>
- </properties>
- </profile>
-
- <profile>
- <id>msg</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <includes>
- <include>org/rhq/enterprise/gui/coregui/client/Messages*.java</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>disable-tags</id>
- <activation>
- <property>
- <name>brew</name>
- </property>
- </activation>
- <properties>
- <enable.tags>false</enable.tags>
- </properties>
- </profile>
-
- </profiles>
-
-
- <repositories>
- <repository>
- <id>smartgwt</id>
- <name>SmartGWT Releases</name>
- <url>http://www.smartclient.com/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
-
- <repository>
- <id>codehaus</id>
- <name>Codehaus Releases</name>
- <url>http://repository.codehaus.org/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
-
- </repositories>
+ <profile>
+ <id>windows</id>
+ <activation>
+ <os>
+ <family>Windows</family>
+ </os>
+ </activation>
+ <properties>
+ <coreGuiRunTarget>http://localhost:7080/coregui/CoreGUI.html${coreGuiParams}</coreGuiRunTarget>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>msg</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>org/rhq/enterprise/gui/coregui/client/Messages*.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>disable-tags</id>
+ <activation>
+ <property>
+ <name>brew</name>
+ </property>
+ </activation>
+ <properties>
+ <enable.tags>false</enable.tags>
+ </properties>
+ </profile>
+
+ </profiles>
+
+
+ <repositories>
+ <repository>
+ <id>smartgwt</id>
+ <name>SmartGWT Releases</name>
+ <url>http://www.smartclient.com/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ <repository>
+ <id>codehaus</id>
+ <name>Codehaus Releases</name>
+ <url>http://repository.codehaus.org/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
</project>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index bf10fc1..aa0aad3 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -1,95 +1,96 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
- <artifactId>rhq-enterprise-server</artifactId>
- <packaging>ejb</packaging>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <packaging>ejb</packaging>
- <name>RHQ Enterprise Server JAR</name>
- <description>RHQ enterprise server main JAR</description>
+ <name>RHQ Enterprise Server JAR</name>
+ <description>RHQ enterprise server main JAR</description>
- <properties>
- <rhq.server.datasource>java:/RHQDS</rhq.server.datasource>
- <rhq.server.ds-mapping>PostgreSQL</rhq.server.ds-mapping>
+ <properties>
+ <rhq.server.datasource>java:/RHQDS</rhq.server.datasource>
+ <rhq.server.ds-mapping>PostgreSQL</rhq.server.ds-mapping>
<!-- dependency versions -->
- <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version>
+ <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version>
- <clean.db>true</clean.db>
- </properties>
+ <clean.db>true</clean.db>
+ </properties>
- <dependencies>
+ <dependencies>
<!-- Internal Deps -->
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-comm</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope> <!-- by ear -->
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-dbutils</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>safe-invoker</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-common-drift</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-container-lib</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.java-diff-utils</groupId>
- <artifactId>diffutils</artifactId>
- <version>1.2.1</version>
- </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-comm</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by ear -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-dbutils</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>safe-invoker</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-common-drift</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-container-lib</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.java-diff-utils</groupId>
+ <artifactId>diffutils</artifactId>
+ <version>1.2.1</version>
+ </dependency>
<!--================ Test Deps ================-->
@@ -99,1103 +100,1114 @@
need the embeddable-ejb3 jar above the standard ejb3 jars because we need the embeddble packages
loaded when testing. -->
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>test-utils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.rhq.helpers</groupId>
- <artifactId>perftest-support</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant-launcher</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>jboss-ejb3-all</artifactId>
- <version>${jboss-embeddable-ejb3.version}</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq.helpers</groupId>
+ <artifactId>perftest-support</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant-launcher</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>jboss-ejb3-all</artifactId>
+ <version>${jboss-embeddable-ejb3.version}</version>
+ <scope>test</scope>
+ </dependency>
<!-- NOTE: The remaining test deps correspond to the classes contained in hibernate-all.jar and thirdparty-all.jar. -->
- <dependency>
- <groupId>antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>2.7.7</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>2.7.7</version>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- <version>1.0.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>${xercesImpl.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sf.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- <version>1.8</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-jxpath</groupId>
- <artifactId>commons-jxpath</artifactId>
- <version>1.3</version>
- <scope>test</scope>
- </dependency>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>${xercesImpl.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>1.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
<!-- 3rd Party Deps -->
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>3.2</version>
- </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>3.2</version>
+ </dependency>
<!-- Required by a couple APL and Lather classes - TODO: Remove this once APL and Lather have been excised. -->
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.6.1</version>
- </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.6.1</version>
+ </dependency>
<!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
<!-- also required by EJB3 Embedded (test scope) -->
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
<!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>1.1.4</version>
- </dependency>
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.1.4</version>
+ </dependency>
<!-- required by RHQ server classes, as well as EJB3 Embedded -->
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>1.6.1-jboss</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>gnu-getopt</groupId>
- <artifactId>getopt</artifactId>
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1-jboss</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>gnu-getopt</groupId>
+ <artifactId>getopt</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
+ <dependency>
+ <groupId>hibernate</groupId>
+ <artifactId>hibernate3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>hibernate-annotations</groupId>
- <artifactId>hibernate-annotations</artifactId>
+ <dependency>
+ <groupId>hibernate-annotations</groupId>
+ <artifactId>hibernate-annotations</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>hibernate-entitymanager</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
+ <dependency>
+ <groupId>hibernate-entitymanager</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>i18nlog</groupId>
- <artifactId>i18nlog</artifactId>
- </dependency>
+ <dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
<!-- The Sun javamail jar isn't available from a public repo due to licensing issues,
so use the Geronimo one instead. -->
- <version>1.3</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-annotations-ejb3</artifactId>
+ <version>1.3</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-cache</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-cache</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>compile</scope>
- </dependency>
+ <scope>compile</scope>
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3x</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
<!-- includes the org.jboss.ejb3.StrictMaxPool class, which is needed by the PoolClass annotation used on some
of our SLSB's -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-jmx</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jmx</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-system</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-system</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbosssx</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbosssx</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbpm</artifactId>
- <version>3.1.1</version>
- </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>3.1.1</version>
+ </dependency>
<!-- for the transaction interrupt EJB3 interceptor -->
- <dependency>
- <groupId>org.jboss.transaction</groupId>
- <artifactId>jboss-jta</artifactId>
+ <dependency>
+ <groupId>org.jboss.transaction</groupId>
+ <artifactId>jboss-jta</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
<!-- TODO: remove this - tests should all be moved under the test source tree -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.opensymphony.quartz</groupId>
- <artifactId>quartz</artifactId>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
+ </dependency>
- <dependency>
- <groupId>org.opensymphony.quartz</groupId>
- <artifactId>quartz-oracle</artifactId>
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz-oracle</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymockclassextension</artifactId>
- <version>2.2</version>
- <scope>test</scope>
+ <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
<!-- somehow this is needed otherwise the hibernate stuff doesn't initialize in our tests -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.snmp4j</groupId>
- <artifactId>snmp4j</artifactId>
- <version>1.8.2</version>
- </dependency>
+ <dependency>
+ <groupId>org.snmp4j</groupId>
+ <artifactId>snmp4j</artifactId>
+ <version>1.8.2</version>
+ </dependency>
<!-- required by RHQ server classes, as well as EJB3 Embedded -->
- <dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4</version>
- </dependency>
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4</version>
+ </dependency>
<!-- TODO: Why is this needed? -->
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
<!--<scope>test</scope>-->
- </dependency>
-
- <dependency>
- <groupId>rss4j</groupId>
- <artifactId>rss4j</artifactId>
- <version>0.92-on.2</version>
- </dependency>
-
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>5.5.20</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>tomcat-jk</artifactId>
- <version>4.1.31</version>
- <scope>provided</scope>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>rss4j</groupId>
+ <artifactId>rss4j</artifactId>
+ <version>0.92-on.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>5.5.20</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>tomcat-jk</artifactId>
+ <version>4.1.31</version>
+ <scope>provided</scope>
+ </dependency>
<!-- Needed by com.jboss.jbossnetwork.apl.actions.xml.XPathProcessor; TODO: Remove once APL has been excised. -->
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.5.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.29</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope> <!-- by container -->
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jackson-provider</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope> <!-- by container -->
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-links</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope> <!-- by container -->
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-yaml-provider</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxb-provider</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.xml.stream</groupId>
- <artifactId>sjsxp</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.wordnik</groupId>
- <artifactId>swagger-annotations_2.9.1</artifactId>
- <version>1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.rhq.helpers</groupId>
- <artifactId>rest-docs-generator</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>1.8</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- <version>2.0.1.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>2.3.18</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-module-testng</artifactId>
- <version>${powermock.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
- <version>${powermock.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.liquibase</groupId>
- <artifactId>liquibase-core</artifactId>
- <version>2.0.3</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${project.artifactId}</finalName>
-
- <resources>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.5.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.29</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope> <!-- by container -->
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jackson-provider</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope> <!-- by container -->
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-links</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope> <!-- by container -->
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-yaml-provider</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxb-provider</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.stream</groupId>
+ <artifactId>sjsxp</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.wordnik</groupId>
+ <artifactId>swagger-annotations_2.9.1</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq.helpers</groupId>
+ <artifactId>rest-docs-generator</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <version>2.0.1.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.18</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-testng</artifactId>
+ <version>${powermock.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>${powermock.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.liquibase</groupId>
+ <artifactId>liquibase-core</artifactId>
+ <version>2.0.3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+
+ <resources>
<!-- Redefine which directories to treat like resources (which are filtered). -->
- <resource>
- <directory>src/main/filtered-sources/java</directory>
- <filtering>true</filtering>
- <targetPath>../filtered-sources/java</targetPath>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
-
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- </testResources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-ejb-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <generateClient>true</generateClient>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <phase>process-classes</phase>
- <configuration>
- <target>
+ <resource>
+ <directory>src/main/filtered-sources/java</directory>
+ <filtering>true</filtering>
+ <targetPath>../filtered-sources/java</targetPath>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <generateClient>true</generateClient>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <phase>process-classes</phase>
+ <configuration>
+ <target>
<!-- generate the I18N resource bundles -->
- <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask" />
+ <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask"/>
- <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false" verify="true">
- <classpath refid="maven.runtime.classpath" />
- <classfileset dir="${project.build.outputDirectory}">
- <include name="**/ServerI18NResourceKeys.class" />
- <include name="**/AlertI18NResourceKeys.class" />
- </classfileset>
- </i18n>
+ <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false"
+ verify="true">
+ <classpath refid="maven.runtime.classpath"/>
+ <classfileset dir="${project.build.outputDirectory}">
+ <include name="**/ServerI18NResourceKeys.class"/>
+ <include name="**/AlertI18NResourceKeys.class"/>
+ </classfileset>
+ </i18n>
<!-- create our rhq-server-version.properties file that goes in our jar -->
- <tstamp>
- <format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z" />
- </tstamp>
-
- <echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
-Product-Version=${project.version}
-Module-Name=${project.name}
-Module-Version=${project.version}
-Build-Number=${buildNumber}
-Build-Date=${build.time}
-Build-Jdk-Vendor=${java.vendor}
-Build-Jdk=${java.version}
-Build-OS-Name=${os.name}
-Build-OS-Version=${os.version}
+ <tstamp>
+ <format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z"/>
+ </tstamp>
+
+ <echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
+ Product-Version=${project.version}
+ Module-Name=${project.name}
+ Module-Version=${project.version}
+ Build-Number=${buildNumber}
+ Build-Date=${build.time}
+ Build-Jdk-Vendor=${java.vendor}
+ Build-Jdk=${java.version}
+ Build-OS-Name=${os.name}
+ Build-OS-Version=${os.version}
</echo>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
<!-- in order to get JMS to work properly in embedded test container, extract jms-rs.rar classes -->
- <execution>
- <id>Extract JMS classes from RAR needed for JMS tests</id>
- <phase>process-classes</phase>
- <configuration>
- <target>
- <unzip src="src/test/resources/jms-ra.rar" dest="target">
- <patternset>
- <include name="jms-ra.jar"/>
- </patternset>
- </unzip>
- <unzip src="target/jms-ra.jar" dest="target/test-classes">
- <patternset>
- <include name="org/**"/>
- </patternset>
- </unzip>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>Extract JMS classes from RAR needed for JMS tests</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <target>
+ <unzip src="src/test/resources/jms-ra.rar" dest="target">
+ <patternset>
+ <include name="jms-ra.jar"/>
+ </patternset>
+ </unzip>
+ <unzip src="target/jms-ra.jar" dest="target/test-classes">
+ <patternset>
+ <include name="org/**"/>
+ </patternset>
+ </unzip>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- </executions>
- </plugin>
+ </executions>
+ </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
<!-- Everything but the web service tests, this is the standard test execution -->
- <configuration>
- <skipTests>true</skipTests>
- <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
- <groups>${rhq.testng.includedGroups}</groups>
- <properties>
- <property>
- <name>listener</name>
- <value>org.rhq.test.testng.StdoutReporter</value>
- </property>
- </properties>
- <systemPropertyVariables>
- <embeddedDeployment>true</embeddedDeployment>
- <deploymentDirectory>target/classes</deploymentDirectory>
- <hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
- <clean.db>${clean.db}</clean.db>
- <log4j.configDebug>false</log4j.configDebug>
- </systemPropertyVariables>
- <additionalClasspathElements>
+ <configuration>
+ <skipTests>true</skipTests>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <groups>${rhq.testng.includedGroups}</groups>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.rhq.test.testng.StdoutReporter</value>
+ </property>
+ </properties>
+ <systemPropertyVariables>
+ <embeddedDeployment>true</embeddedDeployment>
+ <deploymentDirectory>target/classes</deploymentDirectory>
+ <hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
+ <clean.db>${clean.db}</clean.db>
+ <log4j.configDebug>false</log4j.configDebug>
+ </systemPropertyVariables>
+ <additionalClasspathElements>
<!-- The below is required for tests to run against Oracle. -->
- <additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
- </additionalClasspathElements>
+ <additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
+ </additionalClasspathElements>
+ </configuration>
+
+ <executions>
+
+ <execution>
+ <id>allExceptDbTests</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skipTests>${skipTests}</skipTests>
+ <excludes>
+ <exclude>com/**/*.java</exclude>
+ <exclude>org/rhq/**/performance/**/*.java</exclude>
+ <exclude>org/rhq/enterprise/server/db/**</exclude>
+ </excludes>
</configuration>
-
- <executions>
-
- <execution>
- <id>allExceptDbTests</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skipTests>${skipTests}</skipTests>
- <excludes>
- <exclude>com/**/*.java</exclude>
- <exclude>org/rhq/**/performance/**/*.java</exclude>
- <exclude>org/rhq/enterprise/server/db/**</exclude>
- </excludes>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.antlr</groupId>
- <artifactId>antlr3-maven-plugin</artifactId>
- <version>3.2</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>antlr</goal>
- </goals>
- <configuration>
- <conversionTimeout>30000</conversionTimeout>
- <debug>false</debug>
- <dfa>false</dfa>
- <nfa>false</nfa>
- <excludes>
-
- </excludes>
- <includes>
-
- </includes>
- <libDirectory>src/main/antlr3/imports</libDirectory>
- <messageFormat>antlr</messageFormat>
- <outputDirectory>target/generated-sources/antlr3</outputDirectory>
- <printGrammar>false</printGrammar>
- <profile>false</profile>
- <report>false</report>
- <sourceDirectory>src/main/antlr3</sourceDirectory>
- <trace>false</trace>
- <verbose>true</verbose>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-filtered-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/filtered-sources/java</source>
- </sources>
- </configuration>
- </execution>
- <execution>
- <id>add-antlr-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources/antlr3</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr3-maven-plugin</artifactId>
+ <version>3.2</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>antlr</goal>
+ </goals>
+ <configuration>
+ <conversionTimeout>30000</conversionTimeout>
+ <debug>false</debug>
+ <dfa>false</dfa>
+ <nfa>false</nfa>
+ <excludes>
+
+ </excludes>
+ <includes>
+
+ </includes>
+ <libDirectory>src/main/antlr3/imports</libDirectory>
+ <messageFormat>antlr</messageFormat>
+ <outputDirectory>target/generated-sources/antlr3</outputDirectory>
+ <printGrammar>false</printGrammar>
+ <profile>false</profile>
+ <report>false</report>
+ <sourceDirectory>src/main/antlr3</sourceDirectory>
+ <trace>false</trace>
+ <verbose>true</verbose>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-filtered-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/filtered-sources/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-antlr-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/generated-sources/antlr3</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<!-- Document generation from the Annotations on the REST-API. -->
<!-- TODO move to a better suited processing phase -->
- <plugin>
- <groupId>org.bsc.maven</groupId>
- <artifactId>maven-processor-plugin</artifactId>
- <version>2.0.6-redhat</version>
- <configuration>
- <processors>
- <processor>org.rhq.helpers.rest_docs_generator.ClassLevelProcessor</processor>
- </processors>
- <compilerArguments>-AtargetDirectory=${project.build.directory}/docs/xml</compilerArguments>
+ <plugin>
+ <groupId>org.bsc.maven</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ <version>2.0.6-redhat</version>
+ <configuration>
+ <processors>
+ <processor>org.rhq.helpers.rest_docs_generator.ClassLevelProcessor</processor>
+ </processors>
+ <compilerArguments>-AtargetDirectory=${project.build.directory}/docs/xml</compilerArguments>
<!-- Comment the next line in to get more verbose output for debugging -->
<!--<compilerArguments>-Averbose=true</compilerArguments>-->
- </configuration>
- <executions>
- <execution>
- <id>create-rest-api-reports</id>
- <phase>process-classes</phase>
- <goals>
+ </configuration>
+ <executions>
+ <execution>
+ <id>create-rest-api-reports</id>
+ <phase>process-classes</phase>
+ <goals>
<!-- We want to process the classes in src/ -->
- <goal>process</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<!-- Disable annotation processors during normal compilation -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgument>-proc:none</compilerArgument>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xml-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <goals>
- <goal>transform</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <transformationSets>
- <transformationSet>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgument>-proc:none</compilerArgument>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <transformationSets>
+ <transformationSet>
<!-- org.rhq.helpers.rest_docs_generator.test plugin wrote to target/docs/xml (see -AtargetDirectory above) -->
- <dir>target/docs/xml</dir>
- <includes><include>rest-api-out.xml</include></includes>
- <stylesheet>src/main/xsl/apiout2html.xsl</stylesheet>
- <parameters>
- <parameter>
- <name>basePath</name>
- <value>http://localhost:7080/rest/1</value>
- </parameter>
- </parameters>
- <outputDir>${project.build.directory}/docs/html</outputDir>
- <fileMappers>
- <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
- <targetExtension>.html</targetExtension>
- </fileMapper>
- </fileMappers>
- </transformationSet>
- <transformationSet>
+ <dir>target/docs/xml</dir>
+ <includes>
+ <include>rest-api-out.xml</include>
+ </includes>
+ <stylesheet>src/main/xsl/apiout2html.xsl</stylesheet>
+ <parameters>
+ <parameter>
+ <name>basePath</name>
+ <value>http://localhost:7080/rest/1</value>
+ </parameter>
+ </parameters>
+ <outputDir>${project.build.directory}/docs/html</outputDir>
+ <fileMappers>
+ <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
+ <targetExtension>.html</targetExtension>
+ </fileMapper>
+ </fileMappers>
+ </transformationSet>
+ <transformationSet>
<!-- org.rhq.helpers.rest_docs_generator.test plugin wrote to target/docs/xml (see -AtargetDirectory above) -->
- <dir>target/docs/xml</dir>
- <includes><include>rest-api-out.xml</include></includes>
- <stylesheet>src/main/xsl/apiout2docbook.xsl</stylesheet>
- <parameters>
- <parameter>
- <name>basePath</name>
- <value>http://localhost:7080/rest/1</value>
- </parameter>
- </parameters>
- <outputDir>${project.build.directory}/docs/xml</outputDir>
- <fileMappers>
- <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
- <targetExtension>.dbx.xml</targetExtension>
- </fileMapper>
- </fileMappers>
- </transformationSet>
- </transformationSets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>com.agilejava.docbkx</groupId>
- <artifactId>docbkx-maven-plugin</artifactId>
- <version>2.0.9</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <goals>
- <goal>generate-pdf</goal>
- <goal>generate-html</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <sourceDirectory>target/docs/xml</sourceDirectory> <!-- from previous plugin, 2nd transformation set -->
- <includes>rest-api-out.dbx.xml</includes>
- <hyphenate>false</hyphenate>
- <generateToc>true</generateToc>
- </configuration>
- </plugin>
-
- </plugins>
-
- </build>
+ <dir>target/docs/xml</dir>
+ <includes>
+ <include>rest-api-out.xml</include>
+ </includes>
+ <stylesheet>src/main/xsl/apiout2docbook.xsl</stylesheet>
+ <parameters>
+ <parameter>
+ <name>basePath</name>
+ <value>http://localhost:7080/rest/1</value>
+ </parameter>
+ </parameters>
+ <outputDir>${project.build.directory}/docs/xml</outputDir>
+ <fileMappers>
+ <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
+ <targetExtension>.dbx.xml</targetExtension>
+ </fileMapper>
+ </fileMappers>
+ </transformationSet>
+ </transformationSets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.agilejava.docbkx</groupId>
+ <artifactId>docbkx-maven-plugin</artifactId>
+ <version>2.0.9</version>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>generate-pdf</goal>
+ <goal>generate-html</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <sourceDirectory>target/docs/xml</sourceDirectory> <!-- from previous plugin, 2nd transformation set -->
+ <includes>rest-api-out.dbx.xml</includes>
+ <hyphenate>false</hyphenate>
+ <generateToc>true</generateToc>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
<repositories>
<repository>
<!-- TODO change when the annotations are puplished. This is temporary for the swagger annotations for REST-docu -->
- <id>sonatype-oss-snapshot</id>
- <name>Sonatype OSS Snapshot repository</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ <id>sonatype-oss-snapshot</id>
+ <name>Sonatype OSS Snapshot repository</name>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
- <profiles>
+ <profiles>
- <profile>
+ <profile>
<!-- only if we are not running an individual set of tests via -Dtest do we do this -->
- <id>no-individual-test</id>
- <activation>
- <property><name>!test</name></property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <id>no-individual-test</id>
+ <activation>
+ <property>
+ <name>!test</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
<!-- Everything but the web service tests, this is the standard test execution -->
- <configuration>
- <skipTests>true</skipTests>
- <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
- <groups>${rhq.testng.includedGroups}</groups>
- <properties>
- <property>
- <name>listener</name>
- <value>org.rhq.test.testng.StdoutReporter</value>
- </property>
- </properties>
- <systemPropertyVariables>
- <embeddedDeployment>true</embeddedDeployment>
- <deploymentDirectory>target/classes</deploymentDirectory>
- <hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
- <clean.db>${clean.db}</clean.db>
- <log4j.configDebug>false</log4j.configDebug>
- </systemPropertyVariables>
- <additionalClasspathElements>
+ <configuration>
+ <skipTests>true</skipTests>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <groups>${rhq.testng.includedGroups}</groups>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.rhq.test.testng.StdoutReporter</value>
+ </property>
+ </properties>
+ <systemPropertyVariables>
+ <embeddedDeployment>true</embeddedDeployment>
+ <deploymentDirectory>target/classes</deploymentDirectory>
+ <hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
+ <clean.db>${clean.db}</clean.db>
+ <log4j.configDebug>false</log4j.configDebug>
+ </systemPropertyVariables>
+ <additionalClasspathElements>
<!-- The below is required for tests to run against Oracle. -->
- <additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
- </additionalClasspathElements>
- </configuration>
- <executions>
- <execution>
- <id>dbTestsOnly</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skipTests>${skipTests}</skipTests>
- <includes>
- <include>org/rhq/enterprise/server/db/**</include>
- </includes>
- <failIfNoTests>false</failIfNoTests>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>dev</id>
-
- <properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentName>${project.build.finalName}-ejb3.jar</rhq.deploymentName>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}</rhq.deploymentDir>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from target/classes to ${deployment.dir}...</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="target/classes" />
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
+ </additionalClasspathElements>
+ </configuration>
+ <executions>
+ <execution>
+ <id>dbTestsOnly</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skipTests>${skipTests}</skipTests>
+ <includes>
+ <include>org/rhq/enterprise/server/db/**</include>
+ </includes>
+ <failIfNoTests>false</failIfNoTests>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentName>${project.build.finalName}-ejb3.jar</rhq.deploymentName>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Copying updated files from target/classes to ${deployment.dir}...</echo>
+ <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
+ <fileset dir="target/classes"/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
<!--
NOTE: The below execution is necessary to make sure the META-INF/MANIFEST.MF and
META-INF/maven/** files, which get created by the ejb plugin during the package phase, get
copied over to the deployment dir.
-->
- <execution>
- <id>deploy-jar-meta-inf</id>
- <phase>package</phase>
- <configuration>
- <target>
- <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${rhq.deploymentDir}" overwrite="false">
- <patternset>
- <include name="META-INF/**" />
- </patternset>
- </unjar>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
- <delete dir="${deployment.dir}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
+ <execution>
+ <id>deploy-jar-meta-inf</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${rhq.deploymentDir}"
+ overwrite="false">
+ <patternset>
+ <include name="META-INF/**"/>
+ </patternset>
+ </unjar>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <!-- Add dependencies need for jdk5 builds. Remove when we stop supporting jdk5 -->
- <profile>
- <id>java-5-dependencies</id>
- <activation>
- <jdk>1.5</jdk>
- <property>
- <name>java5.home</name>
- </property>
- </activation>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
+ <delete dir="${deployment.dir}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <dependencies>
- <dependency>
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- Add dependencies need for jdk5 builds. Remove when we stop supporting jdk5 -->
+ <profile>
+ <id>java-5-dependencies</id>
+ <activation>
+ <jdk>1.5</jdk>
+ <property>
+ <name>java5.home</name>
+ </property>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>jboss.jbossws</groupId>
+ <artifactId>jboss-jaxws</artifactId>
<!-- NOTE: This version is old but is good enough to resolve the build dependency. -->
- <version>3.0.1-native-2.0.4.GA</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </profile>
-
- <profile>
- <id>javadoc</id>
- <activation>
- <property>
- <name>javadoc.outputDirectory</name>
- </property>
- </activation>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>remote-api</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <property name="javadoc.outputDirectory" value="${javadoc.outputDirectory}" />
- <property name="project.dir" value="./src/main/java/org/rhq/enterprise/server" />
- <property name="maven.compile.classpath" refid="maven.compile.classpath" />
-
- <mkdir dir="${javadoc.outputDirectory}/remote-api" />
- <javadoc destdir="${javadoc.outputDirectory}/remote-api" author="false" version="true" windowtitle="RHQ ${project.version} Remote API" noindex="false">
- <classpath>
- <pathelement path="${maven.compile.classpath}" />
- </classpath>
- <fileset dir="${project.dir}" defaultexcludes="yes">
- <include name="**/*Remote.java" />
- </fileset>
- <link href="../domain/" />
- <link href="http://download.oracle.com/javase/6/docs/api/" />
- <bottom><![CDATA[Copyright © 2005-2011 <a href="http://redhat.com/">Red Hat, Inc.</a>. All Rights Reserved.]]></bottom>
- </javadoc>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
- </plugins>
- </build>
-
- </profile>
-
- <profile>
- <id>cobertura</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.cobertura</groupId>
- <artifactId>cobertura</artifactId>
- <version>${cobertura.version}</version>
- </dependency>
- </dependencies>
- <executions>
+ <version>3.0.1-native-2.0.4.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>javadoc</id>
+ <activation>
+ <property>
+ <name>javadoc.outputDirectory</name>
+ </property>
+ </activation>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
<execution>
- <id>cobertura-instrument</id>
- <phase>process-test-classes</phase>
- <configuration>
- <target>
+ <id>remote-api</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <property name="javadoc.outputDirectory" value="${javadoc.outputDirectory}"/>
+ <property name="project.dir" value="./src/main/java/org/rhq/enterprise/server"/>
+ <property name="maven.compile.classpath" refid="maven.compile.classpath"/>
+
+ <mkdir dir="${javadoc.outputDirectory}/remote-api"/>
+ <javadoc destdir="${javadoc.outputDirectory}/remote-api" author="false" version="true"
+ windowtitle="RHQ ${project.version} Remote API" noindex="false">
+ <classpath>
+ <pathelement path="${maven.compile.classpath}"/>
+ </classpath>
+ <fileset dir="${project.dir}" defaultexcludes="yes">
+ <include name="**/*Remote.java"/>
+ </fileset>
+ <link href="../domain/"/>
+ <link href="http://download.oracle.com/javase/6/docs/api/"/>
+ <bottom><![CDATA[Copyright © 2005-2011 <a href="http://redhat.com/">Red Hat, Inc.</a>. All Rights Reserved.]]></bottom>
+ </javadoc>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ </profile>
+
+ <profile>
+ <id>cobertura</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>${cobertura.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>cobertura-instrument</id>
+ <phase>process-test-classes</phase>
+ <configuration>
+ <target>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/cobertura/backup" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
- <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
+ <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- create a properties file and save there location of cobertura data file-->
- <touch file="target/classes/cobertura.properties" />
- <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <touch file="target/classes/cobertura.properties"/>
+ <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
- <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser" todir="${project.build.directory}/classes">
- <fileset dir="${project.build.directory}/classes">
- <include name="**/*.class" />
- <exclude name="**/DynamicConfigurationPropertyLocal.class" />
- <exclude name="**/DynamicConfigurationPropertyBean.class" />
+ <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
+ todir="${project.build.directory}/classes">
+ <fileset dir="${project.build.directory}/classes">
+ <include name="**/*.class"/>
+ <exclude name="**/DynamicConfigurationPropertyLocal.class"/>
+ <exclude name="**/DynamicConfigurationPropertyBean.class"/>
</fileset>
</cobertura-instrument>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
<execution>
- <id>cobertura-report</id>
- <phase>prepare-package</phase>
- <configuration>
- <target>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <id>cobertura-report</id>
+ <phase>prepare-package</phase>
+ <configuration>
+ <target>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/site/cobertura" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
- <copy toDir="target/classes" verbose="true" overwrite="true">
+ <copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- delete backup folder-->
- <delete dir="target/cobertura/backup" />
+ <delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
- <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura">
+ <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
+ destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.java" />
+ <include name="**/*.java"/>
</fileset>
- </cobertura-report>
+ </cobertura-report>
<!-- delete cobertura.properties file -->
- <delete file="target/classes/cobertura.properties" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <delete file="target/classes/cobertura.properties"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index 6923a7a..8e4bc21 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -1,82 +1,83 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
<groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
- <packaging>jar</packaging>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
+ <packaging>jar</packaging>
- <name>RHQ Server XML Schemas</name>
- <description>Server side XML schemas and JAXB APIs used mailing to support the RHQ Server plugin container</description>
+ <name>RHQ Server XML Schemas</name>
+ <description>Server side XML schemas and JAXB APIs used mailing to support the RHQ Server plugin container</description>
- <dependencies>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope> <!-- rhq.ear -->
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- rhq.ear -->
+ </dependency>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
<!--<scope>test</scope> not sure about this -->
- </dependency>
+ </dependency>
<!--
TODO: This is a fix for the Javac bug requiring annotations to be available when compiling dependent
classes; it is fixed in JDK 6.
-->
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>hibernate-all</artifactId>
- <version>1.0.0.Alpha9</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>hibernate-all</artifactId>
+ <version>1.0.0.Alpha9</version>
+ <scope>provided</scope>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>com.sun.tools.xjc.maven2</groupId>
- <artifactId>maven-jaxb-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
- <schemaDirectory>${basedir}/target/classes</schemaDirectory>
- <includeSchemas>
- <includeSchema>*.xsd</includeSchema>
- </includeSchemas>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.sun.tools.xjc.maven2</groupId>
+ <artifactId>maven-jaxb-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ <schemaDirectory>${basedir}/target/classes</schemaDirectory>
+ <includeSchemas>
+ <includeSchema>*.xsd</includeSchema>
+ </includeSchemas>
+ </configuration>
+ </plugin>
<!--
Because the JAXB generator needs all .xsd's available and in one place so they can reference each other
@@ -90,211 +91,213 @@
we still have a duplicate copy of the .xsd in our jar, but this is OK because it is a true duplicate
so it doesn't really matter that we have one copy here and one copy in client-api jar.
-->
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>Copy the schemas in one place, including rhq-configuration.xsd schema so we can reuse it</id>
- <phase>initialize</phase>
- <configuration>
- <target>
- <mkdir dir="${basedir}/target/classes" />
- <copy todir="${basedir}/target/classes">
- <fileset dir="${basedir}/src/main/resources">
- <include name="*.xsd" />
- </fileset>
- <fileset dir="${basedir}/../../../core/client-api/src/main/resources">
- <include name="rhq-configuration.xsd" />
- </fileset>
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>purge duplicated JAXB-generated configuration schema classes</id>
- <phase>process-sources</phase>
- <configuration>
- <target>
- <delete dir="${basedir}/target/generated-sources/xjc/org/rhq/core" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>Copy the schemas in one place, including rhq-configuration.xsd schema so we can reuse it</id>
+ <phase>initialize</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${basedir}/target/classes"/>
+ <copy todir="${basedir}/target/classes">
+ <fileset dir="${basedir}/src/main/resources">
+ <include name="*.xsd"/>
+ </fileset>
+ <fileset dir="${basedir}/../../../core/client-api/src/main/resources">
+ <include name="rhq-configuration.xsd"/>
+ </fileset>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>purge duplicated JAXB-generated configuration schema classes</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <target>
+ <delete dir="${basedir}/target/generated-sources/xjc/org/rhq/core"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-xjc-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources/xjc</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-xjc-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/generated-sources/xjc</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <profiles>
+ <profiles>
- <profile>
- <id>dev</id>
+ <profile>
+ <id>dev</id>
- <properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/lib</rhq.deploymentDir>
- </properties>
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/lib</rhq.deploymentDir>
+ </properties>
- <build>
- <plugins>
+ <build>
+ <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <mkdir dir="${rhq.deploymentDir}" />
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Updating ${deployment.file}...</echo>
- <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${rhq.deploymentDir}"/>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Deleting ${deployment.file}...</echo>
- <delete file="${deployment.file}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- </executions>
- </plugin>
+ </executions>
+ </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>cobertura</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.cobertura</groupId>
- <artifactId>cobertura</artifactId>
- <version>${cobertura.version}</version>
- </dependency>
- </dependencies>
- <executions>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>${cobertura.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
<execution>
- <id>cobertura-instrument</id>
- <phase>process-test-classes</phase>
- <configuration>
- <target>
+ <id>cobertura-instrument</id>
+ <phase>process-test-classes</phase>
+ <configuration>
+ <target>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/cobertura/backup" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
- <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
+ <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- create a properties file and save there location of cobertura data file-->
- <touch file="target/classes/cobertura.properties" />
- <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <touch file="target/classes/cobertura.properties"/>
+ <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
- <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser" todir="${project.build.directory}/classes">
- <fileset dir="${project.build.directory}/classes">
- <include name="**/*.class" />
+ <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
+ todir="${project.build.directory}/classes">
+ <fileset dir="${project.build.directory}/classes">
+ <include name="**/*.class"/>
</fileset>
</cobertura-instrument>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
<execution>
- <id>cobertura-report</id>
- <phase>prepare-package</phase>
- <configuration>
- <target>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <id>cobertura-report</id>
+ <phase>prepare-package</phase>
+ <configuration>
+ <target>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/site/cobertura" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
- <copy toDir="target/classes" verbose="true" overwrite="true">
+ <copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- delete backup folder-->
- <delete dir="target/cobertura/backup" />
+ <delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
- <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura">
+ <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
+ destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.java" />
+ <include name="**/*.java"/>
</fileset>
- </cobertura-report>
+ </cobertura-report>
<!-- delete cobertura.properties file -->
- <delete file="target/classes/cobertura.properties" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <delete file="target/classes/cobertura.properties"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index e045081..9f93a29 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -1,291 +1,295 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-plugins-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-plugins-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ </parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-perftest-plugin</artifactId>
- <packaging>jar</packaging>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-perftest-plugin</artifactId>
+ <packaging>jar</packaging>
- <name>RHQ Performance Test Plugin</name>
- <description>a plugin for performance testing</description>
+ <name>RHQ Performance Test Plugin</name>
+ <description>a plugin for performance testing</description>
- <dependencies>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
- </dependencies>
+ </dependency>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>com.sun.tools.xjc.maven2</groupId>
- <artifactId>maven-jaxb-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.sun.tools.xjc.maven2</groupId>
+ <artifactId>maven-jaxb-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <generatePackage>org.rhq.plugins.perftest.scenario</generatePackage>
+ <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-jaxb-deps</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
<configuration>
- <generatePackage>org.rhq.plugins.perftest.scenario</generatePackage>
- <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
</configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-jaxb-deps</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-xjc-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources/xjc</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-xjc-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
<configuration>
- <skip>true</skip>
+ <sources>
+ <source>${basedir}/target/generated-sources/xjc</source>
+ </sources>
</configuration>
- <executions>
- <execution>
- <id>surefire-it</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
- <useSystemClassLoader>false</useSystemClassLoader>
- <argLine>-Djava.library.path=${basedir}/target/itest/lib</argLine>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <useSystemClassLoader>false</useSystemClassLoader>
+ <argLine>-Djava.library.path=${basedir}/target/itest/lib</argLine>
<!--
<argLine>-Djava.library.path=${basedir}/target/itest/lib -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</argLine>
-->
- <systemPropertyVariables>
- <project.artifactId>${project.artifactId}</project.artifactId>
- <project.version>${project.version}</project.version>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <systemPropertyVariables>
+ <project.artifactId>${project.artifactId}</project.artifactId>
+ <project.version>${project.version}</project.version>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
- </plugins>
- </build>
+ </plugins>
+ </build>
- <profiles>
+ <profiles>
- <profile>
- <id>dev</id>
+ <profile>
+ <id>dev</id>
- <properties>
- <rhq.rootDir>../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
- </properties>
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
- <build>
- <plugins>
+ <build>
+ <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <mkdir dir="${rhq.deploymentDir}" />
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Updating ${deployment.file}...</echo>
- <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" update="true" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${rhq.deploymentDir}"/>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" update="true"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <execution>
- <id>deploy-jar-meta-inf</id>
- <phase>package</phase>
- <configuration>
- <target>
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
- <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.outputDirectory}">
- <patternset><include name="META-INF/**" /></patternset>
- </unjar>
- <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true">
- </jar>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>deploy-jar-meta-inf</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
+ <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.outputDirectory}">
+ <patternset>
+ <include name="META-INF/**"/>
+ </patternset>
+ </unjar>
+ <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF"
+ update="true">
+ </jar>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Deleting ${deployment.file}...</echo>
- <delete file="${deployment.file}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- </executions>
- </plugin>
+ </executions>
+ </plugin>
- </plugins>
- </build>
- </profile>
+ </plugins>
+ </build>
+ </profile>
- <profile>
+ <profile>
<id>cobertura-plugins</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.cobertura</groupId>
- <artifactId>cobertura</artifactId>
- <version>${cobertura.version}</version>
- </dependency>
- </dependencies>
- <executions>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>${cobertura.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
<execution>
- <id>cobertura-instrument</id>
- <phase>pre-integration-test</phase>
- <configuration>
- <target>
+ <id>cobertura-instrument</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <target>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/cobertura/backup" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
- <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
+ <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- create a properties file and save there location of cobertura data file-->
- <touch file="target/classes/cobertura.properties" />
- <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <touch file="target/classes/cobertura.properties"/>
+ <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
- <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser" todir="${project.build.directory}/classes">
- <fileset dir="${project.build.directory}/classes">
- <include name="**/*.class" />
+ <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
+ todir="${project.build.directory}/classes">
+ <fileset dir="${project.build.directory}/classes">
+ <include name="**/*.class"/>
</fileset>
</cobertura-instrument>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
<execution>
- <id>cobertura-report</id>
- <phase>post-integration-test</phase>
- <configuration>
- <target>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <id>cobertura-report</id>
+ <phase>post-integration-test</phase>
+ <configuration>
+ <target>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/site/cobertura" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
- <copy toDir="target/classes" verbose="true" overwrite="true">
+ <copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- delete backup folder-->
- <delete dir="target/cobertura/backup" />
+ <delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
- <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura">
+ <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
+ destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.java" />
+ <include name="**/*.java"/>
</fileset>
- </cobertura-report>
+ </cobertura-report>
<!-- delete cobertura.properties file -->
- <delete file="target/classes/cobertura.properties" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <delete file="target/classes/cobertura.properties"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
commit 5a714f3df86fe659cf2bc5938accaa72482c362d
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Jun 26 19:14:10 2012 -0400
-Add a few more itests for SecurityDomain
-exercises most of the Module Option Types
-Remove Authentication (Classic) from ignore list
-Add ability to override default discovery depth.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
index 04c40de..43e6e06 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
@@ -18,6 +18,8 @@
*/
package org.rhq.modules.plugins.jbossas7.itest;
+import static org.testng.Assert.assertNotNull;
+
import java.util.Set;
import org.rhq.core.clientapi.agent.PluginContainerException;
@@ -35,8 +37,6 @@ import org.rhq.modules.plugins.jbossas7.itest.domain.DomainServerComponentTest;
import org.rhq.modules.plugins.jbossas7.itest.standalone.StandaloneServerComponentTest;
import org.rhq.test.arquillian.AfterDiscovery;
-import static org.testng.Assert.assertNotNull;
-
/**
* The base class for all as7 plugin integration tests.
*
@@ -51,6 +51,16 @@ public abstract class AbstractJBossAS7PluginTest extends AbstractAgentPluginTest
private static final int TYPE_HIERARCHY_DEPTH = 6;
+ private static int OVERRIDE_TYPE_HIERARCHY_DEPTH = -1;
+
+ public static int getMaxDiscoveryDepthOverride() {
+ return OVERRIDE_TYPE_HIERARCHY_DEPTH;
+ }
+
+ public static void setMaxDiscoveryDepthOverride(int overrideDepth) {
+ OVERRIDE_TYPE_HIERARCHY_DEPTH = overrideDepth;
+ }
+
private static boolean createdManagementUsers;
/**
@@ -115,6 +125,9 @@ public abstract class AbstractJBossAS7PluginTest extends AbstractAgentPluginTest
@Override
protected int getTypeHierarchyDepth() {
+ if (OVERRIDE_TYPE_HIERARCHY_DEPTH != -1) {
+ return OVERRIDE_TYPE_HIERARCHY_DEPTH;
+ }
return TYPE_HIERARCHY_DEPTH;
}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
index bd904b9..aad8739 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
@@ -84,7 +84,7 @@ public class ResourcesStandaloneServerTest extends AbstractJBossAS7PluginTest {
ignoredResources.add("Load Metric");
//will revisit after BZ 826542 is resolved
- ignoredResources.add("Authentication (Classic)");
+ // ignoredResources.add("Authentication (Classic)");
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
Resource server = getResourceByTypeAndKey(platform, StandaloneServerComponentTest.RESOURCE_TYPE,
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
index 7f9464a..e3f88af 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
@@ -21,9 +21,15 @@ package org.rhq.modules.plugins.jbossas7.itest.standalone;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
+import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Set;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;
import org.testng.annotations.Test;
@@ -32,17 +38,24 @@ import org.rhq.core.clientapi.agent.inventory.CreateResourceResponse;
import org.rhq.core.clientapi.agent.inventory.DeleteResourceRequest;
import org.rhq.core.clientapi.agent.inventory.DeleteResourceResponse;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.resource.CreateResourceStatus;
import org.rhq.core.domain.resource.DeleteResourceStatus;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pc.configuration.ConfigurationManager;
import org.rhq.core.pc.inventory.InventoryManager;
import org.rhq.modules.plugins.jbossas7.ASConnection;
import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent;
+import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent.Value;
import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
+import org.rhq.modules.plugins.jbossas7.json.Address;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.Result;
import org.rhq.test.arquillian.RunDiscovery;
/**
@@ -69,6 +82,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
private static String SECURITY_DOMAIN_RESOURCE_KEY = "security-domain";
private static String AUTH_CLASSIC_RESOURCE_TYPE = "Authentication (Classic)";
private static String AUTH_CLASSIC_RESOURCE_KEY = "authentication=classic";
+ private static String PROFILE = "profile=full-ha";
protected static final String DC_HOST = System.getProperty("jboss.domain.bindAddress");
protected static final int DC_HTTP_PORT = Integer.valueOf(System.getProperty("jboss.domain.httpManagementPort"));
@@ -83,6 +97,9 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
public static final ResourceType RESOURCE_TYPE = new ResourceType(SECURITY_RESOURCE_TYPE, PLUGIN_NAME,
ResourceCategory.SERVICE, null);
private static final String RESOURCE_KEY = SECURITY_RESOURCE_KEY;
+ private static Resource testSecurityDomain = null;
+ private String testSecurityDomainKey = null;
+ private ConfigurationManager testConfigurationManager = null;
//Define some shared and reusable content
static HashMap<String, String> jsonMap = new HashMap<String, String>();
@@ -100,19 +117,194 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
"[{\"code\":\"Test\", \"type\":\"attribute\", \"module-options\":{\"mapping\":\"module\", \"mapping1\":\"module1\"}}]");
jsonMap.put("provider-modules",
"[{\"code\":\"Providers\", \"module-options\":{\"provider\":\"module\", \"provider1\":\"module1\"}}]");
+ jsonMap
+ .put("acl-modules",
+ "[{\"flag\":\"sufficient\", \"code\":\"ACL\", \"module-options\":{\"acl\":\"module\", \"acl1\":\"module1\"}}]");
+ jsonMap
+ .put("trust-modules",
+ "[{\"flag\":\"optional\", \"code\":\"TRUST\", \"module-options\":{\"trust\":\"module\", \"trust1\":\"module1\"}}]");
}
- @Test(priority = 10, groups = "discovery")
+ /** This method mass loads all the supported Module Option Types(Excluding authentication=jaspi, cannot co-exist with
+ * authentication=classic) into a single SecurityDomain. This is done as
+ * -i)creating all of the related hierarchy of types needed to exercise N Module Options Types and their associated
+ * Module Options instances would take too long to setup(N creates would signal N discovery runs before test could complete).
+ * -ii)setting the priority of this method lower than the discovery method means that we'll get all the same types in much
+ * less time.
+ *
+ * @throws Exception
+ */
+ @Test(priority = 10)
+ public void testLoadStandardModuleOptionTypes() throws Exception {
+ mapper = new ObjectMapper();
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+
+ //Adjust discovery depth to support deeper hierarchy depth of Module Option elements
+ setMaxDiscoveryDepthOverride(10);
+
+ //create new Security Domain
+ Address destination = new Address(PROFILE);
+ destination.addSegment(SECURITY_RESOURCE_KEY);
+ String securityDomainId = TEST_DOMAIN + "2";
+ destination.addSegment(SECURITY_DOMAIN_RESOURCE_KEY + "=" + securityDomainId);
+
+ ASConnection connection = getASConnection();
+ Result result = new Result();
+ //delete old one if present to setup clean slate
+ Operation op = new Operation("remove", destination);
+ result = connection.execute(op);
+
+ //build/rebuild hierarchy
+ op = new Operation("add", destination);
+ result = connection.execute(op);
+
+ //Ex. profile=standalone-ha,subsystem=security,security-domain
+ String addressPrefix = PROFILE + "," + SECURITY_RESOURCE_KEY + "," + SECURITY_DOMAIN_RESOURCE_KEY;
+
+ //loop over standard types and add base details for all of them to security domain
+ String address = "";
+ for (String attribute : jsonMap.keySet()) {
+ if (attribute.equals("policy-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",authorization=classic";
+ } else if (attribute.equals("acl-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",acl=classic";
+ } else if (attribute.equals("mapping-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",mapping=classic";
+ } else if (attribute.equals("trust-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",identity-trust=classic";
+ } else if (attribute.equals("provider-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",audit=classic";
+ } else if (attribute.equals("login-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",authentication=classic";
+ } else {
+ assert false : "An unknown attribute '" + attribute
+ + "' was found. Is there a new type to be supported?";
+ }
+ //build the operation to add the component
+ ////Load json map into ModuleOptionType
+ List<Value> moduleTypeValue = new ArrayList<Value>();
+ try {
+ // loading jsonMap contents for Ex. 'login-module'
+ JsonNode node = mapper.readTree(jsonMap.get(attribute));
+ Object obj = mapper.treeToValue(node, Object.class);
+ result.setResult(obj);
+ result.setOutcome("success");
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ //populate the Value component complete with module Options.
+ moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ op = ModuleOptionsComponent.createAddModuleOptionTypeOperation(new Address(address), attribute,
+ moduleTypeValue);
+ //submit the command
+ result = connection.execute(op);
+ }
+ }
+
+ @Test(priority = 11, groups = "discovery")
@RunDiscovery(discoverServices = true, discoverServers = true)
public void initialDiscovery() throws Exception {
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
assertNotNull(platform);
assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
- Thread.sleep(20 * 1000L); // delay so that PC gets a chance to scan for resources
+ //Have thread sleep longer to discover deeper resource types.
+ Thread.sleep(120 * 1000L); // delay so that PC gets a chance to scan for resources
}
+ /** This test method exercises a number of things:
+ * - that the security-domain children loaded have been created successfully
+ * - that all of the supported Module Option Type children(excluding 'authentication=jaspi') have been
+ * discovered as AS7 types successfully.
+ * - that the correct child attribute was specified for each type //Ex. acl=classic -> acl-modules
+ * -
+ *
+ * @throws Exception
+ */
@Test(priority = 12)
+ public void testDiscoveredSecurityNodes() throws Exception {
+ //lazy-load configurationManager
+ if (testConfigurationManager == null) {
+ testConfigurationManager = this.pluginContainer.getConfigurationManager();
+ testConfigurationManager = pluginContainer.getConfigurationManager();
+ testConfigurationManager.initialize();
+ Thread.sleep(20 * 1000L);
+ }
+ //iterate through list of nodes and make sure they've all been discovered
+ ////Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,acl=classic
+ String attribute = null;
+ for (String jsonKey : jsonMap.keySet()) {
+ //Ex. policy-modules
+ attribute = jsonKey;
+ //spinder 6/26/12: Temporarily disable until figure out why NPE happens only for this type?
+ if (attribute.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
+ break;//
+ }
+ //Ex. name=acl-modules
+ //check the configuration for the Module Option Type Ex. 'Acl (Profile)' Resource. Should be able to verify components
+ Resource aclResource = getModuleOptionResourceResource(attribute);
+ //assert non-zero id returned
+ assert aclResource.getId() > 0 : "The resource was not properly initialized. Expected id >0 but got:"
+ + aclResource.getId();
+
+ //Now request the resource complete with resource config
+ Configuration loadedConfiguration = testConfigurationManager.loadResourceConfiguration(aclResource.getId());
+ String code = null;
+ String type = null;
+ String flag = null;
+ //populate the associated attributes if it's supported.
+ for (String key : loadedConfiguration.getAllProperties().keySet()) {
+ Property property = loadedConfiguration.getAllProperties().get(key);
+ if (key.equals("code")) {
+ code = ((PropertySimple) property).getStringValue();
+ } else if (key.equals("flag")) {
+ flag = ((PropertySimple) property).getStringValue();
+ } else {//Ex. type.
+ type = ((PropertySimple) property).getStringValue();
+ }
+ }
+
+ //retrieve module options as well.
+ String jsonContent = jsonMap.get(attribute);
+ Result result = new Result();
+ try {
+ // loading jsonMap contents for Ex. 'login-module'
+ JsonNode node = mapper.readTree(jsonContent);
+ Object obj = mapper.treeToValue(node, Object.class);
+ result.setResult(obj);
+ result.setOutcome("success");
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ assert false;
+ } catch (IOException e) {
+ e.printStackTrace();
+ assert false;
+ }
+
+ //populate the Value component complete with module Options.
+ List<Value> moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ Value moduleOptionType = moduleTypeValue.get(0);
+ //Ex. retrieve the acl-modules component and assert values.
+ //always test 'code'
+ assert moduleOptionType.getCode().equals(code) : "Module Option 'code' value is not correct. Expected '"
+ + code + "' but was '" + moduleOptionType.getCode() + "'";
+ if (attribute.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
+ assert moduleOptionType.getType().equals(type) : "Mapping Module 'type' value is not correct. Expected '"
+ + type + "' but was '" + moduleOptionType.getType() + "'";
+ } else if (!attribute.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {//Audit has no second parameter
+ assert moduleOptionType.getFlag().equals(flag) : "Provider Module 'flag' value is not correct. Expected '"
+ + flag + "' but was '" + moduleOptionType.getFlag() + "'";
+ }
+ }
+ //TODO spinder 6-26-12: retrieve the Module Options and test them too.
+ }
+
+ @Test(priority = 13)
public void testCreateSecurityDomain() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -140,7 +332,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+ response.getErrorMessage();
}
- @Test(priority = 13)
+ @Test(priority = 14)
public void testAuthenticationClassic() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -179,7 +371,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+ response.getErrorMessage();
}
- @Test(priority = 14)
+ @Test(priority = 15)
public void testDeleteSecurityDomain() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -210,6 +402,15 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+ response.getErrorMessage();
}
+ // public static void main(String[] args) {
+ // SecurityModuleOptionsTest setup = new SecurityModuleOptionsTest();
+ // try {
+ // setup.testLoadStandardModuleOptionTypes();
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // }
+ // }
+
private Resource getResource() {
InventoryManager im = pluginContainer.getInventoryManager();
@@ -220,6 +421,82 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
return bindings;
}
+ /** Automates
+ *
+ * @param optionAttributeType
+ * @return
+ */
+ private Resource getModuleOptionResourceResource(String optionAttributeType) {
+ Resource moduleOptionResource = null;
+ String securityDomainId = SECURITY_DOMAIN_RESOURCE_KEY + "=" + TEST_DOMAIN + "2";
+ if (testSecurityDomain == null) {
+ InventoryManager im = pluginContainer.getInventoryManager();
+ Resource platform = im.getPlatform();
+ //host controller
+ ResourceType hostControllerType = new ResourceType("JBossAS7 Host Controller", PLUGIN_NAME,
+ ResourceCategory.SERVER, null);
+ Resource hostController = getResourceByTypeAndKey(platform, hostControllerType,
+ "/tmp/jboss-as-6.0.0.GA/domain");
+ //profile=full-ha
+ ResourceType profileType = new ResourceType("Profile", PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ String key = PROFILE;
+ Resource profile = getResourceByTypeAndKey(hostController, profileType, key);
+
+ //Security (Profile)
+ ResourceType securityType = new ResourceType("Security (Profile)", PLUGIN_NAME, ResourceCategory.SERVICE,
+ null);
+ key += "," + SECURITY_RESOURCE_KEY;
+ Resource security = getResourceByTypeAndKey(profile, securityType, key);
+
+ //Security Domain (Profile)
+ ResourceType domainType = new ResourceType("Security Domain (Profile)", PLUGIN_NAME,
+ ResourceCategory.SERVICE, null);
+ key += "," + securityDomainId;
+ testSecurityDomainKey = key;
+ testSecurityDomain = getResourceByTypeAndKey(security, domainType, key);
+ }
+
+ //acl=classic
+ String descriptorName = "";
+ String moduleAttribute = "";
+ //acl
+ if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Acl.getAttribute())) {
+ descriptorName = "ACL (Profile)";
+ moduleAttribute = "acl=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {
+ descriptorName = "Audit (Profile)";
+ moduleAttribute = "audit=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
+ descriptorName = "Authentication (Classic - Profile)";
+ moduleAttribute = "authentication=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authorization.getAttribute())) {
+ descriptorName = "Authorization (Profile)";
+ moduleAttribute = "authorization=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.IdentityTrust.getAttribute())) {
+ descriptorName = "Identity Trust (Profile)";
+ moduleAttribute = "identity-trust=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
+ descriptorName = "Mapping (Profile)";
+ moduleAttribute = "mapping=classic";
+ }
+ //Build the right Module Option Type. Ex. ACL (Profile), etc.
+ ResourceType moduleOptionType = new ResourceType(descriptorName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ ConfigurationDefinition cdef = new ConfigurationDefinition(descriptorName, null);
+ moduleOptionType.setResourceConfigurationDefinition(cdef);
+ //Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,identity-trust=classic
+ String moduleOptionTypeKey = testSecurityDomainKey += "," + moduleAttribute;
+
+ if (!testSecurityDomainKey.endsWith(securityDomainId)) {
+ moduleOptionTypeKey = testSecurityDomainKey.substring(0, testSecurityDomainKey.indexOf(securityDomainId)
+ + securityDomainId.length())
+ + "," + moduleAttribute;
+ }
+
+ moduleOptionResource = getResourceByTypeAndKey(testSecurityDomain, moduleOptionType, moduleOptionTypeKey);
+
+ return moduleOptionResource;
+ }
+
private Resource getResource(Resource parentResource, String pluginDescriptorTypeName, String resourceKey) {
Resource resource = null;
if (((parentResource != null) & (pluginDescriptorTypeName != null) & (resourceKey != null))
commit 8f00d2c8e2fde0d6a2d627a2780cbd4e75e200b5
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed Jun 27 14:13:52 2012 +0200
fix parametrization of class
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java
index 60cb4d3..b40ca54 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java
@@ -38,7 +38,7 @@ import org.rhq.enterprise.gui.coregui.client.components.table.Table;
*
* @author Ian Springer
*/
-public abstract class AbstractMeasurementDataTraitListDetailView extends Table {
+public abstract class AbstractMeasurementDataTraitListDetailView extends Table<AbstractMeasurementDataTraitDataSource> {
private static final String[] EXCLUDED_FIELD_NAMES = new String[] { MeasurementDataTraitCriteria.SORT_FIELD_DISPLAY_NAME };
private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[] {
commit 2d2ae3923fdaa1d94561f3995b4e59521e9267db
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Jun 26 23:03:56 2012 -0500
[BZ 835710] Removed WebservicesComoponent class and moved the two resources using it to the generic BaseComponent.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/WebservicesComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/WebservicesComponent.java
deleted file mode 100644
index 0dea886..0000000
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/WebservicesComponent.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.rhq.modules.plugins.jbossas7;
-
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
-import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
-import org.rhq.core.pluginapi.operation.OperationFacet;
-import org.rhq.core.pluginapi.operation.OperationResult;
-import org.rhq.modules.plugins.jbossas7.json.Operation;
-import org.rhq.modules.plugins.jbossas7.json.Result;
-
-/**
- * Support for Webservices subsystem.
- *
- * @author Simeon Pinder
- */
-public class WebservicesComponent extends BaseComponent implements OperationFacet, ConfigurationFacet {
-
- @Override
- public Configuration loadResourceConfiguration() throws Exception {
- Configuration config = super.loadResourceConfiguration();
-
- return config;
- }
-
- @Override
- public void updateResourceConfiguration(ConfigurationUpdateReport report) {
-
- super.updateResourceConfiguration(report);
- }
-
- @Override
- public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
- Operation op = new Operation(name, getAddress());
- OperationResult operationResult = new OperationResult();
- Result result = null;
-
- if ("list-proxies".equals(name)) {
-
- } else {
- /*
- * This is a catch all for operations that are not explicitly treated above.
- */
- result = getASConnection().execute(op);
- if (result.isSuccess()) {
- operationResult.setSimpleResult("Success");
- }
- }
-
- if (!result.isSuccess()) {
- operationResult.setErrorMessage(result.getFailureDescription());
- }
-
- return operationResult;
- }
-}
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index ecbaea2..e096c0e 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -1745,7 +1745,7 @@
<service name="Webservices (Managed Server)"
discovery="SubsystemDiscovery"
- class="WebservicesComponent"
+ class="BaseComponent"
singleton="true">
<plugin-configuration>
@@ -3228,7 +3228,7 @@
<plugin-configuration>
<c:simple-property name="path" readOnly="true" default="login-modules" />
</plugin-configuration>
-
+
&loginModuleResourceConfig;
<service name="Module Options (Classic - Managed Server)" discovery="ModuleOptionsDiscoveryComponent"
@@ -6062,7 +6062,7 @@
<plugin-configuration>
<c:simple-property name="path" readOnly="true" default="login-modules" />
</plugin-configuration>
-
+
&loginModuleResourceConfig;
<service name="Module Options (Classic - Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
@@ -8143,7 +8143,7 @@
<service name="Webservices"
discovery="SubsystemDiscovery"
- class="WebservicesComponent"
+ class="BaseComponent"
singleton="true">
<runs-inside>
@@ -10631,7 +10631,7 @@
<plugin-configuration>
<c:simple-property name="path" readOnly="true" default="policy-modules" />
</plugin-configuration>
-
+
&flagModuleResourceConfig;
<service name="Module Options (Authorization)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
commit aa77d7ee32f40ee646fec469cac8211bada3abd1
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jun 26 16:35:36 2012 -0400
[BZ 835687] upgrade Postgres driver from 9.1-901.jdbc4 to 9.1-902.jdbc4 (https://bugzilla.redhat.com/show_bug.cgi?id=835687)
diff --git a/pom.xml b/pom.xml
index 210b697..603b89d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,7 +88,7 @@
<log4j.version>1.2.16</log4j.version>
<ojdbc6.version>11.2.0.3.0</ojdbc6.version>
<ems.version>1.3</ems.version>
- <postgresql.version>9.1-901.jdbc4</postgresql.version>
+ <postgresql.version>9.1-902.jdbc4</postgresql.version>
<h2.version>1.2.139</h2.version>
<jtds.version>1.2.2</jtds.version>
<richfaces.version>3.3.3.Final</richfaces.version>
@@ -179,7 +179,8 @@
<!-- NOTE: The below line is a workaround for a Maven bug, where it does not expand settings.* properties
used in the distributionManagement section of the POM. -->
<localRepository>${user.home}/.m2/repository</localRepository>
- <project.json.version>20080701</project.json.version>
+
+ <project.json.version>20080701</project.json.version>
</properties>
11 years, 5 months
[rhq] Branch 'bug/667896' - modules/enterprise
by John Sanda
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/framework/ExpressionEvaluator.java | 18
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java | 272 ++++++++--
2 files changed, 255 insertions(+), 35 deletions(-)
New commits:
commit 73b7a78e527b6baefcfbac961c15c9821b1b7639
Author: John Sanda <jsanda(a)redhat.com>
Date: Wed Jun 27 14:19:03 2012 -0400
[BZ 826716] Adding tests for plugin and resource config expressions.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/framework/ExpressionEvaluator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/framework/ExpressionEvaluator.java
index 32565b6..925d59d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/framework/ExpressionEvaluator.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/framework/ExpressionEvaluator.java
@@ -178,6 +178,20 @@ public class ExpressionEvaluator implements Iterable<ExpressionEvaluator.Result>
resourceExpressions.add("res.parentResource.parentResource.avail.availabilityType");
resourceExpressions.add("res.parentResource.parentResource.parentResource.avail.availabilityType");
resourceExpressions.add("res.parentResource.parentResource.parentResource.parentResource.avail.availabilityType");
+
+ resourceExpressions.add("trait.value");
+ resourceExpressions.add("child.trait.value");
+ resourceExpressions.add("res.parentResource.trait.value");
+ resourceExpressions.add("res.parentResource.parentResource.trait.value");
+ resourceExpressions.add("res.parentResource.parentResource.parentResource.trait.value");
+ resourceExpressions.add("res.parentResource.parentResource.parentResource.parentResource.trait.value");
+
+ resourceExpressions.add("simple.name");
+ resourceExpressions.add("child.simple.name");
+ resourceExpressions.add("res.parentResource.simple.name");
+ resourceExpressions.add("res.parentResource.parentResource.simple.name");
+ resourceExpressions.add("res.parentResource.parentResource.parentResource.simple.name");
+ resourceExpressions.add("res.parentResource.parentResource.parentResource.parentResource.simple.name");
}
public class Result {
@@ -549,10 +563,6 @@ public class ExpressionEvaluator implements Iterable<ExpressionEvaluator.Result>
addJoinCondition(JoinCondition.AVAILABILITY);
populatePredicateCollections(JoinCondition.AVAILABILITY.alias + ".availabilityType", type);
} else if (context == ParseContext.Trait) {
- if (whereConditions.containsKey(TRAIT_ALIAS + ".value")) {
- throw new InvalidExpressionException("Cannot have multiple trait expressions.");
- }
-
// SELECT res.id FROM Resource res JOIN res.schedules sched, sched.definition def, MeasurementDataTrait trait
// WHERE def.name = :arg1 AND trait.value = :arg2 AND trait.schedule = sched AND trait.id.timestamp =
// (SELECT max(mdt.id.timestamp) FROM MeasurementDataTrait mdt WHERE sched.id = mdt.schedule.id)
diff --git a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java
index 78ee34f..76c5824 100644
--- a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java
+++ b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/group/definition/framework/test/ExpressionEvaluatorTest.java
@@ -29,7 +29,6 @@ import org.rhq.enterprise.server.resource.group.definition.framework.ExpressionE
import org.rhq.enterprise.server.resource.group.definition.framework.InvalidExpressionException;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
import org.rhq.enterprise.server.util.QueryUtility;
-import org.rhq.test.TransactionCallback;
public class ExpressionEvaluatorTest extends AbstractEJB3Test {
@@ -158,7 +157,7 @@ public class ExpressionEvaluatorTest extends AbstractEJB3Test {
" AND simple.name = simpleDef.name AND simpleDef.type != 'PASSWORD' " }, };
}
-// @Test(groups = "integration.session")
+ @Test(groups = "integration.session")
public void testWellFormedExpressions() throws Exception {
String[][] successTestCases = getSuccessTestCases();
@@ -215,7 +214,7 @@ public class ExpressionEvaluatorTest extends AbstractEJB3Test {
}
}
-// @Test(groups = "integration.session")
+ @Test(groups = "integration.session")
public void testTokenizer() {
String[] input = { "resource.child.name", //
@@ -257,15 +256,6 @@ public class ExpressionEvaluatorTest extends AbstractEJB3Test {
}
}
- private void executeAndRollback(TransactionCallback callback) throws Exception {
- try {
- getTransactionManager().begin();
- callback.execute();
- } finally {
- getTransactionManager().rollback();
- }
- }
-
private static interface ExpressionGenerator {
String[] getExpressions();
}
@@ -284,34 +274,86 @@ public class ExpressionEvaluatorTest extends AbstractEJB3Test {
}
}
- @Test(expectedExceptions = InvalidExpressionException.class,
- expectedExceptionsMessageRegExp = ".*Cannot have multiple trait expressions.*")
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
public void doNotAllowMultipleResourceTraitExpressions() throws Exception {
- executeAndRollback(new TransactionCallback() {
+ evaluateExpressions(new ExpressionGenerator() {
@Override
- public void execute() throws Exception {
- ExpressionEvaluator evaluator = new ExpressionEvaluator();
- evaluator.addExpression("resource.trait[agentHomeDirectory] = /var/rhq-agent");
- evaluator.addExpression("resource.trait[reasonForLastRestart] = OOMError");
+ public String[] getExpressions() {
+ return new String[] {
+ "resource.trait[agentHomeDirectory] = /var/rhq-agent",
+ "resource.trait[reasonForLastRestart] = OOMError"
+ };
+ }
+ });
+ }
- evaluator.execute();
- evaluator.iterator().next();
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleChildResourceTraitExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[] {
+ "resource.child.trait[agentHomeDirectory] = /var/rhq-agent",
+ "resource.child.trait[reasonForLastRestart] = OOMError"
+ };
}
});
}
- @Test(expectedExceptions = InvalidExpressionException.class,
- expectedExceptionsMessageRegExp = ".*Cannot have multiple trait expressions.*")
- public void doNotAllowMultiplParentResourceTraitExpressions() throws Exception {
- executeAndRollback(new TransactionCallback() {
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleParentResourceTraitExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
@Override
- public void execute() throws Exception {
- ExpressionEvaluator evaluator = new ExpressionEvaluator();
- evaluator.addExpression("resource.parent.trait[agentHomeDirectory] = /var/rhq-agent");
- evaluator.addExpression("resource.parent.trait[reasonForLastRestart] = OOMError");
+ public String[] getExpressions() {
+ return new String[] {
+ "resource.parent.trait[agentHomeDirectory] = /var/rhq-agent",
+ "resource.parent.trait[reasonForLastRestart] = OOMError"
+ };
+ }
+ });
+ }
- evaluator.execute();
- evaluator.iterator().next();
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGrandParentResourceTraitExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[] {
+ "resource.grandParent.trait[agentHomeDirectory] = /var/rhq-agent",
+ "resource.grandParent.trait[reasonForLastRestart] = OOMError"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGreatGrandParentResourceTraitExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[] {
+ "resource.greatGrandParent.trait[agentHomeDirectory] = /var/rhq-agent",
+ "resource.greatGrandParent.trait[reasonForLastRestart] = OOMError"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGreatGreatGrandParentResourceTraitExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[] {
+ "resource.greatGreatGrandParent.trait[agentHomeDirectory] = /var/rhq-agent",
+ "resource.greatGreatGrandParent.trait[reasonForLastRestart] = OOMError"
+ };
}
});
}
@@ -748,6 +790,174 @@ public class ExpressionEvaluatorTest extends AbstractEJB3Test {
});
}
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleResourcePluginConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.pluginConfiguration[x] = 1",
+ "resource.pluginConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleChildResourcePluginConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.child.pluginConfiguration[x] = 1",
+ "resource.child.pluginConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleParentResourcePluginConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.parent.pluginConfiguration[x] = 1",
+ "resource.parent.pluginConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGrandParentResourcePluginConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.grandParent.pluginConfiguration[x] = 1",
+ "resource.grandParent.pluginConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGreatGrandParentResourcePluginConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.greatGrandParent.pluginConfiguration[x] = 1",
+ "resource.greatGrandParent.pluginConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGreatGreatGrandParentResourcePluginConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.greatGreatGrandParent.pluginConfiguration[x] = 1",
+ "resource.greatGreatGrandParent.pluginConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleResourceConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.resourceConfiguration[x] = 1",
+ "resource.resourceConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleChildResourceConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.child.resourceConfiguration[x] = 1",
+ "resource.child.resourceConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleParentResourceConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.parent.resourceConfiguration[x] = 1",
+ "resource.parent.resourceConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGrandParentResourceConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.grandParent.resourceConfiguration[x] = 1",
+ "resource.grandParent.resourceConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGreatGrandParentResourceConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.greatGrandParent.resourceConfiguration[x] = 1",
+ "resource.greatGrandParent.resourceConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
+ @Test(expectedExceptions = DuplicateExpressionTypeException.class,
+ expectedExceptionsMessageRegExp = "You cannot specify multiple.*")
+ public void doNotAllowMultipleGreatGreatGrandParentResourceConfigExpressions() throws Exception {
+ evaluateExpressions(new ExpressionGenerator() {
+ @Override
+ public String[] getExpressions() {
+ return new String[]{
+ "resource.greatGreatGrandParent.resourceConfiguration[x] = 1",
+ "resource.greatGreatGrandParent.resourceConfiguration[y] = 2"
+ };
+ }
+ });
+ }
+
private String cleanUp(String result) {
return result.replaceAll("\\s+", " ").trim();
}
11 years, 5 months
[rhq] modules/plugins
by Jay Shaughnessy
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java | 24 --
modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java | 81 +++++++---
2 files changed, 62 insertions(+), 43 deletions(-)
New commits:
commit 8e3709f8d7a7ffce5b44322a656836be13a7a652
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Jun 27 13:24:00 2012 -0400
[Bug 835113 - EJB2 MDBs are DOWN in JON UI]
Restructure getAvailability() and getManagedComponent() to remove
ambiguity in UNKNOWN runState handling as well as provide consistent
Exception throwing/handling, and ManagedComponent refresh. Simplify the
override point for getManagedComponent.
Remove Ejb2BeanComponent's special-handling for UNKNOWN runState, previously committed for
this fix, in favor of the new base handling.
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java
index c4ae68f..95ba080 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/Ejb2BeanComponent.java
@@ -27,9 +27,7 @@ import java.util.Set;
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.managed.api.ComponentType;
import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.RunState;
-import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.plugins.jbossas5.util.Ejb2BeanUtils;
/**
@@ -40,27 +38,15 @@ import org.rhq.plugins.jbossas5.util.Ejb2BeanUtils;
public class Ejb2BeanComponent extends AbstractEjbBeanComponent {
private static final ComponentType MDB_COMPONENT_TYPE = new ComponentType("EJB", "MDB");
+
@Override
- protected AvailabilityType getAvailabilityForRunState(RunState runState) {
- AvailabilityType avail;
- if (MDB_COMPONENT_TYPE.equals(getComponentType())) {
- // This is a workaround for if BZ 835113.
- avail = (runState == RunState.RUNNING || runState == RunState.UNKNOWN) ?
- AvailabilityType.UP : AvailabilityType.DOWN;
- } else {
- avail = super.getAvailabilityForRunState(runState);
+ protected ManagedComponent getManagedComponent(ManagementView mv) throws Exception {
+ if (null == mv) {
+ throw new IllegalArgumentException("managementView can not be null");
}
- return avail;
- }
- @Override
- protected ManagedComponent getManagedComponent() {
if (MDB_COMPONENT_TYPE.equals(getComponentType())) {
try {
- //we need to reload the management view here, because the MDBs might have changed since
- //the last call, because the @object-id is part of their names.
- ManagementView mv = getConnection().getManagementView();
-
Set<ManagedComponent> mdbs = mv.getComponentsForType(MDB_COMPONENT_TYPE);
for (ManagedComponent mdb : mdbs) {
@@ -73,7 +59,7 @@ public class Ejb2BeanComponent extends AbstractEjbBeanComponent {
throw new IllegalStateException(e);
}
} else {
- return super.getManagedComponent();
+ return super.getManagedComponent(mv);
}
return null;
diff --git a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
index a44cfc8..da0b24b 100644
--- a/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
+++ b/modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/ManagedComponentComponent.java
@@ -104,19 +104,21 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
*/
private static final long AVAIL_REFRESH_INTERVAL = 1000 * 60 * 15; // 15 minutes
+ private long availRefreshInterval = AVAIL_REFRESH_INTERVAL;
+
/**
* The ManagedComponent is fetched from the server in {@link #getManagedComponent} throughout
* the life cycle of this resource component. For example during metrics collections
- * when getValues is invoked, getManagedComponent is called. Any time getManagedComponent
+ * when getValues() is invoked, getManagedComponent() is called. Any time getManagedComponent()
* is called the lastComponentRefresh timestamp is updated. This timestamp is used in
* {@link #getAvailability} to determine whether or not a component is needed to
* perform an availability check.
*/
private long lastComponentRefresh = 0L;
- private long availRefreshInterval = AVAIL_REFRESH_INTERVAL;
-
- private RunState runState = RunState.UNKNOWN;
+ // The last known runState for the component. This is used to determine the result of getAvailability(). We
+ // do *not* cache the entire ManagedComponent because it is potentially a huge object that would eat too much memory.
+ private RunState runState;
private String componentName;
private ComponentType componentType;
@@ -124,20 +126,19 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
// ResourceComponent Implementation --------------------------------------------
public AvailabilityType getAvailability() {
- if (lastComponentRefresh == 0) {
- // The managed component has not been refreshed at all yet.
- getManagedComponent();
- } else {
- long timeSinceComponentRefresh = System.currentTimeMillis() - lastComponentRefresh;
- if (timeSinceComponentRefresh > availRefreshInterval) {
- if (log.isDebugEnabled()) {
- log.debug("The availability refresh interval for [resourceKey: "
- + getResourceContext().getResourceKey() + ", type: " + componentType + ", name: " + componentName
- + "] has been exceeded by " + (timeSinceComponentRefresh - availRefreshInterval)
- + " ms. Reloading managed component...");
- }
- getManagedComponent();
+ long timeSinceComponentRefresh = System.currentTimeMillis() - lastComponentRefresh;
+ boolean refresh = timeSinceComponentRefresh > availRefreshInterval;
+
+ if (refresh) {
+ if (lastComponentRefresh > 0L && log.isDebugEnabled()) {
+ log.debug("The availability refresh interval for [resourceKey: "
+ + getResourceContext().getResourceKey() + ", type: " + componentType + ", name: " + componentName
+ + "] has been exceeded by " + (timeSinceComponentRefresh - availRefreshInterval)
+ + " ms. Reloading managed component...");
}
+
+ ManagedComponent managedComponent = getManagedComponent();
+ runState = managedComponent.getRunState();
}
return getAvailabilityForRunState(runState);
@@ -146,11 +147,14 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
protected AvailabilityType getAvailabilityForRunState(RunState runState) {
if (runState == RunState.RUNNING) {
return AvailabilityType.UP;
+
} else {
if (log.isDebugEnabled()) {
- log.debug(componentType + " component '" + componentName + "' was not running - state was [" + runState
- + "].");
+ log.debug("Returning DOWN avail for " + componentType + " component '" + componentName
+ + "' with runState [" + runState
+ + "].");
}
+
return AvailabilityType.DOWN;
}
}
@@ -438,29 +442,58 @@ public class ManagedComponentComponent extends AbstractManagedComponent implemen
return componentName;
}
+ /**
+ * This method should most likely not be overridden. Instead, override {@link #getManagedComponent(ManagementView)}.
+ * <br/><br/>
+ * IMPORTANT!!! The returned ManagedComponent SHOULD NOT be cached in the instance. It is potentially a memory hog.
+ *
+ * @return The ManagedComponent
+ * @throws RuntimeException if fetching the ManagementView or getting the component fails
+ * @throws IllegalStateException if the managedComponent is null/not found
+ */
+ @NotNull
protected ManagedComponent getManagedComponent() {
ManagedComponent managedComponent;
+
try {
ManagementView managementView = getConnection().getManagementView();
- managedComponent = managementView.getComponent(this.componentName, this.componentType);
+ managedComponent = getManagedComponent(managementView);
} catch (Exception e) {
- runState = RunState.UNKNOWN;
throw new RuntimeException("Failed to load [" + this.componentType + "] ManagedComponent ["
+ this.componentName + "].", e);
}
+
+ // Even if not found, update the refresh time. It will avoid too many costly, and potentially fruitless, fetches
+ lastComponentRefresh = System.currentTimeMillis();
+
if (managedComponent == null) {
- runState = RunState.UNKNOWN;
throw new IllegalStateException("Failed to find [" + this.componentType + "] ManagedComponent named ["
+ this.componentName + "].");
}
+
if (log.isTraceEnabled()) {
log.trace("Retrieved " + toString(managedComponent) + ".");
}
- lastComponentRefresh = System.currentTimeMillis();
- runState = managedComponent.getRunState();
+
return managedComponent;
}
+ /**
+ * This is an override point. When actually fetching the managed component, this entry point should not be
+ * used. Instead, access should be via {@link #getManagedComponent()}.
+ *
+ * @param managementView
+ * @return the ManagedComponent. Null if not found.
+ * @Throws Exception if there is a problem getting the component.
+ */
+ protected ManagedComponent getManagedComponent(ManagementView managementView) throws Exception {
+ if (null == managementView) {
+ throw new IllegalArgumentException("managementView can not be null");
+ }
+
+ return managementView.getComponent(this.componentName, this.componentType);
+ }
+
@NotNull
private OperationDefinition getOperationDefinition(String operationName) {
ResourceType resourceType = getResourceContext().getResourceType();
11 years, 5 months
[rhq] modules/core modules/enterprise modules/plugins
by Jiri Kremser
modules/core/client-api/pom.xml | 437 ++---
modules/enterprise/gui/coregui/pom.xml | 773 ++++-----
modules/enterprise/server/jar/pom.xml | 2108 +++++++++++++-------------
modules/enterprise/server/xml-schemas/pom.xml | 465 ++---
modules/plugins/perftest/pom.xml | 472 ++---
5 files changed, 2139 insertions(+), 2116 deletions(-)
New commits:
commit 4699b70c9bde96b1c95c89e7e9b32e6ff73ad860
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed Jun 27 15:55:28 2012 +0200
formatting only
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index 834ad85..6f6a937 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -1,285 +1,288 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ </parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <packaging>jar</packaging>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <packaging>jar</packaging>
- <name>RHQ Client API</name>
- <description>Server and Client APIs for invoking operations on the RHQ plugin container</description>
+ <name>RHQ Client API</name>
+ <description>Server and Client APIs for invoking operations on the RHQ plugin container</description>
- <dependencies>
+ <dependencies>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-comm-api</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-comm-api</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-common-drift</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-common-drift</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- TODO: This is a fix for the Javac bug requiring annotations to be
available when compiling dependent classes; it is fixed in JDK 6. -->
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>hibernate-all</artifactId>
- <version>1.0.0.Alpha9</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>hibernate-all</artifactId>
+ <version>1.0.0.Alpha9</version>
+ <scope>provided</scope>
<!-- set scope to 'provided', so Hibernate annotations can be used in the entities -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>jboss-ejb3-all</artifactId>
- <version>1.0.0.Alpha9</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>jboss-ejb3-all</artifactId>
+ <version>1.0.0.Alpha9</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
<!--<scope>test</scope> not sure about this -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>commons-jxpath</groupId>
- <artifactId>commons-jxpath</artifactId>
- <version>1.3</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>com.sun.tools.xjc.maven2</groupId>
- <artifactId>maven-jaxb-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.sun.tools.xjc.maven2</groupId>
+ <artifactId>maven-jaxb-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
<configuration>
- <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ <includes>
+ <include>org/rhq/core/clientapi/shared/**</include>
+ </includes>
</configuration>
- </plugin>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-xjc-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
<configuration>
- <source>1.6</source>
+ <sources>
+ <source>${basedir}/target/generated-sources/xjc</source>
+ </sources>
</configuration>
- </plugin>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <configuration>
- <includes>
- <include>org/rhq/core/clientapi/shared/**</include>
- </includes>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <profiles>
+
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/lib</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
+ <artifactId>maven-antrun-plugin</artifactId>
<executions>
+
<execution>
- <id>add-xjc-source</id>
- <phase>generate-sources</phase>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${rhq.deploymentDir}"/>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/>
+ </target>
+ </configuration>
<goals>
- <goal>add-source</goal>
+ <goal>run</goal>
</goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
<configuration>
- <sources>
- <source>${basedir}/target/generated-sources/xjc</source>
- </sources>
+ <target>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}"/>
+ </target>
</configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
+
</executions>
</plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>dev</id>
-
- <properties>
- <rhq.rootDir>../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/lib</rhq.deploymentDir>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <mkdir dir="${rhq.deploymentDir}" />
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Updating ${deployment.file}...</echo>
- <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Deleting ${deployment.file}...</echo>
- <delete file="${deployment.file}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
+ </plugins>
+ </build>
+ </profile>
<profile>
<id>cobertura</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.cobertura</groupId>
- <artifactId>cobertura</artifactId>
- <version>${cobertura.version}</version>
- </dependency>
- </dependencies>
- <executions>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>${cobertura.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
<execution>
- <id>cobertura-instrument</id>
- <phase>process-test-classes</phase>
- <configuration>
- <target>
+ <id>cobertura-instrument</id>
+ <phase>process-test-classes</phase>
+ <configuration>
+ <target>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/cobertura/backup" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
- <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
+ <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- create a properties file and save there location of cobertura data file-->
- <touch file="target/classes/cobertura.properties" />
- <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <touch file="target/classes/cobertura.properties"/>
+ <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
- <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser" todir="${project.build.directory}/classes">
- <fileset dir="${project.build.directory}/classes">
- <include name="**/*.class" />
+ <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
+ todir="${project.build.directory}/classes">
+ <fileset dir="${project.build.directory}/classes">
+ <include name="**/*.class"/>
</fileset>
</cobertura-instrument>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
<execution>
- <id>cobertura-report</id>
- <phase>prepare-package</phase>
- <configuration>
- <target>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <id>cobertura-report</id>
+ <phase>prepare-package</phase>
+ <configuration>
+ <target>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/site/cobertura" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
- <copy toDir="target/classes" verbose="true" overwrite="true">
+ <copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- delete backup folder-->
- <delete dir="target/cobertura/backup" />
+ <delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
- <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura">
+ <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
+ destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.java" />
+ <include name="**/*.java"/>
</fileset>
- </cobertura-report>
+ </cobertura-report>
<!-- delete cobertura.properties file -->
- <delete file="target/classes/cobertura.properties" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <delete file="target/classes/cobertura.properties"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 29662c8..e3aca30 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -1,33 +1,34 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
<groupId>org.rhq</groupId>
- <artifactId>rhq-coregui</artifactId>
- <packaging>war</packaging>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-coregui</artifactId>
+ <packaging>war</packaging>
- <name>RHQ Enterprise Core GUI</name>
- <description>the RHQ Enterprise Core GUI webapp</description>
+ <name>RHQ Enterprise Core GUI</name>
+ <description>the RHQ Enterprise Core GUI webapp</description>
- <properties>
+ <properties>
<!-- dependency versions -->
- <gwt.version>2.4.0</gwt.version>
- <smartgwt.version>3.0</smartgwt.version>
+ <gwt.version>2.4.0</gwt.version>
+ <smartgwt.version>3.0</smartgwt.version>
<!-- If this is too much memory to allocate to your gwt:debug process then override this property in
in your settings.xml -->
- <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs>
- <gwt-plugin.localWorkers>4</gwt-plugin.localWorkers>
+ <gwt-plugin.extraJvmArgs>-Xms512M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=256M</gwt-plugin.extraJvmArgs>
+ <gwt-plugin.localWorkers>4</gwt-plugin.localWorkers>
- <coreGuiParams />
- <coreGuiRunTarget>'http://localhost:7080/coregui/CoreGUI.html${coreGuiParams}'</coreGuiRunTarget>
+ <coreGuiParams/>
+ <coreGuiRunTarget>'http://localhost:7080/coregui/CoreGUI.html${coreGuiParams}'</coreGuiRunTarget>
<!--
This property is substituted, by the resource plugin during the resources phase, as the
@@ -52,201 +53,201 @@
Multiple agents can be specified as a comma-delimited list, as demonstrated by the default
value below.
-->
- <gwt.userAgent>ie8,ie9,gecko1_8,safari,opera</gwt.userAgent>
+ <gwt.userAgent>ie8,ie9,gecko1_8,safari,opera</gwt.userAgent>
<!-- Change this to "true" via the mvn command line or your ~/.m2/settings.xml to speed
up gwt compilation. -->
- <gwt.draftCompile>false</gwt.draftCompile>
+ <gwt.draftCompile>false</gwt.draftCompile>
<!-- Change this to "true" via the mvn command line or your ~/.m2/settings.xml to generate report -->
- <gwt.soyc>false</gwt.soyc>
+ <gwt.soyc>false</gwt.soyc>
<!-- Change this to "DETAILED" via the mvn command line or your ~/.m2/settings.xml to
make sure GWT-generated JavaScript code is not obfuscated. -->
- <gwt.style>PRETTY</gwt.style>
+ <gwt.style>PRETTY</gwt.style>
<!-- Comma-separated list of the locales that should be included during GWT compilation. The specified locales
should each have two corresponding message bundle properties files under
src/main/resources/org/rhq/enterprise/gui/coregui/client/. For example, the "ja" locale has
Messages_ja.properties and MessageConstants_ja.properties. -->
- <gwt.locale>en,de,ja,pt,zh,ru,cs</gwt.locale>
+ <gwt.locale>en,de,ja,pt,zh,ru,cs</gwt.locale>
<!-- The locale that GWT should fallback to if the user specified an unsupported locale via the 'locale' query
string parameter. -->
- <gwt.fallback.locale>en</gwt.fallback.locale>
-
- <enable.tags>true</enable.tags>
- </properties>
+ <gwt.fallback.locale>en</gwt.fallback.locale>
+
+ <enable.tags>true</enable.tags>
+ </properties>
- <dependencies>
+ <dependencies>
<!-- ============= Internal Deps ============= -->
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
<!-- by rhq.ear (as ejb-jar) -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
<!-- by rhq.ear (as ejb-jar) -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-util</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-util</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
<!-- by rhq.ear -->
- </dependency>
+ </dependency>
<!-- =============== 3rd Party Deps =============== -->
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-servlet</artifactId>
- <version>${gwt.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
- <version>${gwt.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- This is so we can compile custom GWT Generators to be called during gwt compilation.
Is is not needed at runtime and so is not included in the WAR. -->
- <dependency>
- <groupId>com.google.gwt</groupId>
- <artifactId>gwt-dev</artifactId>
- <version>${gwt.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>com.smartgwt</groupId>
- <artifactId>smartgwt</artifactId>
- <version>${smartgwt.version}</version>
- </dependency>
+ <dependency>
+ <groupId>com.smartgwt</groupId>
+ <artifactId>smartgwt</artifactId>
+ <version>${smartgwt.version}</version>
+ </dependency>
<!-- the GWT graphing library (note, this provides jquery 1.3.2. If we get rid of GFlot we will need
to provide jquery explcitly for jquery.sparkline support. See CoreGUI.gwt.xml for the jquery.sparkline
declaration and coregui/webapp/js for the lib inclusion.) -->
- <dependency>
- <groupId>ca.nanometrics</groupId>
- <artifactId>gflot</artifactId>
- <version>1.0.0</version>
- </dependency>
+ <dependency>
+ <groupId>ca.nanometrics</groupId>
+ <artifactId>gflot</artifactId>
+ <version>1.0.0</version>
+ </dependency>
<!-- for file uploads -->
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.3.1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.4</version>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.opensymphony.quartz</groupId>
- <artifactId>quartz</artifactId>
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope>
+ <scope>provided</scope>
<!-- by JBossAS itself, which the container buildNodes has packaged with 1.6.5 -->
- </dependency>
+ </dependency>
<!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
- <dependency>
- <groupId>hibernate-annotations</groupId>
- <artifactId>hibernate-annotations</artifactId>
+ <dependency>
+ <groupId>hibernate-annotations</groupId>
+ <artifactId>hibernate-annotations</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
<!-- transitive dependency needed for JspC -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
<!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
<!-- needed for EJB3 annotations (e.g. ApplicationException) -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3x</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
<!-- Needed due to JDK 1.5 bug. -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-annotations-ejb3</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope>
+ <scope>provided</scope>
<!-- by JBossAS -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
- <version>3.0.1-native-2.0.4.GA</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <dependency>
+ <groupId>jboss.jbossws</groupId>
+ <artifactId>jboss-jaxws</artifactId>
+ <version>3.0.1-native-2.0.4.GA</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <finalName>coregui</finalName>
+ <build>
+ <finalName>coregui</finalName>
- <resources>
- <resource>
- <targetPath>${project.build.directory}/generated-sources/gwt</targetPath>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
+ <resources>
+ <resource>
+ <targetPath>${project.build.directory}/generated-sources/gwt</targetPath>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
<!--
Do NOT include java files here, because otherwise the java files from
resources would end up in WEB-INF/classes which definitely not something
@@ -259,110 +260,110 @@
need to replace the ${...} place-holders with the build-provided values
in there.
-->
- <includes>
- <include>**/*.gwt.xml</include>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </resource>
- </resources>
-
-
- <plugins>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>gwt-maven-plugin</artifactId>
- <version>2.4.0</version>
- <configuration>
- <noServer>true</noServer>
- <inplace>false</inplace>
+ <includes>
+ <include>**/*.gwt.xml</include>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </resource>
+ </resources>
+
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <version>2.4.0</version>
+ <configuration>
+ <noServer>true</noServer>
+ <inplace>false</inplace>
<!-- <logLevel>INFO' -bindAddress 0.0.0.0 -logLevel 'INFO</logLevel> -->
- <logLevel>INFO</logLevel>
- <runTarget>${coreGuiRunTarget}</runTarget>
- <extraJvmArgs>${gwt-plugin.extraJvmArgs}</extraJvmArgs>
- <localWorkers>${gwt-plugin.localWorkers}</localWorkers>
- <draftCompile>${gwt.draftCompile}</draftCompile>
- <soyc>${gwt.soyc}</soyc>
- <buildOutputDirectory>target/gwtclasses</buildOutputDirectory>
- <hostedWebapp>target/hostedWar</hostedWebapp>
- <debugSuspend>false</debugSuspend>
- <servicePattern>**/gwt/*GWTService.java</servicePattern>
- <i18nMessagesBundle>org.rhq.enterprise.gui.coregui.client.Messages</i18nMessagesBundle>
- <i18nConstantsWithLookupBundle>org.rhq.enterprise.gui.coregui.client.MessageConstants</i18nConstantsWithLookupBundle>
- <compileSourcesArtifact>org.rhq:rhq-core-domain</compileSourcesArtifact>
- <style>${gwt.style}</style>
- <strict>true</strict>
+ <logLevel>INFO</logLevel>
+ <runTarget>${coreGuiRunTarget}</runTarget>
+ <extraJvmArgs>${gwt-plugin.extraJvmArgs}</extraJvmArgs>
+ <localWorkers>${gwt-plugin.localWorkers}</localWorkers>
+ <draftCompile>${gwt.draftCompile}</draftCompile>
+ <soyc>${gwt.soyc}</soyc>
+ <buildOutputDirectory>target/gwtclasses</buildOutputDirectory>
+ <hostedWebapp>target/hostedWar</hostedWebapp>
+ <debugSuspend>false</debugSuspend>
+ <servicePattern>**/gwt/*GWTService.java</servicePattern>
+ <i18nMessagesBundle>org.rhq.enterprise.gui.coregui.client.Messages</i18nMessagesBundle>
+ <i18nConstantsWithLookupBundle>org.rhq.enterprise.gui.coregui.client.MessageConstants</i18nConstantsWithLookupBundle>
+ <compileSourcesArtifact>org.rhq:rhq-core-domain</compileSourcesArtifact>
+ <style>${gwt.style}</style>
+ <strict>true</strict>
<!-- compiles gwt artifacts like symbolMap outside of war so it doesnt get packaged -->
- <deploy>${project.build.directory}/gwt-deploy</deploy>
- </configuration>
-
- <executions>
- <execution>
- <id>gwt-goals</id>
- <goals>
- <goal>compile</goal>
- <goal>generateAsync</goal>
- <goal>i18n</goal>
- </goals>
- </execution>
- <execution>
+ <deploy>${project.build.directory}/gwt-deploy</deploy>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>gwt-goals</id>
+ <goals>
+ <goal>compile</goal>
+ <goal>generateAsync</goal>
+ <goal>i18n</goal>
+ </goals>
+ </execution>
+ <execution>
<!-- This id is what does the trick, don't change it. For this to work maven 2.2.0 and later is needed. -->
- <id>default-cli</id>
- <goals>
- <goal>debug</goal>
- </goals>
- <configuration>
- <module>org.rhq.enterprise.gui.coregui.CoreGUI</module>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Build-Number>${buildNumber}</Build-Number>
- </manifestEntries>
- </archive>
- <webResources>
- <resource>
- <filtering>false</filtering>
- <directory>${basedir}/src/main/webapp</directory>
- </resource>
- </webResources>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-gwt-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources/gwt</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <id>default-cli</id>
+ <goals>
+ <goal>debug</goal>
+ </goals>
+ <configuration>
+ <module>org.rhq.enterprise.gui.coregui.CoreGUI</module>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Build-Number>${buildNumber}</Build-Number>
+ </manifestEntries>
+ </archive>
+ <webResources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>${basedir}/src/main/webapp</directory>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-gwt-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/generated-sources/gwt</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<!--
<plugin>
@@ -406,36 +407,36 @@
</executions>
</plugin>
-->
- </plugins>
+ </plugins>
- </build>
+ </build>
- <profiles>
- <profile>
- <id>dev</id>
+ <profiles>
+ <profile>
+ <id>dev</id>
- <properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
- <rhq.deploymentDir>
- ${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
+ <rhq.deploymentDir>
+ ${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}
</rhq.deploymentDir>
- </properties>
+ </properties>
- <build>
- <plugins>
+ <build>
+ <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
- <execution>
- <id>deploy-classes</id>
- <phase>compile</phase>
- <configuration>
- <target>
+ <execution>
+ <id>deploy-classes</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
<!--
<property name="classes.dir" location="${rhq.deploymentDir}/WEB-INF/classes" />
<echo>*** Copying updated files from target/${project.buildNodes.finalName}/WEB-INF/classes to ${classes.dir}...</echo>
@@ -443,126 +444,126 @@
<fileset dir="war/WEB-INF/classes" />
</copy>
-->
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from
- src${file.separator}main${file.separator}webapp${file.separator} to
- ${deployment.dir}${file.separator}...
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Copying updated files from
+ src${file.separator}main${file.separator}webapp${file.separator} to
+ ${deployment.dir}${file.separator}...
</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="${basedir}/src/main/webapp" />
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>deploy</id>
- <phase>package</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from
- target${file.separator}${project.build.finalName}${file.separator} to
- ${deployment.dir}${file.separator}...
+ <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
+ <fileset dir="${basedir}/src/main/webapp"/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>deploy</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Copying updated files from
+ target${file.separator}${project.build.finalName}${file.separator} to
+ ${deployment.dir}${file.separator}...
</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="${basedir}/target/${project.build.finalName}" />
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
- <delete dir="${deployment.dir}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
+ <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
+ <fileset dir="${basedir}/target/${project.build.finalName}"/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
+ <delete dir="${deployment.dir}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
<!-- Change the runTarget to not have single quotes. The quotes work for linux but not win -->
- <profile>
- <id>windows</id>
- <activation>
- <os>
- <family>Windows</family>
- </os>
- </activation>
- <properties>
- <coreGuiRunTarget>http://localhost:7080/coregui/CoreGUI.html${coreGuiParams}</coreGuiRunTarget>
- </properties>
- </profile>
-
- <profile>
- <id>msg</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <includes>
- <include>org/rhq/enterprise/gui/coregui/client/Messages*.java</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>disable-tags</id>
- <activation>
- <property>
- <name>brew</name>
- </property>
- </activation>
- <properties>
- <enable.tags>false</enable.tags>
- </properties>
- </profile>
-
- </profiles>
-
-
- <repositories>
- <repository>
- <id>smartgwt</id>
- <name>SmartGWT Releases</name>
- <url>http://www.smartclient.com/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
-
- <repository>
- <id>codehaus</id>
- <name>Codehaus Releases</name>
- <url>http://repository.codehaus.org/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
-
- </repositories>
+ <profile>
+ <id>windows</id>
+ <activation>
+ <os>
+ <family>Windows</family>
+ </os>
+ </activation>
+ <properties>
+ <coreGuiRunTarget>http://localhost:7080/coregui/CoreGUI.html${coreGuiParams}</coreGuiRunTarget>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>msg</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>org/rhq/enterprise/gui/coregui/client/Messages*.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>disable-tags</id>
+ <activation>
+ <property>
+ <name>brew</name>
+ </property>
+ </activation>
+ <properties>
+ <enable.tags>false</enable.tags>
+ </properties>
+ </profile>
+
+ </profiles>
+
+
+ <repositories>
+ <repository>
+ <id>smartgwt</id>
+ <name>SmartGWT Releases</name>
+ <url>http://www.smartclient.com/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ <repository>
+ <id>codehaus</id>
+ <name>Codehaus Releases</name>
+ <url>http://repository.codehaus.org/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
</project>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index bf10fc1..aa0aad3 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -1,95 +1,96 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
- <artifactId>rhq-enterprise-server</artifactId>
- <packaging>ejb</packaging>
+ <artifactId>rhq-enterprise-server</artifactId>
+ <packaging>ejb</packaging>
- <name>RHQ Enterprise Server JAR</name>
- <description>RHQ enterprise server main JAR</description>
+ <name>RHQ Enterprise Server JAR</name>
+ <description>RHQ enterprise server main JAR</description>
- <properties>
- <rhq.server.datasource>java:/RHQDS</rhq.server.datasource>
- <rhq.server.ds-mapping>PostgreSQL</rhq.server.ds-mapping>
+ <properties>
+ <rhq.server.datasource>java:/RHQDS</rhq.server.datasource>
+ <rhq.server.ds-mapping>PostgreSQL</rhq.server.ds-mapping>
<!-- dependency versions -->
- <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version>
+ <jboss-embeddable-ejb3.version>1.0.0.Alpha9</jboss-embeddable-ejb3.version>
- <clean.db>true</clean.db>
- </properties>
+ <clean.db>true</clean.db>
+ </properties>
- <dependencies>
+ <dependencies>
<!-- Internal Deps -->
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-comm</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope> <!-- by ear -->
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-dbutils</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>safe-invoker</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-common-drift</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-container-lib</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.googlecode.java-diff-utils</groupId>
- <artifactId>diffutils</artifactId>
- <version>1.2.1</version>
- </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-comm</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- by ear -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-dbutils</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>safe-invoker</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-common-drift</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-container-lib</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.java-diff-utils</groupId>
+ <artifactId>diffutils</artifactId>
+ <version>1.2.1</version>
+ </dependency>
<!--================ Test Deps ================-->
@@ -99,1103 +100,1114 @@
need the embeddable-ejb3 jar above the standard ejb3 jars because we need the embeddble packages
loaded when testing. -->
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>test-utils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.rhq.helpers</groupId>
- <artifactId>perftest-support</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant-launcher</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>jboss-ejb3-all</artifactId>
- <version>${jboss-embeddable-ejb3.version}</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.rhq.helpers</groupId>
+ <artifactId>perftest-support</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant-launcher</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>jboss-ejb3-all</artifactId>
+ <version>${jboss-embeddable-ejb3.version}</version>
+ <scope>test</scope>
+ </dependency>
<!-- NOTE: The remaining test deps correspond to the classes contained in hibernate-all.jar and thirdparty-all.jar. -->
- <dependency>
- <groupId>antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>2.7.7</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>2.7.7</version>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>trove</groupId>
- <artifactId>trove</artifactId>
- <version>1.0.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>${xercesImpl.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sf.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- <version>1.8</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-jxpath</groupId>
- <artifactId>commons-jxpath</artifactId>
- <version>1.3</version>
- <scope>test</scope>
- </dependency>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>${xercesImpl.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.opencsv</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>1.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-jxpath</groupId>
+ <artifactId>commons-jxpath</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
<!-- 3rd Party Deps -->
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>3.2</version>
- </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>3.2</version>
+ </dependency>
<!-- Required by a couple APL and Lather classes - TODO: Remove this once APL and Lather have been excised. -->
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.6.1</version>
- </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.6.1</version>
+ </dependency>
<!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
<!-- also required by EJB3 Embedded (test scope) -->
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
<!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>1.1.4</version>
- </dependency>
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.1.4</version>
+ </dependency>
<!-- required by RHQ server classes, as well as EJB3 Embedded -->
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>1.6.1-jboss</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>gnu-getopt</groupId>
- <artifactId>getopt</artifactId>
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1-jboss</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>gnu-getopt</groupId>
+ <artifactId>getopt</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
+ <dependency>
+ <groupId>hibernate</groupId>
+ <artifactId>hibernate3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>hibernate-annotations</groupId>
- <artifactId>hibernate-annotations</artifactId>
+ <dependency>
+ <groupId>hibernate-annotations</groupId>
+ <artifactId>hibernate-annotations</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>hibernate-entitymanager</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
+ <dependency>
+ <groupId>hibernate-entitymanager</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>i18nlog</groupId>
- <artifactId>i18nlog</artifactId>
- </dependency>
+ <dependency>
+ <groupId>i18nlog</groupId>
+ <artifactId>i18nlog</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
<!-- The Sun javamail jar isn't available from a public repo due to licensing issues,
so use the Geronimo one instead. -->
- <version>1.3</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-annotations-ejb3</artifactId>
+ <version>1.3</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-cache</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-cache</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>compile</scope>
- </dependency>
+ <scope>compile</scope>
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3x</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
<!-- includes the org.jboss.ejb3.StrictMaxPool class, which is needed by the PoolClass annotation used on some
of our SLSB's -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-jmx</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jmx</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-system</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-system</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbosssx</artifactId>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbosssx</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jbpm</artifactId>
- <version>3.1.1</version>
- </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>3.1.1</version>
+ </dependency>
<!-- for the transaction interrupt EJB3 interceptor -->
- <dependency>
- <groupId>org.jboss.transaction</groupId>
- <artifactId>jboss-jta</artifactId>
+ <dependency>
+ <groupId>org.jboss.transaction</groupId>
+ <artifactId>jboss-jta</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS -->
+ </dependency>
<!-- TODO: remove this - tests should all be moved under the test source tree -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.opensymphony.quartz</groupId>
- <artifactId>quartz</artifactId>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
- </dependency>
+ <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
+ </dependency>
- <dependency>
- <groupId>org.opensymphony.quartz</groupId>
- <artifactId>quartz-oracle</artifactId>
+ <dependency>
+ <groupId>org.opensymphony.quartz</groupId>
+ <artifactId>quartz-oracle</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymockclassextension</artifactId>
- <version>2.2</version>
- <scope>test</scope>
+ <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
<!-- somehow this is needed otherwise the hibernate stuff doesn't initialize in our tests -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>org.snmp4j</groupId>
- <artifactId>snmp4j</artifactId>
- <version>1.8.2</version>
- </dependency>
+ <dependency>
+ <groupId>org.snmp4j</groupId>
+ <artifactId>snmp4j</artifactId>
+ <version>1.8.2</version>
+ </dependency>
<!-- required by RHQ server classes, as well as EJB3 Embedded -->
- <dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4</version>
- </dependency>
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4</version>
+ </dependency>
<!-- TODO: Why is this needed? -->
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
<!--<scope>test</scope>-->
- </dependency>
-
- <dependency>
- <groupId>rss4j</groupId>
- <artifactId>rss4j</artifactId>
- <version>0.92-on.2</version>
- </dependency>
-
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>5.5.20</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>tomcat-jk</artifactId>
- <version>4.1.31</version>
- <scope>provided</scope>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>rss4j</groupId>
+ <artifactId>rss4j</artifactId>
+ <version>0.92-on.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>5.5.20</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>tomcat-jk</artifactId>
+ <version>4.1.31</version>
+ <scope>provided</scope>
+ </dependency>
<!-- Needed by com.jboss.jbossnetwork.apl.actions.xml.XPathProcessor; TODO: Remove once APL has been excised. -->
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.5.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.29</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope> <!-- by container -->
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jackson-provider</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope> <!-- by container -->
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-links</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope> <!-- by container -->
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-yaml-provider</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxb-provider</artifactId>
- <version>${resteasy.version}</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.xml.stream</groupId>
- <artifactId>sjsxp</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.wordnik</groupId>
- <artifactId>swagger-annotations_2.9.1</artifactId>
- <version>1.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.rhq.helpers</groupId>
- <artifactId>rest-docs-generator</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>1.8</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- <version>2.0.1.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>freemarker</artifactId>
- <version>2.3.18</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-module-testng</artifactId>
- <version>${powermock.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
- <version>${powermock.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.liquibase</groupId>
- <artifactId>liquibase-core</artifactId>
- <version>2.0.3</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${project.artifactId}</finalName>
-
- <resources>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.5.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.29</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope> <!-- by container -->
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jackson-provider</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope> <!-- by container -->
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-links</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope> <!-- by container -->
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-yaml-provider</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxb-provider</artifactId>
+ <version>${resteasy.version}</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.stream</groupId>
+ <artifactId>sjsxp</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.wordnik</groupId>
+ <artifactId>swagger-annotations_2.9.1</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq.helpers</groupId>
+ <artifactId>rest-docs-generator</artifactId>
+ <version>${project.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <version>2.0.1.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.18</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-testng</artifactId>
+ <version>${powermock.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>${powermock.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.liquibase</groupId>
+ <artifactId>liquibase-core</artifactId>
+ <version>2.0.3</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+
+ <resources>
<!-- Redefine which directories to treat like resources (which are filtered). -->
- <resource>
- <directory>src/main/filtered-sources/java</directory>
- <filtering>true</filtering>
- <targetPath>../filtered-sources/java</targetPath>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
-
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- </testResources>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-ejb-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <generateClient>true</generateClient>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <phase>process-classes</phase>
- <configuration>
- <target>
+ <resource>
+ <directory>src/main/filtered-sources/java</directory>
+ <filtering>true</filtering>
+ <targetPath>../filtered-sources/java</targetPath>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <generateClient>true</generateClient>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <phase>process-classes</phase>
+ <configuration>
+ <target>
<!-- generate the I18N resource bundles -->
- <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask" />
+ <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask"/>
- <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false" verify="true">
- <classpath refid="maven.runtime.classpath" />
- <classfileset dir="${project.build.outputDirectory}">
- <include name="**/ServerI18NResourceKeys.class" />
- <include name="**/AlertI18NResourceKeys.class" />
- </classfileset>
- </i18n>
+ <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false"
+ verify="true">
+ <classpath refid="maven.runtime.classpath"/>
+ <classfileset dir="${project.build.outputDirectory}">
+ <include name="**/ServerI18NResourceKeys.class"/>
+ <include name="**/AlertI18NResourceKeys.class"/>
+ </classfileset>
+ </i18n>
<!-- create our rhq-server-version.properties file that goes in our jar -->
- <tstamp>
- <format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z" />
- </tstamp>
-
- <echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
-Product-Version=${project.version}
-Module-Name=${project.name}
-Module-Version=${project.version}
-Build-Number=${buildNumber}
-Build-Date=${build.time}
-Build-Jdk-Vendor=${java.vendor}
-Build-Jdk=${java.version}
-Build-OS-Name=${os.name}
-Build-OS-Version=${os.version}
+ <tstamp>
+ <format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z"/>
+ </tstamp>
+
+ <echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
+ Product-Version=${project.version}
+ Module-Name=${project.name}
+ Module-Version=${project.version}
+ Build-Number=${buildNumber}
+ Build-Date=${build.time}
+ Build-Jdk-Vendor=${java.vendor}
+ Build-Jdk=${java.version}
+ Build-OS-Name=${os.name}
+ Build-OS-Version=${os.version}
</echo>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
<!-- in order to get JMS to work properly in embedded test container, extract jms-rs.rar classes -->
- <execution>
- <id>Extract JMS classes from RAR needed for JMS tests</id>
- <phase>process-classes</phase>
- <configuration>
- <target>
- <unzip src="src/test/resources/jms-ra.rar" dest="target">
- <patternset>
- <include name="jms-ra.jar"/>
- </patternset>
- </unzip>
- <unzip src="target/jms-ra.jar" dest="target/test-classes">
- <patternset>
- <include name="org/**"/>
- </patternset>
- </unzip>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>Extract JMS classes from RAR needed for JMS tests</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <target>
+ <unzip src="src/test/resources/jms-ra.rar" dest="target">
+ <patternset>
+ <include name="jms-ra.jar"/>
+ </patternset>
+ </unzip>
+ <unzip src="target/jms-ra.jar" dest="target/test-classes">
+ <patternset>
+ <include name="org/**"/>
+ </patternset>
+ </unzip>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- </executions>
- </plugin>
+ </executions>
+ </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
<!-- Everything but the web service tests, this is the standard test execution -->
- <configuration>
- <skipTests>true</skipTests>
- <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
- <groups>${rhq.testng.includedGroups}</groups>
- <properties>
- <property>
- <name>listener</name>
- <value>org.rhq.test.testng.StdoutReporter</value>
- </property>
- </properties>
- <systemPropertyVariables>
- <embeddedDeployment>true</embeddedDeployment>
- <deploymentDirectory>target/classes</deploymentDirectory>
- <hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
- <clean.db>${clean.db}</clean.db>
- <log4j.configDebug>false</log4j.configDebug>
- </systemPropertyVariables>
- <additionalClasspathElements>
+ <configuration>
+ <skipTests>true</skipTests>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <groups>${rhq.testng.includedGroups}</groups>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.rhq.test.testng.StdoutReporter</value>
+ </property>
+ </properties>
+ <systemPropertyVariables>
+ <embeddedDeployment>true</embeddedDeployment>
+ <deploymentDirectory>target/classes</deploymentDirectory>
+ <hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
+ <clean.db>${clean.db}</clean.db>
+ <log4j.configDebug>false</log4j.configDebug>
+ </systemPropertyVariables>
+ <additionalClasspathElements>
<!-- The below is required for tests to run against Oracle. -->
- <additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
- </additionalClasspathElements>
+ <additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
+ </additionalClasspathElements>
+ </configuration>
+
+ <executions>
+
+ <execution>
+ <id>allExceptDbTests</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skipTests>${skipTests}</skipTests>
+ <excludes>
+ <exclude>com/**/*.java</exclude>
+ <exclude>org/rhq/**/performance/**/*.java</exclude>
+ <exclude>org/rhq/enterprise/server/db/**</exclude>
+ </excludes>
</configuration>
-
- <executions>
-
- <execution>
- <id>allExceptDbTests</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skipTests>${skipTests}</skipTests>
- <excludes>
- <exclude>com/**/*.java</exclude>
- <exclude>org/rhq/**/performance/**/*.java</exclude>
- <exclude>org/rhq/enterprise/server/db/**</exclude>
- </excludes>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.antlr</groupId>
- <artifactId>antlr3-maven-plugin</artifactId>
- <version>3.2</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>antlr</goal>
- </goals>
- <configuration>
- <conversionTimeout>30000</conversionTimeout>
- <debug>false</debug>
- <dfa>false</dfa>
- <nfa>false</nfa>
- <excludes>
-
- </excludes>
- <includes>
-
- </includes>
- <libDirectory>src/main/antlr3/imports</libDirectory>
- <messageFormat>antlr</messageFormat>
- <outputDirectory>target/generated-sources/antlr3</outputDirectory>
- <printGrammar>false</printGrammar>
- <profile>false</profile>
- <report>false</report>
- <sourceDirectory>src/main/antlr3</sourceDirectory>
- <trace>false</trace>
- <verbose>true</verbose>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-filtered-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/filtered-sources/java</source>
- </sources>
- </configuration>
- </execution>
- <execution>
- <id>add-antlr-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources/antlr3</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr3-maven-plugin</artifactId>
+ <version>3.2</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>antlr</goal>
+ </goals>
+ <configuration>
+ <conversionTimeout>30000</conversionTimeout>
+ <debug>false</debug>
+ <dfa>false</dfa>
+ <nfa>false</nfa>
+ <excludes>
+
+ </excludes>
+ <includes>
+
+ </includes>
+ <libDirectory>src/main/antlr3/imports</libDirectory>
+ <messageFormat>antlr</messageFormat>
+ <outputDirectory>target/generated-sources/antlr3</outputDirectory>
+ <printGrammar>false</printGrammar>
+ <profile>false</profile>
+ <report>false</report>
+ <sourceDirectory>src/main/antlr3</sourceDirectory>
+ <trace>false</trace>
+ <verbose>true</verbose>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-filtered-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/filtered-sources/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-antlr-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/generated-sources/antlr3</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<!-- Document generation from the Annotations on the REST-API. -->
<!-- TODO move to a better suited processing phase -->
- <plugin>
- <groupId>org.bsc.maven</groupId>
- <artifactId>maven-processor-plugin</artifactId>
- <version>2.0.6-redhat</version>
- <configuration>
- <processors>
- <processor>org.rhq.helpers.rest_docs_generator.ClassLevelProcessor</processor>
- </processors>
- <compilerArguments>-AtargetDirectory=${project.build.directory}/docs/xml</compilerArguments>
+ <plugin>
+ <groupId>org.bsc.maven</groupId>
+ <artifactId>maven-processor-plugin</artifactId>
+ <version>2.0.6-redhat</version>
+ <configuration>
+ <processors>
+ <processor>org.rhq.helpers.rest_docs_generator.ClassLevelProcessor</processor>
+ </processors>
+ <compilerArguments>-AtargetDirectory=${project.build.directory}/docs/xml</compilerArguments>
<!-- Comment the next line in to get more verbose output for debugging -->
<!--<compilerArguments>-Averbose=true</compilerArguments>-->
- </configuration>
- <executions>
- <execution>
- <id>create-rest-api-reports</id>
- <phase>process-classes</phase>
- <goals>
+ </configuration>
+ <executions>
+ <execution>
+ <id>create-rest-api-reports</id>
+ <phase>process-classes</phase>
+ <goals>
<!-- We want to process the classes in src/ -->
- <goal>process</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<!-- Disable annotation processors during normal compilation -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgument>-proc:none</compilerArgument>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xml-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <goals>
- <goal>transform</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <transformationSets>
- <transformationSet>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgument>-proc:none</compilerArgument>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <transformationSets>
+ <transformationSet>
<!-- org.rhq.helpers.rest_docs_generator.test plugin wrote to target/docs/xml (see -AtargetDirectory above) -->
- <dir>target/docs/xml</dir>
- <includes><include>rest-api-out.xml</include></includes>
- <stylesheet>src/main/xsl/apiout2html.xsl</stylesheet>
- <parameters>
- <parameter>
- <name>basePath</name>
- <value>http://localhost:7080/rest/1</value>
- </parameter>
- </parameters>
- <outputDir>${project.build.directory}/docs/html</outputDir>
- <fileMappers>
- <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
- <targetExtension>.html</targetExtension>
- </fileMapper>
- </fileMappers>
- </transformationSet>
- <transformationSet>
+ <dir>target/docs/xml</dir>
+ <includes>
+ <include>rest-api-out.xml</include>
+ </includes>
+ <stylesheet>src/main/xsl/apiout2html.xsl</stylesheet>
+ <parameters>
+ <parameter>
+ <name>basePath</name>
+ <value>http://localhost:7080/rest/1</value>
+ </parameter>
+ </parameters>
+ <outputDir>${project.build.directory}/docs/html</outputDir>
+ <fileMappers>
+ <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
+ <targetExtension>.html</targetExtension>
+ </fileMapper>
+ </fileMappers>
+ </transformationSet>
+ <transformationSet>
<!-- org.rhq.helpers.rest_docs_generator.test plugin wrote to target/docs/xml (see -AtargetDirectory above) -->
- <dir>target/docs/xml</dir>
- <includes><include>rest-api-out.xml</include></includes>
- <stylesheet>src/main/xsl/apiout2docbook.xsl</stylesheet>
- <parameters>
- <parameter>
- <name>basePath</name>
- <value>http://localhost:7080/rest/1</value>
- </parameter>
- </parameters>
- <outputDir>${project.build.directory}/docs/xml</outputDir>
- <fileMappers>
- <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
- <targetExtension>.dbx.xml</targetExtension>
- </fileMapper>
- </fileMappers>
- </transformationSet>
- </transformationSets>
- </configuration>
- </plugin>
- <plugin>
- <groupId>com.agilejava.docbkx</groupId>
- <artifactId>docbkx-maven-plugin</artifactId>
- <version>2.0.9</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <goals>
- <goal>generate-pdf</goal>
- <goal>generate-html</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <sourceDirectory>target/docs/xml</sourceDirectory> <!-- from previous plugin, 2nd transformation set -->
- <includes>rest-api-out.dbx.xml</includes>
- <hyphenate>false</hyphenate>
- <generateToc>true</generateToc>
- </configuration>
- </plugin>
-
- </plugins>
-
- </build>
+ <dir>target/docs/xml</dir>
+ <includes>
+ <include>rest-api-out.xml</include>
+ </includes>
+ <stylesheet>src/main/xsl/apiout2docbook.xsl</stylesheet>
+ <parameters>
+ <parameter>
+ <name>basePath</name>
+ <value>http://localhost:7080/rest/1</value>
+ </parameter>
+ </parameters>
+ <outputDir>${project.build.directory}/docs/xml</outputDir>
+ <fileMappers>
+ <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
+ <targetExtension>.dbx.xml</targetExtension>
+ </fileMapper>
+ </fileMappers>
+ </transformationSet>
+ </transformationSets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.agilejava.docbkx</groupId>
+ <artifactId>docbkx-maven-plugin</artifactId>
+ <version>2.0.9</version>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>generate-pdf</goal>
+ <goal>generate-html</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <sourceDirectory>target/docs/xml</sourceDirectory> <!-- from previous plugin, 2nd transformation set -->
+ <includes>rest-api-out.dbx.xml</includes>
+ <hyphenate>false</hyphenate>
+ <generateToc>true</generateToc>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
<repositories>
<repository>
<!-- TODO change when the annotations are puplished. This is temporary for the swagger annotations for REST-docu -->
- <id>sonatype-oss-snapshot</id>
- <name>Sonatype OSS Snapshot repository</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ <id>sonatype-oss-snapshot</id>
+ <name>Sonatype OSS Snapshot repository</name>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
- <profiles>
+ <profiles>
- <profile>
+ <profile>
<!-- only if we are not running an individual set of tests via -Dtest do we do this -->
- <id>no-individual-test</id>
- <activation>
- <property><name>!test</name></property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <id>no-individual-test</id>
+ <activation>
+ <property>
+ <name>!test</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
<!-- Everything but the web service tests, this is the standard test execution -->
- <configuration>
- <skipTests>true</skipTests>
- <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
- <groups>${rhq.testng.includedGroups}</groups>
- <properties>
- <property>
- <name>listener</name>
- <value>org.rhq.test.testng.StdoutReporter</value>
- </property>
- </properties>
- <systemPropertyVariables>
- <embeddedDeployment>true</embeddedDeployment>
- <deploymentDirectory>target/classes</deploymentDirectory>
- <hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
- <clean.db>${clean.db}</clean.db>
- <log4j.configDebug>false</log4j.configDebug>
- </systemPropertyVariables>
- <additionalClasspathElements>
+ <configuration>
+ <skipTests>true</skipTests>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <groups>${rhq.testng.includedGroups}</groups>
+ <properties>
+ <property>
+ <name>listener</name>
+ <value>org.rhq.test.testng.StdoutReporter</value>
+ </property>
+ </properties>
+ <systemPropertyVariables>
+ <embeddedDeployment>true</embeddedDeployment>
+ <deploymentDirectory>target/classes</deploymentDirectory>
+ <hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
+ <clean.db>${clean.db}</clean.db>
+ <log4j.configDebug>false</log4j.configDebug>
+ </systemPropertyVariables>
+ <additionalClasspathElements>
<!-- The below is required for tests to run against Oracle. -->
- <additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
- </additionalClasspathElements>
- </configuration>
- <executions>
- <execution>
- <id>dbTestsOnly</id>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skipTests>${skipTests}</skipTests>
- <includes>
- <include>org/rhq/enterprise/server/db/**</include>
- </includes>
- <failIfNoTests>false</failIfNoTests>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>dev</id>
-
- <properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentName>${project.build.finalName}-ejb3.jar</rhq.deploymentName>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}</rhq.deploymentDir>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from target/classes to ${deployment.dir}...</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="target/classes" />
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
+ </additionalClasspathElements>
+ </configuration>
+ <executions>
+ <execution>
+ <id>dbTestsOnly</id>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skipTests>${skipTests}</skipTests>
+ <includes>
+ <include>org/rhq/enterprise/server/db/**</include>
+ </includes>
+ <failIfNoTests>false</failIfNoTests>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentName>${project.build.finalName}-ejb3.jar</rhq.deploymentName>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Copying updated files from target/classes to ${deployment.dir}...</echo>
+ <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
+ <fileset dir="target/classes"/>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
<!--
NOTE: The below execution is necessary to make sure the META-INF/MANIFEST.MF and
META-INF/maven/** files, which get created by the ejb plugin during the package phase, get
copied over to the deployment dir.
-->
- <execution>
- <id>deploy-jar-meta-inf</id>
- <phase>package</phase>
- <configuration>
- <target>
- <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${rhq.deploymentDir}" overwrite="false">
- <patternset>
- <include name="META-INF/**" />
- </patternset>
- </unjar>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
- <delete dir="${deployment.dir}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
+ <execution>
+ <id>deploy-jar-meta-inf</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${rhq.deploymentDir}"
+ overwrite="false">
+ <patternset>
+ <include name="META-INF/**"/>
+ </patternset>
+ </unjar>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <!-- Add dependencies need for jdk5 builds. Remove when we stop supporting jdk5 -->
- <profile>
- <id>java-5-dependencies</id>
- <activation>
- <jdk>1.5</jdk>
- <property>
- <name>java5.home</name>
- </property>
- </activation>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.dir" location="${rhq.deploymentDir}"/>
+ <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
+ <delete dir="${deployment.dir}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <dependencies>
- <dependency>
- <groupId>jboss.jbossws</groupId>
- <artifactId>jboss-jaxws</artifactId>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- Add dependencies need for jdk5 builds. Remove when we stop supporting jdk5 -->
+ <profile>
+ <id>java-5-dependencies</id>
+ <activation>
+ <jdk>1.5</jdk>
+ <property>
+ <name>java5.home</name>
+ </property>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>jboss.jbossws</groupId>
+ <artifactId>jboss-jaxws</artifactId>
<!-- NOTE: This version is old but is good enough to resolve the build dependency. -->
- <version>3.0.1-native-2.0.4.GA</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </profile>
-
- <profile>
- <id>javadoc</id>
- <activation>
- <property>
- <name>javadoc.outputDirectory</name>
- </property>
- </activation>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>remote-api</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <property name="javadoc.outputDirectory" value="${javadoc.outputDirectory}" />
- <property name="project.dir" value="./src/main/java/org/rhq/enterprise/server" />
- <property name="maven.compile.classpath" refid="maven.compile.classpath" />
-
- <mkdir dir="${javadoc.outputDirectory}/remote-api" />
- <javadoc destdir="${javadoc.outputDirectory}/remote-api" author="false" version="true" windowtitle="RHQ ${project.version} Remote API" noindex="false">
- <classpath>
- <pathelement path="${maven.compile.classpath}" />
- </classpath>
- <fileset dir="${project.dir}" defaultexcludes="yes">
- <include name="**/*Remote.java" />
- </fileset>
- <link href="../domain/" />
- <link href="http://download.oracle.com/javase/6/docs/api/" />
- <bottom><![CDATA[Copyright © 2005-2011 <a href="http://redhat.com/">Red Hat, Inc.</a>. All Rights Reserved.]]></bottom>
- </javadoc>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
- </plugins>
- </build>
-
- </profile>
-
- <profile>
- <id>cobertura</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.cobertura</groupId>
- <artifactId>cobertura</artifactId>
- <version>${cobertura.version}</version>
- </dependency>
- </dependencies>
- <executions>
+ <version>3.0.1-native-2.0.4.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>javadoc</id>
+ <activation>
+ <property>
+ <name>javadoc.outputDirectory</name>
+ </property>
+ </activation>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
<execution>
- <id>cobertura-instrument</id>
- <phase>process-test-classes</phase>
- <configuration>
- <target>
+ <id>remote-api</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <property name="javadoc.outputDirectory" value="${javadoc.outputDirectory}"/>
+ <property name="project.dir" value="./src/main/java/org/rhq/enterprise/server"/>
+ <property name="maven.compile.classpath" refid="maven.compile.classpath"/>
+
+ <mkdir dir="${javadoc.outputDirectory}/remote-api"/>
+ <javadoc destdir="${javadoc.outputDirectory}/remote-api" author="false" version="true"
+ windowtitle="RHQ ${project.version} Remote API" noindex="false">
+ <classpath>
+ <pathelement path="${maven.compile.classpath}"/>
+ </classpath>
+ <fileset dir="${project.dir}" defaultexcludes="yes">
+ <include name="**/*Remote.java"/>
+ </fileset>
+ <link href="../domain/"/>
+ <link href="http://download.oracle.com/javase/6/docs/api/"/>
+ <bottom><![CDATA[Copyright © 2005-2011 <a href="http://redhat.com/">Red Hat, Inc.</a>. All Rights Reserved.]]></bottom>
+ </javadoc>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ </profile>
+
+ <profile>
+ <id>cobertura</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>${cobertura.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>cobertura-instrument</id>
+ <phase>process-test-classes</phase>
+ <configuration>
+ <target>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/cobertura/backup" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
- <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
+ <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- create a properties file and save there location of cobertura data file-->
- <touch file="target/classes/cobertura.properties" />
- <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <touch file="target/classes/cobertura.properties"/>
+ <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
- <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser" todir="${project.build.directory}/classes">
- <fileset dir="${project.build.directory}/classes">
- <include name="**/*.class" />
- <exclude name="**/DynamicConfigurationPropertyLocal.class" />
- <exclude name="**/DynamicConfigurationPropertyBean.class" />
+ <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
+ todir="${project.build.directory}/classes">
+ <fileset dir="${project.build.directory}/classes">
+ <include name="**/*.class"/>
+ <exclude name="**/DynamicConfigurationPropertyLocal.class"/>
+ <exclude name="**/DynamicConfigurationPropertyBean.class"/>
</fileset>
</cobertura-instrument>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
<execution>
- <id>cobertura-report</id>
- <phase>prepare-package</phase>
- <configuration>
- <target>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <id>cobertura-report</id>
+ <phase>prepare-package</phase>
+ <configuration>
+ <target>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/site/cobertura" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
- <copy toDir="target/classes" verbose="true" overwrite="true">
+ <copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- delete backup folder-->
- <delete dir="target/cobertura/backup" />
+ <delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
- <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura">
+ <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
+ destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.java" />
+ <include name="**/*.java"/>
</fileset>
- </cobertura-report>
+ </cobertura-report>
<!-- delete cobertura.properties file -->
- <delete file="target/classes/cobertura.properties" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <delete file="target/classes/cobertura.properties"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index 6923a7a..8e4bc21 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -1,82 +1,83 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
<groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
- <packaging>jar</packaging>
+ <artifactId>rhq-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ <relativePath>../../../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-enterprise-server-xml-schemas</artifactId>
+ <packaging>jar</packaging>
- <name>RHQ Server XML Schemas</name>
- <description>Server side XML schemas and JAXB APIs used mailing to support the RHQ Server plugin container</description>
+ <name>RHQ Server XML Schemas</name>
+ <description>Server side XML schemas and JAXB APIs used mailing to support the RHQ Server plugin container</description>
- <dependencies>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope> <!-- rhq.ear -->
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope> <!-- rhq.ear -->
+ </dependency>
- <dependency>
- <groupId>${rhq.groupId}</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <dependency>
+ <groupId>${rhq.groupId}</groupId>
+ <artifactId>rhq-core-client-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
<!--<scope>test</scope> not sure about this -->
- </dependency>
+ </dependency>
<!--
TODO: This is a fix for the Javac bug requiring annotations to be available when compiling dependent
classes; it is fixed in JDK 6.
-->
- <dependency>
- <groupId>jboss.jboss-embeddable-ejb3</groupId>
- <artifactId>hibernate-all</artifactId>
- <version>1.0.0.Alpha9</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>jboss.jboss-embeddable-ejb3</groupId>
+ <artifactId>hibernate-all</artifactId>
+ <version>1.0.0.Alpha9</version>
+ <scope>provided</scope>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>com.sun.tools.xjc.maven2</groupId>
- <artifactId>maven-jaxb-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
- <schemaDirectory>${basedir}/target/classes</schemaDirectory>
- <includeSchemas>
- <includeSchema>*.xsd</includeSchema>
- </includeSchemas>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.sun.tools.xjc.maven2</groupId>
+ <artifactId>maven-jaxb-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ <schemaDirectory>${basedir}/target/classes</schemaDirectory>
+ <includeSchemas>
+ <includeSchema>*.xsd</includeSchema>
+ </includeSchemas>
+ </configuration>
+ </plugin>
<!--
Because the JAXB generator needs all .xsd's available and in one place so they can reference each other
@@ -90,211 +91,213 @@
we still have a duplicate copy of the .xsd in our jar, but this is OK because it is a true duplicate
so it doesn't really matter that we have one copy here and one copy in client-api jar.
-->
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>Copy the schemas in one place, including rhq-configuration.xsd schema so we can reuse it</id>
- <phase>initialize</phase>
- <configuration>
- <target>
- <mkdir dir="${basedir}/target/classes" />
- <copy todir="${basedir}/target/classes">
- <fileset dir="${basedir}/src/main/resources">
- <include name="*.xsd" />
- </fileset>
- <fileset dir="${basedir}/../../../core/client-api/src/main/resources">
- <include name="rhq-configuration.xsd" />
- </fileset>
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>purge duplicated JAXB-generated configuration schema classes</id>
- <phase>process-sources</phase>
- <configuration>
- <target>
- <delete dir="${basedir}/target/generated-sources/xjc/org/rhq/core" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>Copy the schemas in one place, including rhq-configuration.xsd schema so we can reuse it</id>
+ <phase>initialize</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${basedir}/target/classes"/>
+ <copy todir="${basedir}/target/classes">
+ <fileset dir="${basedir}/src/main/resources">
+ <include name="*.xsd"/>
+ </fileset>
+ <fileset dir="${basedir}/../../../core/client-api/src/main/resources">
+ <include name="rhq-configuration.xsd"/>
+ </fileset>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>purge duplicated JAXB-generated configuration schema classes</id>
+ <phase>process-sources</phase>
+ <configuration>
+ <target>
+ <delete dir="${basedir}/target/generated-sources/xjc/org/rhq/core"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-xjc-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources/xjc</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-xjc-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/target/generated-sources/xjc</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <profiles>
+ <profiles>
- <profile>
- <id>dev</id>
+ <profile>
+ <id>dev</id>
- <properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/lib</rhq.deploymentDir>
- </properties>
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/lib</rhq.deploymentDir>
+ </properties>
- <build>
- <plugins>
+ <build>
+ <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <mkdir dir="${rhq.deploymentDir}" />
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Updating ${deployment.file}...</echo>
- <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${rhq.deploymentDir}"/>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Deleting ${deployment.file}...</echo>
- <delete file="${deployment.file}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- </executions>
- </plugin>
+ </executions>
+ </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>cobertura</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.cobertura</groupId>
- <artifactId>cobertura</artifactId>
- <version>${cobertura.version}</version>
- </dependency>
- </dependencies>
- <executions>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>${cobertura.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
<execution>
- <id>cobertura-instrument</id>
- <phase>process-test-classes</phase>
- <configuration>
- <target>
+ <id>cobertura-instrument</id>
+ <phase>process-test-classes</phase>
+ <configuration>
+ <target>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/cobertura/backup" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
- <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
+ <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- create a properties file and save there location of cobertura data file-->
- <touch file="target/classes/cobertura.properties" />
- <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <touch file="target/classes/cobertura.properties"/>
+ <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
- <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser" todir="${project.build.directory}/classes">
- <fileset dir="${project.build.directory}/classes">
- <include name="**/*.class" />
+ <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
+ todir="${project.build.directory}/classes">
+ <fileset dir="${project.build.directory}/classes">
+ <include name="**/*.class"/>
</fileset>
</cobertura-instrument>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
<execution>
- <id>cobertura-report</id>
- <phase>prepare-package</phase>
- <configuration>
- <target>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <id>cobertura-report</id>
+ <phase>prepare-package</phase>
+ <configuration>
+ <target>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/site/cobertura" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
- <copy toDir="target/classes" verbose="true" overwrite="true">
+ <copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- delete backup folder-->
- <delete dir="target/cobertura/backup" />
+ <delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
- <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura">
+ <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
+ destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.java" />
+ <include name="**/*.java"/>
</fileset>
- </cobertura-report>
+ </cobertura-report>
<!-- delete cobertura.properties file -->
- <delete file="target/classes/cobertura.properties" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <delete file="target/classes/cobertura.properties"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/modules/plugins/perftest/pom.xml b/modules/plugins/perftest/pom.xml
index e045081..9f93a29 100644
--- a/modules/plugins/perftest/pom.xml
+++ b/modules/plugins/perftest/pom.xml
@@ -1,291 +1,295 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-plugins-parent</artifactId>
- <version>4.5.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-plugins-parent</artifactId>
+ <version>4.5.0-SNAPSHOT</version>
+ </parent>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-perftest-plugin</artifactId>
- <packaging>jar</packaging>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-perftest-plugin</artifactId>
+ <packaging>jar</packaging>
- <name>RHQ Performance Test Plugin</name>
- <description>a plugin for performance testing</description>
+ <name>RHQ Performance Test Plugin</name>
+ <description>a plugin for performance testing</description>
- <dependencies>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
+ </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- </dependency>
- </dependencies>
+ </dependency>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>com.sun.tools.xjc.maven2</groupId>
- <artifactId>maven-jaxb-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.sun.tools.xjc.maven2</groupId>
+ <artifactId>maven-jaxb-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <generatePackage>org.rhq.plugins.perftest.scenario</generatePackage>
+ <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-jaxb-deps</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
<configuration>
- <generatePackage>org.rhq.plugins.perftest.scenario</generatePackage>
- <generateDirectory>${basedir}/target/generated-sources/xjc</generateDirectory>
+ <artifactItems>
+ <artifactItem>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
</configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-jaxb-deps</id>
- <phase>process-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-xjc-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources/xjc</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-xjc-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
<configuration>
- <skip>true</skip>
+ <sources>
+ <source>${basedir}/target/generated-sources/xjc</source>
+ </sources>
</configuration>
- <executions>
- <execution>
- <id>surefire-it</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>${maven.test.skip}</skip>
- <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
- <useSystemClassLoader>false</useSystemClassLoader>
- <argLine>-Djava.library.path=${basedir}/target/itest/lib</argLine>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>${maven.test.skip}</skip>
+ <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+ <useSystemClassLoader>false</useSystemClassLoader>
+ <argLine>-Djava.library.path=${basedir}/target/itest/lib</argLine>
<!--
<argLine>-Djava.library.path=${basedir}/target/itest/lib -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</argLine>
-->
- <systemPropertyVariables>
- <project.artifactId>${project.artifactId}</project.artifactId>
- <project.version>${project.version}</project.version>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <systemPropertyVariables>
+ <project.artifactId>${project.artifactId}</project.artifactId>
+ <project.version>${project.version}</project.version>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
- </plugins>
- </build>
+ </plugins>
+ </build>
- <profiles>
+ <profiles>
- <profile>
- <id>dev</id>
+ <profile>
+ <id>dev</id>
- <properties>
- <rhq.rootDir>../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
- </properties>
+ <properties>
+ <rhq.rootDir>../../..</rhq.rootDir>
+ <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+ <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+ </properties>
- <build>
- <plugins>
+ <build>
+ <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
- <execution>
- <id>deploy</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <mkdir dir="${rhq.deploymentDir}" />
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Updating ${deployment.file}...</echo>
- <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" update="true" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${rhq.deploymentDir}"/>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" update="true"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <execution>
- <id>deploy-jar-meta-inf</id>
- <phase>package</phase>
- <configuration>
- <target>
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
- <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.outputDirectory}">
- <patternset><include name="META-INF/**" /></patternset>
- </unjar>
- <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true">
- </jar>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>deploy-jar-meta-inf</id>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Updating META-INF dir in ${deployment.file}...</echo>
+ <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.outputDirectory}">
+ <patternset>
+ <include name="META-INF/**"/>
+ </patternset>
+ </unjar>
+ <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF"
+ update="true">
+ </jar>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
- <echo>*** Deleting ${deployment.file}...</echo>
- <delete file="${deployment.file}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar"/>
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
- </executions>
- </plugin>
+ </executions>
+ </plugin>
- </plugins>
- </build>
- </profile>
+ </plugins>
+ </build>
+ </profile>
- <profile>
+ <profile>
<id>cobertura-plugins</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.cobertura</groupId>
- <artifactId>cobertura</artifactId>
- <version>${cobertura.version}</version>
- </dependency>
- </dependencies>
- <executions>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <version>${cobertura.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
<execution>
- <id>cobertura-instrument</id>
- <phase>pre-integration-test</phase>
- <configuration>
- <target>
+ <id>cobertura-instrument</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <target>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/cobertura/backup" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
- <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
+ <copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- create a properties file and save there location of cobertura data file-->
- <touch file="target/classes/cobertura.properties" />
- <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <touch file="target/classes/cobertura.properties"/>
+ <echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
- <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser" todir="${project.build.directory}/classes">
- <fileset dir="${project.build.directory}/classes">
- <include name="**/*.class" />
+ <cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
+ todir="${project.build.directory}/classes">
+ <fileset dir="${project.build.directory}/classes">
+ <include name="**/*.class"/>
</fileset>
</cobertura-instrument>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
<execution>
- <id>cobertura-report</id>
- <phase>post-integration-test</phase>
- <configuration>
- <target>
- <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties" />
+ <id>cobertura-report</id>
+ <phase>post-integration-test</phase>
+ <configuration>
+ <target>
+ <taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
- <mkdir dir="target/cobertura" />
- <mkdir dir="target/site/cobertura" />
+ <mkdir dir="target/cobertura"/>
+ <mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
- <copy toDir="target/classes" verbose="true" overwrite="true">
+ <copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
- <include name="**/*.class" />
+ <include name="**/*.class"/>
</fileset>
- </copy>
+ </copy>
<!-- delete backup folder-->
- <delete dir="target/cobertura/backup" />
+ <delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
- <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser" destdir="${project.build.directory}/site/cobertura">
+ <cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
+ destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.java" />
+ <include name="**/*.java"/>
</fileset>
- </cobertura-report>
+ </cobertura-report>
<!-- delete cobertura.properties file -->
- <delete file="target/classes/cobertura.properties" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
+ <delete file="target/classes/cobertura.properties"/>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
11 years, 5 months
[rhq] modules/plugins
by Simeon Pinder
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java | 17
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java | 2
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java | 285 +++++++++-
3 files changed, 297 insertions(+), 7 deletions(-)
New commits:
commit 5a714f3df86fe659cf2bc5938accaa72482c362d
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Jun 26 19:14:10 2012 -0400
-Add a few more itests for SecurityDomain
-exercises most of the Module Option Types
-Remove Authentication (Classic) from ignore list
-Add ability to override default discovery depth.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
index 04c40de..43e6e06 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/AbstractJBossAS7PluginTest.java
@@ -18,6 +18,8 @@
*/
package org.rhq.modules.plugins.jbossas7.itest;
+import static org.testng.Assert.assertNotNull;
+
import java.util.Set;
import org.rhq.core.clientapi.agent.PluginContainerException;
@@ -35,8 +37,6 @@ import org.rhq.modules.plugins.jbossas7.itest.domain.DomainServerComponentTest;
import org.rhq.modules.plugins.jbossas7.itest.standalone.StandaloneServerComponentTest;
import org.rhq.test.arquillian.AfterDiscovery;
-import static org.testng.Assert.assertNotNull;
-
/**
* The base class for all as7 plugin integration tests.
*
@@ -51,6 +51,16 @@ public abstract class AbstractJBossAS7PluginTest extends AbstractAgentPluginTest
private static final int TYPE_HIERARCHY_DEPTH = 6;
+ private static int OVERRIDE_TYPE_HIERARCHY_DEPTH = -1;
+
+ public static int getMaxDiscoveryDepthOverride() {
+ return OVERRIDE_TYPE_HIERARCHY_DEPTH;
+ }
+
+ public static void setMaxDiscoveryDepthOverride(int overrideDepth) {
+ OVERRIDE_TYPE_HIERARCHY_DEPTH = overrideDepth;
+ }
+
private static boolean createdManagementUsers;
/**
@@ -115,6 +125,9 @@ public abstract class AbstractJBossAS7PluginTest extends AbstractAgentPluginTest
@Override
protected int getTypeHierarchyDepth() {
+ if (OVERRIDE_TYPE_HIERARCHY_DEPTH != -1) {
+ return OVERRIDE_TYPE_HIERARCHY_DEPTH;
+ }
return TYPE_HIERARCHY_DEPTH;
}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
index bd904b9..aad8739 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
@@ -84,7 +84,7 @@ public class ResourcesStandaloneServerTest extends AbstractJBossAS7PluginTest {
ignoredResources.add("Load Metric");
//will revisit after BZ 826542 is resolved
- ignoredResources.add("Authentication (Classic)");
+ // ignoredResources.add("Authentication (Classic)");
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
Resource server = getResourceByTypeAndKey(platform, StandaloneServerComponentTest.RESOURCE_TYPE,
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
index 7f9464a..e3f88af 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/SecurityModuleOptionsTest.java
@@ -21,9 +21,15 @@ package org.rhq.modules.plugins.jbossas7.itest.standalone;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
+import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Set;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;
import org.testng.annotations.Test;
@@ -32,17 +38,24 @@ import org.rhq.core.clientapi.agent.inventory.CreateResourceResponse;
import org.rhq.core.clientapi.agent.inventory.DeleteResourceRequest;
import org.rhq.core.clientapi.agent.inventory.DeleteResourceResponse;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.resource.CreateResourceStatus;
import org.rhq.core.domain.resource.DeleteResourceStatus;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pc.configuration.ConfigurationManager;
import org.rhq.core.pc.inventory.InventoryManager;
import org.rhq.modules.plugins.jbossas7.ASConnection;
import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent;
+import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent.Value;
import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
+import org.rhq.modules.plugins.jbossas7.json.Address;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.Result;
import org.rhq.test.arquillian.RunDiscovery;
/**
@@ -69,6 +82,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
private static String SECURITY_DOMAIN_RESOURCE_KEY = "security-domain";
private static String AUTH_CLASSIC_RESOURCE_TYPE = "Authentication (Classic)";
private static String AUTH_CLASSIC_RESOURCE_KEY = "authentication=classic";
+ private static String PROFILE = "profile=full-ha";
protected static final String DC_HOST = System.getProperty("jboss.domain.bindAddress");
protected static final int DC_HTTP_PORT = Integer.valueOf(System.getProperty("jboss.domain.httpManagementPort"));
@@ -83,6 +97,9 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
public static final ResourceType RESOURCE_TYPE = new ResourceType(SECURITY_RESOURCE_TYPE, PLUGIN_NAME,
ResourceCategory.SERVICE, null);
private static final String RESOURCE_KEY = SECURITY_RESOURCE_KEY;
+ private static Resource testSecurityDomain = null;
+ private String testSecurityDomainKey = null;
+ private ConfigurationManager testConfigurationManager = null;
//Define some shared and reusable content
static HashMap<String, String> jsonMap = new HashMap<String, String>();
@@ -100,19 +117,194 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
"[{\"code\":\"Test\", \"type\":\"attribute\", \"module-options\":{\"mapping\":\"module\", \"mapping1\":\"module1\"}}]");
jsonMap.put("provider-modules",
"[{\"code\":\"Providers\", \"module-options\":{\"provider\":\"module\", \"provider1\":\"module1\"}}]");
+ jsonMap
+ .put("acl-modules",
+ "[{\"flag\":\"sufficient\", \"code\":\"ACL\", \"module-options\":{\"acl\":\"module\", \"acl1\":\"module1\"}}]");
+ jsonMap
+ .put("trust-modules",
+ "[{\"flag\":\"optional\", \"code\":\"TRUST\", \"module-options\":{\"trust\":\"module\", \"trust1\":\"module1\"}}]");
}
- @Test(priority = 10, groups = "discovery")
+ /** This method mass loads all the supported Module Option Types(Excluding authentication=jaspi, cannot co-exist with
+ * authentication=classic) into a single SecurityDomain. This is done as
+ * -i)creating all of the related hierarchy of types needed to exercise N Module Options Types and their associated
+ * Module Options instances would take too long to setup(N creates would signal N discovery runs before test could complete).
+ * -ii)setting the priority of this method lower than the discovery method means that we'll get all the same types in much
+ * less time.
+ *
+ * @throws Exception
+ */
+ @Test(priority = 10)
+ public void testLoadStandardModuleOptionTypes() throws Exception {
+ mapper = new ObjectMapper();
+ mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+
+ //Adjust discovery depth to support deeper hierarchy depth of Module Option elements
+ setMaxDiscoveryDepthOverride(10);
+
+ //create new Security Domain
+ Address destination = new Address(PROFILE);
+ destination.addSegment(SECURITY_RESOURCE_KEY);
+ String securityDomainId = TEST_DOMAIN + "2";
+ destination.addSegment(SECURITY_DOMAIN_RESOURCE_KEY + "=" + securityDomainId);
+
+ ASConnection connection = getASConnection();
+ Result result = new Result();
+ //delete old one if present to setup clean slate
+ Operation op = new Operation("remove", destination);
+ result = connection.execute(op);
+
+ //build/rebuild hierarchy
+ op = new Operation("add", destination);
+ result = connection.execute(op);
+
+ //Ex. profile=standalone-ha,subsystem=security,security-domain
+ String addressPrefix = PROFILE + "," + SECURITY_RESOURCE_KEY + "," + SECURITY_DOMAIN_RESOURCE_KEY;
+
+ //loop over standard types and add base details for all of them to security domain
+ String address = "";
+ for (String attribute : jsonMap.keySet()) {
+ if (attribute.equals("policy-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",authorization=classic";
+ } else if (attribute.equals("acl-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",acl=classic";
+ } else if (attribute.equals("mapping-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",mapping=classic";
+ } else if (attribute.equals("trust-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",identity-trust=classic";
+ } else if (attribute.equals("provider-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",audit=classic";
+ } else if (attribute.equals("login-modules")) {
+ address = addressPrefix + "=" + securityDomainId + ",authentication=classic";
+ } else {
+ assert false : "An unknown attribute '" + attribute
+ + "' was found. Is there a new type to be supported?";
+ }
+ //build the operation to add the component
+ ////Load json map into ModuleOptionType
+ List<Value> moduleTypeValue = new ArrayList<Value>();
+ try {
+ // loading jsonMap contents for Ex. 'login-module'
+ JsonNode node = mapper.readTree(jsonMap.get(attribute));
+ Object obj = mapper.treeToValue(node, Object.class);
+ result.setResult(obj);
+ result.setOutcome("success");
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ //populate the Value component complete with module Options.
+ moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ op = ModuleOptionsComponent.createAddModuleOptionTypeOperation(new Address(address), attribute,
+ moduleTypeValue);
+ //submit the command
+ result = connection.execute(op);
+ }
+ }
+
+ @Test(priority = 11, groups = "discovery")
@RunDiscovery(discoverServices = true, discoverServers = true)
public void initialDiscovery() throws Exception {
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
assertNotNull(platform);
assertEquals(platform.getInventoryStatus(), InventoryStatus.COMMITTED);
- Thread.sleep(20 * 1000L); // delay so that PC gets a chance to scan for resources
+ //Have thread sleep longer to discover deeper resource types.
+ Thread.sleep(120 * 1000L); // delay so that PC gets a chance to scan for resources
}
+ /** This test method exercises a number of things:
+ * - that the security-domain children loaded have been created successfully
+ * - that all of the supported Module Option Type children(excluding 'authentication=jaspi') have been
+ * discovered as AS7 types successfully.
+ * - that the correct child attribute was specified for each type //Ex. acl=classic -> acl-modules
+ * -
+ *
+ * @throws Exception
+ */
@Test(priority = 12)
+ public void testDiscoveredSecurityNodes() throws Exception {
+ //lazy-load configurationManager
+ if (testConfigurationManager == null) {
+ testConfigurationManager = this.pluginContainer.getConfigurationManager();
+ testConfigurationManager = pluginContainer.getConfigurationManager();
+ testConfigurationManager.initialize();
+ Thread.sleep(20 * 1000L);
+ }
+ //iterate through list of nodes and make sure they've all been discovered
+ ////Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,acl=classic
+ String attribute = null;
+ for (String jsonKey : jsonMap.keySet()) {
+ //Ex. policy-modules
+ attribute = jsonKey;
+ //spinder 6/26/12: Temporarily disable until figure out why NPE happens only for this type?
+ if (attribute.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
+ break;//
+ }
+ //Ex. name=acl-modules
+ //check the configuration for the Module Option Type Ex. 'Acl (Profile)' Resource. Should be able to verify components
+ Resource aclResource = getModuleOptionResourceResource(attribute);
+ //assert non-zero id returned
+ assert aclResource.getId() > 0 : "The resource was not properly initialized. Expected id >0 but got:"
+ + aclResource.getId();
+
+ //Now request the resource complete with resource config
+ Configuration loadedConfiguration = testConfigurationManager.loadResourceConfiguration(aclResource.getId());
+ String code = null;
+ String type = null;
+ String flag = null;
+ //populate the associated attributes if it's supported.
+ for (String key : loadedConfiguration.getAllProperties().keySet()) {
+ Property property = loadedConfiguration.getAllProperties().get(key);
+ if (key.equals("code")) {
+ code = ((PropertySimple) property).getStringValue();
+ } else if (key.equals("flag")) {
+ flag = ((PropertySimple) property).getStringValue();
+ } else {//Ex. type.
+ type = ((PropertySimple) property).getStringValue();
+ }
+ }
+
+ //retrieve module options as well.
+ String jsonContent = jsonMap.get(attribute);
+ Result result = new Result();
+ try {
+ // loading jsonMap contents for Ex. 'login-module'
+ JsonNode node = mapper.readTree(jsonContent);
+ Object obj = mapper.treeToValue(node, Object.class);
+ result.setResult(obj);
+ result.setOutcome("success");
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ assert false;
+ } catch (IOException e) {
+ e.printStackTrace();
+ assert false;
+ }
+
+ //populate the Value component complete with module Options.
+ List<Value> moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ Value moduleOptionType = moduleTypeValue.get(0);
+ //Ex. retrieve the acl-modules component and assert values.
+ //always test 'code'
+ assert moduleOptionType.getCode().equals(code) : "Module Option 'code' value is not correct. Expected '"
+ + code + "' but was '" + moduleOptionType.getCode() + "'";
+ if (attribute.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
+ assert moduleOptionType.getType().equals(type) : "Mapping Module 'type' value is not correct. Expected '"
+ + type + "' but was '" + moduleOptionType.getType() + "'";
+ } else if (!attribute.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {//Audit has no second parameter
+ assert moduleOptionType.getFlag().equals(flag) : "Provider Module 'flag' value is not correct. Expected '"
+ + flag + "' but was '" + moduleOptionType.getFlag() + "'";
+ }
+ }
+ //TODO spinder 6-26-12: retrieve the Module Options and test them too.
+ }
+
+ @Test(priority = 13)
public void testCreateSecurityDomain() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -140,7 +332,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+ response.getErrorMessage();
}
- @Test(priority = 13)
+ @Test(priority = 14)
public void testAuthenticationClassic() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -179,7 +371,7 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+ response.getErrorMessage();
}
- @Test(priority = 14)
+ @Test(priority = 15)
public void testDeleteSecurityDomain() throws Exception {
//get the root security resource
securityResource = getResource();
@@ -210,6 +402,15 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
+ response.getErrorMessage();
}
+ // public static void main(String[] args) {
+ // SecurityModuleOptionsTest setup = new SecurityModuleOptionsTest();
+ // try {
+ // setup.testLoadStandardModuleOptionTypes();
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // }
+ // }
+
private Resource getResource() {
InventoryManager im = pluginContainer.getInventoryManager();
@@ -220,6 +421,82 @@ public class SecurityModuleOptionsTest extends AbstractJBossAS7PluginTest {
return bindings;
}
+ /** Automates
+ *
+ * @param optionAttributeType
+ * @return
+ */
+ private Resource getModuleOptionResourceResource(String optionAttributeType) {
+ Resource moduleOptionResource = null;
+ String securityDomainId = SECURITY_DOMAIN_RESOURCE_KEY + "=" + TEST_DOMAIN + "2";
+ if (testSecurityDomain == null) {
+ InventoryManager im = pluginContainer.getInventoryManager();
+ Resource platform = im.getPlatform();
+ //host controller
+ ResourceType hostControllerType = new ResourceType("JBossAS7 Host Controller", PLUGIN_NAME,
+ ResourceCategory.SERVER, null);
+ Resource hostController = getResourceByTypeAndKey(platform, hostControllerType,
+ "/tmp/jboss-as-6.0.0.GA/domain");
+ //profile=full-ha
+ ResourceType profileType = new ResourceType("Profile", PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ String key = PROFILE;
+ Resource profile = getResourceByTypeAndKey(hostController, profileType, key);
+
+ //Security (Profile)
+ ResourceType securityType = new ResourceType("Security (Profile)", PLUGIN_NAME, ResourceCategory.SERVICE,
+ null);
+ key += "," + SECURITY_RESOURCE_KEY;
+ Resource security = getResourceByTypeAndKey(profile, securityType, key);
+
+ //Security Domain (Profile)
+ ResourceType domainType = new ResourceType("Security Domain (Profile)", PLUGIN_NAME,
+ ResourceCategory.SERVICE, null);
+ key += "," + securityDomainId;
+ testSecurityDomainKey = key;
+ testSecurityDomain = getResourceByTypeAndKey(security, domainType, key);
+ }
+
+ //acl=classic
+ String descriptorName = "";
+ String moduleAttribute = "";
+ //acl
+ if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Acl.getAttribute())) {
+ descriptorName = "ACL (Profile)";
+ moduleAttribute = "acl=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Audit.getAttribute())) {
+ descriptorName = "Audit (Profile)";
+ moduleAttribute = "audit=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authentication.getAttribute())) {
+ descriptorName = "Authentication (Classic - Profile)";
+ moduleAttribute = "authentication=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Authorization.getAttribute())) {
+ descriptorName = "Authorization (Profile)";
+ moduleAttribute = "authorization=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.IdentityTrust.getAttribute())) {
+ descriptorName = "Identity Trust (Profile)";
+ moduleAttribute = "identity-trust=classic";
+ } else if (optionAttributeType.equals(ModuleOptionsComponent.ModuleOptionType.Mapping.getAttribute())) {
+ descriptorName = "Mapping (Profile)";
+ moduleAttribute = "mapping=classic";
+ }
+ //Build the right Module Option Type. Ex. ACL (Profile), etc.
+ ResourceType moduleOptionType = new ResourceType(descriptorName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
+ ConfigurationDefinition cdef = new ConfigurationDefinition(descriptorName, null);
+ moduleOptionType.setResourceConfigurationDefinition(cdef);
+ //Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,identity-trust=classic
+ String moduleOptionTypeKey = testSecurityDomainKey += "," + moduleAttribute;
+
+ if (!testSecurityDomainKey.endsWith(securityDomainId)) {
+ moduleOptionTypeKey = testSecurityDomainKey.substring(0, testSecurityDomainKey.indexOf(securityDomainId)
+ + securityDomainId.length())
+ + "," + moduleAttribute;
+ }
+
+ moduleOptionResource = getResourceByTypeAndKey(testSecurityDomain, moduleOptionType, moduleOptionTypeKey);
+
+ return moduleOptionResource;
+ }
+
private Resource getResource(Resource parentResource, String pluginDescriptorTypeName, String resourceKey) {
Resource resource = null;
if (((parentResource != null) & (pluginDescriptorTypeName != null) & (resourceKey != null))
11 years, 5 months
[rhq] modules/enterprise
by Jiri Kremser
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 8f00d2c8e2fde0d6a2d627a2780cbd4e75e200b5
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed Jun 27 14:13:52 2012 +0200
fix parametrization of class
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java
index 60cb4d3..b40ca54 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/AbstractMeasurementDataTraitListDetailView.java
@@ -38,7 +38,7 @@ import org.rhq.enterprise.gui.coregui.client.components.table.Table;
*
* @author Ian Springer
*/
-public abstract class AbstractMeasurementDataTraitListDetailView extends Table {
+public abstract class AbstractMeasurementDataTraitListDetailView extends Table<AbstractMeasurementDataTraitDataSource> {
private static final String[] EXCLUDED_FIELD_NAMES = new String[] { MeasurementDataTraitCriteria.SORT_FIELD_DISPLAY_NAME };
private static final SortSpecifier[] SORT_SPECIFIERS = new SortSpecifier[] {
11 years, 5 months