servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r564607 [11/12] - in /incubator/servicemix/trunk/core/servicemix-core/src: main/java/org/apache/servicemix/ main/java/org/apache/servicemix/jbi/ main/java/org/apache/servicemix/jbi/framework/ main/java/org/apache/servicemix/jbi/framework/su...
Date Fri, 10 Aug 2007 14:38:14 GMT
Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MEPExchangeTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MEPExchangeTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MEPExchangeTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MEPExchangeTest.java Fri Aug 10 07:37:46 2007
@@ -16,81 +16,86 @@
  */
 package org.apache.servicemix.jbi.messaging;
 
-import org.apache.servicemix.JbiConstants;
-import org.apache.servicemix.components.util.ComponentSupport;
-import org.apache.servicemix.jbi.ExchangeTimeoutException;
-import org.apache.servicemix.jbi.container.JBIContainer;
-import org.apache.servicemix.jbi.jaxp.StringSource;
-import org.apache.servicemix.tck.ExchangeCompletedListener;
-
 import javax.jbi.messaging.DeliveryChannel;
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.Fault;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.InOptionalOut;
 import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.MessageExchange.Role;
 import javax.jbi.messaging.MessageExchangeFactory;
 import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
 import javax.jbi.messaging.RobustInOnly;
-import javax.jbi.messaging.MessageExchange.Role;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
 
