servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r749606 - in /servicemix/smx4/nmr/trunk/jbi/cluster/engine: ./ src/test/java/org/apache/servicemix/jbi/cluster/engine/ src/test/resources/
Date Tue, 03 Mar 2009 13:08:55 GMT
Author: gnodet
Date: Tue Mar  3 13:08:55 2009
New Revision: 749606

URL: http://svn.apache.org/viewvc?rev=749606&view=rev
Log:
SMX4NMR-25: Improve clustering tests

Modified:
    servicemix/smx4/nmr/trunk/jbi/cluster/engine/pom.xml
    servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/AbstractClusterEndpointTest.java
    servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQClusterEndpointLoadTest.java
    servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOnlyClusterEndpointTest.java
    servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOutClusterEndpointTest.java
    servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/GenericInOutClusterEndpointTest.java
    servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ReconnectTest.java
    servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/resources/log4j.properties

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/engine/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/engine/pom.xml?rev=749606&r1=749605&r2=749606&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/engine/pom.xml (original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/engine/pom.xml Tue Mar  3 13:08:55 2009
@@ -130,10 +130,16 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <forkMode>pertest</forkMode>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <forkedProcessTimeoutInSeconds>60</forkedProcessTimeoutInSeconds>
+                    <!--
                     <skip>true</skip>
+                    -->
                     <excludes>
+                        <!--
                         <exclude>**/*ReconnectTest.java</exclude>
                         <exclude>**/*LoadTest.java</exclude>
+                        -->
                     </excludes>
                 </configuration>
             </plugin>

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/AbstractClusterEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/AbstractClusterEndpointTest.java?rev=749606&r1=749605&r2=749606&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/AbstractClusterEndpointTest.java
(original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/AbstractClusterEndpointTest.java
Tue Mar  3 13:08:55 2009
@@ -21,6 +21,9 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
+import java.io.File;
+import java.net.ServerSocket;
+import java.lang.management.ManagementFactory;
 
 import javax.jms.ConnectionFactory;
 import javax.xml.namespace.QName;
@@ -43,10 +46,13 @@
 import org.apache.servicemix.nmr.core.util.StringSource;
 import org.apache.servicemix.jbi.runtime.impl.MessageExchangeImpl;
 import org.apache.servicemix.jbi.runtime.impl.DeliveryChannelImpl;
+import org.apache.servicemix.jbi.runtime.impl.AbstractComponentContext;
 import org.apache.servicemix.jbi.runtime.ExchangeCompletedListener;
 import org.apache.servicemix.jbi.cluster.requestor.Transacted;
 import org.apache.servicemix.jbi.cluster.requestor.GenericJmsRequestorPool;
 import org.apache.servicemix.jbi.cluster.requestor.AbstractPollingRequestorPool;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
 import org.jencks.GeronimoPlatformTransactionManager;
 import org.springframework.core.task.TaskExecutor;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@@ -57,6 +63,8 @@
     public static final String PROXY_ENDPOINT_NAME = "proxy";
     public static final String RECEIVER_ENDPOINT_NAME = "receiver";
 
+    private final Log LOG = LogFactory.getLog(getClass());
+
     protected NMR nmr1;
     protected NMR nmr2;
     protected Service broker;
@@ -64,14 +72,19 @@
     protected ExchangeCompletedListener listener;
     protected TransactionManager transactionManager;
     protected TaskExecutor executor;
+    protected int port;
 
     @Override
     protected void setUp() throws Exception {
+        LOG.info("============================================================");
+        LOG.info("     Starting test: " + this.toString());
+        LOG.info("============================================================");
         super.setUp();
         ExchangeImpl.getConverter();
+        this.port = findFreePort();
         this.executor = createTaskExecutor();
         this.transactionManager = new GeronimoPlatformTransactionManager();
-        this.broker = createBroker();
+        this.broker = createBroker(true);
         this.connectionFactory = createConnectionFactory();
         this.nmr1 = createNmr();
         this.nmr2 = createNmr();
@@ -80,8 +93,19 @@
         this.nmr2.getListenerRegistry().register(this.listener, null);
     }
 
+    protected int findFreePort() {
+        int port = 61616;
+        try {
+            ServerSocket ss = new ServerSocket(0);
+            port = ss.getLocalPort();
+            ss.close();
+        } catch (Exception e) {
+        }
+        return port;
+    }
+
     protected ConnectionFactory createConnectionFactory() {
-        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?jms.prefetchPolicy.queuePrefetch=1000");
+        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:" +
port);
         XaPooledConnectionFactory cnf = new XaPooledConnectionFactory(cf);
         cnf.setTransactionManager(transactionManager);
         return cnf;
@@ -111,10 +135,16 @@
         return exec;
     }
 
-    protected Service createBroker() throws Exception {
+    protected Service createBroker(boolean deleteData) throws Exception {
+        File data = new File("target/activemq");
+        if (deleteData) {
+            deleteFile(data);
+        }
         BrokerService broker = new BrokerService();
-        broker.setPersistent(false);
-        broker.setUseJmx(false);
+        broker.setPersistent(true);
+        broker.setDataDirectoryFile(data);
+        broker.setUseJmx(true);
+        broker.addConnector("tcp://localhost:" + port);
         broker.start();
         return broker;
     }
@@ -153,7 +183,8 @@
         nmr.getEndpointRegistry().register(proxy,
                 ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME,
                                         Endpoint.SERVICE_NAME, "{urn:test}proxy",
-                                        Endpoint.ENDPOINT_NAME, "endpoint"));
+                                        Endpoint.ENDPOINT_NAME, "endpoint",
+                                        AbstractComponentContext.INTERNAL_ENDPOINT, "true"));
         SimpleClusterRegistration reg = new SimpleClusterRegistration();
         reg.setEndpoint(proxy);
         reg.init();
