qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r745799 [3/3] - in /qpid/trunk/qpid/java: broker/src/main/java/org/apache/qpid/server/ broker/src/main/java/org/apache/qpid/server/configuration/ broker/src/main/java/org/apache/qpid/server/exchange/ broker/src/main/java/org/apache/qpid/ser...
Date Thu, 19 Feb 2009 10:03:24 GMT
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=745799&r1=745798&r2=745799&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 Feb 19 10:03:18 2009
@@ -20,13 +20,7 @@
  */
 package org.apache.qpid.test.client.timeouts;
 
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.io.File;
 
 import javax.jms.Connection;
 import javax.jms.JMSException;
@@ -35,7 +29,13 @@
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
-import java.io.File;
+
+import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
+import org.apache.qpid.test.utils.QpidTestCase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This tests that when the commit takes a long time(due to POST_COMMIT_DELAY) that the commit
does not timeout
@@ -67,16 +67,17 @@
             fail("Unable to test without config file:" + _configFile);
         }
 
-        ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(_configFile);
-
-        //Disable management on broker.
-        config.getConfiguration().setProperty("management.enabled", "false");
-
-        Configuration testVirtualhost = config.getConfiguration().subset("virtualhosts.virtualhost."
+ VIRTUALHOST);
-        testVirtualhost.setProperty("store.class", "org.apache.qpid.server.store.SlowMessageStore");
-        testVirtualhost.setProperty("store.delays.commitTran.post", POST_COMMIT_DELAY);
-
-        startBroker(1, config);
+        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);
+        
+        File tmpFile = File.createTempFile("configFile", "test");
+        tmpFile.deleteOnExit();
+        configuration.save(tmpFile);
+        
+        ApplicationRegistry reg = new ConfigurationFileApplicationRegistry(tmpFile);
+        
+        startBroker(1, reg);
 
         //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=745799&r1=745798&r2=745799&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 Feb 19 10:03:18 2009
@@ -290,7 +290,7 @@
         }
     }
 
-    public void startBroker(int port, ConfigurationFileApplicationRegistry config) throws
Exception
+    public void startBroker(int port, ApplicationRegistry config) throws Exception
     {
         ApplicationRegistry.initialise(config, port);
         startBroker(port);



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


Mime
View raw message