[jboss-cvs] JBoss Messaging SVN: r6869 - in trunk: docs/user-manual/en/modules and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 19 05:25:24 EDT 2009


Author: timfox
Date: 2009-05-19 05:25:23 -0400 (Tue, 19 May 2009)
New Revision: 6869

Modified:
   trunk/.classpath
   trunk/docs/user-manual/en/modules/configuration-index.xml
   trunk/docs/user-manual/en/modules/embedding-jbm.xml
   trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java
   trunk/src/main/org/jboss/messaging/core/client/ClientSessionFactory.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java
   trunk/src/main/org/jboss/messaging/core/filter/impl/FilterImpl.java
   trunk/src/main/org/jboss/messaging/core/message/Message.java
   trunk/src/main/org/jboss/messaging/core/message/impl/MessageImpl.java
   trunk/src/main/org/jboss/messaging/core/server/cluster/impl/BridgeImpl.java
   trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ActivationTimeoutTest.java
Log:
some tweaks

Modified: trunk/.classpath
===================================================================
--- trunk/.classpath	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/.classpath	2009-05-19 09:25:23 UTC (rev 6869)
@@ -15,6 +15,7 @@
 	<classpathentry kind="src" path="tests/jms-tests/src"/>
 	<classpathentry kind="src" path="tests/joram-tests/src"/>
 	<classpathentry kind="src" path="tests/joram-tests/config"/>
+	<classpathentry kind="src" path="examples/core/embedded/src"/>
 	<classpathentry kind="src" path="examples/jms/application-layer-failover/src"/>
 	<classpathentry kind="src" path="examples/jms/automatic-failover/src"/>
 	<classpathentry kind="src" path="examples/jms/bridge/src"/>

Modified: trunk/docs/user-manual/en/modules/configuration-index.xml
===================================================================
--- trunk/docs/user-manual/en/modules/configuration-index.xml	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/docs/user-manual/en/modules/configuration-index.xml	2009-05-19 09:25:23 UTC (rev 6869)
@@ -307,7 +307,7 @@
                         <entry><link linkend="configuring.message.journal"
                             >journal-file-size</link></entry>
                         <entry>Long</entry>
-                        <entry>The max size, in bytes, each journal file should be</entry>
+                        <entry>The size, in bytes, each journal file should be</entry>
                         <entry>10485760</entry>
                     </row>
                     <row>

Modified: trunk/docs/user-manual/en/modules/embedding-jbm.xml
===================================================================
--- trunk/docs/user-manual/en/modules/embedding-jbm.xml	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/docs/user-manual/en/modules/embedding-jbm.xml	2009-05-19 09:25:23 UTC (rev 6869)
@@ -194,9 +194,9 @@
         </section>
     </section>
     <section>
-        <title>Embedding Example</title>
+        <title>JMS Embedding Example</title>
         <para>The <ulink url="../../../../examples/jms/embedded/readme.html"><literal
-                    >Embedding</literal> Example</ulink> shows how to setup and run JBoss Messaging
-            embedded..</para>
+                    >JMS Embedding</literal> Example</ulink> shows how to setup and run JBoss Messaging
+            embedded with JMS...</para>
     </section>
 </chapter>