@@ -166,7 +197,8 @@
         nmr.getEndpointRegistry().register(receiver,
                 ServiceHelper.createMap(Endpoint.NAME, RECEIVER_ENDPOINT_NAME,
                                         Endpoint.SERVICE_NAME, "{urn:test}receiver",
-                                        Endpoint.ENDPOINT_NAME, "endpoint"));
+                                        Endpoint.ENDPOINT_NAME, "endpoint",
+                                        AbstractComponentContext.INTERNAL_ENDPOINT, "true"));
         return receiver;
     }
 
@@ -253,11 +285,11 @@
             }
             if (exchange.getStatus() == Status.Active) {
                 String key = exchange.getIn().getBody(String.class);
-                if (sendFault && !faultSent.containsKey(key)) {
+                if (sendFault && key != null && !faultSent.containsKey(key))
{
                     exchange.getFault().setBody(new StringSource("<fault/>"));
                     channel.send(exchange);
                     faultSent.put(key, true);
-                } else if (sendError && !errorSent.containsKey(key)) {
+                } else if (sendError && key != null && !errorSent.containsKey(key))
{
                     exchange.setError(new Exception("error"));
                     exchange.setStatus(Status.Error);
                     channel.send(exchange);
@@ -323,4 +355,31 @@
         }
     }
 
+    protected static boolean deleteFile(File fileToDelete) {
+        if (fileToDelete == null || !fileToDelete.exists()) {
+            return true;
+        }
+        boolean result = true;
+        if (fileToDelete.isDirectory()) {
+            File[] files = fileToDelete.listFiles();
+            if (files == null) {
+                result = false;
+            } else {
+                for (int i = 0; i < files.length; i++) {
+                    File file = files[i];
+                    if (file.getName().equals(".") || file.getName().equals("..")) {
+                        continue;
+                    }
+                    if (file.isDirectory()) {
+                        result &= deleteFile(file);
+                    } else {
+                        result &= file.delete();
+                    }
+                }
+            }
+        }
+        result &= fileToDelete.delete();
+        return result;
+    }
+
 }

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQClusterEndpointLoadTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQClusterEndpointLoadTest.java?rev=749606&r1=749605&r2=749606&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQClusterEndpointLoadTest.java
(original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQClusterEndpointLoadTest.java
Tue Mar  3 13:08:55 2009
@@ -44,16 +44,6 @@
         super.testLoadInOut();
     }
 
