You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2009/09/10 16:41:08 UTC

svn commit: r813461 - in /qpid/trunk/qpid/java: broker/etc/ systests/etc/ systests/src/main/java/org/apache/qpid/server/configuration/ systests/src/main/java/org/apache/qpid/server/logging/ systests/src/main/java/org/apache/qpid/server/security/acl/ sy...

Author: ritchiem
Date: Thu Sep 10 14:41:08 2009
New Revision: 813461

URL: http://svn.apache.org/viewvc?rev=813461&view=rev
Log:
QPID-2092  Move test configuration to systest package and update to provide an more reliable way of adjusting the configuration form the test. In doing this it made sense to udpate the configurations such that they all inherit from the cannonical config.xml from the broker package. Each test now gets its own configuration file that is used to override the defaut values in config.xml.

So the config is now a hierarchy of:
- Test Specific
- Systest adjustments
- stock broker config.xml

I have disabled the DerbyMessageStoreLoggingTest as after making this change it is more reliably throwing a Derby exception on broker startup.

The other changes to the tests were to ensure they correctly save the Test Specific config file before loading. As for some reason, Commons Configuration is not abiding by the optional flag.

Added:
    qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-New.xml
      - copied, changed from r813459, qpid/trunk/qpid/java/broker/etc/persistent_config-config-test.xml
    qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-Old.xml
      - copied, changed from r813459, qpid/trunk/qpid/java/broker/etc/sample-parsed-config.xml
    qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml
    qpid/trunk/qpid/java/systests/etc/config-systests-acl.xml
      - copied, changed from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml
    qpid/trunk/qpid/java/systests/etc/config-systests-derby-settings.xml
    qpid/trunk/qpid/java/systests/etc/config-systests-derby.xml
      - copied, changed from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml
    qpid/trunk/qpid/java/systests/etc/config-systests-settings.xml
      - copied, changed from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml
    qpid/trunk/qpid/java/systests/etc/config-systests.xml
      - copied, changed from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-ServerConfigurationTest-New.xml
      - copied, changed from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml
Removed:
    qpid/trunk/qpid/java/broker/etc/acl.config.xml
    qpid/trunk/qpid/java/broker/etc/config-systests-derby.xml
    qpid/trunk/qpid/java/broker/etc/config-systests.xml
    qpid/trunk/qpid/java/broker/etc/persistent_config-config-test.xml
    qpid/trunk/qpid/java/broker/etc/sample-parsed-config.xml
    qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml
    qpid/trunk/qpid/java/broker/etc/virtualhosts-systests.xml
Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
    qpid/trunk/qpid/java/test-profiles/08Excludes
    qpid/trunk/qpid/java/test-profiles/Excludes

Copied: qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-New.xml (from r813459, qpid/trunk/qpid/java/broker/etc/persistent_config-config-test.xml)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-New.xml?p2=qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-New.xml&p1=qpid/trunk/qpid/java/broker/etc/persistent_config-config-test.xml&r1=813459&r2=813461&rev=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/etc/persistent_config-config-test.xml (original)
+++ qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-New.xml Thu Sep 10 14:41:08 2009
@@ -87,7 +87,7 @@
         <auto_register>true</auto_register>
     </queue>
 
-    <virtualhosts>${conf}/virtualhosts-config-test.xml</virtualhosts>
+    <virtualhosts>${conf}/virtualhosts-ServerConfigurationTest-New.xml</virtualhosts>
 </broker>
 
 

Copied: qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-Old.xml (from r813459, qpid/trunk/qpid/java/broker/etc/sample-parsed-config.xml)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-Old.xml?p2=qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-Old.xml&p1=qpid/trunk/qpid/java/broker/etc/sample-parsed-config.xml&r1=813459&r2=813461&rev=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/etc/sample-parsed-config.xml (original)
+++ qpid/trunk/qpid/java/systests/etc/config-systests-ServerConfigurationTest-Old.xml Thu Sep 10 14:41:08 2009
@@ -41,7 +41,7 @@
 <principal-database>passwordfile</principal-database>
 </jmx>
 </security>
-<virtualhosts>${conf}/virtualhosts-config-test.xml
+<virtualhosts>${conf}/virtualhosts-ServerConfigurationTest-New.xml
 <default>dev-only</default>
 <virtualhost>
 <name>dev-only</name>

Added: qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml?rev=813461&view=auto
==============================================================================
--- qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml (added)
+++ qpid/trunk/qpid/java/systests/etc/config-systests-acl-settings.xml Thu Sep 10 14:41:08 2009
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements.  See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership.  The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied.  See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<broker>
+
+    <virtualhosts>
+
+        <virtualhost>
+            <name>test</name>
+            <test>
+                <queues>
+                    <exchange>amq.direct</exchange>
+                    <!-- 4Mb -->
+                    <maximumQueueDepth>4235264</maximumQueueDepth>
+                    <!-- 2Mb -->
+                    <maximumMessageSize>2117632</maximumMessageSize>
+                    <!-- 10 mins -->
+                    <maximumMessageAge>600000</maximumMessageAge>
+                </queues>
+
+
+                <security>
+                    <access>
+                        <class>org.apache.qpid.server.security.access.plugins.SimpleXML</class>
+                    </access>
+                    <access_control_list>
+                        <!-- This section grants pubish rights to an exchange + routing key pair -->
+                        <publish>
+                            <exchanges>
+                                <exchange>
+                                    <name>amq.direct</name>
+                                    <routing_keys>
+
+                                        <!-- Allow clients to publish requests -->
+                                        <routing_key>
+                                            <value>example.RequestQueue</value>
+                                            <users>
+                                                <user>client</user>
+                                            </users>
+                                        </routing_key>
+
+                                        <!-- Allow the processor to respond to a client on their Temporary Topic -->
+                                        <routing_key>
+                                            <value>tmp_*</value>
+                                            <users>
+                                                <user>server</user>
+                                            </users>
+                                        </routing_key>
+                                        <routing_key>
+                                            <value>TempQueue*</value>
+                                            <users>
+                                                <user>server</user>
+                                            </users>
+                                        </routing_key>
+                                    </routing_keys>
+
+                                </exchange>
+                            </exchanges>
+                        </publish>
+
+                        <!-- This section grants users the ability to consume from the broker -->
+                        <consume>
+                            <queues>
+
+                                <!-- Allow the clients to consume from their temporary queues-->
+                                <queue>
+                                    <temporary/>
+                                    <users>
+                                        <user>client</user>
+                                    </users>
+                                </queue>
+
+
+                                <!-- Only allow the server to consume from the Request Queue-->
+                                <queue>
+                                    <name>example.RequestQueue</name>
+                                    <users>
+                                        <user>server</user>
+                                    </users>
+                                </queue>
+
+
+                            </queues>
+                        </consume>
+
+                        <!-- This section grants clients the ability to create queues and exchanges -->
+                        <create>
+                            <queues>
+                                <!-- Allow clients to create temporary queues-->
+                                <queue>
+                                    <temporary/>
+                                    <exchanges>
+                                        <exchange>
+                                            <name>amq.direct</name>
+                                            <users>
+                                                <user>client</user>
+                                            </users>
+                                        </exchange>
+                                    </exchanges>
+                                </queue>
+                                <!-- Allow the server to create the Request Queue-->
+                                <queue>
+                                    <name>example.RequestQueue</name>
+                                    <users>
+                                        <user>server</user>
+                                    </users>
+                                </queue>
+
+                            </queues>
+                        </create>
+
+
+                    </access_control_list>
+
+                </security>
+            </test>
+        </virtualhost>
+    </virtualhosts>
+</broker>
+
+

