[rhq] Branch 'release/jon3.1.x' - 2 commits - modules/plugins

Heiko W. Rupp pilhuhn at fedoraproject.org
Fri Aug 10 12:50:50 UTC 2012


 modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java |   20 ++
 modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml                                     |   76 ++++----
 modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/ConfigurationUpdatingTest.java  |   86 ++++++++++
 modules/plugins/jboss-as-7/src/test/resources/test-plugin.xml                                             |   33 +++
 4 files changed, 180 insertions(+), 35 deletions(-)

New commits:
commit 79cbe6c8250c3c5c6e9ed1f76869812da80b3d65
Author: Heiko W. Rupp <hwr at redhat.com>
Date:   Fri Aug 10 08:50:15 2012 -0400

    BZ 847119 Mark more configuration elements as r/w, as underyling AS allows that now.
    (cherry-picked from 71dc21a, BZ 838670)

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 f7381af..3778b5a 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
@@ -398,33 +398,34 @@
 
 <!ENTITY datasourceReadWriteConfiguration '
       <resource-configuration>
-        <c:simple-property name="connection-url" required="true" type="string" readOnly="true" description="The JDBC driver connection URL"/>
-        <c:simple-property name="driver-name" required="true" type="string" description="Name of the (existing) JDBC driver to use" readOnly="true">
+        <c:simple-property name="connection-url" required="true" type="string" readOnly="false" description="The JDBC driver connection URL"/>
+        <c:simple-property name="driver-name" required="true" type="string" description="Name of the (existing) JDBC driver to use" readOnly="false">
           <c:option-source target="resource" expression="type=^Deployment$" filter=".*\.jar"/>
         </c:simple-property>
-        <c:simple-property name="driver-class" required="false" type="string" readOnly="true" description="The fully qualified name of the JDBC driver class"/>
-        <c:simple-property name="jndi-name" required="true" type="string" readOnly="true" description="Specifies the JNDI name for the datasource"/>
+        <c:simple-property name="driver-class" required="false" type="string" readOnly="false" description="The fully qualified name of the JDBC driver class"/>
+        <c:simple-property name="jndi-name" required="true" type="string" readOnly="false" description="Specifies the JNDI name for the datasource"/>
         <c:simple-property name="driver" required="false" type="string" readOnly="true" description="Defines the JDBC driver the datasource should use with this format: driver-name>#major-version.minor-version where driver-name is the fully qualified name of the JDBC driver class"/>
-        <c:simple-property name="user-name" type="string" readOnly="true" required="false" description="Specify the username used when creating a new connection."/>
-        <c:simple-property name="password" type="password" readOnly="true" required="false" description="Specify the password used when creating a new connection."/>
-        <c:simple-property name="new-connection-sql" type="string" readOnly="true" required="false" description="Specifies an SQL statement to execute whenever a connection is added to the connection pool."/>
-        <c:simple-property name="url-delimiter" type="string" readOnly="true" description="Specifies the delimiter for URLs in connection-url for HA datasources" required="false"/>
-        <c:simple-property name="url-selector-strategy-class-name" type="string" readOnly="true" description="A class that implements org.jboss.jca.adapters.jdbc.URLSelectorStrategy" required="false"/>
-        <c:simple-property name="use-java-context" type="boolean" readOnly="true" required="false" description="Setting this to false will bind the DataSource into global JNDI;"/>
+        <c:simple-property name="user-name" type="string" readOnly="false" required="false" description="Specify the username used when creating a new connection."/>
+        <c:simple-property name="password" type="password" readOnly="false" required="false" description="Specify the password used when creating a new connection."/>
+        <c:simple-property name="new-connection-sql" type="string" readOnly="false" required="false" description="Specifies an SQL statement to execute whenever a connection is added to the connection pool."/>
+        <c:simple-property name="url-delimiter" type="string" readOnly="false" description="Specifies the delimiter for URLs in connection-url for HA datasources" required="false"/>
+        <c:simple-property name="url-selector-strategy-class-name" type="string" readOnly="false" description="A class that implements org.jboss.jca.adapters.jdbc.URLSelectorStrategy" required="false"/>
+        <c:simple-property name="use-java-context" type="boolean" readOnly="false" required="false" default="true" description="Setting this to false will bind the DataSource into global JNDI;"/>
         <c:simple-property name="enabled" type="boolean" readOnly="true" required="false" description="Specifies if the datasource should be enabled"/>