-    protected ConnectionFactory createConnectionFactory() {
-        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost");
-        cf.setAlwaysSessionAsync(false);
-        cf.setObjectMessageSerializationDefered(true);
-        cf.setCopyMessageOnSend(false);
-        XaPooledConnectionFactory cnf = new XaPooledConnectionFactory(cf);
-        cnf.setTransactionManager(transactionManager);
-        return cnf;
-    }
-
     protected AbstractPollingRequestorPool createPool() {
         ActiveMQJmsRequestorPool pool = new ActiveMQJmsRequestorPool();
         pool.setCacheSessions(true);

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOnlyClusterEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOnlyClusterEndpointTest.java?rev=749606&r1=749605&r2=749606&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOnlyClusterEndpointTest.java
(original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOnlyClusterEndpointTest.java
Tue Mar  3 13:08:55 2009
@@ -47,16 +47,6 @@
         super.testInOnlyAckTxRb();
     }
 
-    protected ConnectionFactory createConnectionFactory() {
-        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost");
-        cf.setAlwaysSessionAsync(false);
-        cf.setObjectMessageSerializationDefered(true);
-        cf.setCopyMessageOnSend(false);
-        XaPooledConnectionFactory cnf = new XaPooledConnectionFactory(cf);
-        cnf.setTransactionManager(transactionManager);
-        return cnf;
-    }
-
     protected AbstractPollingRequestorPool createPool() {
         ActiveMQJmsRequestorPool pool = new ActiveMQJmsRequestorPool();
         pool.setCacheSessions(true);

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOutClusterEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOutClusterEndpointTest.java?rev=749606&r1=749605&r2=749606&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOutClusterEndpointTest.java
(original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ActiveMQInOutClusterEndpointTest.java
Tue Mar  3 13:08:55 2009
@@ -38,14 +38,6 @@
         super.testInOutJmsTxRbInError();
     }
 
-    protected ConnectionFactory createConnectionFactory() {
-        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost");
-        cf.setAlwaysSessionAsync(false);
-        cf.setObjectMessageSerializationDefered(true);
-        cf.setCopyMessageOnSend(false);
-        return cf;
-    }
-
     protected AbstractPollingRequestorPool createPool() {
         ActiveMQJmsRequestorPool pool = new ActiveMQJmsRequestorPool();
         pool.setCacheSessions(true);

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/GenericInOutClusterEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/GenericInOutClusterEndpointTest.java?rev=749606&r1=749605&r2=749606&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/GenericInOutClusterEndpointTest.java
(original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/GenericInOutClusterEndpointTest.java
Tue Mar  3 13:08:55 2009
@@ -42,8 +42,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Active, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
         exchange.setStatus(Status.Done);
         client.send(exchange);
         client.close();
@@ -57,8 +57,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Error, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Error, exchange.getStatus());
         client.close();
         receiver.assertExchangesReceived(1, TIMEOUT);
     }
@@ -70,8 +70,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Active, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
         exchange.setStatus(Status.Done);
         client.send(exchange);
         client.close();
@@ -85,8 +85,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Error, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Error, exchange.getStatus());
         client.close();
         receiver.assertExchangesReceived(1, TIMEOUT);
     }
@@ -98,8 +98,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Active, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
         exchange.setStatus(Status.Done);
         client.send(exchange);
         client.close();
@@ -113,8 +113,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Error, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Error, exchange.getStatus());
         client.close();
         receiver.assertExchangesReceived(1, TIMEOUT);
     }
@@ -126,8 +126,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Active, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
         exchange.setStatus(Status.Done);
         client.send(exchange);
         client.close();
@@ -141,8 +141,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Active, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
         exchange.setStatus(Status.Done);
         client.send(exchange);
         client.close();
@@ -156,8 +156,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Active, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
         exchange.setStatus(Status.Done);
         client.send(exchange);
         client.close();
