modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadDelegate.java
| 11
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
| 27
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
| 64 +-
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
| 58 +
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
| 315 +++++-----
modules/plugins/jboss-as-7/src/test/resources/groupedproperties.json
| 24
modules/plugins/jboss-as-7/src/test/resources/test-plugin.xml
| 29
7 files changed, 371 insertions(+), 157 deletions(-)
New commits:
commit f58db1a1406ee2e0db86698a55912c9ac6c2172c
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Mar 28 20:52:55 2012 -0500
Preliminary support for cmp subsystem.
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 3bc4694..8436761 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
@@ -2808,4 +2808,36 @@ working area for individual server
instances</li></ul>"/>
</service>
+ <service name="CMP"
+ class="BaseComponent"
+ discovery="SubsystemDiscovery"
+ description="The configuration of the cmp subsystem."
+ singleton="true">
+
+ <runs-inside>
+ <parent-resource-type name="Profile"
plugin="jboss-as-7"/>
+ <parent-resource-type name="JBossAS7 Standalone Server"
plugin="jboss-as-7"/>
+ </runs-inside>
+
+ <plugin-configuration>
+ <c:simple-property name="path" default="subsystem=cmp"
readOnly="true"/>
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:group name="child:hilo-keygenerator=hilo-keygenerator"
displayName="HiLo based key generators.">
+ <c:simple-property name="block-size"
required="false" type="long" readOnly="true"
description="The block size"/>
+ <c:simple-property name="create-table"
required="false" type="boolean" readOnly="true"
description="Boolean to determine whether to create create the tables"/>
+ <c:simple-property name="create-table-ddl"
required="false" type="string" readOnly="true"
description="The DDL used to create the table"/>
+ <c:simple-property name="data-source"
required="false" type="string" readOnly="true"
description="The datasource used for sequence generation"/>
+ <c:simple-property name="drop-table"
required="false" type="boolean" readOnly="true"
description="Boolean to determine whether to create drop the tables"/>
+ <c:simple-property name="id-column"
required="false" type="string" readOnly="true"
description="The ID column name"/>
+ <c:simple-property name="select-hi-ddl"
required="false" type="string" readOnly="true"
description="The DDL used to select the hi value"/>
+ <c:simple-property name="sequence-column"
required="false" type="string" readOnly="true"
description="The sequence column name"/>
+ <c:simple-property name="sequence-name"
required="false" type="string" readOnly="true"
description="The name of the sequence"/>
+ <c:simple-property name="table-name"
required="false" type="string" readOnly="true"
description="The table name"/>
+ </c:group>
+ </resource-configuration>
+
+ </service>
+
</plugin>
commit fa0d3329874e5887557df4afafcdd8d82cd99bc6
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Wed Mar 28 18:05:40 2012 -0500
Add support for singleton subsystems with identically named properties to be
configured from the grouped properties section of the main resource.
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadDelegate.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadDelegate.java
index 9965e9c..a1cde65 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadDelegate.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadDelegate.java
@@ -206,6 +206,17 @@ public class ConfigurationLoadDelegate implements ConfigurationFacet
{
} else { // standard case
Object valueObject;
+
+ //strip :number from properties
+ if (propertyName.contains(":")) {
+ try {
+
Integer.parseInt(propertyName.substring(propertyName.lastIndexOf(':') + 1));
+ propertyName = propertyName.substring(0,
propertyName.lastIndexOf(':'));
+ } catch (Exception e) {
+ //do nothing, this means the property name does not end with
:number, so nothing needs to be stripped
+ }
+ }
+
if (propertyName.endsWith(":expr") ||
propertyName.endsWith(":collapsed")) {
String realName = propertyName.substring(0,
propertyName.indexOf(":"));
valueObject = results.get(realName);
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
index fad0128..0d39fd1 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
@@ -240,12 +240,11 @@ public class ConfigurationWriteDelegate implements
ConfigurationFacet {
}
}
- private void updateHandlePropertyMap(CompositeOperation cop, PropertyMap prop,
PropertyDefinitionMap propDef,
- Address address) {
-
- String propName = prop.getName();
+ private void updateHandlePropertyMap(CompositeOperation cop, PropertyMap prop,
PropertyDefinitionMap propDef, Address address) {
Operation writeAttribute;
Map<String,Object> results;
+
+ String propName = stripNumberIdentifier(prop.getName());
if (propName.endsWith(":collapsed")) {
String realName = propName.substring(0, propName.indexOf(':'));
results = handleCollapsedMap(prop, propDef);
@@ -386,7 +385,9 @@ public class ConfigurationWriteDelegate implements ConfigurationFacet
{
values.add(mapResult);
}
}
- Operation writeAttribute = new WriteAttribute(address,prop.getName(),values);
+
+ String name = stripNumberIdentifier(prop.getName());
+ Operation writeAttribute = new WriteAttribute(address,name,values);
cop.addStep(writeAttribute);
}
@@ -399,7 +400,7 @@ public class ConfigurationWriteDelegate implements ConfigurationFacet
{
return;
Operation writeAttribute = new WriteAttribute(address);
- String name = propertySimple.getName();
+ String name = stripNumberIdentifier(propertySimple.getName());
if (name.endsWith(":expr")) {
String realName = name.substring(0,name.indexOf(":"));
@@ -482,5 +483,17 @@ public class ConfigurationWriteDelegate implements ConfigurationFacet
{
return ret;
}
-
+ private String stripNumberIdentifier(String name) {
+ //strip :number from the property name, it's not needed
+ //it was added in the descriptor as unique identifier
+ if (name.contains(":")) {
+ try {
+ Integer.parseInt(name.substring(name.lastIndexOf(':') + 1));
+ name = name.substring(0, name.lastIndexOf(':'));
+ } catch (Exception e) {
+ //do nothing, this means the property name does not end with :number, so
nothing needs to be stripped
+ }
+ }
+ return name;
+ }
}
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 1d85bff..3bc4694 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
@@ -2694,10 +2694,10 @@ working area for individual server
instances</li></ul>"/>
<resource-configuration>
<c:group name="child:bean-validation=bean-validation"
displayName="Bean validation (JSR-303) for resource adapters.">
- <c:simple-property name="enabled" required="false"
type="boolean" readOnly="false" defaultValue="true"
description="Specify whether bean validation is enabled. The default value is
true."/>
+ <c:simple-property name="enabled:1"
required="false" type="boolean" readOnly="false"
defaultValue="true" displayName="Enabled" description="Specify
whether bean validation is enabled. The default value is true."/>
</c:group>
<c:group name="child:archive-validation=archive-validation"
displayName="Archive validation for resource adapters.">
- <c:simple-property name="enabled" required="false"
type="boolean" readOnly="false" defaultValue="true"
description="Specify whether archive validation is enabled. The default value is
true."/>
+ <c:simple-property name="enabled:2"
required="false" type="boolean" readOnly="false"
defaultValue="true" displayName="Enabled" description="Specify
whether archive validation is enabled. The default value is true."/>
<c:simple-property name="fail-on-error"
required="false" type="boolean" readOnly="false"
defaultValue="true" description="Should an archive validation error report
fail the deployment. The default value is true."/>
<c:simple-property name="fail-on-warn"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="Should an archive validation warning
report fail the deployment. The default value is false."/>
</c:group>
@@ -2736,28 +2736,28 @@ working area for individual server
instances</li></ul>"/>
<c:simple-property name="name" required="false"
type="string" readOnly="false" description="The name of the
WorkManager"/>
<c:group
name="child:long-running-threads=default-long-running-threads"
displayName="Long running thread pool executor with a bounded queue where threads
submittings tasks may block.">
- <c:simple-property name="allow-core-timeout"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="Whether core threads may time out. The
default value is false."/>
- <c:simple-property name="core-threads:expr"
required="false" type="string" readOnly="false"
description="The core thread pool size which is smaller than the maximum pool size.
If undefined, the core thread pool size is the same as the maximum thread pool
size."/>
- <c:map-property name="keepalive-time"
description="Used to specify the amount of time that pool threads should be kept
running when idle; if not specified, threads will run until the executor is shut
down." >
+ <c:simple-property name="allow-core-timeout:1"
required="false" type="boolean" readOnly="false"
defaultValue="false" displayName="Allow Core Timeout"
description="Whether core threads may time out. The default value is
false."/>
+ <c:simple-property name="core-threads:expr:2"
required="false" type="string" readOnly="false"
displayName="Core Threads" description="The core thread pool size which is
smaller than the maximum pool size. If undefined, the core thread pool size is the same as
the maximum thread pool size."/>
+ <c:map-property name="keepalive-time:3"
displayName="Keepalive Time" description="Used to specify the amount of
time that pool threads should be kept running when idle; if not specified, threads will
run until the executor is shut down." >
<c:simple-property name="time" required="true"
type="long" readOnly="true" description="The time"/>
<c:simple-property name="unit" required="true"
type="string" readOnly="true" description="The time
unit"/>
</c:map-property>
- <c:simple-property name="max-threads:expr"
required="false" type="string" readOnly="false"
description="The maximum thread pool size."/>
- <c:simple-property name="name" required="false"
type="string" readOnly="true" description="The name of the thread
pool."/>
- <c:simple-property name="queue-length:expr"
required="false" type="string" readOnly="false"
description="The queue length."/>
- <c:simple-property name="thread-factory"
required="false" type="string" readOnly="false"
description="Specifies the name of a specific thread factory to use to create worker
threads. If not defined an appropriate default thread factory will be used."/>
+ <c:simple-property name="max-threads:expr:4"
required="false" type="string" readOnly="false"
displayName="Max Threads" description="The maximum thread pool
size."/>
+ <c:simple-property name="name:5" required="false"
type="string" readOnly="true" displayName="Name"
description="The name of the thread pool."/>
+ <c:simple-property name="queue-length:expr:6"
required="false" type="string" readOnly="false"
displayName="Queue Length" description="The queue length."/>
+ <c:simple-property name="thread-factory:7"
required="false" type="string" readOnly="false"
displayName="Thread Factory" description="Specifies the name of a specific
thread factory to use to create worker threads. If not defined an appropriate default
thread factory will be used."/>
</c:group>
<c:group
name="child:short-running-threads=default-short-running-threads"
displayName="Short running thread pool executor with a bounded queue where threads
submittings tasks may block.">
- <c:simple-property name="allow-core-timeout"
required="false" type="boolean" readOnly="false"
defaultValue="false" description="Whether core threads may time out. The
default value is false."/>
- <c:simple-property name="core-threads:expr"
required="false" type="string" readOnly="false"
description="The core thread pool size which is smaller than the maximum pool size.
If undefined, the core thread pool size is the same as the maximum thread pool
size."/>
- <c:map-property name="keepalive-time"
description="Used to specify the amount of time that pool threads should be kept
running when idle; if not specified, threads will run until the executor is shut
down." >
+ <c:simple-property name="allow-core-timeout:8"
required="false" type="boolean" readOnly="false"
defaultValue="false" displayName="Allow Core Timeout"
description="Whether core threads may time out. The default value is
false."/>
+ <c:simple-property name="core-threads:expr:9"
required="false" type="string" readOnly="false"
displayName="Core Threads" description="The core thread pool size which is
smaller than the maximum pool size. If undefined, the core thread pool size is the same as
the maximum thread pool size."/>
+ <c:map-property name="keepalive-time:10"
displayName="Keepalive Time" description="Used to specify the amount of
time that pool threads should be kept running when idle; if not specified, threads will
run until the executor is shut down." >
<c:simple-property name="time"
required="true" type="long" readOnly="true"
description="The time"/>
<c:simple-property name="unit"
required="true" type="string" readOnly="true"
description="The time unit"/>
</c:map-property>
- <c:simple-property name="max-threads:expr"
required="false" type="string" readOnly="false"
description="The maximum thread pool size."/>
- <c:simple-property name="name"
required="false" type="string" readOnly="true"
description="The name of the thread pool."/>
- <c:simple-property name="queue-length:expr"
required="false" type="string" readOnly="false"
description="The queue length."/>
- <c:simple-property name="thread-factory"
required="false" type="string" readOnly="false"
description="Specifies the name of a specific thread factory to use to create worker
threads. If not defined an appropriate default thread factory will be used."/>
+ <c:simple-property name="max-threads:expr:11"
required="false" type="string" readOnly="false"
displayName="Max Threads" description="The maximum thread pool
size."/>
+ <c:simple-property name="name:12"
required="false" type="string" readOnly="true"
displayName="Name" description="The name of the thread pool."/>
+ <c:simple-property name="queue-length:expr:13"
required="false" type="string" readOnly="false"
displayName="Queue Length" description="The queue length."/>
+ <c:simple-property name="thread-factory:14"
required="false" type="string" readOnly="false"
displayName="Thread Factory" description="Specifies the name of a specific
thread factory to use to create worker threads. If not defined an appropriate default
thread factory will be used."/>
</c:group>
</resource-configuration>
</service>
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
index c9caba4..171a6c7 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationLoadingTest.java
@@ -525,4 +525,60 @@ public class ConfigurationLoadingTest extends
AbstractConfigurationHandlingTest
index++;
}
}
-}
+
+ public void testGroupedPropertiesWithIdenticalNames() throws Exception {
+ String resultString = loadJsonFromFile("groupedproperties.json");
+
+ ConfigurationDefinition definition =
loadDescriptor("groupedproperties");
+
+ ObjectMapper mapper = new ObjectMapper();
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
+ JsonNode json = mapper.valueToTree(result);
+
+ FakeConnection connection = new FakeConnection();
+ connection.setContent(json);
+
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(definition,
connection, null);
+ Configuration config = delegate.loadResourceConfiguration();
+ Collection<Property> properties = config.getProperties();
+
+ Assert.assertEquals(properties.size(), 6);
+
+ for (int index = 1; index < 5; index += 3) {
+ String stringValue = index + "" + (index + 1) + "" +
(index + 2);
+
+ String firstPropName = "firstprop:" + index;
+ boolean firstPropFound = false;
+ String secondPropName = "secondprop:" + (index + 1);
+ boolean secondPropFound = false;
+ String thirdPropName = "thirdprop:" + (index + 2);
+ boolean thirdPropFound = false;
+
+ for (Property property : properties) {
+ if (property.getName().equals(firstPropName)) {
+ firstPropFound = true;
+ Assert.assertEquals(((PropertySimple) property).getStringValue(),
stringValue);
+ } else if (property.getName().equals(secondPropName)) {
+ secondPropFound = true;
+ PropertyList list = (PropertyList) property;
+ Assert.assertEquals(list.getList().size(), 3);
+ for (int i = 0; i < 3; i++) {
+ PropertySimple simpleProperty = (PropertySimple)
list.getList().get(i);
+ String expectedValue = "test" + (i + index);
+ Assert.assertEquals(simpleProperty.getStringValue(),
expectedValue);
+ }
+ } else if (property.getName().equals(thirdPropName)) {
+ thirdPropFound = true;
+ PropertyMap map = (PropertyMap) property;
+ Assert.assertEquals(map.getMap().size(), 1);
+ String actualValue = ((PropertySimple)
(map.get("value"))).getStringValue();
+ Assert.assertEquals(actualValue, stringValue);
+ }
+ }
+
+ Assert.assertTrue(firstPropFound);
+ Assert.assertTrue(secondPropFound);
+ Assert.assertTrue(thirdPropFound);
+ }
+ }
+}
\ No newline at end of file
diff --git
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
index 75967bb..2fffee5 100644
---
a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
+++
b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java
@@ -45,7 +45,8 @@ import org.rhq.modules.plugins.jbossas7.json.Operation;
@Test(groups = "unit")
public class ConfigurationUpdatingTest extends AbstractConfigurationHandlingTest {
- ObjectMapper mapper ;
+ ObjectMapper mapper;
+
@BeforeSuite
void loadPluginDescriptor() throws Exception {
super.loadPluginDescriptor();
@@ -60,20 +61,19 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
- conf.put(new PropertySimple("needed","test"));
- conf.put(new PropertySimple("optional",null));
+ conf.put(new PropertySimple("needed", "test"));
+ conf.put(new PropertySimple("optional", null));
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
assert cop.numberOfSteps() == 1;
Operation step1 = cop.step(0);
assert step1.getOperation().equals("write-attribute");
- Map<String,Object> props = step1.getAdditionalProperties();
- assert props.size()==2;
-
+ Map<String, Object> props = step1.getAdditionalProperties();
+ assert props.size() == 2;
}
@@ -83,13 +83,11 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
- PropertyList propertyList = new PropertyList("foo",
- new PropertySimple("optional","Hello"),
- new PropertySimple("optional",null),
- new PropertySimple("optional","world"));
+ PropertyList propertyList = new PropertyList("foo", new
PropertySimple("optional", "Hello"),
+ new PropertySimple("optional", null), new
PropertySimple("optional", "world"));
conf.put(propertyList);
@@ -98,12 +96,10 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
assert cop.numberOfSteps() == 1 : "#Steps should be 1 but were " +
cop.numberOfSteps();
Operation step1 = cop.step(0);
assert step1.getOperation().equals("write-attribute");
- Map<String,Object> props = step1.getAdditionalProperties();
- assert props.size()==2;
+ Map<String, Object> props = step1.getAdditionalProperties();
+ assert props.size() == 2;
List<String> values = (List<String>) props.get("value");
- assert values.size()==2 : "Values had "+ values.size() + "
entries"; // The optional null must not be present
-
-
+ assert values.size() == 2 : "Values had " + values.size() + "
entries"; // The optional null must not be present
String result = mapper.writeValueAsString(cop);
@@ -115,12 +111,11 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
- PropertyMap propertyMap = new PropertyMap("foo",
- new PropertySimple("needed","Hello"),
- new PropertySimple("optional","world"));
+ PropertyMap propertyMap = new PropertyMap("foo", new
PropertySimple("needed", "Hello"), new PropertySimple(
+ "optional", "world"));
conf.put(propertyMap);
@@ -129,26 +124,26 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
assert cop.numberOfSteps() == 1 : "#Steps should be 1 but were " +
cop.numberOfSteps();
Operation step1 = cop.step(0);
assert step1.getOperation().equals("write-attribute");
- Map<String,Object> props = step1.getAdditionalProperties();
- assert props.size()==2;
- Map<String,Object> values = (Map<String,Object>)
props.get("value");
- assert values.size()==2 : "Values had "+ values.size() + " entries
instead of 2"; // The optional null must not be present
+ Map<String, Object> props = step1.getAdditionalProperties();
+ assert props.size() == 2;
+ Map<String, Object> values = (Map<String, Object>)
props.get("value");
+ assert values.size() == 2 : "Values had " + values.size() + "
entries instead of 2"; // The optional null must not be present
String result = mapper.writeValueAsString(cop);
}
+
public void test4() throws Exception {
ConfigurationDefinition definition = loadDescriptor("mapOfSimple1");
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
- PropertyMap propertyMap = new PropertyMap("foo",
- new PropertySimple("needed","Hello"),
- new PropertySimple("readOnly","world"));
+ PropertyMap propertyMap = new PropertyMap("foo", new
PropertySimple("needed", "Hello"), new PropertySimple(
+ "readOnly", "world"));
conf.put(propertyMap);
@@ -157,10 +152,10 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
assert cop.numberOfSteps() == 1 : "#Steps should be 1 but were " +
cop.numberOfSteps();
Operation step1 = cop.step(0);
assert step1.getOperation().equals("write-attribute");
- Map<String,Object> props = step1.getAdditionalProperties();
- assert props.size()==2;
- Map<String,Object> values = (Map<String,Object>)
props.get("value");
- assert values.size()==1 : "Values had "+ values.size() + " entries
instead of 1"; // The optional null must not be present
+ Map<String, Object> props = step1.getAdditionalProperties();
+ assert props.size() == 2;
+ Map<String, Object> values = (Map<String, Object>)
props.get("value");
+ assert values.size() == 1 : "Values had " + values.size() + "
entries instead of 1"; // The optional null must not be present
String result = mapper.writeValueAsString(cop);
@@ -172,11 +167,10 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
- PropertyMap propertyMap = new PropertyMap("foo",
- new PropertySimple("needed","Hello"));
+ PropertyMap propertyMap = new PropertyMap("foo", new
PropertySimple("needed", "Hello"));
conf.put(propertyMap);
@@ -185,10 +179,10 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
assert cop.numberOfSteps() == 1 : "#Steps should be 1 but were " +
cop.numberOfSteps();
Operation step1 = cop.step(0);
assert step1.getOperation().equals("write-attribute");
- Map<String,Object> props = step1.getAdditionalProperties();
- assert props.size()==2;
- Map<String,Object> values = (Map<String,Object>)
props.get("value");
- assert values.size()==1 : "Values had "+ values.size() + " entries
instead of 1"; // The optional null must not be present
+ Map<String, Object> props = step1.getAdditionalProperties();
+ assert props.size() == 2;
+ Map<String, Object> values = (Map<String, Object>)
props.get("value");
+ assert values.size() == 1 : "Values had " + values.size() + "
entries instead of 1"; // The optional null must not be present
String result = mapper.writeValueAsString(cop);
@@ -200,14 +194,13 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
- PropertyMap propertyMap = new PropertyMap("theMap",
- new PropertySimple("needed","Hello"),
- new PropertySimple("optional","World"));
+ PropertyMap propertyMap = new PropertyMap("theMap", new
PropertySimple("needed", "Hello"), new PropertySimple(
+ "optional", "World"));
- PropertyList propertyList = new PropertyList("foo",propertyMap);
+ PropertyList propertyList = new PropertyList("foo", propertyMap);
conf.put(propertyList);
@@ -216,12 +209,12 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
assert cop.numberOfSteps() == 1 : "#Steps should be 1 but were " +
cop.numberOfSteps();
Operation step1 = cop.step(0);
assert step1.getOperation().equals("write-attribute");
- Map<String,Object> props = step1.getAdditionalProperties();
- assert props.size()==2;
- List<Map<String,Object>> values = (List<Map<String,
Object>>) props.get("value");
- assert values.size()==1 : "Values had "+ values.size() + " entries
instead of 1"; // The optional null must not be present
- Map<String,Object> map = values.get(0);
- assert map.size()==2 : "Map had " + map.size() + " entries instead
of two";
+ Map<String, Object> props = step1.getAdditionalProperties();
+ assert props.size() == 2;
+ List<Map<String, Object>> values = (List<Map<String,
Object>>) props.get("value");
+ assert values.size() == 1 : "Values had " + values.size() + "
entries instead of 1"; // The optional null must not be present
+ Map<String, Object> map = values.get(0);
+ assert map.size() == 2 : "Map had " + map.size() + " entries
instead of two";
String result = mapper.writeValueAsString(cop);
@@ -232,17 +225,17 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
PropertyMap propertyMap = new PropertyMap("http");
- propertyMap.put(new PropertySimple("name","http"));
- propertyMap.put(new PropertySimple("port",18080));
- propertyMap.put(new PropertySimple("fixed-port",false));
+ propertyMap.put(new PropertySimple("name", "http"));
+ propertyMap.put(new PropertySimple("port", 18080));
+ propertyMap.put(new PropertySimple("fixed-port", false));
PropertyList propertyList = new PropertyList("*");
propertyList.add(propertyMap);
conf.put(propertyList);
- conf.put(new PropertySimple("port-offset",0));
+ conf.put(new PropertySimple("port-offset", 0));
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
@@ -253,23 +246,23 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
// As we do not specify a base address when creating the delegate 0 or 1 address
element is ok.
assert step1.getAddress().isEmpty();
- assert step2.getAddress().size()==1;
- assert step3.getAddress().size()==1;
+ assert step2.getAddress().size() == 1;
+ assert step3.getAddress().size() == 1;
assert
step1.getAdditionalProperties().get("name").equals("port-offset");
assert
step1.getAdditionalProperties().get("value").equals("0");
assert
step2.getAdditionalProperties().get("name").equals("port");
Object value = step2.getAdditionalProperties().get("value");
- assert value !=null;
+ assert value != null;
assert value instanceof Integer;
- assert (Integer)value == 18080;
+ assert (Integer) value == 18080;
assert
step3.getAdditionalProperties().get("name").equals("fixed-port");
Object value1 = step3.getAdditionalProperties().get("value");
- assert value1 !=null;
+ assert value1 != null;
assert value1 instanceof Boolean;
- assert !(Boolean)value1;
+ assert !(Boolean) value1;
assert step2.getAddress().get(0).equals("socket-binding=http");
assert step3.getAddress().get(0).equals("socket-binding=http");
@@ -280,24 +273,24 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
PropertyList propertyList = new PropertyList("*");
PropertyMap propertyMap = new PropertyMap("binding");
- propertyMap.put(new PropertySimple("name","http"));
- propertyMap.put(new PropertySimple("port",18080));
- propertyMap.put(new PropertySimple("fixed-port",false));
+ propertyMap.put(new PropertySimple("name", "http"));
+ propertyMap.put(new PropertySimple("port", 18080));
+ propertyMap.put(new PropertySimple("fixed-port", false));
propertyList.add(propertyMap);
propertyMap = new PropertyMap("binding");
- propertyMap.put(new PropertySimple("name","https"));
- propertyMap.put(new PropertySimple("port",18081));
- propertyMap.put(new PropertySimple("fixed-port",false));
+ propertyMap.put(new PropertySimple("name", "https"));
+ propertyMap.put(new PropertySimple("port", 18081));
+ propertyMap.put(new PropertySimple("fixed-port", false));
propertyList.add(propertyMap);
conf.put(propertyList);
- conf.put(new PropertySimple("port-offset",0));
+ conf.put(new PropertySimple("port-offset", 0));
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
@@ -310,24 +303,23 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
// As we do not specify a base address when creating the delegate 0 or 1 address
element is ok.
assert step1.getAddress().isEmpty();
- assert step2.getAddress().size()==1;
- assert step3.getAddress().size()==1;
+ assert step2.getAddress().size() == 1;
+ assert step3.getAddress().size() == 1;
assert
step1.getAdditionalProperties().get("name").equals("port-offset");
assert
step1.getAdditionalProperties().get("value").equals("0");
assert
step2.getAdditionalProperties().get("name").equals("port");
Object value = step2.getAdditionalProperties().get("value");
- assert value !=null;
+ assert value != null;
assert value instanceof Integer;
- assert (Integer)value == 18080;
-
+ assert (Integer) value == 18080;
assert
step3.getAdditionalProperties().get("name").equals("fixed-port");
Object value1 = step3.getAdditionalProperties().get("value");
- assert value1 !=null;
+ assert value1 != null;
assert value1 instanceof Boolean;
- assert !(Boolean)value1;
+ assert !(Boolean) value1;
assert step2.getAddress().get(0).equals("socket-binding=http");
assert step3.getAddress().get(0).equals("socket-binding=http");
@@ -341,16 +333,16 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
FakeConnection connection = new FakeConnection();
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
- conf.put(new
PropertySimple("default-virtual-server","hulla")); // this is
read-only and must not show up in result
- conf.put(new PropertySimple("test-prop","Heiko"));
- conf.put(new PropertySimple("check-interval",23));
- conf.put(new PropertySimple("disabled",true));
- conf.put(new PropertySimple("listings",false));
- conf.put(new PropertySimple("max-depth",17));
+ conf.put(new PropertySimple("default-virtual-server",
"hulla")); // this is read-only and must not show up in result
+ conf.put(new PropertySimple("test-prop", "Heiko"));
+ conf.put(new PropertySimple("check-interval", 23));
+ conf.put(new PropertySimple("disabled", true));
+ conf.put(new PropertySimple("listings", false));
+ conf.put(new PropertySimple("max-depth", 17));
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
@@ -363,10 +355,10 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
Operation step5 = cop.step(4);
assert step1.getAddress().isEmpty();
- assert step2.getAddress().size()==1;
- assert step3.getAddress().size()==1;
- assert step4.getAddress().size()==1;
- assert step5.getAddress().size()==1;
+ assert step2.getAddress().size() == 1;
+ assert step3.getAddress().size() == 1;
+ assert step4.getAddress().size() == 1;
+ assert step5.getAddress().size() == 1;
assert
step2.getAddress().get(0).equals("configuration=jsp-configuration");
assert
step3.getAddress().get(0).equals("configuration=jsp-configuration");
assert
step4.getAddress().get(0).equals("configuration=static-resources");
@@ -387,13 +379,12 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
String resultString = loadJsonFromFile("system-props.json");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
connection.setContent(json);
-
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
@@ -402,16 +393,15 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
PropertyList propertyList = new PropertyList("*2");
PropertyMap propertyMap = new PropertyMap("*");
- propertyMap.put(new PropertySimple("name","hulla"));
- propertyMap.put(new PropertySimple("value","hopp"));
+ propertyMap.put(new PropertySimple("name", "hulla"));
+ propertyMap.put(new PropertySimple("value", "hopp"));
propertyList.add(propertyMap);
propertyMap = new PropertyMap("*");
- propertyMap.put(new PropertySimple("name","bar"));
- propertyMap.put(new PropertySimple("value","42!"));
+ propertyMap.put(new PropertySimple("name", "bar"));
+ propertyMap.put(new PropertySimple("value", "42!"));
propertyList.add(propertyMap);
conf.put(propertyList);
-
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
assert cop.numberOfSteps() == 3 : "#Steps should be 3 but were " +
cop.numberOfSteps();
@@ -420,9 +410,9 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
Operation step2 = cop.step(1);
Operation step3 = cop.step(2);
- assert step1.getAddress().size()==1;
- assert step2.getAddress().size()==1;
- assert step3.getAddress().size()==1;
+ assert step1.getAddress().size() == 1;
+ assert step2.getAddress().size() == 1;
+ assert step3.getAddress().size() == 1;
assert step1.getAddress().get(0).equals("system-property=hulla");
assert step2.getAddress().get(0).equals("system-property=bar");
assert step3.getAddress().get(0).equals("system-property=hello");
@@ -444,13 +434,12 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
String resultString = loadJsonFromFile("system-props.json");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
connection.setContent(json);
-
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
@@ -461,18 +450,17 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
PropertyList propertyList = new PropertyList("*2");
PropertyMap propertyMap = new PropertyMap("*");
// add 'hulla'
- propertyMap.put(new PropertySimple("name","hulla"));
- propertyMap.put(new PropertySimple("value","hopp"));
+ propertyMap.put(new PropertySimple("name", "hulla"));
+ propertyMap.put(new PropertySimple("value", "hopp"));
propertyList.add(propertyMap);
propertyMap = new PropertyMap("*");
// update 'bar' -> needs to trigger a remove + an :add
- propertyMap.put(new PropertySimple("name","bar"));
- propertyMap.put(new PropertySimple("value","42!"));
+ propertyMap.put(new PropertySimple("name", "bar"));
+ propertyMap.put(new PropertySimple("value", "42!"));
propertyList.add(propertyMap);
conf.put(propertyList);
// 'hello' is not present -> needs to trigger a :remove for it
-
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
assert cop.numberOfSteps() == 4 : "#Steps should be 4 but were " +
cop.numberOfSteps();
@@ -482,10 +470,10 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
Operation step3 = cop.step(2);
Operation step4 = cop.step(3);
- assert step1.getAddress().size()==1;
- assert step2.getAddress().size()==1;
- assert step3.getAddress().size()==1;
- assert step4.getAddress().size()==1;
+ assert step1.getAddress().size() == 1;
+ assert step2.getAddress().size() == 1;
+ assert step3.getAddress().size() == 1;
+ assert step4.getAddress().size() == 1;
assert step1.getAddress().get(0).equals("system-property=hulla");
assert step2.getAddress().get(0).equals("system-property=bar");
assert step3.getAddress().get(0).equals("system-property=bar");
@@ -509,24 +497,23 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
String resultString = loadJsonFromFile("expressionTest.json");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
connection.setContent(json);
-
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
- conf.put(new PropertySimple("foo:expr",123));
- conf.put(new PropertySimple("foo2:expr","${foo:42}"));
- conf.put(new PropertySimple("bar",456));
+ conf.put(new PropertySimple("foo:expr", 123));
+ conf.put(new PropertySimple("foo2:expr", "${foo:42}"));
+ conf.put(new PropertySimple("bar", 456));
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
assert cop != null;
- assert cop.numberOfSteps()==3;
+ assert cop.numberOfSteps() == 3;
Map<String, Object> additionalProperties =
cop.step(0).getAdditionalProperties();
assert additionalProperties.get("name").equals("foo");
@@ -534,20 +521,18 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
additionalProperties = cop.step(1).getAdditionalProperties();
assert additionalProperties.get("name").equals("foo2");
- assert additionalProperties.get("value")!=null;
+ assert additionalProperties.get("value") != null;
assert additionalProperties.get("value") instanceof Map;
- Map<String,Object> map = (Map<String, Object>)
additionalProperties.get("value");
+ Map<String, Object> map = (Map<String, Object>)
additionalProperties.get("value");
assert map.containsKey("EXPRESSION_VALUE");
assert map.get("EXPRESSION_VALUE").equals("${foo:42}");
-
additionalProperties = cop.step(2).getAdditionalProperties();
assert additionalProperties.get("name").equals("bar");
assert additionalProperties.get("value").equals("456");
}
-
public void test13() throws Exception {
ConfigurationDefinition definition = loadDescriptor("test13");
@@ -556,37 +541,36 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
String resultString = loadJsonFromFile("collapsedMapTest.json");
ObjectMapper mapper = new ObjectMapper();
- ComplexResult result = mapper.readValue(resultString,ComplexResult.class);
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
JsonNode json = mapper.valueToTree(result);
connection.setContent(json);
-
- ConfigurationWriteDelegate delegate = new
ConfigurationWriteDelegate(definition,connection,null);
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
Configuration conf = new Configuration();
PropertyMap pm = new PropertyMap("connector:collapsed");
- PropertySimple ps = new PropertySimple("name:0","in-vm");
+ PropertySimple ps = new PropertySimple("name:0", "in-vm");
pm.put(ps);
- ps = new PropertySimple("backup:1","hulla-hoo");
+ ps = new PropertySimple("backup:1", "hulla-hoo");
pm.put(ps);
conf.put(pm);
CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
assert cop != null;
- assert cop.numberOfSteps()==1;
+ assert cop.numberOfSteps() == 1;
Operation step = cop.step(0);
- assert step!=null;
+ assert step != null;
assert step.getOperation().equals("write-attribute") : "Step name
was " + step.getOperation();
Map<String, Object> additionalProperties = step.getAdditionalProperties();
- assert additionalProperties !=null;
- assert additionalProperties.size()==2;
+ assert additionalProperties != null;
+ assert additionalProperties.size() == 2;
assert additionalProperties.get("name").equals("connector");
Object value = additionalProperties.get("value");
assert value instanceof Map;
- Map <String,Object> map = (Map<String, Object>) value;
+ Map<String, Object> map = (Map<String, Object>) value;
assert map.containsKey("in-vm");
assert map.containsValue("hulla-hoo");
}
@@ -648,4 +632,71 @@ public class ConfigurationUpdatingTest extends
AbstractConfigurationHandlingTest
Assert.assertEquals(map.size(), 1);
}
}
+
+ @SuppressWarnings("unchecked")
+ public void testGroupedPropertiesWithIdenticalNames() throws Exception {
+ String resultString = loadJsonFromFile("groupedproperties.json");
+ ObjectMapper mapper = new ObjectMapper();
+ ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
+ JsonNode json = mapper.valueToTree(result);
+
+ FakeConnection connection = new FakeConnection();
+ connection.setContent(json);
+
+ ConfigurationDefinition definition =
loadDescriptor("groupedproperties");
+
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition,
connection, null);
+
+ Configuration conf = new Configuration();
+ for (int index = 1; index < 5; index += 3) {
+ String stringValue = index + "" + (index + 1) + "" +
(index + 2);
+
+ String firstPropName = "firstprop:" + index;
+ PropertySimple propertySimple = new PropertySimple(firstPropName,
stringValue);
+ conf.put(propertySimple);
+
+ String secondPropName = "secondprop:" + (index + 1);
+ PropertyList propertyList = new PropertyList(secondPropName);
+ for (int i = 0; i < 3; i++) {
+ String value = "test" + (i + index);
+ PropertySimple tempPropertySimple = new PropertySimple("name",
value);
+ propertyList.add(tempPropertySimple);
+ }
+ conf.put(propertyList);
+
+ String thirdPropName = "thirdprop:" + (index + 2);
+ PropertyMap propertyMap = new PropertyMap(thirdPropName);
+ PropertySimple tempPropertySimple = new PropertySimple("value",
stringValue);
+ propertyMap.put(tempPropertySimple);
+ conf.put(propertyMap);
+ }
+
+ CompositeOperation cop = delegate.updateGenerateOperationFromProperties(conf, new
Address());
+
+ Assert.assertNotNull(cop);
+ Assert.assertEquals(cop.numberOfSteps(), 6);
+
+ for (int index = 0; index < 6; index++) {
+ Operation step = cop.step(index);
+ Assert.assertEquals(step.getOperation(), "write-attribute",
"Step name was " + step.getOperation());
+ Map<String, Object> additionalProperties =
step.getAdditionalProperties();
+ Assert.assertEquals(additionalProperties.size(), 2);
+
+ if (additionalProperties.get("name").equals("firstprop"))
{
+ String expectedValue = (index + 1) + "" + (index + 2) +
"" + (index + 3);
+ Assert.assertEquals(additionalProperties.get("value"),
expectedValue);
+ } else if
(additionalProperties.get("name").equals("secondprop")) {
+ List<String> listValue = (List<String>)
additionalProperties.get("value");
+ Assert.assertTrue(listValue.contains("test" + (index)));
+ Assert.assertTrue(listValue.contains("test" + (index + 1)));
+ Assert.assertTrue(listValue.contains("test" + (index + 2)));
+ } else {
+ Map<String, String> mapValue = (Map<String, String>)
additionalProperties.get("value");
+ Assert.assertEquals(mapValue.size(), 1);
+ String expectedValue = (index - 1) + "" + (index) +
"" + (index + 1);
+ Assert.assertEquals(mapValue.values().iterator().next(), expectedValue);
+ }
+ }
+
+ }
}
diff --git a/modules/plugins/jboss-as-7/src/test/resources/groupedproperties.json
b/modules/plugins/jboss-as-7/src/test/resources/groupedproperties.json
new file mode 100644
index 0000000..06ff443
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/test/resources/groupedproperties.json
@@ -0,0 +1,24 @@
+{
+ "outcome" : "success",
+ "result" : {
+ "first-group" : {
+ "first-group" : {
+ "firstprop" : "123",
+ "secondprop" : [ "test1", "test2",
"test3" ],
+ "thirdprop" : {
+ "value" : "123"
+ }
+ }
+ },
+ "second-group" : {
+ "second-group" : {
+ "firstprop" : "456",
+ "secondprop" : [ "test4", "test5",
"test6" ],
+ "thirdprop" : {
+ "value" : "456"
+ }
+ }
+ }
+ },
+ "response-headers" : {"process-state" :
"reload-required"}
+}
diff --git a/modules/plugins/jboss-as-7/src/test/resources/test-plugin.xml
b/modules/plugins/jboss-as-7/src/test/resources/test-plugin.xml
index 4e9cdd2..16247c6 100644
--- a/modules/plugins/jboss-as-7/src/test/resources/test-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/test/resources/test-plugin.xml
@@ -234,7 +234,7 @@
<server name="listOfPlainMaps"
class="BaseComponent"
discovery="SubsystemDiscovery"
- description="JacORB subsystem configuration"
+ description="list of plain maps"
singleton="true">
<resource-configuration>
@@ -247,5 +247,32 @@
</resource-configuration>
</server>
+ <server name="groupedproperties"
+ class="BaseComponent"
+ discovery="SubsystemDiscovery"
+ description="same name grouped properties"
+ singleton="true">
+ <resource-configuration>
+ <c:group name="child:first-group=first-group"
displayName="First group">
+ <c:simple-property name="firstprop:1"
type="string"/>
+ <c:list-property name="secondprop:2"
displayName="Properties" required="false"
readOnly="false">
+ <c:simple-property name="name"
displayName="Property-Name"/>
+ </c:list-property>
+ <c:map-property name="thirdprop:3"
displayName="Keepalive Time" description="Sample map property." >
+ <c:simple-property name="value"
required="true" type="string" description="value"/>
+ </c:map-property>
+ </c:group>
+ <c:group name="child:second-group=second-group"
displayName="First group">
+ <c:simple-property name="firstprop:4"
type="string"/>
+ <c:list-property name="secondprop:5"
displayName="Properties" required="false"
readOnly="false">
+ <c:simple-property name="name"
displayName="Property-Name"/>
+ </c:list-property>
+ <c:map-property name="thirdprop:6"
displayName="Keepalive Time" description="Sample map property." >
+ <c:simple-property name="value"
required="true" type="string" description="value"/>
+ </c:map-property>
+ </c:group>
+ </resource-configuration>
+ </server>
+
</plugin>
\ No newline at end of file