+        <c:simple-property name="jta" type="boolean" readOnly="false" required="false" default="true" description="Enable JTA integration"/>
         <c:simple-property name="max-pool-size" type="integer" readOnly="false" required="false" description="The max-pool-size element indicates the maximum number of connections for a pool. No more connections will be created in each sub-pool."/>
         <c:simple-property name="min-pool-size" type="integer" readOnly="false" required="false" description="The min-pool-size element indicates the minimum number of connections a pool should hold. These are not created until a Subject is known from a request for a connection."/>
-        <c:simple-property name="pool-prefill" type="boolean" readOnly="false" required="false" description="Whether to attempt to prefill the connection pool. Changing this value require a server restart."/>
-        <c:simple-property name="pool-use-strict-min" type="boolean" readOnly="false" required="false" description="Define if the min-pool-size should be considered a strictly."/>
-        <c:simple-property name="security-domain" required="false" type="string" readOnly="true" description="Indicates Subject (from security domain) are used to distinguish connections in the pool. The content of the security-domain is the name of the JAAS security manager that will handleauthentication. This name correlates to the JAAS login-config.xml descriptor application-policy/name attribute."/>
-        <c:simple-property name="reauth-plugin-class-name" required="false" type="string" readOnly="true" description="re-authentication plugin implementation provided for specific purpose (i.e vendor)"/>
+        <c:simple-property name="pool-prefill" type="boolean" readOnly="false" required="false" default="false" description="Whether to attempt to prefill the connection pool. Changing this value require a server restart."/>
+        <c:simple-property name="pool-use-strict-min" type="boolean" readOnly="false" required="false" default="false" description="Define if the min-pool-size should be considered a strictly."/>
+        <c:simple-property name="security-domain" required="false" type="string" readOnly="false" description="Indicates Subject (from security domain) are used to distinguish connections in the pool. The content of the security-domain is the name of the JAAS security manager that will handleauthentication. This name correlates to the JAAS login-config.xml descriptor application-policy/name attribute."/>
+        <c:simple-property name="reauth-plugin-class-name" required="false" type="string" readOnly="false" description="re-authentication plugin implementation provided for specific purpose (i.e vendor)"/>
         <!--
                         <c:map-property name="reauth-plugin-properties" description="properties for reauthentication plugin passed to the implementation provided for specific purpose (i.e vendor)" >
                             read-only
                             configuration
                         </c:map-property>
         -->
-        <c:simple-property name="flush-strategy" required="false" type="string" readOnly="true" description="Specifies how the pool should be flush in case of an error." default="FailingConnectionOnly" defaultValue="FailingConnectionOnly">
+        <c:simple-property name="flush-strategy" required="false" type="string" readOnly="false" description="Specifies how the pool should be flush in case of an error." default="FailingConnectionOnly" defaultValue="FailingConnectionOnly">
           <c:property-options>
             <c:option value="FailingConnectionOnly"/>
             <c:option value="IdleConnections"/>
@@ -432,17 +433,24 @@
           </c:property-options>
         </c:simple-property>
 
-        <c:simple-property name="prepared-statements-cacheSize" type="long" readOnly="true" required="false" description="The number of prepared statements per connection in an LRU cache"/>
-        <c:simple-property name="share-prepared-statements" type="boolean" readOnly="true" required="false" description="Whether to share prepare statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement"/>
-        <c:simple-property name="track-statements" type="string" readOnly="true" required="false" description="Whether to check for unclosed statements when a connection is returned to the pool and result sets are closed when a statement is closed/return to the prepared statement cache. valid values are: false - do not track statements and results true - track statements and result sets and warn when they are not closed nowarn - track statements but do no warn about them being unclosed"/>
-        <c:simple-property name="allocation-retry" type="integer" readOnly="true" required="false" description="The allocation retry element indicates the number of times that allocating a connection should be tried before throwing an exception."/>
-        <c:simple-property name="allocation-retry-wait-millis" type="long" readOnly="true" required="false" description="Indicates the time in milliseconds to wait between retrying to allocate a connection."/>
+        <c:simple-property name="allow-multiple-users" type="boolean" required="false" readOnly="false" description="Specifies if multiple users will access the datasource through the getConnection(user, password) method and hence if the internal pool type should account for that"/>
+        <c:simple-property name="prepared-statements-cacheSize" type="long" readOnly="false" required="false" description="The number of prepared statements per connection in an LRU cache"/>
+        <c:simple-property name="share-prepared-statements" type="boolean" readOnly="false" required="false" default="false" description="Whether to share prepare statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement"/>
+        <c:simple-property name="track-statements" type="string" readOnly="false" required="false" description="Whether to check for unclosed statements when a connection is returned to the pool and result sets are closed when a statement is closed/return to the prepared statement cache. valid values are: false - do not track statements and results true - track statements and result sets and warn when they are not closed nowarn - track statements but do no warn about them being unclosed">
+          <c:property-options>
+            <c:option value="false"/>
+            <c:option value="true"/>
+            <c:option value="NOWARN"/>
+          </c:property-options>
+        </c:simple-property>
+        <c:simple-property name="allocation-retry" type="integer" readOnly="false" required="false" description="The allocation retry element indicates the number of times that allocating a connection should be tried before throwing an exception."/>
+        <c:simple-property name="allocation-retry-wait-millis" type="long" readOnly="false" required="false" description="Indicates the time in milliseconds to wait between retrying to allocate a connection."/>
         <c:simple-property name="blocking-timeout-wait-millis" type="long" readOnly="false" required="false" description="The blocking-timeout-millis element indicates the maximum time in milliseconds to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and will never throw an exception if creating a new connection takes an inordinately long time."/>
         <c:simple-property name="idle-timeout-minutes" type="long" readOnly="false" required="false" description="The idle-timeout-minutes elements indicates the maximum time in minutes a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest idle-timeout-minutes of any pool. Changing this value require a server restart."/>