@@ -171,8 +171,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Error, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Error, exchange.getStatus());
         client.close();
         receiver.assertExchangesReceived(1, TIMEOUT);
     }
@@ -184,8 +184,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Active, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
         exchange.setStatus(Status.Done);
         client.send(exchange);
         client.close();
@@ -199,8 +199,8 @@
         Exchange exchange = client.createExchange(Pattern.InOut);
         exchange.getIn().setBody(new StringSource("<hello/>"));
         exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME,
PROXY_ENDPOINT_NAME)));
-        client.sendSync(exchange);
-        assertEquals(Status.Active, exchange.getStatus());
+        assertTrue("sendSync failed for exchange " + exchange.getId(), client.sendSync(exchange));
+        assertEquals("bad status for exchange " + exchange.getId(), Status.Active, exchange.getStatus());
         exchange.setStatus(Status.Done);
         client.send(exchange);
         client.close();

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ReconnectTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ReconnectTest.java?rev=749606&r1=749605&r2=749606&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ReconnectTest.java
(original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/java/org/apache/servicemix/jbi/cluster/engine/ReconnectTest.java
Tue Mar  3 13:08:55 2009
@@ -20,6 +20,7 @@
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.io.File;
 
 import javax.jms.ConnectionFactory;
 
@@ -90,15 +91,15 @@
 
         latch.await();
 
-        Thread.sleep(1000);
+//        Thread.sleep(1000);
 
         cluster2.resume();
 
         //Thread.sleep(100);
 
         broker.stop();
-        Thread.sleep(1000);
-        broker = createBroker();
+//        Thread.sleep(1000);
+        broker = createBroker(false);
 
         latch.await();
 
@@ -112,22 +113,13 @@
         System.err.println("Throuput: " + (nbThreads * nbExchanges * 1000 / (t1 - t0)) +
" messages/sec");
     }
 
-    protected ConnectionFactory createConnectionFactory() {
-        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
-        return cf;
-//        XaPooledConnectionFactory cnf = new XaPooledConnectionFactory(cf);
-//        cnf.setTransactionManager(transactionManager);
-//        return cnf;
-    }
-
-    protected Service createBroker() throws Exception {
-        BrokerService broker = new BrokerService();
-        broker.setPersistent(true);
-        broker.setUseJmx(false);
-        broker.addConnector("tcp://localhost:61616");
-        broker.start();
-        return broker;
-    }
+//    protected ConnectionFactory createConnectionFactory() {
+//        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
+//        return cf;
+////        XaPooledConnectionFactory cnf = new XaPooledConnectionFactory(cf);
+////        cnf.setTransactionManager(transactionManager);
+////        return cnf;
+//    }
 
     protected void createRoute(Transacted transacted,
                                boolean rollbackOnErrors,
@@ -157,4 +149,5 @@
         nmr2.getEndpointRegistry().unregister(receiver, null);
         super.tearDown();
     }
+
 }

Modified: servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/resources/log4j.properties?rev=749606&r1=749605&r2=749606&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/resources/log4j.properties (original)
+++ servicemix/smx4/nmr/trunk/jbi/cluster/engine/src/test/resources/log4j.properties Tue Mar
 3 13:08:55 2009
@@ -21,13 +21,13 @@
 #
 # The logging properties used during tests..
 #
-log4j.rootLogger=DEBUG, out
+log4j.rootLogger=DEBUG, stdout
 
-#log4j.logger.org.springframework=INFO
+log4j.logger.org.springframework=INFO
 log4j.logger.org.apache.activemq=INFO
-log4j.logger.org.apache.activemq.spring=WARN
-log4j.logger.org.apache.activemq.store.journal=INFO
-log4j.logger.org.activeio.journal=INFO
+#log4j.logger.org.apache.activemq.spring=WARN
+#log4j.logger.org.apache.activemq.store.journal=INFO
+#log4j.logger.org.activeio.journal=INFO
 
 # CONSOLE appender not used by default
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender



Mime
View raw message