+import org.apache.servicemix.JbiConstants;
+import org.apache.servicemix.components.util.ComponentSupport;
+import org.apache.servicemix.jbi.ExchangeTimeoutException;
+import org.apache.servicemix.jbi.container.JBIContainer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.ExchangeCompletedListener;
+
 public class MEPExchangeTest extends TestCase {
 
-	public static final String PAYLOAD = "<payload/>";
-	public static final String RESPONSE = "<response/>";
-	
-	private JBIContainer container;
-	private TestComponent provider;
-	private TestComponent consumer;
+    public static final String PAYLOAD = "<payload/>";
+
+    public static final String RESPONSE = "<response/>";
+
+    private JBIContainer container;
+
+    private TestComponent provider;
+
+    private TestComponent consumer;
+
     private ExchangeCompletedListener listener;
-	
-	public static class TestComponent extends ComponentSupport {
-		public TestComponent(QName service, String endpoint) {
-			super(service, endpoint);
-		}
-		public DeliveryChannel getChannel() throws MessagingException {
-			return getContext().getDeliveryChannel();
-		}
-	}
-	
-	public void setUp() throws Exception {
-		// Create jbi container
-		container = new JBIContainer();
+
+    public static class TestComponent extends ComponentSupport {
+        public TestComponent(QName service, String endpoint) {
+            super(service, endpoint);
+        }
+
+        public DeliveryChannel getChannel() throws MessagingException {
+            return getContext().getDeliveryChannel();
+        }
+    }
+
+    public void setUp() throws Exception {
+        // Create jbi container
+        container = new JBIContainer();
         container.setEmbedded(true);
-		container.setFlowName("st");
+        container.setFlowName("st");
         listener = new ExchangeCompletedListener();
         container.addListener(listener);
-		container.init();
-		container.start();
-		// Create components
-		provider = new TestComponent(new QName("provider"), "endpoint");
-		consumer = new TestComponent(new QName("consumer"), "endpoint");
-		// Register components
-		container.activateComponent(provider, "provider");
-		container.activateComponent(consumer, "consumer");
-	}
-	
-	public void tearDown() throws Exception {
+        container.init();
+        container.start();
+        // Create components
+        provider = new TestComponent(new QName("provider"), "endpoint");
+        consumer = new TestComponent(new QName("consumer"), "endpoint");
+        // Register components
+        container.activateComponent(provider, "provider");
+        container.activateComponent(consumer, "consumer");
+    }
+
+    public void tearDown() throws Exception {
         if (listener != null) {
             listener.assertExchangeCompleted();
         }
-		if (container != null) {
-			container.shutDown();
-		}
-		container = null;
-	}
-	
-	public void testInOnly() throws Exception {
-		// Send message exchange
-		MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
-		InOnly mec = mef.createInOnlyExchange();
-		NormalizedMessage m = mec.createMessage();
-		m.setContent(new StringSource(PAYLOAD));
-		mec.setInMessage(m);
+        if (container != null) {
+            container.shutDown();
+        }
+        container = null;
+    }
+
+    public void testInOnly() throws Exception {
+        // Send message exchange
+        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
+        InOnly mec = mef.createInOnlyExchange();
+        NormalizedMessage m = mec.createMessage();
+        m.setContent(new StringSource(PAYLOAD));
+        mec.setInMessage(m);
         assertEquals(Role.CONSUMER, mec.getRole());
         try {
             mec.setMessage(null, "in");
@@ -116,29 +121,29 @@
         } catch (Exception e) {
             // ok
         }
-		consumer.getChannel().send(mec);
+        consumer.getChannel().send(mec);
         try {
             mec.setProperty("myprop", "myvalue");
             fail("Component is not owner");
         } catch (Exception e) {
             // ok
         }
-		// Provider side
-		InOnly mep = (InOnly) provider.getChannel().accept(1000L);
-		assertNotNull(mep);
-		assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
+        // Provider side
+        InOnly mep = (InOnly) provider.getChannel().accept(1000L);
+        assertNotNull(mep);
+        assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
         assertEquals(Role.PROVIDER, mep.getRole());
-		mep.setStatus(ExchangeStatus.DONE);
-		provider.getChannel().send(mep);
-		// Consumer side
-		assertSame(mec, consumer.getChannel().accept(1000L));
-		assertEquals(ExchangeStatus.DONE, mec.getStatus());
+        mep.setStatus(ExchangeStatus.DONE);
+        provider.getChannel().send(mep);
+        // Consumer side
+        assertSame(mec, consumer.getChannel().accept(1000L));
+        assertEquals(ExchangeStatus.DONE, mec.getStatus());
         assertEquals(Role.CONSUMER, mec.getRole());
-		// Nothing left
-		assertNull(consumer.getChannel().accept(100L)); // receive in
-		assertNull(provider.getChannel().accept(100L)); // receive in
-	}
-    
+        // Nothing left
+        assertNull(consumer.getChannel().accept(100L)); // receive in
+        assertNull(provider.getChannel().accept(100L)); // receive in
+    }
+
     public void testInOnlyWithError() throws Exception {
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
         InOnly mec = mef.createInOnlyExchange();
@@ -170,39 +175,39 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-	
-	public void testInOnlySync() throws Exception {
-		// Create thread to answer
-		new Thread(new Runnable() {
-			public void run() {
-				try {
-					// Provider side
-					InOnly mep = (InOnly) provider.getChannel().accept(10000L);
-					assertNotNull(mep);
-					assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
+
+    public void testInOnlySync() throws Exception {
+        // Create thread to answer
+        new Thread(new Runnable() {
+            public void run() {
+                try {
+                    // Provider side
+                    InOnly mep = (InOnly) provider.getChannel().accept(10000L);
+                    assertNotNull(mep);
+                    assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
                     assertEquals(Boolean.TRUE, mep.getProperty(JbiConstants.SEND_SYNC));
-					mep.setStatus(ExchangeStatus.DONE);
-					provider.getChannel().send(mep);
-				} catch (Exception e) {
-					e.printStackTrace();
-					fail();
-				}
-			}
-		}).start();
-		// Send message exchange
-		MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
-		InOnly mec = mef.createInOnlyExchange();
-		NormalizedMessage m = mec.createMessage();
-		m.setContent(new StringSource(PAYLOAD));
-		mec.setInMessage(m);
-		boolean result = consumer.getChannel().sendSync(mec, 10000L);
+                    mep.setStatus(ExchangeStatus.DONE);
+                    provider.getChannel().send(mep);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    fail();
+                }
+            }
+        }).start();
+        // Send message exchange
+        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
+        InOnly mec = mef.createInOnlyExchange();
+        NormalizedMessage m = mec.createMessage();
+        m.setContent(new StringSource(PAYLOAD));
+        mec.setInMessage(m);
+        boolean result = consumer.getChannel().sendSync(mec, 10000L);
         assertTrue(result);
-		assertEquals(ExchangeStatus.DONE, mec.getStatus());
-		// Nothing left
-		assertNull(consumer.getChannel().accept(100L)); // receive in
-		assertNull(provider.getChannel().accept(100L)); // receive in
-	}
-	
+        assertEquals(ExchangeStatus.DONE, mec.getStatus());
+        // Nothing left
+        assertNull(consumer.getChannel().accept(100L)); // receive in
+        assertNull(provider.getChannel().accept(100L)); // receive in
+    }
+
     public void testInOnlySyncWithTimeoutBeforeAccept() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -217,7 +222,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testInOnlySyncWithTimeoutAfterAccept() throws Exception {
         // Create thread to answer
         Thread t = new Thread(new Runnable() {
@@ -247,118 +252,118 @@
         m.setContent(new StringSource(PAYLOAD));
         mec.setInMessage(m);
         boolean result = consumer.getChannel().sendSync(mec, 50L);
-        
+
         assertFalse(result);
         assertEquals(ExchangeStatus.ERROR, mec.getStatus());
         // Nothing left
         assertNull(consumer.getChannel().accept(100L)); // receive in
         t.join();
     }
-    
-	public void testInOut() throws Exception {
-		// Send message exchange
-		MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
-		InOut mec = mef.createInOutExchange();
-		NormalizedMessage m = mec.createMessage();
-		m.setContent(new StringSource(PAYLOAD));
-		mec.setInMessage(m);
-		consumer.getChannel().send(mec);
-		// Provider side
-		InOut mep = (InOut) provider.getChannel().accept(100L);
-		assertNotNull(mep);
-		assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
-		m = mep.createMessage();
-		m.setContent(new StringSource(RESPONSE));
-		mep.setOutMessage(m);
-		provider.getChannel().send(mep);
-		// Consumer side
-		assertSame(mec, consumer.getChannel().accept(100L));
-		assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
-		mec.setStatus(ExchangeStatus.DONE);
-		consumer.getChannel().send(mec);
-		// Provider site
-		assertSame(mep, provider.getChannel().accept(100L));
-		assertEquals(ExchangeStatus.DONE, mec.getStatus());
-		// Nothing left
-		assertNull(consumer.getChannel().accept(100L)); // receive in
-		assertNull(provider.getChannel().accept(100L)); // receive in
-	}
-	
-	public void testInOutSync() throws Exception {
-		// Create thread to answer
-		new Thread(new Runnable() {
-			public void run() {
-				try {
-					// Provider side
-					InOut mep = (InOut) provider.getChannel().accept(10000L);
-					assertNotNull(mep);
-					assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
-					NormalizedMessage m = mep.createMessage();
-					m.setContent(new StringSource(RESPONSE));
-					mep.setOutMessage(m);
-					provider.getChannel().send(mep);
-				} catch (Exception e) {
-					e.printStackTrace();
-					fail();
-				}
-			}
-		}).start();
-		// Send message exchange
-		MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
-		InOut mec = mef.createInOutExchange();
-		NormalizedMessage m = mec.createMessage();
-		m.setContent(new StringSource(PAYLOAD));
-		mec.setInMessage(m);
-		consumer.getChannel().sendSync(mec, 10000L);
-		assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
-		mec.setStatus(ExchangeStatus.DONE);
-		consumer.getChannel().send(mec);
-		// Provider site
-		assertNotNull(provider.getChannel().accept(100L));
-		assertEquals(ExchangeStatus.DONE, mec.getStatus());
-		// Nothing left
-		assertNull(consumer.getChannel().accept(100L)); // receive in
-		assertNull(provider.getChannel().accept(100L)); // receive in
-	}
-	
-	public void testInOutSyncSync() throws Exception {
-		// Create thread to answer
-		Thread t = new Thread(new Runnable() {
-			public void run() {
-				try {
-					// Provider side
-					InOut mep = (InOut) provider.getChannel().accept(10000L);
-					assertNotNull(mep);
-					assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
-					NormalizedMessage m = mep.createMessage();
-					m.setContent(new StringSource(RESPONSE));
-					mep.setOutMessage(m);
-					provider.getChannel().sendSync(mep);
-					assertEquals(ExchangeStatus.DONE, mep.getStatus());
-				} catch (Exception e) {
-					e.printStackTrace();
-					fail();
-				}
-			}
-		});
-		t.start();
-		// Send message exchange
-		MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
-		InOut mec = mef.createInOutExchange();
-		NormalizedMessage m = mec.createMessage();
-		m.setContent(new StringSource(PAYLOAD));
-		mec.setInMessage(m);
-		consumer.getChannel().sendSync(mec, 10000L);
-		assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
-		mec.setStatus(ExchangeStatus.DONE);
-		consumer.getChannel().send(mec);
-		// Wait until other thread end
-		t.join(100L);
-		// Nothing left
-		assertNull(consumer.getChannel().accept(100L)); // receive in
-		assertNull(provider.getChannel().accept(100L)); // receive in
-	}
-	
+
+    public void testInOut() throws Exception {
+        // Send message exchange
+        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
+        InOut mec = mef.createInOutExchange();
+        NormalizedMessage m = mec.createMessage();
+        m.setContent(new StringSource(PAYLOAD));
+        mec.setInMessage(m);
+        consumer.getChannel().send(mec);
+        // Provider side
+        InOut mep = (InOut) provider.getChannel().accept(100L);
+        assertNotNull(mep);
+        assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
+        m = mep.createMessage();
+        m.setContent(new StringSource(RESPONSE));
+        mep.setOutMessage(m);
+        provider.getChannel().send(mep);
+        // Consumer side
+        assertSame(mec, consumer.getChannel().accept(100L));
+        assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
+        mec.setStatus(ExchangeStatus.DONE);
+        consumer.getChannel().send(mec);
+        // Provider site
+        assertSame(mep, provider.getChannel().accept(100L));
+        assertEquals(ExchangeStatus.DONE, mec.getStatus());
+        // Nothing left
+        assertNull(consumer.getChannel().accept(100L)); // receive in
+        assertNull(provider.getChannel().accept(100L)); // receive in
+    }
+
+    public void testInOutSync() throws Exception {
+        // Create thread to answer
+        new Thread(new Runnable() {
+            public void run() {
+                try {
+                    // Provider side
+                    InOut mep = (InOut) provider.getChannel().accept(10000L);
+                    assertNotNull(mep);
+                    assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
+                    NormalizedMessage m = mep.createMessage();
+                    m.setContent(new StringSource(RESPONSE));
+                    mep.setOutMessage(m);
+                    provider.getChannel().send(mep);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    fail();
+                }
+            }
+        }).start();
+        // Send message exchange
+        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
+        InOut mec = mef.createInOutExchange();
+        NormalizedMessage m = mec.createMessage();
+        m.setContent(new StringSource(PAYLOAD));
+        mec.setInMessage(m);
+        consumer.getChannel().sendSync(mec, 10000L);
+        assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
+        mec.setStatus(ExchangeStatus.DONE);
+        consumer.getChannel().send(mec);
+        // Provider site
+        assertNotNull(provider.getChannel().accept(100L));
+        assertEquals(ExchangeStatus.DONE, mec.getStatus());
+        // Nothing left
+        assertNull(consumer.getChannel().accept(100L)); // receive in
+        assertNull(provider.getChannel().accept(100L)); // receive in
+    }
+
+    public void testInOutSyncSync() throws Exception {
+        // Create thread to answer
+        Thread t = new Thread(new Runnable() {
+            public void run() {
+                try {
+                    // Provider side
+                    InOut mep = (InOut) provider.getChannel().accept(10000L);
+                    assertNotNull(mep);
+                    assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
+                    NormalizedMessage m = mep.createMessage();
+                    m.setContent(new StringSource(RESPONSE));
+                    mep.setOutMessage(m);
+                    provider.getChannel().sendSync(mep);
+                    assertEquals(ExchangeStatus.DONE, mep.getStatus());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    fail();
+                }
+            }
+        });
+        t.start();
+        // Send message exchange
+        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
+        InOut mec = mef.createInOutExchange();
+        NormalizedMessage m = mec.createMessage();
+        m.setContent(new StringSource(PAYLOAD));
+        mec.setInMessage(m);
+        consumer.getChannel().sendSync(mec, 10000L);
+        assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
+        mec.setStatus(ExchangeStatus.DONE);
+        consumer.getChannel().send(mec);
+        // Wait until other thread end
+        t.join(100L);
+        // Nothing left
+        assertNull(consumer.getChannel().accept(100L)); // receive in
+        assertNull(provider.getChannel().accept(100L)); // receive in
+    }
+
     public void testInOutWithFault() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -388,7 +393,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testInOutWithFaultAndError() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -424,7 +429,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testInOutWithError1() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -455,7 +460,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testInOutWithError2() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -483,58 +488,58 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
-	public void testInOptOutWithRep() throws Exception {
-		// Send message exchange
-		MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
-		InOptionalOut mec = mef.createInOptionalOutExchange();
-		NormalizedMessage m = mec.createMessage();
-		m.setContent(new StringSource(PAYLOAD));
-		mec.setInMessage(m);
-		consumer.getChannel().send(mec);
-		// Provider side
-		InOptionalOut mep = (InOptionalOut) provider.getChannel().accept(100L);
-		assertNotNull(mep);
-		assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
-		m = mep.createMessage();
-		m.setContent(new StringSource(RESPONSE));
-		mep.setOutMessage(m);
-		provider.getChannel().send(mep);
-		// Consumer side
-		assertSame(mec, consumer.getChannel().accept(100L));
-		assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
-		mec.setStatus(ExchangeStatus.DONE);
-		consumer.getChannel().send(mec);
-		// Provider site
-		assertSame(mep, provider.getChannel().accept(100L));
-		assertEquals(ExchangeStatus.DONE, mec.getStatus());
-		// Nothing left
-		assertNull(consumer.getChannel().accept(100L)); // receive in
-		assertNull(provider.getChannel().accept(100L)); // receive in
-	}
-	
-	public void testInOptOutWithoutRep() throws Exception {
-		// Send message exchange
-		MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
-		InOptionalOut mec = mef.createInOptionalOutExchange();
-		NormalizedMessage m = mec.createMessage();
-		m.setContent(new StringSource(PAYLOAD));
-		mec.setInMessage(m);
-		consumer.getChannel().send(mec);
-		// Provider side
-		InOptionalOut mep = (InOptionalOut) provider.getChannel().accept(100L);
-		assertNotNull(mep);
-		assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
-		mep.setStatus(ExchangeStatus.DONE);
-		provider.getChannel().send(mep);
-		// Consumer side
-		assertSame(mec, consumer.getChannel().accept(100L));
-		assertEquals(ExchangeStatus.DONE, mec.getStatus());
-		// Nothing left
-		assertNull(consumer.getChannel().accept(100L)); // receive in
-		assertNull(provider.getChannel().accept(100L)); // receive in
-	}
-	
+
+    public void testInOptOutWithRep() throws Exception {
+        // Send message exchange
+        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
+        InOptionalOut mec = mef.createInOptionalOutExchange();
+        NormalizedMessage m = mec.createMessage();
+        m.setContent(new StringSource(PAYLOAD));
+        mec.setInMessage(m);
+        consumer.getChannel().send(mec);
+        // Provider side
+        InOptionalOut mep = (InOptionalOut) provider.getChannel().accept(100L);
+        assertNotNull(mep);
+        assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
+        m = mep.createMessage();
+        m.setContent(new StringSource(RESPONSE));
+        mep.setOutMessage(m);
+        provider.getChannel().send(mep);
+        // Consumer side
+        assertSame(mec, consumer.getChannel().accept(100L));
+        assertEquals(ExchangeStatus.ACTIVE, mec.getStatus());
+        mec.setStatus(ExchangeStatus.DONE);
+        consumer.getChannel().send(mec);
+        // Provider site
+        assertSame(mep, provider.getChannel().accept(100L));
+        assertEquals(ExchangeStatus.DONE, mec.getStatus());
+        // Nothing left
+        assertNull(consumer.getChannel().accept(100L)); // receive in
+        assertNull(provider.getChannel().accept(100L)); // receive in
+    }
+
+    public void testInOptOutWithoutRep() throws Exception {
+        // Send message exchange
+        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
+        InOptionalOut mec = mef.createInOptionalOutExchange();
+        NormalizedMessage m = mec.createMessage();
+        m.setContent(new StringSource(PAYLOAD));
+        mec.setInMessage(m);
+        consumer.getChannel().send(mec);
+        // Provider side
+        InOptionalOut mep = (InOptionalOut) provider.getChannel().accept(100L);
+        assertNotNull(mep);
+        assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
+        mep.setStatus(ExchangeStatus.DONE);
+        provider.getChannel().send(mep);
+        // Consumer side
+        assertSame(mec, consumer.getChannel().accept(100L));
+        assertEquals(ExchangeStatus.DONE, mec.getStatus());
+        // Nothing left
+        assertNull(consumer.getChannel().accept(100L)); // receive in
+        assertNull(provider.getChannel().accept(100L)); // receive in
+    }
+
     public void testInOptOutWithProviderFault() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -562,7 +567,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testInOptOutWithProviderError() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -591,7 +596,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testInOptOutWithRepAndConsumerFault() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -626,7 +631,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testInOptOutWithRepAndConsumerError() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -662,7 +667,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testInOptOutWithRepFaultAndError() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -704,29 +709,29 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
-	public void testRobustInOnly() throws Exception {
-		// Send message exchange
-		MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
-		RobustInOnly mec = mef.createRobustInOnlyExchange();
-		NormalizedMessage m = mec.createMessage();
-		m.setContent(new StringSource(PAYLOAD));
-		mec.setInMessage(m);
-		consumer.getChannel().send(mec);
-		// Provider side
-		RobustInOnly mep = (RobustInOnly) provider.getChannel().accept(100L);
-		assertNotNull(mep);
-		assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
-		mep.setStatus(ExchangeStatus.DONE);
-		provider.getChannel().send(mep);
-		// Consumer side
-		assertSame(mec, consumer.getChannel().accept(100L));
-		assertEquals(ExchangeStatus.DONE, mec.getStatus());
-		// Nothing left
-		assertNull(consumer.getChannel().accept(100L)); // receive in
-		assertNull(provider.getChannel().accept(100L)); // receive in
-	}
-	
+
+    public void testRobustInOnly() throws Exception {
+        // Send message exchange
+        MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
+        RobustInOnly mec = mef.createRobustInOnlyExchange();
+        NormalizedMessage m = mec.createMessage();
+        m.setContent(new StringSource(PAYLOAD));
+        mec.setInMessage(m);
+        consumer.getChannel().send(mec);
+        // Provider side
+        RobustInOnly mep = (RobustInOnly) provider.getChannel().accept(100L);
+        assertNotNull(mep);
+        assertEquals(ExchangeStatus.ACTIVE, mep.getStatus());
+        mep.setStatus(ExchangeStatus.DONE);
+        provider.getChannel().send(mep);
+        // Consumer side
+        assertSame(mec, consumer.getChannel().accept(100L));
+        assertEquals(ExchangeStatus.DONE, mec.getStatus());
+        // Nothing left
+        assertNull(consumer.getChannel().accept(100L)); // receive in
+        assertNull(provider.getChannel().accept(100L)); // receive in
+    }
+
     public void testRobustInOnlyWithFault() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -754,7 +759,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testRobustInOnlyWithError() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -783,7 +788,7 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
     public void testRobustInOnlyWithFaultAndError() throws Exception {
         // Send message exchange
         MessageExchangeFactory mef = consumer.getChannel().createExchangeFactoryForService(new QName("provider"));
@@ -818,5 +823,5 @@
         assertNull(consumer.getChannel().accept(100L)); // receive in
         assertNull(provider.getChannel().accept(100L)); // receive in
     }
-    
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MessageExchangeImplTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MessageExchangeImplTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MessageExchangeImplTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MessageExchangeImplTest.java Fri Aug 10 07:37:46 2007
@@ -40,9 +40,9 @@
 import org.apache.servicemix.jbi.util.StreamDataSource;
 
 public class MessageExchangeImplTest extends TestCase {
-    
-	private static final Log log = LogFactory.getLog(MessageExchangeImplTest.class);
-	
+
+    private static final Log LOG = LogFactory.getLog(MessageExchangeImplTest.class);
+
     protected void testSerializeDeserialize(Source src) throws Exception {
         MessageExchange me = new InOnlyImpl("exchangeId");
         me.setOperation(new QName("uri", "op"));
@@ -53,16 +53,16 @@
         msg.addAttachment("myAttachment", new DataHandler(new StreamDataSource(new ByteArrayInputStream("hello".getBytes()))));
         me.setMessage(msg, "in");
         assertNotNull(((NormalizedMessageImpl) msg).getBody());
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(me);
         oos.close();
-        
+
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         ObjectInputStream ois = new ObjectInputStream(bais);
         Object out = ois.readObject();
-        
+
         assertNotNull(out);
         assertTrue(out instanceof MessageExchange);
         MessageExchange meOut = (MessageExchange) out;
@@ -76,11 +76,10 @@
         String outStr = new SourceTransformer().toString(outSrc);
         assertNotNull(outStr);
         assertNotNull(((NormalizedMessageImpl) msgOut).getBody());
-        log.info(outStr);
+        LOG.info(outStr);
         assertNotNull(msgOut.getAttachment("myAttachment"));
     }
 
-    
     public void testSerializeDeserializeWithStringSource() throws Exception {
         Source src = new StringSource("<hello>world</hello>");
         testSerializeDeserialize(src);
@@ -107,7 +106,8 @@
     }
 
     public void testAgeComparator() throws Exception {
-        PriorityBlockingQueue<MessageExchangeImpl> queue = new PriorityBlockingQueue<MessageExchangeImpl>(11, new MessageExchangeImpl.AgeComparator());
+        PriorityBlockingQueue<MessageExchangeImpl> queue = new PriorityBlockingQueue<MessageExchangeImpl>(11,
+                        new MessageExchangeImpl.AgeComparator());
         MessageExchangeImpl me1 = new InOnlyImpl("me1");
         MessageExchangeImpl me2 = new InOnlyImpl("me2");
         me2.handleSend(false);

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MessageExchangeTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MessageExchangeTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MessageExchangeTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/MessageExchangeTest.java Fri Aug 10 07:37:46 2007
@@ -22,23 +22,20 @@
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.MessageExchange;
 
-import org.apache.servicemix.jbi.messaging.ExchangePacket;
-import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
-
 import junit.framework.TestCase;
 
 public class MessageExchangeTest extends TestCase {
 
     public static class TestMessageExchange extends MessageExchangeImpl {
         private static final long serialVersionUID = 5572313276570983400L;
+        private static final int[][] STATES = {
+            {CAN_CONSUMER + CAN_OWNER + CAN_SET_IN_MSG + CAN_SEND + CAN_STATUS_ACTIVE, -1, -1, -1 },
+        };
         public TestMessageExchange() {
             super(new ExchangePacket(), STATES);
         }
         public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         }
-        private static int[][] STATES = {
-            { CAN_CONSUMER + CAN_OWNER + CAN_SET_IN_MSG + CAN_SEND + CAN_STATUS_ACTIVE, -1, -1, -1 },
-        };
     }
     
     public void testErrorStatus() throws Exception {

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/SedaFlowTransactionTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/SedaFlowTransactionTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/SedaFlowTransactionTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/SedaFlowTransactionTest.java Fri Aug 10 07:37:46 2007
@@ -24,9 +24,9 @@
  */
 public class SedaFlowTransactionTest extends AbstractTransactionTest {
 
-	protected Flow createFlow() {
-		return new SedaFlow();
-	}
+    protected Flow createFlow() {
+        return new SedaFlow();
+    }
 
     public void testAsyncSendSyncReceive() throws Exception {
         try {

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/StFlowTransactionTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/StFlowTransactionTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/StFlowTransactionTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/StFlowTransactionTest.java Fri Aug 10 07:37:46 2007
@@ -24,9 +24,9 @@
  */
 public class StFlowTransactionTest extends AbstractTransactionTest {
 
-	protected Flow createFlow() {
-		return new STFlow();
-	}
+    protected Flow createFlow() {
+        return new STFlow();
+    }
 
     public void testAsyncSendSyncReceive() throws Exception {
         try {

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/TransactionsTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/TransactionsTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/TransactionsTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/TransactionsTest.java Fri Aug 10 07:37:46 2007
@@ -96,7 +96,7 @@
         store = storeFactory.open("store");
         
         jbi = new JBIContainer();
-        jbi.setFlows(new Flow[] { new SedaFlow(), new JCAFlow() });
+        jbi.setFlows(new Flow[] {new SedaFlow(), new JCAFlow() });
         jbi.setEmbedded(true);
         jbi.setUseMBeanServer(false);
         jbi.setCreateMBeanServer(false);
@@ -430,7 +430,7 @@
         assertEquals(Status.STATUS_NO_TRANSACTION, tm.getStatus());
         
         assertNotNull(store.load(me.getExchangeId()));
-   }
+    }
     
     protected class Async extends ComponentSupport implements Runnable {
         private boolean sync;
@@ -456,8 +456,7 @@
                     DeliveryChannel deliveryChannel = getContext().getDeliveryChannel();
                     MessageExchange messageExchange = deliveryChannel.accept();
                     process(messageExchange);
-                }
-                catch (Exception e) {
+                } catch (Exception e) {
                     e.printStackTrace();
                 }
             }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/BrokerTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/BrokerTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/BrokerTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/BrokerTest.java Fri Aug 10 07:37:46 2007
@@ -16,6 +16,16 @@
  */
 package org.apache.servicemix.jbi.nmr;
 
+import javax.jbi.JBIException;
+import javax.jbi.messaging.InOnly;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+
+import junit.framework.TestCase;
+
 import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.xml.DomDriver;
 
@@ -26,15 +36,6 @@
 import org.apache.servicemix.jbi.jaxp.SourceTransformer;
 import org.apache.servicemix.jbi.jaxp.StringSource;
 import org.apache.servicemix.tck.ReceiverComponent;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-
-import javax.jbi.JBIException;
-import javax.jbi.messaging.InOnly;
-import javax.jbi.servicedesc.ServiceEndpoint;
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
 
 public class BrokerTest extends TestCase {
     

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/PubSubTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/PubSubTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/PubSubTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/PubSubTest.java Fri Aug 10 07:37:46 2007
@@ -21,20 +21,21 @@
 
 import junit.framework.TestCase;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.jbi.container.ActivationSpec;
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.container.SubscriptionSpec;
 import org.apache.servicemix.jbi.resolver.SubscriptionFilter;
 import org.apache.servicemix.tck.ReceiverComponent;
 import org.apache.servicemix.tck.SenderComponent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 public class PubSubTest extends TestCase {
 
-    private static final Log log = LogFactory.getLog(PubSubTest.class);
+    private static final Log LOG = LogFactory.getLog(PubSubTest.class);
 
     private SenderComponent sender;
+
     private JBIContainer container;
 
     protected void setUp() throws Exception {
@@ -43,10 +44,10 @@
         container.setFlowName("seda");
         container.init();
         container.start();
-        
+
         sender = new SenderComponent();
-        ActivationSpec as = new ActivationSpec("source",sender);
-        as.setService(new QName("http://www.test.com","source"));
+        ActivationSpec as = new ActivationSpec("source", sender);
+        as.setService(new QName("http://www.test.com", "source"));
         as.setFailIfNoDestinationEndpoint(false);
         container.activateComponent(as);
     }
@@ -54,17 +55,17 @@
     protected void tearDown() throws Exception {
         container.shutDown();
     }
-    
+
     public void testPubSub() throws Exception {
-    	ReceiverComponent recListener = new ReceiverComponent();
-        container.activateComponent(createReceiverAS("receiver",recListener));
+        ReceiverComponent recListener = new ReceiverComponent();
+        container.activateComponent(createReceiverAS("receiver", recListener));
         sender.sendMessages(1);
         recListener.getMessageList().assertMessagesReceived(1);
     }
-    
+
     public void testPubSubFiltered() throws Exception {
-    	ReceiverComponent recListener = new ReceiverComponent();
-        container.activateComponent(createReceiverASFiltered("receiver",recListener));
+        ReceiverComponent recListener = new ReceiverComponent();
+        container.activateComponent(createReceiverASFiltered("receiver", recListener));
         sender.sendMessages(1, false);
         recListener.getMessageList().assertMessagesReceived(1);
     }
@@ -72,8 +73,8 @@
     private ActivationSpec createReceiverAS(String id, Object component) {
         ActivationSpec as = new ActivationSpec(id, component);
         SubscriptionSpec ss = new SubscriptionSpec();
-        ss.setService(new QName("http://www.test.com","source"));
-        as.setSubscriptions(new SubscriptionSpec[] { ss });
+        ss.setService(new QName("http://www.test.com", "source"));
+        as.setSubscriptions(new SubscriptionSpec[] {ss });
         as.setFailIfNoDestinationEndpoint(false);
         return as;
     }
@@ -81,9 +82,9 @@
     private ActivationSpec createReceiverASFiltered(String id, Object component) {
         ActivationSpec as = new ActivationSpec(id, component);
         SubscriptionSpec ss = new SubscriptionSpec();
-        ss.setService(new QName("http://www.test.com","source"));
+        ss.setService(new QName("http://www.test.com", "source"));
         ss.setFilter(new Filter());
-        as.setSubscriptions(new SubscriptionSpec[] { ss });
+        as.setSubscriptions(new SubscriptionSpec[] {ss });
         as.setFailIfNoDestinationEndpoint(false);
         return as;
     }
@@ -91,9 +92,9 @@
     public static class Filter implements SubscriptionFilter {
 
         public boolean matches(MessageExchange arg0) {
-            log.info("Matches");
+            LOG.info("Matches");
             return true;
         }
-        
+
     }
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/SubscriptionPropertyCopyTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/SubscriptionPropertyCopyTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/SubscriptionPropertyCopyTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/SubscriptionPropertyCopyTest.java Fri Aug 10 07:37:46 2007
@@ -16,6 +16,12 @@
  */
 package org.apache.servicemix.jbi.nmr;
 
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.NormalizedMessage;
+
+import junit.framework.TestCase;
+
 import org.apache.servicemix.jbi.container.ActivationSpec;
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.container.SubscriptionSpec;
@@ -25,105 +31,101 @@
 import org.apache.servicemix.tck.Sender;
 import org.apache.servicemix.tck.SenderComponent;
 
-import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.MessagingException;
-import javax.jbi.messaging.NormalizedMessage;
+public class SubscriptionPropertyCopyTest extends TestCase {
 
-import junit.framework.TestCase;
+    public void testStNull() throws Exception {
+        runTest("st", null);
+    }
 
-public class SubscriptionPropertyCopyTest extends TestCase {
+    public void testStSt() throws Exception {
+        runTest("st", "st");
+    }
+
+    public void testStSeda() throws Exception {
+        runTest("st", "seda");
+    }
+
+    public void testSedaNull() throws Exception {
+        runTest("seda", null);
+    }
+
+    public void testSedaSt() throws Exception {
+        runTest("seda", "st");
+    }
 
-	public void testStNull() throws Exception {
-		runTest("st", null);
-	}
-	
-	public void testStSt() throws Exception {
-		runTest("st", "st");
-	}
-	
-	public void testStSeda() throws Exception {
-		runTest("st", "seda");
-	}
-	
-	public void testSedaNull() throws Exception {
-		runTest("seda", null);
-	}
-	
-	public void testSedaSt() throws Exception {
-		runTest("seda", "st");
-	}
-	
-	public void testSedaSeda() throws Exception {
-		runTest("seda", "seda");
-	}
-	
-	private void runTest(String flowName, String subscriptionFlowName) throws Exception {
-		JBIContainer container = new JBIContainer();
-		try {
+    public void testSedaSeda() throws Exception {
+        runTest("seda", "seda");
+    }
+
+    private void runTest(String flowName, String subscriptionFlowName) throws Exception {
+        JBIContainer container = new JBIContainer();
+        try {
             if (subscriptionFlowName != null && !subscriptionFlowName.equals(flowName)) {
-                container.getDefaultBroker().setFlows(new Flow[] { FlowProvider.getFlow(flowName),
-                                                                   FlowProvider.getFlow(subscriptionFlowName)});
+                container.getDefaultBroker().setFlows(new Flow[] { 
+                                FlowProvider.getFlow(flowName), FlowProvider.getFlow(subscriptionFlowName) });
             } else {
-                container.getDefaultBroker().setFlows(new Flow[] { FlowProvider.getFlow(flowName) });
+                container.getDefaultBroker().setFlows(new Flow[] { 
+                                FlowProvider.getFlow(flowName) });
             }
             if (subscriptionFlowName != null) {
                 container.getDefaultBroker().getSubscriptionManager().setFlowName(subscriptionFlowName);
             }
             container.setEmbedded(true);
-			container.init();
-			container.start();
-			
-			Sender sender = new SenderComponent();
+            container.init();
+            container.start();
+
+            Sender sender = new SenderComponent();
             ActivationSpec senderActivationSpec = new ActivationSpec("sender", sender);
             senderActivationSpec.setFailIfNoDestinationEndpoint(false);
             container.activateComponent(senderActivationSpec);
-			
-			ReceiverListener receiver1 = new ReceiverListener();
-			container.activateComponent(createReceiverAS("receiver1", receiver1));
-	
-			ReceiverListener receiver2 = new ReceiverListener();
-			container.activateComponent(createReceiverAS("receiver2", receiver2));
-			
-			sender.sendMessages(1);
-			
-			Thread.sleep(100);
-			
+
+            ReceiverListener receiver1 = new ReceiverListener();
+            container.activateComponent(createReceiverAS("receiver1", receiver1));
+
+            ReceiverListener receiver2 = new ReceiverListener();
+            container.activateComponent(createReceiverAS("receiver2", receiver2));
+
+            sender.sendMessages(1);
+
+            Thread.sleep(100);
+
             assertFalse(receiver1.isPropertySetOnExchange());
             assertFalse(receiver2.isPropertySetOnExchange());
             assertFalse(receiver1.isPropertySetOnMessage());
             assertFalse(receiver2.isPropertySetOnMessage());
-		} finally {
-			container.shutDown();
-		}
-	}
-	
-	private ActivationSpec createReceiverAS(String id, Object component) {
-		ActivationSpec as = new ActivationSpec(id, component);
-		SubscriptionSpec ss = new SubscriptionSpec();
-		ss.setService(SenderComponent.SERVICE);
+        } finally {
+            container.shutDown();
+        }
+    }
+
+    private ActivationSpec createReceiverAS(String id, Object component) {
+        ActivationSpec as = new ActivationSpec(id, component);
+        SubscriptionSpec ss = new SubscriptionSpec();
+        ss.setService(SenderComponent.SERVICE);
         as.setEndpoint(id);
-		as.setSubscriptions(new SubscriptionSpec[] { ss }); 
-		return as;
-	}
-	
-	public static class ReceiverListener extends ReceiverComponent {
+        as.setSubscriptions(new SubscriptionSpec[] {ss });
+        return as;
+    }
+
+    public static class ReceiverListener extends ReceiverComponent {
         private boolean propertySetOnExchange;
+
         private boolean propertySetOnMessage;
-		
-		public void onMessageExchange(MessageExchange exchange) throws MessagingException {
-            propertySetOnExchange = (exchange.getProperty("testProperty") != null);
-			exchange.setProperty("testProperty", "foo");
+
+        public void onMessageExchange(MessageExchange exchange) throws MessagingException {
+            propertySetOnExchange = exchange.getProperty("testProperty") != null;
+            exchange.setProperty("testProperty", "foo");
             NormalizedMessage in = exchange.getMessage("in");
-			propertySetOnMessage = (in.getProperty("testProperty") != null);
+            propertySetOnMessage = in.getProperty("testProperty") != null;
             in.setProperty("testProperty", "foo");
-		}
-        
+        }
+
         public boolean isPropertySetOnExchange() {
             return propertySetOnExchange;
         }
-        
+
         public boolean isPropertySetOnMessage() {
             return propertySetOnMessage;
         }
-	}
+    }
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/SubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/SubscriptionTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/SubscriptionTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/SubscriptionTest.java Fri Aug 10 07:37:46 2007
@@ -16,8 +16,14 @@
  */
 package org.apache.servicemix.jbi.nmr;
 
+import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessagingException;
+
+import junit.framework.TestCase;
+
 import org.apache.servicemix.MessageExchangeListener;
 import org.apache.servicemix.jbi.container.ActivationSpec;
 import org.apache.servicemix.jbi.container.JBIContainer;
@@ -28,122 +34,117 @@
 import org.apache.servicemix.tck.ReceiverComponent;
 import org.apache.servicemix.tck.SenderComponent;
 
-import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.MessagingException;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
 public class SubscriptionTest extends TestCase {
 
     public void testStNullAsync() throws Exception {
         runTest("st", null, false);
     }
-    
+
     public void testStStAsync() throws Exception {
         runTest("st", "st", false);
     }
-    
+
     public void testStSedaAsync() throws Exception {
         runTest("st", "seda", false);
     }
-    
+
     public void testSedaNullAsync() throws Exception {
         runTest("seda", null, false);
     }
-    
+
     public void testSedaStAsync() throws Exception {
         runTest("seda", "st", false);
     }
-    
+
     public void testSedaSedaAsync() throws Exception {
         runTest("seda", "seda", false);
     }
-    
+
     public void testStNullSync() throws Exception {
         runTest("st", null, true);
     }
-    
+
     public void testStStSync() throws Exception {
         runTest("st", "st", true);
     }
-    
+
     public void testStSedaSync() throws Exception {
         runTest("st", "seda", true);
     }
-    
+
     public void testSedaNullSync() throws Exception {
         runTest("seda", null, true);
     }
-    
+
     public void testSedaStSync() throws Exception {
         runTest("seda", "st", true);
     }
-    
+
     public void testSedaSedaSync() throws Exception {
         runTest("seda", "seda", true);
     }
-    
-	private void runTest(String flowName, String subscriptionFlowName, boolean sync) throws Exception {
-		JBIContainer container = new JBIContainer();
-		try {
+
+    private void runTest(String flowName, String subscriptionFlowName, boolean sync) throws Exception {
+        JBIContainer container = new JBIContainer();
+        try {
             container.setEmbedded(true);
             if (subscriptionFlowName != null && !subscriptionFlowName.equals(flowName)) {
-                container.getDefaultBroker().setFlows(new Flow[] { FlowProvider.getFlow(flowName),
-                                                            FlowProvider.getFlow(subscriptionFlowName)});
+                container.getDefaultBroker().setFlows(new Flow[] { 
+                                FlowProvider.getFlow(flowName), 
+                                FlowProvider.getFlow(subscriptionFlowName) });
             } else {
-                container.getDefaultBroker().setFlows(new Flow[] { FlowProvider.getFlow(flowName) });
+                container.getDefaultBroker().setFlows(new Flow[] { 
+                                FlowProvider.getFlow(flowName) });
+            }
+            if (subscriptionFlowName != null) {
+                container.getDefaultBroker().getSubscriptionManager().setFlowName(subscriptionFlowName);
             }
-			if (subscriptionFlowName != null) {
-				container.getDefaultBroker().getSubscriptionManager().setFlowName(subscriptionFlowName);
-			}
-            // TODO: check why the following line is enabled, there is 
+            // TODO: check why the following line is enabled, there is
             // a 5 seconds pause when Management stuff is initialized
-			//container.setCreateMBeanServer(true);
-			container.init();
-			container.start();
-			
-			SenderListener sender = new SenderListener();
+            // container.setCreateMBeanServer(true);
+            container.init();
+            container.start();
+
+            SenderListener sender = new SenderListener();
             ActivationSpec senderActivationSpec = new ActivationSpec("sender", sender);
             senderActivationSpec.setFailIfNoDestinationEndpoint(false);
-			container.activateComponent(senderActivationSpec);
-			
-			Receiver receiver1 = new ReceiverComponent();
-			container.activateComponent(createReceiverAS("receiver1", receiver1));
-	
-			Receiver receiver2 = new ReceiverComponent();
-			container.activateComponent(createReceiverAS("receiver2", receiver2));
-			
-			sender.sendMessages(1, sync);
-			
-			Thread.sleep(100);
-			
-			assertEquals(1, receiver1.getMessageList().getMessageCount());
-			assertEquals(1, receiver2.getMessageList().getMessageCount());
-			assertEquals(0, sender.responses.size());
-		} finally {
-			container.shutDown();
-		}
-	}
-	
-	private ActivationSpec createReceiverAS(String id, Object component) {
-		ActivationSpec as = new ActivationSpec(id, component);
-		SubscriptionSpec ss = new SubscriptionSpec();
-		ss.setService(SenderComponent.SERVICE);
+            container.activateComponent(senderActivationSpec);
+
+            Receiver receiver1 = new ReceiverComponent();
+            container.activateComponent(createReceiverAS("receiver1", receiver1));
+
+            Receiver receiver2 = new ReceiverComponent();
+            container.activateComponent(createReceiverAS("receiver2", receiver2));
+
+            sender.sendMessages(1, sync);
+
+            Thread.sleep(100);
+
+            assertEquals(1, receiver1.getMessageList().getMessageCount());
+            assertEquals(1, receiver2.getMessageList().getMessageCount());
+            assertEquals(0, sender.responses.size());
+        } finally {
+            container.shutDown();
+        }
+    }
+
+    private ActivationSpec createReceiverAS(String id, Object component) {
+        ActivationSpec as = new ActivationSpec(id, component);
+        SubscriptionSpec ss = new SubscriptionSpec();
+        ss.setService(SenderComponent.SERVICE);
         as.setEndpoint(id);
-		as.setSubscriptions(new SubscriptionSpec[] { ss }); 
-		return as;
-	}
-	
-	public static class SenderListener extends SenderComponent implements MessageExchangeListener {
-
-		public List responses = new CopyOnWriteArrayList();
-		
-		public void onMessageExchange(MessageExchange exchange) throws MessagingException {
-			responses.add(exchange);			
-		}
-		
-	}
-	
+        as.setSubscriptions(new SubscriptionSpec[] {ss });
+        return as;
+    }
+
+    public static class SenderListener extends SenderComponent implements MessageExchangeListener {
+
+        List responses = new CopyOnWriteArrayList();
+
+        public void onMessageExchange(MessageExchange exchange) throws MessagingException {
+            responses.add(exchange);
+        }
+
+    }
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/FlowProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/FlowProviderTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/FlowProviderTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/FlowProviderTest.java Fri Aug 10 07:37:46 2007
@@ -16,27 +16,25 @@
  */
 package org.apache.servicemix.jbi.nmr.flow;
 
-import org.apache.servicemix.jbi.nmr.flow.Flow;
-import org.apache.servicemix.jbi.nmr.flow.FlowProvider;
+import junit.framework.TestCase;
+
 import org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow;
 import org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow;
 import org.apache.servicemix.jbi.nmr.flow.st.STFlow;
 
-import junit.framework.TestCase;
+public class FlowProviderTest extends TestCase {
 
-public class FlowProviderTest extends TestCase{
-    
-    public void testGetFlowName(){
+    public void testGetFlowName() {
         String name = "fred";
-        String query ="props=foo";
+        String query = "props=foo";
         String nameAndQuery = name + "?" + query;
         assertTrue(FlowProvider.getFlowName(name).equals(name));
         assertTrue(FlowProvider.getFlowName(nameAndQuery).equals(name));
         assertTrue(FlowProvider.getQuery(nameAndQuery).equals(query));
-       
+
     }
-    
-    public void testGetFlows() throws Exception{
+
+    public void testGetFlows() throws Exception {
         Flow flow = FlowProvider.getFlow("st");
         assertTrue(flow instanceof STFlow);
         flow = FlowProvider.getFlow("seda");
@@ -46,12 +44,12 @@
         flow = FlowProvider.getFlow("cluster");
         assertTrue(flow instanceof JMSFlow);
     }
-    
+
     public void testSetProperties() throws Exception {
         String jmsURL = "reliable://tcp://fred:666";
-        Flow flow = FlowProvider.getFlow("jms?jmsURL="+jmsURL);
+        Flow flow = FlowProvider.getFlow("jms?jmsURL=" + jmsURL);
         assertTrue(flow instanceof JMSFlow);
-        JMSFlow jmsFlow = (JMSFlow)flow;
+        JMSFlow jmsFlow = (JMSFlow) flow;
         assertTrue(jmsFlow.getJmsURL().equals(jmsURL));
     }
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlowTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlowTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlowTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jca/JCAFlowTest.java Fri Aug 10 07:37:46 2007
@@ -16,12 +16,15 @@
  */
 package org.apache.servicemix.jbi.nmr.flow.jca;
 
+import javax.jbi.JBIException;
+
+import junit.framework.TestCase;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.xbean.BrokerFactoryBean;
 import org.apache.servicemix.jbi.RuntimeJBIException;
 import org.apache.servicemix.jbi.container.ActivationSpec;
 import org.apache.servicemix.jbi.container.JBIContainer;
-import org.apache.servicemix.jbi.nmr.flow.jca.JCAFlow;
 import org.apache.servicemix.jbi.resolver.ServiceNameEndpointResolver;
 import org.apache.servicemix.tck.ReceiverComponent;
 import org.apache.servicemix.tck.SenderComponent;
@@ -31,34 +34,35 @@
 import org.springframework.transaction.support.TransactionCallback;
 import org.springframework.transaction.support.TransactionTemplate;
 
-import javax.jbi.JBIException;
-
-import junit.framework.TestCase;
-
 /**
  * @version $Revision$
  */
 public class JCAFlowTest extends TestCase {
-	private JBIContainer senderContainer = new JBIContainer();
+
+    private static final int NUM_MESSAGES = 10;
+
+    private JBIContainer senderContainer = new JBIContainer();
+
     private JBIContainer receiverContainer = new JBIContainer();
+
     private BrokerService broker;
+
     private TransactionTemplate tt;
-    private static final int NUM_MESSAGES = 10;
-    
+
     /*
      * @see TestCase#setUp()
      */
     protected void setUp() throws Exception {
         super.setUp();
-        
+
         GeronimoPlatformTransactionManager tm = new GeronimoPlatformTransactionManager();
         tt = new TransactionTemplate(tm);
-       
+
         BrokerFactoryBean bfb = new BrokerFactoryBean(new ClassPathResource("org/apache/servicemix/jbi/nmr/flow/jca/broker.xml"));
         bfb.afterPropertiesSet();
         broker = bfb.getBroker();
         broker.start();
-        
+
         JCAFlow senderFlow = new JCAFlow();
         senderFlow.setJmsURL("tcp://localhost:61216");
         senderContainer.setTransactionManager(tm);
@@ -68,8 +72,7 @@
         senderContainer.setMonitorInstallationDirectory(false);
         senderContainer.init();
         senderContainer.start();
-        
-        
+
         JCAFlow receiverFlow = new JCAFlow();
         receiverFlow.setJmsURL("tcp://localhost:61216");
         receiverContainer.setTransactionManager(tm);
@@ -80,17 +83,17 @@
         receiverContainer.init();
         receiverContainer.start();
     }
-    
-    protected void tearDown() throws Exception{
+
+    protected void tearDown() throws Exception {
         super.tearDown();
         senderContainer.shutDown();
         receiverContainer.shutDown();
         broker.stop();
     }
-    
+
     public void testInOnly() throws Exception {
         final SenderComponent sender = new SenderComponent();
-        final ReceiverComponent receiver =  new ReceiverComponent();
+        final ReceiverComponent receiver = new ReceiverComponent();
         sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
 
         senderContainer.activateComponent(new ActivationSpec("sender", sender));
@@ -102,36 +105,36 @@
         Thread.sleep(3000);
         receiver.getMessageList().assertMessagesReceived(NUM_MESSAGES);
     }
-    
+
     public void testTxInOnly() throws Exception {
         final SenderComponent sender = new SenderComponent();
-        final ReceiverComponent receiver =  new ReceiverComponent();
+        final ReceiverComponent receiver = new ReceiverComponent();
         sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
 
         senderContainer.activateComponent(new ActivationSpec("sender", sender));
         receiverContainer.activateComponent(new ActivationSpec("receiver", receiver));
 
         Thread.sleep(5000);
-        
-    	senderContainer.setAutoEnlistInTransaction(true);
+
+        senderContainer.setAutoEnlistInTransaction(true);
         tt.execute(new TransactionCallback() {
-	  		public Object doInTransaction(TransactionStatus status) {
+            public Object doInTransaction(TransactionStatus status) {
                 try {
                     sender.sendMessages(NUM_MESSAGES);
                 } catch (JBIException e) {
                     throw new RuntimeJBIException(e);
                 }
-	  			return null;
-	  		}
+                return null;
+            }
         });
-      Thread.sleep(3000);
-      receiver.getMessageList().assertMessagesReceived(NUM_MESSAGES);
+        Thread.sleep(3000);
+        receiver.getMessageList().assertMessagesReceived(NUM_MESSAGES);
     }
-    
+
     public void testClusteredInOnly() throws Exception {
         final SenderComponent sender = new SenderComponent();
-        final ReceiverComponent receiver1 =  new ReceiverComponent();
-        final ReceiverComponent receiver2 =  new ReceiverComponent();
+        final ReceiverComponent receiver1 = new ReceiverComponent();
+        final ReceiverComponent receiver2 = new ReceiverComponent();
         sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
 
         senderContainer.activateComponent(new ActivationSpec("sender", sender));
@@ -145,21 +148,21 @@
         assertTrue(receiver2.getMessageList().hasReceivedMessage());
         receiver1.getMessageList().flushMessages();
         receiver2.getMessageList().flushMessages();
-        
+
         senderContainer.deactivateComponent("receiver");
         Thread.sleep(1000);
-        
+
         sender.sendMessages(NUM_MESSAGES);
         Thread.sleep(3000);
         assertFalse(receiver1.getMessageList().hasReceivedMessage());
         assertTrue(receiver2.getMessageList().hasReceivedMessage());
         receiver1.getMessageList().flushMessages();
         receiver2.getMessageList().flushMessages();
-        
+
         senderContainer.activateComponent(new ActivationSpec("receiver", receiver1));
         receiverContainer.deactivateComponent("receiver");
         Thread.sleep(1000);
-        
+
         sender.sendMessages(NUM_MESSAGES);
         Thread.sleep(3000);
         assertTrue(receiver1.getMessageList().hasReceivedMessage());
@@ -167,5 +170,5 @@
         receiver1.getMessageList().flushMessages();
         receiver2.getMessageList().flushMessages();
     }
-    
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jca/JcaFlowWithTxLogTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jca/JcaFlowWithTxLogTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jca/JcaFlowWithTxLogTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jca/JcaFlowWithTxLogTest.java Fri Aug 10 07:37:46 2007
@@ -43,76 +43,78 @@
  * @version $Revision: 426415 $
  */
 public class JcaFlowWithTxLogTest extends TestCase {
-    
-	private JBIContainer senderContainer = new JBIContainer();
+
+    private JBIContainer senderContainer = new JBIContainer();
+
     private JBIContainer receiverContainer = new JBIContainer();
+
     private BrokerService broker;
-	private GeronimoPlatformTransactionManager tm;
-    
-	public class MyEchoComponent extends ComponentSupport implements MessageExchangeListener {
-
-		public void onMessageExchange(MessageExchange exchange) throws MessagingException {
-			if(exchange.getStatus() == ExchangeStatus.ACTIVE && exchange instanceof InOut) {
-				InOut inOut = (InOut) exchange;
-				NormalizedMessage inMessage = inOut.getInMessage();
-				NormalizedMessage outMessage = inOut.createMessage();
-				outMessage.setContent(inMessage.getContent());
-				inOut.setOutMessage(outMessage);
-				send(inOut);
-			}
-		}
 
-	}
+    private GeronimoPlatformTransactionManager tm;
+
+    public class MyEchoComponent extends ComponentSupport implements MessageExchangeListener {
+
+        public void onMessageExchange(MessageExchange exchange) throws MessagingException {
+            if (exchange.getStatus() == ExchangeStatus.ACTIVE && exchange instanceof InOut) {
+                InOut inOut = (InOut) exchange;
+                NormalizedMessage inMessage = inOut.getInMessage();
+                NormalizedMessage outMessage = inOut.createMessage();
+                outMessage.setContent(inMessage.getContent());
+                inOut.setOutMessage(outMessage);
+                send(inOut);
+            }
+        }
+
+    }
 
     /*
      * @see TestCase#setUp()
      */
     protected void setUp() throws Exception {
         super.setUp();
-        
+
         System.setProperty(Context.INITIAL_CONTEXT_FACTORY, SpringInitialContextFactory.class.getName());
         System.setProperty(Context.PROVIDER_URL, "jndi.xml");
 
         TransactionManagerFactoryBean factory = new TransactionManagerFactoryBean();
         factory.setTransactionLogDir("target/txlog");
         tm = (GeronimoPlatformTransactionManager) factory.getObject();
-       
+
         broker = new BrokerService();
         broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
         broker.addConnector("tcp://localhost:61616");
         broker.start();
-        
+
         JCAFlow senderFlow = new JCAFlow();
         senderFlow.setJmsURL("tcp://localhost:61616");
         senderContainer.setTransactionManager(tm);
         senderContainer.setEmbedded(true);
         senderContainer.setName("senderContainer");
-        senderContainer.setFlows(new Flow[] { senderFlow} );
+        senderContainer.setFlows(new Flow[] {senderFlow });
         senderContainer.setMonitorInstallationDirectory(false);
         senderContainer.setAutoEnlistInTransaction(true);
         senderContainer.init();
         senderContainer.start();
-        
-        
+
         JCAFlow receiverFlow = new JCAFlow();
         receiverFlow.setJmsURL("tcp://localhost:61616");
         receiverContainer.setTransactionManager(tm);
         receiverContainer.setEmbedded(true);
         receiverContainer.setName("receiverContainer");
-        receiverContainer.setFlows(new Flow[] { receiverFlow} );
+        receiverContainer.setFlows(new Flow[] {receiverFlow });
         receiverContainer.setMonitorInstallationDirectory(false);
         receiverContainer.setAutoEnlistInTransaction(true);
         receiverContainer.init();
         receiverContainer.start();
     }
-    
-    protected void tearDown() throws Exception{
+
+    protected void tearDown() throws Exception {
         super.tearDown();
         senderContainer.shutDown();
         receiverContainer.shutDown();
         broker.stop();
     }
-    
+
     public void testClusteredInOut() throws Exception {
         QName service = new QName("http://org.echo", "echo");
         MyEchoComponent echoComponent = new MyEchoComponent();
@@ -133,5 +135,5 @@
             client.done(inOut);
         }
     }
-    
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlowTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlowTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlowTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/JMSFlowTest.java Fri Aug 10 07:37:46 2007
@@ -16,28 +16,29 @@
  */
 package org.apache.servicemix.jbi.nmr.flow.jms;
 
+import junit.framework.TestCase;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.xbean.BrokerFactoryBean;
 import org.apache.servicemix.jbi.container.ActivationSpec;
 import org.apache.servicemix.jbi.container.JBIContainer;
-import org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow;
 import org.apache.servicemix.jbi.resolver.ServiceNameEndpointResolver;
 import org.apache.servicemix.tck.ReceiverComponent;
 import org.apache.servicemix.tck.SenderComponent;
 import org.springframework.core.io.ClassPathResource;
 
-import junit.framework.TestCase;
-
 /**
  *
  * JMSFlowTest
  */
 public class JMSFlowTest extends TestCase {
-    JBIContainer senderContainer = new JBIContainer();
-    JBIContainer receiverContainer = new JBIContainer();
-    private SenderComponent sender;
-    private ReceiverComponent receiver;
+
     private static final int NUM_MESSAGES = 10;
+    
+    protected JBIContainer senderContainer = new JBIContainer();
+    protected JBIContainer receiverContainer = new JBIContainer();
+    protected SenderComponent sender;
+    protected ReceiverComponent receiver;
     protected BrokerService broker;
     
     /*
@@ -72,7 +73,7 @@
         sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
     }
     
-    protected void tearDown() throws Exception{
+    protected void tearDown() throws Exception {
         super.tearDown();
         senderContainer.shutDown();
         receiverContainer.shutDown();
@@ -90,17 +91,17 @@
     }
 
     public void testClusteredInOnly() throws Exception {
-        final SenderComponent sender = new SenderComponent();
+        final SenderComponent sender2 = new SenderComponent();
         final ReceiverComponent receiver1 =  new ReceiverComponent();
         final ReceiverComponent receiver2 =  new ReceiverComponent();
-        sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
+        sender2.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
 
-        senderContainer.activateComponent(new ActivationSpec("sender", sender));
+        senderContainer.activateComponent(new ActivationSpec("sender", sender2));
         senderContainer.activateComponent(new ActivationSpec("receiver", receiver1));
         receiverContainer.activateComponent(new ActivationSpec("receiver", receiver2));
         Thread.sleep(1000);
 
-        sender.sendMessages(NUM_MESSAGES);
+        sender2.sendMessages(NUM_MESSAGES);
         Thread.sleep(3000);
         assertTrue(receiver1.getMessageList().hasReceivedMessage());
         assertTrue(receiver2.getMessageList().hasReceivedMessage());
@@ -110,7 +111,7 @@
         senderContainer.deactivateComponent("receiver");
         Thread.sleep(1000);
         
-        sender.sendMessages(NUM_MESSAGES);
+        sender2.sendMessages(NUM_MESSAGES);
         Thread.sleep(3000);
         assertFalse(receiver1.getMessageList().hasReceivedMessage());
         assertTrue(receiver2.getMessageList().hasReceivedMessage());
@@ -121,7 +122,7 @@
         receiverContainer.deactivateComponent("receiver");
         Thread.sleep(1000);
         
-        sender.sendMessages(NUM_MESSAGES);
+        sender2.sendMessages(NUM_MESSAGES);
         Thread.sleep(3000);
         assertTrue(receiver1.getMessageList().hasReceivedMessage());
         assertFalse(receiver2.getMessageList().hasReceivedMessage());

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/MultipleJMSFlowTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/MultipleJMSFlowTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/MultipleJMSFlowTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/MultipleJMSFlowTest.java Fri Aug 10 07:37:46 2007
@@ -89,7 +89,9 @@
     protected void printNodes(JBIContainer[] containers) {
         String msg = "Nodes: ";
         for (int j = 0; j < containers.length; j++) {
-            if (j > 0) msg += ", ";
+            if (j > 0) {
+                msg += ", ";
+            }
             msg += ((JMSFlow) containers[j].getFlow()).numberInNetwork();
         }
         log.info(msg);

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/PingService.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/PingService.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/PingService.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/PingService.java Fri Aug 10 07:37:46 2007
@@ -30,20 +30,20 @@
 /**
  * Test service from SM-174 - (Craig Wall orginal author)
  */
-public class PingService extends ComponentSupport implements MessageExchangeListener{
+public class PingService extends ComponentSupport implements MessageExchangeListener {
     private static transient Log log = LogFactory.getLog(PingService.class);
 
-    public void onMessageExchange(MessageExchange exchange) throws MessagingException{
+    public void onMessageExchange(MessageExchange exchange) throws MessagingException {
         if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
-            log.info("GOT A MESSAGE; exchange.status="+exchange.getStatus());
-            NormalizedMessage out=exchange.createMessage();
+            log.info("GOT A MESSAGE; exchange.status=" + exchange.getStatus());
+            NormalizedMessage out = exchange.createMessage();
             out.setContent(new StringSource("<response>Ping back at ya!</response>"));
-            log.info("SENDING RESPONSE; exchange.status="+exchange.getStatus());
+            log.info("SENDING RESPONSE; exchange.status=" + exchange.getStatus());
             exchange.setMessage(out, "out");
             getDeliveryChannel().sendSync(exchange);
-            log.info("RESPONSE SENT; exchange.status="+exchange.getStatus());
+            log.info("RESPONSE SENT; exchange.status=" + exchange.getStatus());
         } else {
-            log.info("GOT A MESSAGE; exchange.status="+exchange.getStatus());
+            log.info("GOT A MESSAGE; exchange.status=" + exchange.getStatus());
         }
     }
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/StatelessJcaFlowTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/StatelessJcaFlowTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/StatelessJcaFlowTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/nmr/flow/jms/StatelessJcaFlowTest.java Fri Aug 10 07:37:46 2007
@@ -25,12 +25,12 @@
 public class StatelessJcaFlowTest extends StatelessJmsFlowTest {
 
     private TransactionManager tm;
-    
+
     protected void setUp() throws Exception {
-    	tm = new GeronimoPlatformTransactionManager();
+        tm = new GeronimoPlatformTransactionManager();
         super.setUp();
     }
-    
+
     protected JBIContainer createContainer(String name) throws Exception {
         JBIContainer container = new JBIContainer();
         container.setName(name);
@@ -43,6 +43,5 @@
         container.start();
         return container;
     }
-    
 
 }



Mime
View raw message