-        <c:simple-property name="query-timeout" type="long" readOnly="true" required="false" description="Any configured query timeout in seconds The default is no timeout"/>
-        <c:simple-property name="use-try-lock" type="long" readOnly="true" required="false" description="Any configured timeout for internal locks on the resource adapter objects in seconds"/>
-        <c:simple-property name="set-tx-query-timeout" type="boolean" readOnly="true" required="false" description="Whether to set the query timeout based on the time remaining until transaction timeout, any configured query timeout will be used if there is no transaction."/>
-        <c:simple-property name="transaction-isolation" type="string" readOnly="true" required="false" description="Set java.sql.Connection transaction isolation level to use. The constants defined by transaction-isolation-values are the possible transaction isolation levels.">
+        <c:simple-property name="query-timeout" type="long" readOnly="false" required="false" description="Any configured query timeout in seconds The default is no timeout"/>
+        <c:simple-property name="use-try-lock" type="long" readOnly="false" required="false" description="Any configured timeout for internal locks on the resource adapter objects in seconds"/>
+        <c:simple-property name="set-tx-query-timeout" type="boolean" readOnly="false" required="false" default="false" description="Whether to set the query timeout based on the time remaining until transaction timeout, any configured query timeout will be used if there is no transaction."/>
+        <c:simple-property name="transaction-isolation" type="string" readOnly="false" required="false" description="Set java.sql.Connection transaction isolation level to use. The constants defined by transaction-isolation-values are the possible transaction isolation levels.">
           <c:property-options>
             <c:option value="TRANSACTION_READ_UNCOMMITTED"/>
             <c:option value="TRANSACTION_READ_COMMITTED"/>
@@ -451,16 +459,16 @@
             <c:option value="TRANSACTION_NONE"/>
           </c:property-options>
         </c:simple-property>