Copied: qpid/trunk/qpid/java/systests/etc/config-systests-acl.xml (from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests-acl.xml?p2=qpid/trunk/qpid/java/systests/etc/config-systests-acl.xml&p1=qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml&r1=813459&r2=813461&rev=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml (original)
+++ qpid/trunk/qpid/java/systests/etc/config-systests-acl.xml Thu Sep 10 14:41:08 2009
@@ -8,9 +8,9 @@
  - to you under the Apache License, Version 2.0 (the
  - "License"); you may not use this file except in compliance
  - with the License.  You may obtain a copy of the License at
- - 
+ -
  -   http://www.apache.org/licenses/LICENSE-2.0
- - 
+ -
  - Unless required by applicable law or agreed to in writing,
  - software distributed under the License is distributed on an
  - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,22 +19,11 @@
  - under the License.
  -
  -->
-<virtualhosts>
-    <default>dev-only</default>
-    <virtualhost>
-        <name>dev-only</name>
-        <dev-only>            
-            <queues>
-                <exchange>amq.direct</exchange>
-		<!-- Small defaults for development -->
-                <maximumQueueDepth>102400</maximumQueueDepth>  <!-- 100k -->
-                <maximumMessageSize>20480</maximumMessageSize> <!-- 20kb -->
-                <maximumMessageAge>60000</maximumMessageAge>  <!-- 1 mins -->
-
-                <queue>
-                    <name>dev-queue</name>
-                </queue>
-            </queues>
-        </dev-only>
-    </virtualhost>
-</virtualhosts>
+<configuration>
+    <system/>
+    <override>
+        <xml fileName="${QPID_HOME}/etc/config-systests-acl-settings.xml"/>
+        <xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/>
+        <xml fileName="${QPID_HOME}/etc/config.xml"/>
+    </override>
+</configuration>

Added: qpid/trunk/qpid/java/systests/etc/config-systests-derby-settings.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests-derby-settings.xml?rev=813461&view=auto
==============================================================================
--- qpid/trunk/qpid/java/systests/etc/config-systests-derby-settings.xml (added)
+++ qpid/trunk/qpid/java/systests/etc/config-systests-derby-settings.xml Thu Sep 10 14:41:08 2009
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements.  See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership.  The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied.  See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<broker>
+    <virtualhosts>
+        <directory>${conf}/virtualhosts</directory>
+
+        <virtualhost>
+            <name>localhost</name>
+            <localhost>
+                <store>
+                    <class>org.apache.qpid.server.store.DerbyMessageStore</class>
+                    <environment-path>${work}/derbyDB/localhost-store</environment-path>
+                </store>
+
+                <housekeeping>
+                    <expiredMessageCheckPeriod>20000</expiredMessageCheckPeriod>
+                </housekeeping>
+
+            </localhost>
+        </virtualhost>
+
+        <virtualhost>
+            <name>development</name>
+            <development>
+                <store>
+                    <class>org.apache.qpid.server.store.DerbyMessageStore</class>
+                    <environment-path>${work}/derbyDB/development-store</environment-path>                                        
+                </store>
+            </development>
+        </virtualhost>
+
+        <virtualhost>
+            <name>test</name>
+            <test>
+                <store>
+                    <class>org.apache.qpid.server.store.DerbyMessageStore</class>
+                    <environment-path>${work}/derbyDB/test-store</environment-path>
+                </store>
+            </test>
+        </virtualhost>
+
+    </virtualhosts>
+</broker>
+
+

Copied: qpid/trunk/qpid/java/systests/etc/config-systests-derby.xml (from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests-derby.xml?p2=qpid/trunk/qpid/java/systests/etc/config-systests-derby.xml&p1=qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml&r1=813459&r2=813461&rev=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml (original)
+++ qpid/trunk/qpid/java/systests/etc/config-systests-derby.xml Thu Sep 10 14:41:08 2009
@@ -8,9 +8,9 @@
  - to you under the Apache License, Version 2.0 (the
  - "License"); you may not use this file except in compliance
  - with the License.  You may obtain a copy of the License at
- - 
+ -
  -   http://www.apache.org/licenses/LICENSE-2.0
- - 
+ -
  - Unless required by applicable law or agreed to in writing,
  - software distributed under the License is distributed on an
  - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,22 +19,11 @@
  - under the License.
  -
  -->
-<virtualhosts>
-    <default>dev-only</default>
-    <virtualhost>
-        <name>dev-only</name>
-        <dev-only>            
-            <queues>
-                <exchange>amq.direct</exchange>
-		<!-- Small defaults for development -->
-                <maximumQueueDepth>102400</maximumQueueDepth>  <!-- 100k -->
-                <maximumMessageSize>20480</maximumMessageSize> <!-- 20kb -->
-                <maximumMessageAge>60000</maximumMessageAge>  <!-- 1 mins -->
-
-                <queue>
-                    <name>dev-queue</name>
-                </queue>
-            </queues>
-        </dev-only>
-    </virtualhost>
-</virtualhosts>
+<configuration>
+    <system/>
+    <override>
+        <xml fileName="${QPID_HOME}/etc/config-systests-derby-settings.xml"/>
+        <xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/>
+        <xml fileName="${QPID_HOME}/etc/config.xml"/>
+    </override>
+</configuration>

Copied: qpid/trunk/qpid/java/systests/etc/config-systests-settings.xml (from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests-settings.xml?p2=qpid/trunk/qpid/java/systests/etc/config-systests-settings.xml&p1=qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml&r1=813459&r2=813461&rev=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml (original)
+++ qpid/trunk/qpid/java/systests/etc/config-systests-settings.xml Thu Sep 10 14:41:08 2009
@@ -8,9 +8,9 @@
  - to you under the Apache License, Version 2.0 (the
  - "License"); you may not use this file except in compliance
  - with the License.  You may obtain a copy of the License at
- - 
+ -
  -   http://www.apache.org/licenses/LICENSE-2.0
- - 
+ -
  - Unless required by applicable law or agreed to in writing,
  - software distributed under the License is distributed on an
  - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,22 +19,11 @@
  - under the License.
  -
  -->
-<virtualhosts>
-    <default>dev-only</default>
-    <virtualhost>
-        <name>dev-only</name>
-        <dev-only>            
-            <queues>
-                <exchange>amq.direct</exchange>
-		<!-- Small defaults for development -->
-                <maximumQueueDepth>102400</maximumQueueDepth>  <!-- 100k -->
-                <maximumMessageSize>20480</maximumMessageSize> <!-- 20kb -->
-                <maximumMessageAge>60000</maximumMessageAge>  <!-- 1 mins -->
-
-                <queue>
-                    <name>dev-queue</name>
-                </queue>
-            </queues>
-        </dev-only>
-    </virtualhost>
-</virtualhosts>
+<broker>
+    <management>
+        <enabled>false</enabled>
+        <ssl>
+            <enabled>false</enabled>
+        </ssl>
+    </management>
+</broker>

Copied: qpid/trunk/qpid/java/systests/etc/config-systests.xml (from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests.xml?p2=qpid/trunk/qpid/java/systests/etc/config-systests.xml&p1=qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml&r1=813459&r2=813461&rev=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml (original)
+++ qpid/trunk/qpid/java/systests/etc/config-systests.xml Thu Sep 10 14:41:08 2009
@@ -8,9 +8,9 @@
  - to you under the Apache License, Version 2.0 (the
  - "License"); you may not use this file except in compliance
  - with the License.  You may obtain a copy of the License at
- - 
+ -
  -   http://www.apache.org/licenses/LICENSE-2.0
- - 
+ -
  - Unless required by applicable law or agreed to in writing,
  - software distributed under the License is distributed on an
  - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,22 +19,11 @@
  - under the License.
  -
  -->
-<virtualhosts>
-    <default>dev-only</default>
-    <virtualhost>
-        <name>dev-only</name>
-        <dev-only>            
-            <queues>
-                <exchange>amq.direct</exchange>
-		<!-- Small defaults for development -->
-                <maximumQueueDepth>102400</maximumQueueDepth>  <!-- 100k -->
-                <maximumMessageSize>20480</maximumMessageSize> <!-- 20kb -->
-                <maximumMessageAge>60000</maximumMessageAge>  <!-- 1 mins -->
-
-                <queue>
-                    <name>dev-queue</name>
-                </queue>
-            </queues>
-        </dev-only>
-    </virtualhost>
-</virtualhosts>
+<configuration>
+    <system/>
+    <override>
+        <xml fileName="${test.config}" config-optional="true"/>
+        <xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/>
+        <xml fileName="${QPID_HOME}/etc/config.xml"/>                
+    </override>
+</configuration>

Copied: qpid/trunk/qpid/java/systests/etc/virtualhosts-ServerConfigurationTest-New.xml (from r813459, qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/virtualhosts-ServerConfigurationTest-New.xml?p2=qpid/trunk/qpid/java/systests/etc/virtualhosts-ServerConfigurationTest-New.xml&p1=qpid/trunk/qpid/java/broker/etc/virtualhosts-config-test.xml&r1=813459&r2=813461&rev=813461&view=diff
==============================================================================
    (empty)

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/configuration/ServerConfigurationFileTest.java Thu Sep 10 14:41:08 2009
@@ -40,6 +40,8 @@
         {
             fail("Unable to test without config file:" + _configFile);
         }
+
+        saveTestConfiguration();
         _serverConfig = new ServerConfiguration(_configFile);
     }
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Thu Sep 10 14:41:08 2009
@@ -94,7 +94,7 @@
     {
         _connection = getConnection();
         _session = _connection.createSession(true, Session.SESSION_TRANSACTED);
-        _destination = _session.createQueue("testQueue");
+        _destination = _session.createQueue(getTestQueueName());
 
         // Consumer is only used to actually create the destination
         _session.createConsumer(_destination).close();
@@ -116,14 +116,12 @@
             // Add the current contents of the log file to test output
             message.append(_monitor.readFile());
 
-            // Write the server config file to test output
-            message.append("Server configuration file in use:\n");
-            message.append(FileUtils.readFileAsString(_configFile));
-
-            // Write the virtualhost config file to test output
-            message.append("\nVirtualhost configuration file in use:\n");
-            message.append(FileUtils.readFileAsString(ServerConfiguration.
-                    flatConfig(_configFile).getString("virtualhosts")));
+            // Write the test config file to test output
+            message.append("Server configuration overrides in use:\n");
+            message.append(FileUtils.readFileAsString(getTestConfigFile()));
+
+            message.append("\nVirtualhost maxMessageCount:\n");                        
+            message.append((new ServerConfiguration(_configFile)).getConfig().getString("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount"));
 
             fail(message.toString());
         }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/DerbyMessageStoreLoggingTest.java Thu Sep 10 14:41:08 2009
@@ -28,6 +28,7 @@
 import javax.jms.Queue;
 import javax.jms.Session;
 import java.util.List;
+import java.io.File;
 
 /**
  * The MessageStore test suite validates that the follow log messages as
@@ -56,9 +57,9 @@
         //We call super.setUp but this will not start the broker as that is
         //part of the test case.
 
-        // Load current configuration file to get the list of defined vhosts
-        Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-        List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+        // Load the default configuration file to get the list of defined vhosts
+        ServerConfiguration configuration = new ServerConfiguration(new File(_configFile.getParent() + "/config.xml"));
+        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         // Make them all persistent i.e. Use DerbyMessageStore and
         // test that it logs correctly.
@@ -97,8 +98,8 @@
         assertTrue("MST messages not logged", results.size() > 0);
 
         // Load VirtualHost list from file.
-        Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-        List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+        ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
         results = _monitor.findMatches("MST-1002");
@@ -117,7 +118,7 @@
             // the virtualhost name, found above. AND
             // the index that the virtualhost is within the configuration.
             // we can retrive that from the vhosts list previously extracted.
-            String fullStoreName = configuration.getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
+            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
 
             // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
             String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);
@@ -160,8 +161,8 @@
         assertTrue("MST messages not logged", results.size() > 0);
 
         // Load VirtualHost list from file.
-        Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-        List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+        ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
         results = _monitor.findMatches("MST-1004");
@@ -186,7 +187,7 @@
             // the virtualhost name, found above. AND
             // the index that the virtualhost is within the configuration.
             // we can retrive that from the vhosts list previously extracted.
-            String fullStoreName = configuration.getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
+            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
 
             // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
             String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);
@@ -227,8 +228,8 @@
         assertTrue("MST messages not logged", results.size() > 0);
 
         // Load VirtualHost list from file.
-        Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-        List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+        ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
         results = _monitor.findMatches("MST-1006");
@@ -253,7 +254,7 @@
             // the virtualhost name, found above. AND
             // the index that the virtualhost is within the configuration.
             // we can retrive that from the vhosts list previously extracted.
-            String fullStoreName = configuration.getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
+            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
 
             // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
             String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);
@@ -293,8 +294,8 @@
         assertTrue("MST messages not logged", results.size() > 0);
 
         // Load VirtualHost list from file.
-        Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-        List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+        ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
         results = _monitor.findMatches("MST-1004 : Recovery Start :");
@@ -316,7 +317,7 @@
         // the virtualhost name, found above. AND
         // the index that the virtualhost is within the configuration.
         // we can retrive that from the vhosts list previously extracted.
-        String fullStoreName = configuration.getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
+        String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
 
         // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
         String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);
@@ -358,8 +359,8 @@
         assertTrue("MST messages not logged", results.size() > 0);
 
         // Load VirtualHost list from file.
-        Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-        List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+        ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
         results = _monitor.findMatches("MST-1006 : Recovery Complete :");
@@ -381,7 +382,7 @@
         // the virtualhost name, found above. AND
         // the index that the virtualhost is within the configuration.
         // we can retrive that from the vhosts list previously extracted.
-        String fullStoreName = configuration.getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
+        String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
 
         // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
         String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);
@@ -500,8 +501,8 @@
             assertTrue("MST messages not logged", results.size() > 0);
 
             // Load VirtualHost list from file.
-            Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-            List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+            ServerConfiguration configuration = new ServerConfiguration(_configFile);
+            List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
             //Validate each vhost logs a creation
             results = _monitor.findMatches("MST-1004 : Recovery Start : " + queueName);
@@ -542,7 +543,7 @@
             // the virtualhost name, found above. AND
             // the index that the virtualhost is within the configuration.
             // we can retrive that from the vhosts list previously extracted.
-            String fullStoreName = configuration.getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
+            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
 
             // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
             String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ManagementLoggingTest.java Thu Sep 10 14:41:08 2009
@@ -24,6 +24,7 @@
 import org.apache.qpid.util.LogMonitor;
 
 import java.util.List;
+import java.io.File;
 
 /**
  * Management Console Test Suite
@@ -308,9 +309,8 @@
 
                 // We expect the RMIConnector Server port to be 100 higher than
                 // the RMI Server Port
-                int mPort = getPort() + (DEFAULT_MANAGEMENT_PORT - DEFAULT_PORT) + 100;
-                assertTrue("SSL Keystore entry expected(" + mPort + ").:" + getMessageString(log),
-                           getMessageString(log).endsWith(getConfigurationStringProperty("management.ssl.keyStorePath")));
+                assertTrue("SSL Keystore entry expected.:" + getMessageString(log),
+                           getMessageString(log).endsWith(new File(getConfigurationStringProperty("management.ssl.keyStorePath")).getAbsolutePath()));
             }
             catch (AssertionFailedError afe)
             {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/MemoryMessageStoreLoggingTest.java Thu Sep 10 14:41:08 2009
@@ -89,8 +89,8 @@
         assertEquals("MST-1001 is not the first MST message", "MST-1001", getMessageID(fromMessage(log)));
 
         // Load VirtualHost list from file.
-        Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-        List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+        ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
         results = _monitor.findMatches("MST-1001");
@@ -109,7 +109,7 @@
             // the virtualhost name, found above. AND
             // the index that the virtualhost is within the configuration.
             // we can retrive that from the vhosts list previously extracted.
-            String fullStoreName = configuration.getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
+            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
 
             // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
             String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);
@@ -156,8 +156,8 @@
         assertTrue("MST messages not logged", results.size() > 0);
 
         // Load VirtualHost list from file.
-        Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-        List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+        ServerConfiguration configuration = new ServerConfiguration(_configFile);
+        List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
         //Validate each vhost logs a creation
         results = _monitor.findMatches("MST-1003");
@@ -176,7 +176,7 @@
             // the virtualhost name, found above. AND
             // the index that the virtualhost is within the configuration.
             // we can retrive that from the vhosts list previously extracted.
-            String fullStoreName = configuration.getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
+            String fullStoreName = configuration.getConfig().getString("virtualhosts.virtualhost(" + vhosts.indexOf(vhostName) + ")." + vhostName + ".store.class");
 
             // Get the Simple class name from the expected class name of o.a.q.s.s.MMS
             String storeName = fullStoreName.substring(fullStoreName.lastIndexOf(".") + 1);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/VirtualHostLoggingTest.java Thu Sep 10 14:41:08 2009
@@ -64,8 +64,8 @@
         try
         {
             // Validation
-            Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-            List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+            ServerConfiguration configuration = new ServerConfiguration(_configFile);
+            List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
             //Validate each vhost logs a creation
             results = _monitor.findMatches("VHT-1001");
@@ -117,8 +117,8 @@
         {
             // Validation
 
-            Configuration configuration = ServerConfiguration.flatConfig(_configFile);
-            List<String> vhosts = configuration.getList("virtualhosts.virtualhost.name");
+            ServerConfiguration configuration = new ServerConfiguration(_configFile);
+            List<String> vhosts = configuration.getConfig().getList("virtualhosts.virtualhost.name");
 
             //Validate each vhost logs a creation
             results = _monitor.findMatches("VHT-1002");

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java Thu Sep 10 14:41:08 2009
@@ -21,67 +21,57 @@
 
 package org.apache.qpid.server.security.acl;
 
-import junit.framework.TestCase;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.*;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.test.utils.QpidTestCase;
+import org.apache.qpid.AMQConnectionFailureException;
+import org.apache.qpid.client.AMQAuthenticationException;
+import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.jms.ConnectionListener;
+import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.url.URLSyntaxException;
 
-import javax.jms.*;
+import javax.jms.Connection;
+import javax.jms.DeliveryMode;
 import javax.jms.IllegalStateException;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.NamingException;
 import java.io.File;
 
 public class SimpleACLTest extends QpidTestCase implements ConnectionListener
 {
-    private String BROKER = "vm://:"+ApplicationRegistry.DEFAULT_INSTANCE;//"tcp://localhost:5672";
-
     public void setUp() throws Exception
     {
-        //Shutdown the QTC broker
-        stopBroker();
-
-        // Initialise ACLs.
-        final String QpidExampleHome = System.getProperty("QPID_EXAMPLE_HOME");
-        final File defaultaclConfigFile = new File(QpidExampleHome, "etc/acl.config.xml");
+        final String QPID_HOME = System.getProperty("QPID_HOME");
 
-        if (!defaultaclConfigFile.exists())
-        {
-            System.err.println("Configuration file not found:" + defaultaclConfigFile);
-            fail("Configuration file not found:" + defaultaclConfigFile);
-        }
-
-        if (System.getProperty("QPID_HOME") == null)                                                                                            
+        if (QPID_HOME == null)
         {
             fail("QPID_HOME not set");
         }
 
-        ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(defaultaclConfigFile);
-        ApplicationRegistry.initialise(config, ApplicationRegistry.DEFAULT_INSTANCE);
-        TransportConnection.createVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
-    }
+        // Initialise ACLs.
+        _configFile = new File(QPID_HOME, "etc/config-systests-acl.xml");
 
-    public void tearDown()
-    {
-        TransportConnection.killVMBroker(ApplicationRegistry.DEFAULT_INSTANCE);
-        ApplicationRegistry.remove(ApplicationRegistry.DEFAULT_INSTANCE);
+        super.setUp();
     }
 
-    public String createConnectionString(String username, String password, String broker)
+    public String createConnectionString(String username, String password)
     {
 
-        return "amqp://" + username + ":" + password + "@clientid/test?brokerlist='" + broker + "?retries='0''";
+        return "amqp://" + username + ":" + password + "@clientid/test?brokerlist='" + getBroker() + "?retries='0''";
     }
 
     public void testAccessAuthorized() throws AMQException, URLSyntaxException
     {
         try
         {
-            Connection conn = createConnection("client", "guest");
+            Connection conn = getConnection("client", "guest");
 
             Session sesh = conn.createSession(true, Session.SESSION_TRANSACTED);
 
@@ -94,28 +84,32 @@
         }
         catch (Exception e)
         {
-            fail("Connection was not created due to:" + e.getMessage());
+            fail("Connection was not created due to:" + e);
         }
     }
 
-    public void testAccessNoRights() throws URLSyntaxException, JMSException
+    public void testAccessNoRights() throws Exception
     {
         try
         {
-            Connection conn = createConnection("guest", "guest");
+            Connection conn = getConnection("guest", "guest");
 
             //Attempt to do do things to test connection.
             Session sesh = conn.createSession(true, Session.SESSION_TRANSACTED);
             conn.start();
             sesh.rollback();
 
-            conn.close();
             fail("Connection was created.");
         }
-        catch (AMQException amqe)
+        catch (JMSException jmse)
         {
-            Throwable cause = amqe.getCause();
-            assertEquals("Exception was wrong type", AMQAuthenticationException.class, cause.getClass());
+            Throwable linkedException = jmse.getLinkedException();
+            assertNotNull("Cause was null", linkedException);
+
+            assertEquals("Linked Exception was wrong type", AMQConnectionFailureException.class, linkedException.getClass());
+
+            Throwable cause = linkedException.getCause();
+            assertEquals("Cause was wrong type", AMQAuthenticationException.class, cause.getClass());
             assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
         }
     }
@@ -124,7 +118,7 @@
     {
         try
         {
-            Connection conn = createConnection("client", "guest");
+            Connection conn = getConnection("client", "guest");
 
             Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -140,11 +134,11 @@
         }
     }
 
-    public void testClientConsumeFromNamedQueueInvalid() throws AMQException, URLSyntaxException
+    public void testClientConsumeFromNamedQueueInvalid() throws NamingException
     {
         try
         {
-            Connection conn = createConnection("client", "guest");
+            Connection conn = getConnection("client", "guest");
 
             //Prevent Failover
             ((AMQConnection) conn).setConnectionListener(this);
@@ -171,7 +165,7 @@
     {
         try
         {
-            Connection conn = createConnection("client", "guest");
+            Connection conn = getConnection("client", "guest");
 
             Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -189,11 +183,11 @@
         }
     }
 
-    public void testClientCreateNamedQueue() throws JMSException, URLSyntaxException, AMQException
+    public void testClientCreateNamedQueue() throws NamingException, JMSException, AMQException
     {
         try
         {
-            Connection conn = createConnection("client", "guest");
+            Connection conn = getConnection("client", "guest");
 
             Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -207,6 +201,7 @@
         }
         catch (AMQAuthenticationException amqe)
         {
+            amqe.printStackTrace();
             assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) amqe).getErrorCode().getCode());
         }
     }
@@ -215,7 +210,7 @@
     {
         try
         {
-            Connection conn = createConnection("client", "guest");
+            Connection conn = getConnection("client", "guest");
 
             ((AMQConnection) conn).setConnectionListener(this);
 
@@ -242,7 +237,7 @@
     {
         try
         {
-            Connection conn = createConnection("client", "guest");
+            Connection conn = getConnection("client", "guest");
 
             ((AMQConnection) conn).setConnectionListener(this);
 
@@ -268,11 +263,11 @@
         }
     }
 
-    public void testClientPublishInvalidQueueSuccess() throws AMQException, URLSyntaxException, JMSException
+    public void testClientPublishInvalidQueueSuccess() throws AMQException, URLSyntaxException, JMSException, NamingException
     {
         try
         {
-            Connection conn = createConnection("client", "guest");
+            Connection conn = getConnection("client", "guest");
 
             ((AMQConnection) conn).setConnectionListener(this);
 
@@ -317,7 +312,7 @@
     {
         try
         {
-            Connection conn = createConnection("server", "guest");
+            Connection conn = getConnection("server", "guest");
 
             Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -333,11 +328,11 @@
         }
     }
 
-    public void testServerConsumeFromNamedQueueInvalid() throws AMQException, URLSyntaxException
+    public void testServerConsumeFromNamedQueueInvalid() throws AMQException, URLSyntaxException, NamingException
     {
         try
-        {                                                      
-            Connection conn = createConnection("client", "guest");
+        {
+            Connection conn = getConnection("client", "guest");
 
             Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -358,11 +353,11 @@
         }
     }
 
-    public void testServerConsumeFromTemporaryQueue() throws AMQException, URLSyntaxException
+    public void testServerConsumeFromTemporaryQueue() throws AMQException, URLSyntaxException, NamingException
     {
         try
         {
-            Connection conn = createConnection("server","guest");
+            Connection conn = getConnection("server", "guest");
 
             Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -382,30 +377,22 @@
         }
     }
 
-    private Connection createConnection(String username, String password) throws AMQException
+    @Override
+    public Connection getConnection(String username, String password) throws NamingException, JMSException
     {
-        AMQConnection connection = null;
-        try
-        {
-            connection = new AMQConnection(createConnectionString(username, password, BROKER));
-        }
-        catch (URLSyntaxException e)
-        {
-            // This should never happen as we generate the URLs.
-            fail(e.getMessage());
-        }
+        AMQConnection connection = (AMQConnection) super.getConnection(username, password);
 
         //Prevent Failover
         connection.setConnectionListener(this);
 
-        return (Connection)connection;
+        return (Connection) connection;
     }
 
     public void testServerCreateNamedQueueValid() throws JMSException, URLSyntaxException
     {
         try
         {
-            Connection conn = createConnection("server", "guest");
+            Connection conn = getConnection("server", "guest");
 
             Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -422,11 +409,11 @@
         }
     }
 
-    public void testServerCreateNamedQueueInvalid() throws JMSException, URLSyntaxException, AMQException
+    public void testServerCreateNamedQueueInvalid() throws JMSException, URLSyntaxException, AMQException, NamingException
     {
         try
         {
-            Connection conn = createConnection("server", "guest");
+            Connection conn = getConnection("server", "guest");
 
             Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
@@ -444,18 +431,18 @@
         }
     }
 
-    public void testServerCreateTemporaryQueueInvalid() throws JMSException, URLSyntaxException, AMQException
+    public void testServerCreateTemporaryQueueInvalid() throws NamingException
     {
         try
         {
-            Connection conn = createConnection("server", "guest");
+            Connection conn = getConnection("server", "guest");
 
             Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
             conn.start();
 
             session.createTemporaryQueue();
-                    
+
             fail("Test failed as creation succeded.");
             //conn will be automatically closed
         }
@@ -469,19 +456,19 @@
         }
     }
 
-    public void testServerCreateAutoDeleteQueueInvalid() throws JMSException, URLSyntaxException, AMQException
+    public void testServerCreateAutoDeleteQueueInvalid() throws NamingException, JMSException, AMQException
     {
         Connection connection = null;
         try
         {
-            connection = createConnection("server", "guest");
+            connection = getConnection("server", "guest");
 
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
             connection.start();
 
             ((AMQSession) session).createQueue(new AMQShortString("again_ensure_auto_delete_queue_for_temporary"),
-                                            true, false, false);
+                                               true, false, false);
 
             fail("Test failed as creation succeded.");
             //connection will be automatically closed
@@ -489,7 +476,7 @@
         catch (AMQAuthenticationException amqe)
         {
             assertEquals("Incorrect error code thrown", 403, amqe.getErrorCode().getCode());
-        }       
+        }
     }
 
     /**
@@ -500,10 +487,10 @@
      * @throws URLSyntaxException
      * @throws JMSException
      */
-    public void testServerPublishUsingTransactionSuccess() throws AMQException, URLSyntaxException, JMSException
+    public void testServerPublishUsingTransactionSuccess() throws AMQException, URLSyntaxException, JMSException, NamingException
     {
         //Set up the Server
-        Connection serverConnection = createConnection("server", "guest");
+        Connection serverConnection = getConnection("server", "guest");
 
         ((AMQConnection) serverConnection).setConnectionListener(this);
 
@@ -516,7 +503,7 @@
         serverConnection.start();
 
         //Set up the consumer
-        Connection clientConnection = createConnection("client", "guest");
+        Connection clientConnection = getConnection("client", "guest");
 
         //Send a test mesage
         Session clientSession = clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -557,8 +544,6 @@
             //Send the message using a transaction as this will allow us to retrieve any errors that occur on the broker.
             serverSession.commit();
 
-
-
             //Ensure Response is received.
             Message clientResponseMsg = clientResponse.receive(2000);
             assertNotNull("Client did not receive response message,", clientResponseMsg);
@@ -582,11 +567,11 @@
         }
     }
 
-    public void testServerPublishInvalidQueueSuccess() throws AMQException, URLSyntaxException, JMSException
+    public void testServerPublishInvalidQueueSuccess() throws AMQException, URLSyntaxException, JMSException, NamingException
     {
         try
         {
-            Connection conn = createConnection("server", "guest");
+            Connection conn = getConnection("server", "guest");
 
             ((AMQConnection) conn).setConnectionListener(this);
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java Thu Sep 10 14:41:08 2009
@@ -57,26 +57,13 @@
 
     public void setUp() throws Exception
     {
-        super.setUp();
-        stopBroker();
-        if (!_configFile.exists())
-        {
-            fail("Unable to test without config file:" + _configFile);
-        }
 
-        XMLConfiguration configuration = new XMLConfiguration(_configFile); 
-        configuration.setProperty("virtualhosts.virtualhost." + VIRTUALHOST+".store.class", "org.apache.qpid.server.store.SlowMessageStore");
-        configuration.setProperty("virtualhosts.virtualhost." + VIRTUALHOST+".store.delays.commitTran.post", POST_COMMIT_DELAY);
-        configuration.setProperty("management.enabled", "false");
+        setConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST+".store.class", "org.apache.qpid.server.store.SlowMessageStore");
+        setConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST+".store.delays.commitTran.post", String.valueOf(POST_COMMIT_DELAY));
+        setConfigurationProperty("management.enabled", "false");
 
         
-        File tmpFile = File.createTempFile("configFile", "test");
-        tmpFile.deleteOnExit();
-        configuration.save(tmpFile);
-        
-        _configFile = tmpFile;
-
-        startBroker(1);
+        super.setUp();
 
         //Set the syncWrite timeout to be just larger than the delay on the commitTran.
         setSystemProperty("amqj.default_syncwrite_timeout", String.valueOf(SYNC_WRITE_TIMEOUT));

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java Thu Sep 10 14:41:08 2009
@@ -21,6 +21,7 @@
 import junit.framework.TestResult;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQConnectionFactory;
 import org.apache.qpid.client.transport.TransportConnection;
@@ -30,6 +31,7 @@
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
 import org.apache.qpid.server.store.DerbyMessageStore;
+import org.apache.qpid.url.URLSyntaxException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -73,6 +75,7 @@
     protected long RECEIVE_TIMEOUT = 1000l;
 
     private Map<String, String> _setProperties = new HashMap<String, String>();
+    private XMLConfiguration _testConfiguration = new XMLConfiguration();
 
     /**
      * Some tests are excluded when the property test.excludes is set to true.
@@ -183,8 +186,7 @@
     public static final String QUEUE = "queue";
     public static final String TOPIC = "topic";
     /** Map to hold test defined environment properties */
-    private Map<String,String> _env;
-
+    private Map<String, String> _env;
 
     public QpidTestCase(String name)
     {
@@ -368,7 +370,9 @@
 
     /**
      * Return the management portin use by the broker on this main port
+     *
      * @param mainPort the broker's main port.
+     *
      * @return the management port that corresponds to the broker on the given port
      */
     protected int getManagementPort(int mainPort)
@@ -415,6 +419,9 @@
     {
         port = getPort(port);
 
+        // Save any configuratio changes that have been made
+        saveTestConfiguration();
+
         Process process = null;
         if (_broker.equals(VM))
         {
@@ -444,9 +451,28 @@
             // Add all the environment settings the test requested
             if (!_env.isEmpty())
             {
-                for(Map.Entry<String,String> entry : _env.entrySet())
+                for (Map.Entry<String, String> entry : _env.entrySet())
+                {
+                    env.put(entry.getKey(), entry.getValue());
+                }
+            }
+
+            String QPID_OPTS = " ";
+            // Add all the specified system properties to QPID_OPTS
+            if (!_setProperties.isEmpty())
+            {
+                for (String key : _setProperties.keySet())
+                {
+                    QPID_OPTS += "-D" + key + "=" + System.getProperty(key) + " ";
+                }
+
+                if (env.containsKey("QPID_OPTS"))
                 {
-                    env.put(entry.getKey() ,entry.getValue());
+                    env.put("QPID_OPTS", env.get("QPID_OPTS") + QPID_OPTS);
+                }
+                else
+                {
+                    env.put("QPID_OPTS", QPID_OPTS);
                 }
             }
 
@@ -484,6 +510,26 @@
         _brokers.put(port, process);
     }
 
+    public String getTestConfigFile()
+    {
+        return _output + "/" + getTestQueueName() + ".xml";
+    }
+
+    protected void saveTestConfiguration() throws ConfigurationException
+    {
+        String testConfig = getTestConfigFile();
+        //Specifiy the test configuration
+        setSystemProperty("test.config", testConfig);
+
+        // This is a work
+        if (_testConfiguration.isEmpty())
+        {
+            _testConfiguration.addProperty("test", getTestQueueName());
+        }
+
+        _testConfiguration.save(getTestConfigFile());
+    }
+
     public void cleanBroker()
     {
         if (_brokerClean != null)
@@ -565,18 +611,12 @@
             storeClass = bdb;
         }
 
-        // First we munge the config file and, if we're in a VM, set up an additional logfile
-        XMLConfiguration configuration = new XMLConfiguration(_configFile);
-        configuration.setProperty("virtualhosts.virtualhost." + virtualhost +
+
+        _testConfiguration.setProperty("virtualhosts.virtualhost." + virtualhost +
                                   ".store.class", storeClass.getName());
-        configuration.setProperty("virtualhosts.virtualhost." + virtualhost +
+        _testConfiguration.setProperty("virtualhosts.virtualhost." + virtualhost +
                                   ".store." + DerbyMessageStore.ENVIRONMENT_PATH_PROPERTY,
-                                  "${work}/" + virtualhost);
-
-        File tmpFile = File.createTempFile("configFile", "test");
-        tmpFile.deleteOnExit();
-        configuration.save(tmpFile);
-        _configFile = tmpFile;
+                                  "${QPID_WORK}/" + virtualhost);
     }
 
     /**
@@ -591,6 +631,10 @@
      */
     protected String getConfigurationStringProperty(String property) throws ConfigurationException
     {
+        // Call save Configuration to be sure we have saved the test specific
+        // file. As the optional status
+        saveTestConfiguration();
+
         ServerConfiguration configuration = new ServerConfiguration(_configFile);
         return configuration.getConfig().getString(property);
     }
@@ -613,48 +657,9 @@
     protected void setConfigurationProperty(String property, String value)
             throws ConfigurationException, IOException
     {
-        XMLConfiguration configuration = new XMLConfiguration(_configFile);
-
-        // If we are modifying a virtualhost value then we need to do so in
-        // the virtualhost.xml file as these values overwrite the values in
-        // the main config.xml file
-        if (property.startsWith("virtualhosts"))
-        {
-            // So locate the virtualhost.xml file and use the ServerConfiguration
-            // flatConfig method to get the interpolated value.
-            String vhostConfigFile = ServerConfiguration.
-                    flatConfig(_configFile).getString("virtualhosts");
-
-            // Load the vhostConfigFile
-            XMLConfiguration vhostConfiguration = new XMLConfiguration(vhostConfigFile);
-
-            // Set the value specified in to the vhostConfig.
-            // Remembering that property will be 'virtualhosts.virtulhost....'
-            // so we need to take off the 'virtualhosts.' from the start.
-            vhostConfiguration.setProperty(property.substring(property.indexOf(".") + 1), value);
-
-            // Write out the new virtualhost config file
-            File tmpFile = File.createTempFile("virtualhost-configFile", ".xml");
-            tmpFile.deleteOnExit();
-            vhostConfiguration.save(tmpFile);
-
-            // Change the property and value to be the new virtualhosts file
-            // so that then update the value in the main config file.
-            property = "virtualhosts";
-            value = tmpFile.getAbsolutePath();
-        }
-
-        configuration.setProperty(property, value);
-
-        // Write the new server config file
-        File tmpFile = File.createTempFile("configFile", ".xml");
-        tmpFile.deleteOnExit();
-        configuration.save(tmpFile);
-
-        _logger.info("Qpid Test Case now using configuration File:"
-                     + tmpFile.getAbsolutePath());
-
-        _configFile = tmpFile;
+        //Write the value in to this configuration file which will override the
+        // defaults.
+        _testConfiguration.setProperty(property, value);
     }
 
     /**
@@ -695,14 +700,13 @@
      * Add an environtmen variable for the external broker environment
      *
      * @param property the property to set
-     * @param value the value to set it to
+     * @param value    the value to set it to
      */
     protected void setBrokerEnvironment(String property, String value)
     {
-        _env.put(property,value);
+        _env.put(property, value);
     }
 
-
     /**
      * Check whether the broker is an 0.8
      *
@@ -720,7 +724,7 @@
 
     protected boolean isJavaBroker()
     {
-        return _brokerLanguage.equals("java");
+        return _brokerLanguage.equals("java") || _broker.equals("vm");
     }
 
     protected boolean isCppBroker()
@@ -831,7 +835,7 @@
      *
      * @throws Exception if there is an error getting the connection
      */
-    public Connection getConnection(String username, String password) throws Exception
+    public Connection getConnection(String username, String password) throws JMSException, NamingException
     {
         _logger.info("get Connection");
         Connection con = getConnectionFactory().createConnection(username, password);
@@ -840,7 +844,7 @@
         return con;
     }
 
-    public Connection getConnection(String username, String password, String id) throws Exception
+    public Connection getConnection(String username, String password, String id) throws JMSException, URLSyntaxException, AMQException, NamingException
     {
         _logger.info("get Connection");
         Connection con;
@@ -860,6 +864,7 @@
     /**
      * Return a uniqueName for this test.
      * In this case it returns a queue Named by the TestCase and TestName
+     *
      * @return String name for a queue
      */
     protected String getTestQueueName()

Modified: qpid/trunk/qpid/java/test-profiles/08Excludes
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/08Excludes?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/08Excludes (original)
+++ qpid/trunk/qpid/java/test-profiles/08Excludes Thu Sep 10 14:41:08 2009
@@ -15,3 +15,6 @@
 org.apache.qpid.client.SessionCreateTest#*
 
 org.apache.qpid.test.client.RollbackOrderTest#*
+
+// MALT requries an external broker so exclude it from the InVM test runs
+org.apache.qpid.management.jmx.ManagementActorLoggingTest

Modified: qpid/trunk/qpid/java/test-profiles/Excludes
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/Excludes?rev=813461&r1=813460&r2=813461&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/Excludes (original)
+++ qpid/trunk/qpid/java/test-profiles/Excludes Thu Sep 10 14:41:08 2009
@@ -13,5 +13,9 @@
 org.apache.qpid.server.logging.BrokerLoggingTest#testBrokerShutdownStopped
 org.apache.qpid.server.logging.VirtualHostLoggingTest#testVirtualhostClosure
 org.apache.qpid.server.logging.MemoryMessageStoreLoggingTest#testMessageStoreClose
-org.apache.qpid.server.logging.DerbyMessageStoreLoggingTest#testMessageStoreClose
 
+// QPID-XXX : Test fails to start external broker due to Derby Exception.
+org.apache.qpid.server.logging.DerbyMessageStoreLoggingTest#*
+
+// QPID-2081 :The configuration changes are now highlighting the close race condition
+org.apache.qpid.server.security.acl.SimipleACLTest#*



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org