Modified: trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java
===================================================================
--- trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java	2009-05-19 09:25:23 UTC (rev 6869)
@@ -82,9 +82,8 @@
          {
    
             // Step 5. Create the session, and producer
-            session = sf.createSession(false, true, true);
-            
-                       
+            session = sf.createSession();
+                                   
             ClientProducer producer = session.createProducer(queueName);
    
             // Step 6. Create and send a message

Modified: trunk/src/main/org/jboss/messaging/core/client/ClientSessionFactory.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/ClientSessionFactory.java	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/src/main/org/jboss/messaging/core/client/ClientSessionFactory.java	2009-05-19 09:25:23 UTC (rev 6869)
@@ -35,6 +35,14 @@
  */
 public interface ClientSessionFactory
 {
+   ClientSession createXASession() throws MessagingException;
+   
+   ClientSession createTransactedSession() throws MessagingException;
+   
+   ClientSession createSession() throws MessagingException;
+   
+   ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks) throws MessagingException;
+   
    ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks) throws MessagingException;
 
    ClientSession createSession(String username,

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java	2009-05-19 09:25:23 UTC (rev 6869)
@@ -58,7 +58,7 @@
 
    public static final String DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME = "org.jboss.messaging.core.client.impl.RoundRobinConnectionLoadBalancingPolicy";
 
-   public static final long DEFAULT_PING_PERIOD = 1000000;
+   public static final long DEFAULT_PING_PERIOD = 100000;
 
    // 5 minutes - normally this should be much higher than ping period, this allows clients to re-attach on live
    // or backup without fear of session having already been closed when connection times out.
@@ -369,10 +369,11 @@
                                    final TransportConfiguration backupConnectorConfig)
    {
       this();
-      
+
       staticConnectors = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
 
-      staticConnectors.add(new Pair<TransportConfiguration, TransportConfiguration>(connectorConfig, backupConnectorConfig));
+      staticConnectors.add(new Pair<TransportConfiguration, TransportConfiguration>(connectorConfig,
+                                                                                    backupConnectorConfig));
    }
 
    public ClientSessionFactoryImpl(final TransportConfiguration connectorConfig)
@@ -692,12 +693,12 @@
    }
 
    public ClientSession createSession(final String username,
-                                                   final String password,
-                                                   final boolean xa,
-                                                   final boolean autoCommitSends,
-                                                   final boolean autoCommitAcks,
-                                                   final boolean preAcknowledge,
-                                                   final int ackBatchSize) throws MessagingException
+                                      final String password,
+                                      final boolean xa,
+                                      final boolean autoCommitSends,
+                                      final boolean autoCommitAcks,
+                                      final boolean preAcknowledge,
+                                      final int ackBatchSize) throws MessagingException
    {
       return createSessionInternal(username,
                                    password,
@@ -707,18 +708,36 @@
                                    preAcknowledge,
                                    ackBatchSize);
    }
+   
+   public ClientSession createXASession() throws MessagingException
+   {
+      return createSessionInternal(null, null, true, false, false, preAcknowledge, this.ackBatchSize);
+   }
+   
+   public ClientSession createTransactedSession() throws MessagingException
+   {
+      return createSessionInternal(null, null, false, false, false, preAcknowledge, this.ackBatchSize);
+   }
+   
+   public ClientSession createSession() throws MessagingException
+   {
+      return createSessionInternal(null, null, false, true, true, preAcknowledge, this.ackBatchSize);
+   }
+   
+   public ClientSession createSession(final boolean autoCommitSends, final boolean autoCommitAcks) throws MessagingException
+   {
+      return createSessionInternal(null, null, false, autoCommitSends, autoCommitAcks, preAcknowledge, this.ackBatchSize);
+   }
 
-   public ClientSession createSession(final boolean xa,
-                                                   final boolean autoCommitSends,
-                                                   final boolean autoCommitAcks) throws MessagingException
+   public ClientSession createSession(final boolean xa, final boolean autoCommitSends, final boolean autoCommitAcks) throws MessagingException
    {
       return createSessionInternal(null, null, xa, autoCommitSends, autoCommitAcks, preAcknowledge, this.ackBatchSize);
    }
 
    public ClientSession createSession(final boolean xa,
-                                                   final boolean autoCommitSends,
-                                                   final boolean autoCommitAcks,
-                                                   final boolean preAcknowledge) throws MessagingException
+                                      final boolean autoCommitSends,
+                                      final boolean autoCommitAcks,
+                                      final boolean preAcknowledge) throws MessagingException
    {
       return createSessionInternal(null, null, xa, autoCommitSends, autoCommitAcks, preAcknowledge, this.ackBatchSize);
    }