-        <c:simple-property name="check-valid-connection-sql" type="string" readOnly="true" required="false" description="Specify an SQL statement to check validity of a pool connection. This may be called when managed connection is taken from pool for use."/>
-        <c:simple-property name="exception-sorter-class-name" type="string" readOnly="true" required="false" description="An org.jboss.jca.adapters.jdbc.ExceptionSorter that provides a boolean isExceptionFatal(SQLException e) method to validate is an exception should be broadcast to all javax.resource.spi.ConnectionEventListener as a connectionErrorOccurred"/>
-        <c:simple-property name="stale-connection-checker-class-name" type="string" readOnly="true" required="false" description="An org.jboss.jca.adapters.jdbc.StaleConnectionChecker that provides a boolean isStaleConnection(SQLException e) method which if it it returns true will wrap the exception in an org.jboss.jca.adapters.jdbc.StaleConnectionException"/>
-        <c:simple-property name="valid-connection-checker-class-name" type="string" readOnly="true" required="false" description="An org.jboss.jca.adapters.jdbc.ValidConnectionChecker that provides a SQLException isValidConnection(Connection e) method to validate is a connection is valid. An exception means the connection is destroyed. This overrides the check-valid-connection-sql when present."/>
-        <c:simple-property name="background-validation-minutes" type="long" readOnly="false" required="false" description="The background-validation-minutes element specifies the amount of time, in minutes, that background validation will run. Changing this value require a server restart."/>
-        <c:simple-property name="background-validation" type="boolean" readOnly="false" required="false" description="An element to specify that connections should be validated on a background thread versus being validated prior to use. Changing this value require a server restart."/>
+        <c:simple-property name="check-valid-connection-sql" type="string" readOnly="false" required="false" description="Specify an SQL statement to check validity of a pool connection. This may be called when managed connection is taken from pool for use."/>
+        <c:simple-property name="exception-sorter-class-name" type="string" readOnly="false" required="false" description="An org.jboss.jca.adapters.jdbc.ExceptionSorter that provides a boolean isExceptionFatal(SQLException e) method to validate is an exception should be broadcast to all javax.resource.spi.ConnectionEventListener as a connectionErrorOccurred"/>
+        <c:simple-property name="stale-connection-checker-class-name" type="string" readOnly="false" required="false" description="An org.jboss.jca.adapters.jdbc.StaleConnectionChecker that provides a boolean isStaleConnection(SQLException e) method which if it it returns true will wrap the exception in an org.jboss.jca.adapters.jdbc.StaleConnectionException"/>
+        <c:simple-property name="valid-connection-checker-class-name" type="string" readOnly="false" required="false" description="An org.jboss.jca.adapters.jdbc.ValidConnectionChecker that provides a SQLException isValidConnection(Connection e) method to validate is a connection is valid. An exception means the connection is destroyed. This overrides the check-valid-connection-sql when present."/>
+        <c:simple-property name="background-validation-millis" type="long" readOnly="false" required="false" description="The background-validation-minutes element specifies the amount of time, in minutes, that background validation will run. Changing this value require a server restart."/>
+        <c:simple-property name="background-validation" type="boolean" readOnly="false" required="false" default="false" description="An element to specify that connections should be validated on a background thread versus being validated prior to use. Changing this value require a server restart."/>
         <c:simple-property name="use-fast-fail" type="boolean" readOnly="false" required="false" description="Whether fail a connection allocation on the first connection if it is invalid (true) or keep trying until the pool is exhausted of all potential connections (false)"/>
-        <c:simple-property name="validate-on-match" type="boolean" readOnly="true" required="false" description="The validate-on-match element indicates whether or not connection level validation should be done when a connection factory attempts to match a managed connection for a given set. This is typically exclusive to the use of background validation"/>
-        <c:simple-property name="spy" type="boolean" readOnly="true" required="false" description="whatever spy or not the jdbc connection"/>
-        <c:simple-property name="use-ccm" type="boolean" readOnly="true" required="false" description="Enable the use of a cached connection manager"/>
+        <c:simple-property name="validate-on-match" type="boolean" readOnly="false" required="false" default="false" description="The validate-on-match element indicates whether or not connection level validation should be done when a connection factory attempts to match a managed connection for a given set. This is typically exclusive to the use of background validation"/>
+        <c:simple-property name="spy" type="boolean" readOnly="false" required="false" defaultValue="false" description="whatever spy or not the jdbc connection"/>
+        <c:simple-property name="use-ccm" type="boolean" readOnly="false" required="false" description="Enable the use of a cached connection manager"/>
         <c:group name="children:connection-properties:pname+-" displayName="Connection Properties">
           <c:list-property name="*1" displayName="Connection Property" readOnly="false" required="false">
             <c:map-property name="*:pname" displayName="Name" readOnly="false">


commit 910542aea3d3fdf20d4fe85225277330e7ee3d01
Author: Heiko W. Rupp <hwr at redhat.com>
Date:   Fri Aug 10 08:49:13 2012 -0400

    BZ 846458 When a property is required and the user has not explicitly chosen a value and there is a defaultValue, use this.
    (cherry-picked from 77cee38, BZ 839320)

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 366f840..86ba37a 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
@@ -500,7 +500,25 @@ public class ConfigurationWriteDelegate implements ConfigurationFacet {
                 entry = new SimpleEntry<String, Object>(realName, null);
             }
         } else {
-            Object o = getObjectWithType(propertyDefinition,property.getStringValue());
+            Object o;
+/*
+            If no value is given in the property and the property is required,
+            we'll take the default value from the definition. This can e.g. happen
+            when you have
+            <c:simple-property name="mode" required="true" type="string" readOnly="false" default="SYNC" defaultValue="SYNC">
+              <c:property-options>
+                <c:option value="SYNC"/>
+                <c:option value="ASYNC"/>
+              </c:property-options>
+            </c:simple-property>
+            and the user chooses to just keep the default choice in the ui
+*/
+
+            if (property.getStringValue()==null && propertyDefinition.isRequired()) {
+                o = getObjectWithType(propertyDefinition,propertyDefinition.getDefaultValue());
+            } else {
+                o = getObjectWithType(propertyDefinition,property.getStringValue());
+            }
             entry = new SimpleEntry<String, Object>(name, o);
         }
 
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 d46a3fb..f7381af 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
@@ -11321,7 +11321,7 @@
             </c:property-options>
           </c:simple-property>
           <c:simple-property name="jndi-name" required="false" type="string" readOnly="false" description="The jndi-name to which to bind this cache instance."/>