Modified: trunk/src/main/org/jboss/messaging/core/filter/impl/FilterImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/filter/impl/FilterImpl.java	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/src/main/org/jboss/messaging/core/filter/impl/FilterImpl.java	2009-05-19 09:25:23 UTC (rev 6869)
@@ -81,8 +81,6 @@
 
    private static final SimpleString JBM_PRIORITY = new SimpleString("JBMPriority");
 
-   private static final SimpleString JBM_MESSAGE_ID = new SimpleString("JBMMessageID");
-
    private static final SimpleString JBM_SIZE = new SimpleString("JBMSize");
 
    private static final SimpleString JBM_PREFIX = new SimpleString("JBM");
@@ -177,12 +175,8 @@
 
    private Object getHeaderFieldValue(final ServerMessage msg, final SimpleString fieldName)
    {
-      if (JBM_MESSAGE_ID.equals(fieldName))
+      if (JBM_PRIORITY.equals(fieldName))
       {
-         return msg.getMessageID();
-      }
-      else if (JBM_PRIORITY.equals(fieldName))
-      {
          return new Integer(msg.getPriority());
       }
       else if (JBM_TIMESTAMP.equals(fieldName))

Modified: trunk/src/main/org/jboss/messaging/core/message/Message.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/message/Message.java	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/src/main/org/jboss/messaging/core/message/Message.java	2009-05-19 09:25:23 UTC (rev 6869)
@@ -126,6 +126,24 @@
    
    void putStringProperty(SimpleString key, SimpleString value);
    
+   void putBooleanProperty(String key, boolean value);
+   
+   void putByteProperty(String key, byte value);
+   
+   void putBytesProperty(String key, byte[] value);
+   
+   void putShortProperty(String key, short value);
+   
+   void putIntProperty(String key, int value);
+   
+   void putLongProperty(String key, long value);
+   
+   void putFloatProperty(String key, float value);
+   
+   void putDoubleProperty(String key, double value);
+   
+   void putStringProperty(String key, String value);
+   
    void putTypedProperties(TypedProperties properties);
 
    // TODO - should have typed property getters and do conversions herein
@@ -136,6 +154,12 @@
    
    boolean containsProperty(SimpleString key);
    
+   Object getProperty(String key);
+   
+   Object removeProperty(String key);
+   
+   boolean containsProperty(String key);
+   
    Set<SimpleString> getPropertyNames();
    
    Map<String, Object> toMap();

Modified: trunk/src/main/org/jboss/messaging/core/message/impl/MessageImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/message/impl/MessageImpl.java	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/src/main/org/jboss/messaging/core/message/impl/MessageImpl.java	2009-05-19 09:25:23 UTC (rev 6869)
@@ -411,7 +411,52 @@
    {
       properties.putStringProperty(key, value);
    }
+   
+   public void putBooleanProperty(final String key, final boolean value)
+   {
+      properties.putBooleanProperty(new SimpleString(key), value);
+   }
 
+   public void putByteProperty(final String key, final byte value)
+   {
+      properties.putByteProperty(new SimpleString(key), value);
+   }
+
+   public void putBytesProperty(final String key, final byte[] value)
+   {
+      properties.putBytesProperty(new SimpleString(key), value);
+   }
+
+   public void putShortProperty(final String key, final short value)
+   {
+      properties.putShortProperty(new SimpleString(key), value);
+   }
+
+   public void putIntProperty(final String key, final int value)
+   {
+      properties.putIntProperty(new SimpleString(key), value);
+   }
+
+   public void putLongProperty(final String key, final long value)
+   {
+      properties.putLongProperty(new SimpleString(key), value);
+   }
+
+   public void putFloatProperty(final String key, final float value)
+   {
+      properties.putFloatProperty(new SimpleString(key), value);
+   }
+
+   public void putDoubleProperty(final String key, final double value)
+   {
+      properties.putDoubleProperty(new SimpleString(key), value);
+   }
+
+   public void putStringProperty(final String key, final String value)
+   {
+      properties.putStringProperty(new SimpleString(key), new SimpleString(value));
+   }
+
    public void putTypedProperties(TypedProperties otherProps)
    {
       properties.putTypedProperties(otherProps);
@@ -421,16 +466,31 @@
    {
       return properties.getProperty(key);
    }
+   
+   public Object getProperty(final String key)
+   {
+      return properties.getProperty(new SimpleString(key));
+   }
 
    public Object removeProperty(final SimpleString key)
    {
       return properties.removeProperty(key);
    }
+   
+   public Object removeProperty(final String key)
+   {
+      return properties.removeProperty(new SimpleString(key));
+   }
 
    public boolean containsProperty(final SimpleString key)
    {
       return properties.containsProperty(key);
    }
+   
+   public boolean containsProperty(final String key)
+   {
+      return properties.containsProperty(new SimpleString(key));
+   }
 
    public Set<SimpleString> getPropertyNames()
    {

Modified: trunk/src/main/org/jboss/messaging/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/cluster/impl/BridgeImpl.java	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/src/main/org/jboss/messaging/core/server/cluster/impl/BridgeImpl.java	2009-05-19 09:25:23 UTC (rev 6869)
@@ -156,9 +156,6 @@
 
    private boolean activated;
    
-   
-   private MessagingServer server;
-
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
@@ -280,8 +277,6 @@
       this.replicatingChannel = replicatingChannel;
 
       this.activated = activated;  
-      
-      this.server = server;
    }
 
    public synchronized void start() throws Exception

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ActivationTimeoutTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ActivationTimeoutTest.java	2009-05-19 09:12:40 UTC (rev 6868)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ActivationTimeoutTest.java	2009-05-19 09:25:23 UTC (rev 6869)
@@ -65,7 +65,7 @@
    // Attributes ----------------------------------------------------
 
    private static final long ACTIVATION_TIMEOUT = 5000;
-   
+
    private static final SimpleString ADDRESS = new SimpleString("FailoverTestAddress");
 
    private MessagingServer liveService;
@@ -81,11 +81,11 @@
    // Public --------------------------------------------------------
 
    public void testTimeoutAfterConsumerFailsToReattach() throws Exception
-   {            
+   {
       ClientSessionFactoryInternal sf1 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
                                                                       new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
                                                                                                  backupParams));
-      
+
       ClientSessionFactoryInternal sf2 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
                                                                       new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
                                                                                                  backupParams));
@@ -104,153 +104,163 @@
       for (int i = 0; i < numMessages; i++)
       {
          ClientMessage message = session1.createClientMessage(JBossTextMessage.TYPE,
-                                                             false,
-                                                             0,
-                                                             System.currentTimeMillis(),
-                                                             (byte)1);
+                                                              false,
+                                                              0,
+                                                              System.currentTimeMillis(),
+                                                              (byte)1);
          message.putIntProperty(new SimpleString("count"), i);
          message.getBody().writeString("aardvarks");
          producer.send(message);
       }
-      
+
       ClientConsumer consumer1 = session1.createConsumer(ADDRESS);
-      
+
       ClientSession session2 = sf2.createSession(false, true, true);
-      
-      //Create another consumer so we have two consumers on the queue
+
+      // Create another consumer so we have two consumers on the queue
       ClientConsumer consumer2 = session2.createConsumer(ADDRESS);
-      
+
       long start = System.currentTimeMillis();
 
       RemotingConnection conn1 = ((ClientSessionImpl)session1).getConnection();
 
-      // Now we fail ONLY the connections on sf1, not on sf2      
+      // Now we fail ONLY the connections on sf1, not on sf2
       conn1.fail(new MessagingException(MessagingException.NOT_CONNECTED));
 
       session1.start();
 