-          <c:simple-property name="mode" required="true" type="string" readOnly="false" default="SYNC" description="Sets the clustered cache mode, ASYNC for asynchronous operation, or SYNC for synchronous operation.">
+          <c:simple-property name="mode" required="true" type="string" readOnly="false" default="SYNC" defaultValue="SYNC" description="Sets the clustered cache mode, ASYNC for asynchronous operation, or SYNC for synchronous operation.">
             <c:property-options>
               <c:option value="SYNC"/>
               <c:option value="ASYNC"/>
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 ba2f13c..21e3d5f 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
@@ -862,4 +862,90 @@ public class ConfigurationUpdatingTest extends AbstractConfigurationHandlingTest
         assert cop.numberOfSteps() == 1 : "One step was expected, but got " + cop.numberOfSteps();
 
     }
+
+    /**
+     * Test that if a property is required and has a defaultValue and the user just uses this,
+     * we actually pass this default to the operation, as e.g. the CreateResourceReport may not
+     * include the default value.
+     * @throws Exception If anything goes wrong
+     */
+    public void testSimpleWithDefault1() throws Exception {
+
+        ConfigurationDefinition definition = loadDescriptor("simpleWithDefault1");
+
+        FakeConnection connection = new FakeConnection();
+
+        ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition, connection, null);
+
+        Configuration conf = new Configuration();
+        PropertySimple ps = new PropertySimple("mode",null);
+        conf.put(ps);
+
+        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;
+        assert props.get("name").equals("mode");
+        assert props.get("value").equals("SYNC"); // the defaultValue
+    }
+
+    /**
+     * Check that if a property is required and has no defaultValue, but the user provides a value,
+     * that the user provided value ends up in the operation
+     * @throws Exception
+     */
+    public void testSimpleWithDefault2() throws Exception {
+
+        ConfigurationDefinition definition = loadDescriptor("simpleWithDefault2");
+
+        FakeConnection connection = new FakeConnection();
+
+        ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition, connection, null);
+
+        Configuration conf = new Configuration();
+        PropertySimple ps = new PropertySimple("mode","ASYNC");
+        conf.put(ps);
+
+        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;
+        assert props.get("name").equals("mode");
+        assert props.get("value").equals("ASYNC"); // the user provided value
+    }
+
+    /**
+     * Check that if a property is required and has no defaultValue, and the user provides null
+     * as value, that we set null
+     * @throws Exception
+     */
+    public void testSimpleWithDefault3() throws Exception {
+
+        ConfigurationDefinition definition = loadDescriptor("simpleWithDefault2");
+
+        FakeConnection connection = new FakeConnection();
+
+        ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(definition, connection, null);
+
+        Configuration conf = new Configuration();
+        PropertySimple ps = new PropertySimple("mode",null);
+        conf.put(ps);
+
+        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;
+        assert props.get("name").equals("mode");
+        assert props.get("value")==null; // no value
+    }
+
 }
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 4350230..f10f52b 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
@@ -290,6 +290,37 @@
         </resource-configuration>
     </server>
 
+  <server name="simpleWithDefault1"
+           class="BaseComponent"
+           discovery="SubsystemDiscovery">
+
+    <resource-configuration>
+      <c:simple-property name="mode" required="true" type="string" readOnly="false" default="SYNC" defaultValue="SYNC" >
+        <c:property-options>
+          <c:option value="SYNC"/>
+          <c:option value="ASYNC"/>
+        </c:property-options>
+      </c:simple-property>
+    </resource-configuration>
+
+  </server>
+
+  <server name="simpleWithDefault2"
+           class="BaseComponent"
+           discovery="SubsystemDiscovery">
+
+    <resource-configuration>
+      <c:simple-property name="mode" required="true" type="string" readOnly="false" default="SYNC" >
+        <c:property-options>
+          <c:option value="SYNC"/>
+          <c:option value="ASYNC"/>
+        </c:property-options>
+      </c:simple-property>
+    </resource-configuration>
+
+  </server>
+
+
     <!-- Simple c:group entries from descriptor with no special handling. -->
     <service name="simpleGroupNoSpecial"
              class="BaseComponent"
@@ -327,4 +358,6 @@
        </resource-configuration>
     </service>
 
+
+
 </plugin>
\ No newline at end of file




More information about the rhq-commits mailing list