-      //The messages should not be delivered until after activationTimeout ms, since
-      //session 2 didn't reattach
-             
+      // The messages should not be delivered until after activationTimeout ms, since
+      // session 2 didn't reattach
+
       for (int i = 0; i < numMessages; i++)
       {
          ClientMessage message = consumer1.receive(2 * ACTIVATION_TIMEOUT);
-         
+
          assertNotNull(message);
-         
+
          if (i == 0)
          {
             long now = System.currentTimeMillis();
-            
+
             assertTrue(now - start >= ACTIVATION_TIMEOUT);
          }
-         
+
          assertEquals("aardvarks", message.getBody().readString());
 
          assertEquals(i, message.getProperty(new SimpleString("count")));
 
          message.acknowledge();
       }
-      
+
       ClientMessage message = consumer1.receive(1000);
-      
+
       assertNull(message);
-      
+
       session1.close();
-      
+
       RemotingConnection conn2 = ((ClientSessionImpl)session2).getConnection();
-     
+
       conn2.fail(new MessagingException(MessagingException.NOT_CONNECTED));
-      
+
       session2.close();
    }
-   
+
    public void testTimeoutAfterAllConsumerFailsToReattach() throws Exception
-   {            
-      ClientSessionFactoryInternal sf1 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
-                                                                      new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
-                                                                                                 backupParams));
-      
-      ClientSessionFactoryInternal sf2 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
-                                                                      new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
-                                                                                                 backupParams));
+   {
+      for (int j = 0; j < 10000; j++)
+      {
+         log.info("*************** ITERATION " + j);
+         
+         ClientSessionFactoryInternal sf1 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
+                                                                         new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
+                                                                                                    backupParams));
 
-      sf1.setProducerWindowSize(32 * 1024);
-      sf2.setProducerWindowSize(32 * 1024);
+         ClientSessionFactoryInternal sf2 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"),
+                                                                         new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
+                                                                                                    backupParams));
 
-      ClientSession session1 = sf1.createSession(false, true, true);
+         sf1.setProducerWindowSize(32 * 1024);
+         sf2.setProducerWindowSize(32 * 1024);
 
-      session1.createQueue(ADDRESS, ADDRESS, null, false);
+         ClientSession session1 = sf1.createSession(false, true, true);
 
-      ClientProducer producer = session1.createProducer(ADDRESS);
+         session1.createQueue(ADDRESS, ADDRESS, null, false);
 
-      final int numMessages = 1000;
+         ClientProducer producer = session1.createProducer(ADDRESS);
 
-      for (int i = 0; i < numMessages; i++)
-      {
-         ClientMessage message = session1.createClientMessage(JBossTextMessage.TYPE,
-                                                             false,
-                                                             0,
-                                                             System.currentTimeMillis(),
-                                                             (byte)1);
-         message.putIntProperty(new SimpleString("count"), i);
-         message.getBody().writeString("aardvarks");
-         producer.send(message);
-      }
-      
-      ClientSession session2 = sf2.createSession(false, true, true);
-      
-      ClientConsumer consumer1 = session2.createConsumer(ADDRESS);
-      
-      ClientConsumer consumer2 = session2.createConsumer(ADDRESS);
-      
-      long start = System.currentTimeMillis();
+         final int numMessages = 1000;
 
-      RemotingConnection conn1 = ((ClientSessionImpl)session1).getConnection();
+         for (int i = 0; i < numMessages; i++)
+         {
+            ClientMessage message = session1.createClientMessage(JBossTextMessage.TYPE,
+                                                                 false,
+                                                                 0,
+                                                                 System.currentTimeMillis(),
+                                                                 (byte)1);
+            message.putIntProperty(new SimpleString("count"), i);
+            message.getBody().writeString("aardvarks");
+            producer.send(message);
+         }
 
-      // Now we fail ONLY the connections on sf1, not on sf2      
-      conn1.fail(new MessagingException(MessagingException.NOT_CONNECTED));
+         ClientSession session2 = sf2.createSession(false, true, true);
 
-      session1.start();
+         ClientConsumer consumer1 = session2.createConsumer(ADDRESS);
 
-      //The messages should not be delivered until after activationTimeout ms, since
-      //session 2 didn't reattach
-              
-      //We now create a new consumer but it shouldn't receive the messages until after the timeout
-      
-      ClientConsumer consumer3 = session1.createConsumer(ADDRESS);
-               
-      for (int i = 0; i < numMessages; i++)
-      {
-         ClientMessage message = consumer3.receive(2 * ACTIVATION_TIMEOUT);
-         
-         assertNotNull(message);
-         
-         if (i == 0)
+         ClientConsumer consumer2 = session2.createConsumer(ADDRESS);
+
+         long start = System.currentTimeMillis();
+
+         RemotingConnection conn1 = ((ClientSessionImpl)session1).getConnection();
+
+         // Now we fail ONLY the connections on sf1, not on sf2
+         conn1.fail(new MessagingException(MessagingException.NOT_CONNECTED));
+
+         session1.start();
+
+         // The messages should not be delivered until after activationTimeout ms, since
+         // session 2 didn't reattach
+
+         // We now create a new consumer but it shouldn't receive the messages until after the timeout
+
+         ClientConsumer consumer3 = session1.createConsumer(ADDRESS);
+
+         for (int i = 0; i < numMessages; i++)
          {
-            long now = System.currentTimeMillis();
-            
-            assertTrue(now - start >= ACTIVATION_TIMEOUT);
+            ClientMessage message = consumer3.receive(2 * ACTIVATION_TIMEOUT);
+
+            assertNotNull(message);
+
+            if (i == 0)
+            {
+               long now = System.currentTimeMillis();
+
+               assertTrue(now - start >= ACTIVATION_TIMEOUT);
+            }
+
+            assertEquals("aardvarks", message.getBody().readString());
+
+            assertEquals(i, message.getProperty(new SimpleString("count")));
+
+            message.acknowledge();
          }
-         
-         assertEquals("aardvarks", message.getBody().readString());
 
-         assertEquals(i, message.getProperty(new SimpleString("count")));
+         ClientMessage message = consumer3.receive(1000);
 
-         message.acknowledge();
+         assertNull(message);
+
+         session1.close();
+
+         RemotingConnection conn2 = ((ClientSessionImpl)session2).getConnection();
+
+         conn2.fail(new MessagingException(MessagingException.NOT_CONNECTED));
+
+         session2.close();
+
+         tearDown();
+
+         setUp();
+
       }
-      
-      ClientMessage message = consumer3.receive(1000);
-      
-      assertNull(message);
-      
-      session1.close();
-      
-      RemotingConnection conn2 = ((ClientSessionImpl)session2).getConnection();
-     
-      conn2.fail(new MessagingException(MessagingException.NOT_CONNECTED));
-      
-      session2.close();
    }
 
    // Package protected ---------------------------------------------
@@ -261,7 +271,7 @@
    protected void setUp() throws Exception
    {
       super.setUp();
-      
+
       Configuration backupConf = new ConfigurationImpl();
       backupConf.setSecurityEnabled(false);
       backupConf.setQueueActivationTimeout(ACTIVATION_TIMEOUT);
@@ -279,7 +289,8 @@
               .add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));
       Map<String, TransportConfiguration> connectors = new HashMap<String, TransportConfiguration>();
       TransportConfiguration backupTC = new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory",
-                                                                   backupParams, "backup-connector");
+                                                                   backupParams,
+                                                                   "backup-connector");
       connectors.put(backupTC.getName(), backupTC);
       liveConf.setConnectorConfigurations(connectors);
       liveConf.setBackupConnectorName(backupTC.getName());
@@ -295,7 +306,7 @@
       liveService.stop();
 
       assertEquals(0, InVMRegistry.instance.size());
-      
+
       super.tearDown();
    }
 




More information about the jboss-cvs-commits mailing list