servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r564607 [10/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/jaxp/FragmentStreamReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/FragmentStreamReaderTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/FragmentStreamReaderTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/FragmentStreamReaderTest.java Fri Aug 10 07:37:46 2007
@@ -28,36 +28,37 @@
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 
+import org.w3c.dom.Document;
+
 import junit.framework.TestCase;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.Document;
 
 public class FragmentStreamReaderTest extends TestCase {
 
-	private static final Log log = LogFactory.getLog(FragmentStreamReaderTest.class);
-	
-	public void testStaxSource() throws Exception {
-		InputStream is = getClass().getResourceAsStream("test.xml");
-		XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(is);
+    private static final Log LOG = LogFactory.getLog(FragmentStreamReaderTest.class);
+
+    public void testStaxSource() throws Exception {
+        InputStream is = getClass().getResourceAsStream("test.xml");
+        XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(is);
         xsr = new ExtendedXMLStreamReader(xsr);
-		xsr.nextTag();
-		log.info(xsr.getName());
-		xsr.nextTag();
-		log.info(xsr.getName());
-		XMLStreamReader fsr = new FragmentStreamReader(xsr);
-		StaxSource ss = new StaxSource(fsr);
+        xsr.nextTag();
+        LOG.info(xsr.getName());
+        xsr.nextTag();
+        LOG.info(xsr.getName());
+        XMLStreamReader fsr = new FragmentStreamReader(xsr);
+        StaxSource ss = new StaxSource(fsr);
         StringWriter buffer = new StringWriter();
         Transformer transformer = TransformerFactory.newInstance().newTransformer();
         transformer.transform(ss, new StreamResult(buffer));
-        log.info(buffer.toString());
-        DocumentBuilderFactory dbf =DocumentBuilderFactory.newInstance();
+        LOG.info(buffer.toString());
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
-		Document doc = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(buffer.toString().getBytes()));
-		StringWriter buffer2 = new StringWriter();
+        Document doc = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(buffer.toString().getBytes()));
+        StringWriter buffer2 = new StringWriter();
         transformer.transform(new DOMSource(doc), new StreamResult(buffer2));
-        log.info(buffer2.toString());
-	}
-	
+        LOG.info(buffer2.toString());
+    }
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/SourceTransformerTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/SourceTransformerTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/SourceTransformerTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/SourceTransformerTest.java Fri Aug 10 07:37:46 2007
@@ -19,12 +19,13 @@
 import javax.xml.namespace.QName;
 import javax.xml.transform.dom.DOMSource;
 
-import junit.framework.TestCase;
-
-import org.apache.servicemix.jbi.util.DOMUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
+
+import junit.framework.TestCase;
+
+import org.apache.servicemix.jbi.util.DOMUtil;
 
 public class SourceTransformerTest extends TestCase {
 

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/StaxSourceTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/StaxSourceTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/StaxSourceTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/StaxSourceTest.java Fri Aug 10 07:37:46 2007
@@ -17,7 +17,6 @@
 package org.apache.servicemix.jbi.jaxp;
 
 import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.StringWriter;
 
@@ -32,19 +31,18 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
 import junit.framework.TestCase;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.util.FileUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-import org.xml.sax.InputSource;
 
 public class StaxSourceTest extends TestCase {
 
-    private static final Log log = LogFactory.getLog(StaxSourceTest.class);
+    private static final Log LOG = LogFactory.getLog(StaxSourceTest.class);
 
     public void testStaxSourceOnStream() throws Exception {
         InputStream is = getClass().getResourceAsStream("test.xml");
@@ -55,25 +53,27 @@
         StringWriter buffer = new StringWriter();
         Transformer transformer = TransformerFactory.newInstance().newTransformer();
         transformer.transform(ss, new StreamResult(buffer));
-        log.info(buffer.toString());
-        
+        LOG.info(buffer.toString());
+
         /*
-         * Attribute ordering is not preserved, so we can not compare the strings
+         * Attribute ordering is not preserved, so we can not compare the
+         * strings
          * 
-        is = getClass().getResourceAsStream("test.xml");
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        FileUtil.copyInputStream(is, baos);
-        compare(baos.toString().replaceAll("\r", ""), buffer.toString().replaceAll("\r", ""));
-        */
-        
+         * is = getClass().getResourceAsStream("test.xml");
+         * ByteArrayOutputStream baos = new ByteArrayOutputStream();
+         * FileUtil.copyInputStream(is, baos);
+         * compare(baos.toString().replaceAll("\r", ""),
+         * buffer.toString().replaceAll("\r", ""));
+         */
+
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
         Document doc = dbf.newDocumentBuilder().parse(new ByteArrayInputStream(buffer.toString().getBytes()));
         checkDomResult(doc);
-        
+
         StringWriter buffer2 = new StringWriter();
         transformer.transform(new DOMSource(doc), new StreamResult(buffer2));
-        log.info(buffer2.toString());
+        LOG.info(buffer2.toString());
     }
 
     public void testStaxSourceOnDOM() throws Exception {
@@ -102,9 +102,9 @@
         StringSource src = new StringSource(msg);
         DOMSource dom = new SourceTransformer().toDOMSource(src);
         StreamSource stream = new SourceTransformer().toStreamSource(dom);
-        log.info(new SourceTransformer().toString(stream));
+        LOG.info(new SourceTransformer().toString(stream));
         SAXSource sax = new SourceTransformer().toSAXSource(dom);
-        log.info(new SourceTransformer().toString(sax));
+        LOG.info(new SourceTransformer().toString(sax));
     }
 
     protected void checkDomResult(Document doc) {
@@ -124,8 +124,8 @@
         for (int i = 0; i < 4; i++) {
             for (int j = 0; j < 10; j++) {
                 for (int k = 0; k < 10; k++) {
-                    expected.append((char)('0' + j));
-                    expected.append((char)('0' + k));
+                    expected.append((char) ('0' + j));
+                    expected.append((char) ('0' + k));
                     if (k != 9) {
                         expected.append(' ');
                     }
@@ -135,17 +135,18 @@
         }
         assertEquals(expected.toString(), txt.getTextContent());
     }
-    
+
     protected void compare(String s1, String s2) {
         char[] c1 = s1.toCharArray();
         char[] c2 = s2.toCharArray();
         for (int i = 0; i < c1.length; i++) {
             if (c1[i] != c2[i]) {
-                fail("Expected '" + (int)c2[i] + "' but found '" + (int)c1[i] + "' at index " + i + ". Expected '" + build(c2, i) + "' but found '" + build(c1, i) + "'.");
+                fail("Expected '" + (int) c2[i] + "' but found '" + (int) c1[i] + "' at index " + i + ". Expected '" + build(c2, i)
+                                + "' but found '" + build(c1, i) + "'.");
             }
         }
     }
-    
+
     protected String build(char[] c, int i) {
         int min = Math.max(0, i - 10);
         int cnt = Math.min(20, c.length - min);

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReaderTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReaderTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReaderTest.java Fri Aug 10 07:37:46 2007
@@ -16,8 +16,8 @@
  */
 package org.apache.servicemix.jbi.jaxp;
 
-import java.io.OutputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.stream.XMLStreamReader;
@@ -32,53 +32,48 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-
 /**
  * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
  * @since Oct 26, 2004
  */
-public class W3CDOMStreamReaderTest
-    extends AbstractStreamReaderTest
-{
-
-    private static final Log log = LogFactory.getLog(W3CDOMStreamReaderTest.class);
-    
-    public void testSingleElement() throws Exception
-    {
+public class W3CDOMStreamReaderTest extends AbstractStreamReaderTest {
+
+    private static final Log LOG = LogFactory.getLog(W3CDOMStreamReaderTest.class);
+
+    public void testSingleElement() throws Exception {
         Document doc = getDocument();
-        Element e = doc.createElementNS("urn:test","root");
+        Element e = doc.createElementNS("urn:test", "root");
         e.setAttribute("xmlns", "urn:test");
         doc.appendChild(e);
-        
+
         assertEquals(1, e.getAttributes().getLength());
-        log.info("start: " + XMLStreamReader.START_ELEMENT);
-        log.info("attr: " + XMLStreamReader.ATTRIBUTE);
-        log.info("ns: " + XMLStreamReader.NAMESPACE);
-        log.info("chars: " + XMLStreamReader.CHARACTERS);
-        log.info("end: " + XMLStreamReader.END_ELEMENT);
+        LOG.info("start: " + XMLStreamReader.START_ELEMENT);
+        LOG.info("attr: " + XMLStreamReader.ATTRIBUTE);
+        LOG.info("ns: " + XMLStreamReader.NAMESPACE);
+        LOG.info("chars: " + XMLStreamReader.CHARACTERS);
+        LOG.info("end: " + XMLStreamReader.END_ELEMENT);
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         writeXml(doc, baos);
-        log.info(baos.toString());
+        LOG.info(baos.toString());
         W3CDOMStreamReader reader = new W3CDOMStreamReader(doc.getDocumentElement());
         testSingleElement(reader);
     }
-    
-    private Document getDocument() throws Exception{
+
+    private Document getDocument() throws Exception {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setNamespaceAware(true);
         Document doc = factory.newDocumentBuilder().newDocument();
         return doc;
     }
-    
-    
-    public void testTextChild() throws Exception
-    {
+
+    public void testTextChild() throws Exception {
         Document doc = getDocument();
-        Element e = doc.createElementNS( "urn:test","root");
+        Element e = doc.createElementNS("urn:test", "root");
         e.setAttribute("xmlns", "urn:test");
         doc.appendChild(e);
         Node text = doc.createTextNode("Hello World");
@@ -86,17 +81,15 @@
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         writeXml(doc, baos);
-        log.info(baos.toString());
+        LOG.info(baos.toString());
 
         W3CDOMStreamReader reader = new W3CDOMStreamReader(e);
         testTextChild(reader);
     }
-    
-    
-    public void testMixedContent() throws Exception
-    {
+
+    public void testMixedContent() throws Exception {
         Document doc = getDocument();
-        Element e = doc.createElementNS( "urn:test","test:root");
+        Element e = doc.createElementNS("urn:test", "test:root");
         e.setAttribute("xmlns", "urn:test");
         doc.appendChild(e);
         Node text = doc.createTextNode("Hello World");
@@ -108,62 +101,59 @@
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         writeXml(doc, baos);
-        log.info(baos);
-        
+        LOG.info(baos);
+
         W3CDOMStreamReader reader = new W3CDOMStreamReader(e);
         testMixedContent(reader);
     }
-    
-    
-    public void testAttributes() throws Exception
-    {
+
+    public void testAttributes() throws Exception {
         Document doc = getDocument();
-        
-        Element e = doc.createElementNS("urn:test","root");
+
+        Element e = doc.createElementNS("urn:test", "root");
         e.setAttribute("xmlns", "urn:test");
         doc.appendChild(e);
         e.setAttribute("att1", "value1");
-        
-        Attr attr = doc.createAttributeNS("urn:test2","att2");
+
+        Attr attr = doc.createAttributeNS("urn:test2", "att2");
         attr.setValue("value2");
         attr.setPrefix("p");
-        
+
         e.setAttribute("xmlns:p", "urn:test2");
-        
+
         e.setAttributeNode(attr);
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         writeXml(doc, baos);
-        log.info(baos.toString());
-        
+        LOG.info(baos.toString());
+
         W3CDOMStreamReader reader = new W3CDOMStreamReader(doc.getDocumentElement());
-        
+
         testAttributes(reader);
     }
-    
-    public void testElementChild() throws Exception
-    {
+
+    public void testElementChild() throws Exception {
         Document doc = getDocument();
-        Element e = doc.createElementNS("urn:test","root");
+        Element e = doc.createElementNS("urn:test", "root");
         e.setAttribute("xmlns", "urn:test");
-        Element child =  doc.createElementNS("urn:test2","child");
+        Element child = doc.createElementNS("urn:test2", "child");
         child.setAttribute("xmlns:a", "urn:test2");
-        
+
         child.setPrefix("a");
         e.appendChild(child);
         doc.appendChild(e);
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         writeXml(doc, baos);
-        log.info(baos.toString());
-        
+        LOG.info(baos.toString());
+
         W3CDOMStreamReader reader = new W3CDOMStreamReader(e);
         testElementChild(reader);
     }
-    
+
     protected void writeXml(Document doc, OutputStream out) throws TransformerException {
         TransformerFactory tf = TransformerFactory.newInstance();
-        //identity
+        // identity
         Transformer t = tf.newTransformer();
         t.setOutputProperty(OutputKeys.INDENT, "yes");
         t.transform(new DOMSource(doc), new StreamResult(out));

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/loaders/ClassLoaderTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/loaders/ClassLoaderTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/loaders/ClassLoaderTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/loaders/ClassLoaderTest.java Fri Aug 10 07:37:46 2007
@@ -20,50 +20,50 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 
-import org.apache.xbean.classloader.JarFileClassLoader;
-
 import junit.framework.TestCase;
 
+import org.apache.xbean.classloader.JarFileClassLoader;
+
 /**
  * @version $Revision$
  */
 public class ClassLoaderTest extends TestCase {
 
-	public static class TestClass {
-	}
-	
-	public void testParentFirstClassLoader() throws Exception {
-		URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
-		ClassLoader clsLoader = new JarFileClassLoader("", pcl.getURLs(), pcl, false, new String[0], new String[0]);
-		Class  clazz = clsLoader.loadClass(TestClass.class.getName());
-		assertSame(TestClass.class, clazz);
-	}
-	
-	public void testSelfFirstClassLoader() throws Exception {
-		URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
-		ClassLoader clsLoader = new JarFileClassLoader("", pcl.getURLs(), pcl, true, new String[0], new String[0]);
-		Class  clazz = clsLoader.loadClass(TestClass.class.getName());
-		assertNotSame(TestClass.class, clazz);
-	}
-    
+    public static class TestClass {
+    }
+
+    public void testParentFirstClassLoader() throws Exception {
+        URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
+        ClassLoader clsLoader = new JarFileClassLoader("", pcl.getURLs(), pcl, false, new String[0], new String[0]);
+        Class clazz = clsLoader.loadClass(TestClass.class.getName());
+        assertSame(TestClass.class, clazz);
+    }
+
+    public void testSelfFirstClassLoader() throws Exception {
+        URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
+        ClassLoader clsLoader = new JarFileClassLoader("", pcl.getURLs(), pcl, true, new String[0], new String[0]);
+        Class clazz = clsLoader.loadClass(TestClass.class.getName());
+        assertNotSame(TestClass.class, clazz);
+    }
+
     public void testParentFirstResource() throws Exception {
         URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
         URL url = getClass().getResource("jndi.properties");
         url = new File(url.toURI()).getParentFile().toURL();
-        ClassLoader clsLoader = new JarFileClassLoader("", new URL[] { url }, pcl, false, new String[0], new String[0]);
+        ClassLoader clsLoader = new JarFileClassLoader("", new URL[] {url }, pcl, false, new String[0], new String[0]);
         URL res1 = clsLoader.getResource("jndi.properties");
         URL res2 = pcl.getResource("jndi.properties");
         assertEquals(res2, res1);
     }
-    
+
     public void testSelfFirstResource() throws Exception {
         URLClassLoader pcl = (URLClassLoader) getClass().getClassLoader();
         URL url = getClass().getResource("jndi.properties");
         url = new File(url.toURI()).getParentFile().toURL();
-        ClassLoader clsLoader = new JarFileClassLoader("", new URL[] { url }, pcl, true, new String[0], new String[0]);
+        ClassLoader clsLoader = new JarFileClassLoader("", new URL[] {url }, pcl, true, new String[0], new String[0]);
         URL res1 = clsLoader.getResource("jndi.properties");
         URL res2 = pcl.getResource("jndi.properties");
         assertFalse(res2.equals(res1));
     }
-    
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/AdminServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/AdminServiceTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/AdminServiceTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/AdminServiceTest.java Fri Aug 10 07:37:46 2007
@@ -34,31 +34,32 @@
  * ManagementContextTest
  */
 public class AdminServiceTest extends TestCase {
-    
-	private Log log = LogFactory.getLog(getClass());
-	
-	private JBIContainer container;
+
+    private Log log = LogFactory.getLog(getClass());
+
+    private JBIContainer container;
 
     // The host, port and path where the rmiregistry runs.
-	private String namingHost = "localhost";
-	private int namingPort = ManagementContext.DEFAULT_CONNECTOR_PORT;
-	private String jndiPath = ManagementContext.DEFAULT_CONNECTOR_PATH;
-    
+    private String namingHost = "localhost";
+
+    private int namingPort = ManagementContext.DEFAULT_CONNECTOR_PORT;
+
+    private String jndiPath = ManagementContext.DEFAULT_CONNECTOR_PATH;
+
     protected void setUp() throws Exception {
-    	container = new JBIContainer();
-    	container.setRmiPort(namingPort);
-    	container.setCreateMBeanServer(true);
-    	container.init();
+        container = new JBIContainer();
+        container.setRmiPort(namingPort);
+        container.setCreateMBeanServer(true);
+        container.init();
     }
-    
+
     protected void tearDown() throws Exception {
         container.shutDown();
     }
 
     public void testAdminService() throws Exception {
         // The address of the connector server
-        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"
-                + namingHost + ":" + namingPort + jndiPath);
+        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + namingHost + ":" + namingPort + jndiPath);
         // Connect a JSR 160 JMXConnector to the server side
         JMXConnector connector = JMXConnectorFactory.connect(url);
         // Retrieve an MBeanServerConnection that represent the MBeanServer the remote
@@ -66,15 +67,14 @@
         MBeanServerConnection connection = connector.getMBeanServerConnection();
         // Call the server side as if it is a local MBeanServer
         ObjectName asmName = getObjectName(ManagementContext.class);
-        Object proxy = MBeanServerInvocationHandler.newProxyInstance(connection, asmName,
-        		AdminServiceMBean.class, true);
+        Object proxy = MBeanServerInvocationHandler.newProxyInstance(connection, asmName, AdminServiceMBean.class, true);
         AdminServiceMBean asm = (AdminServiceMBean) proxy;
 
-        log.info(asm.getBindingComponents()); 
-        log.info(asm.getComponentByName("toto")); 
+        log.info(asm.getBindingComponents());
+        log.info(asm.getComponentByName("toto"));
     }
-    
-    protected  ObjectName getObjectName (Class systemClass){
+
+    protected ObjectName getObjectName(Class systemClass) {
         return ManagementContext.getSystemObjectName(ManagementContext.DEFAULT_DOMAIN, JBIContainer.DEFAULT_NAME, systemClass);
     }
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/ManagementAttributesTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/ManagementAttributesTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/ManagementAttributesTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/ManagementAttributesTest.java Fri Aug 10 07:37:46 2007
@@ -16,9 +16,8 @@
  */
 package org.apache.servicemix.jbi.management;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.container.JBIContainer;
+import java.util.Iterator;
+import java.util.Set;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -30,62 +29,64 @@
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
 
-import java.util.Iterator;
-import java.util.Set;
-
 import junit.framework.TestCase;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.container.JBIContainer;
+
 /**
  * ManagementContextTest
  */
 public class ManagementAttributesTest extends TestCase {
 
-	private Log log = LogFactory.getLog(getClass());
-	
-	private JBIContainer container;
+    private Log log = LogFactory.getLog(getClass());
+
+    private JBIContainer container;
 
     // The host, port and path where the rmiregistry runs.
-	private String namingHost = "localhost";
-	private int namingPort = ManagementContext.DEFAULT_CONNECTOR_PORT;
-	private String jndiPath = ManagementContext.DEFAULT_CONNECTOR_PATH;
-    
+    private String namingHost = "localhost";
+
+    private int namingPort = ManagementContext.DEFAULT_CONNECTOR_PORT;
+
+    private String jndiPath = ManagementContext.DEFAULT_CONNECTOR_PATH;
+
     protected void setUp() throws Exception {
-    	container = new JBIContainer();
-    	container.setRmiPort(namingPort);
-    	container.setCreateMBeanServer(true);
-    	container.init();
+        container = new JBIContainer();
+        container.setRmiPort(namingPort);
+        container.setCreateMBeanServer(true);
+        container.init();
     }
-    
+
     protected void tearDown() throws Exception {
         container.shutDown();
     }
 
     public void testRemote() throws Exception {
         // The address of the connector server
-        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"
-                + namingHost + ":" + namingPort + jndiPath);
+        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + namingHost + ":" + namingPort + jndiPath);
         // Connect a JSR 160 JMXConnector to the server side
         JMXConnector connector = JMXConnectorFactory.connect(url);
-        // Retrieve an MBeanServerConnection that represent the MBeanServer the remote
+        // Retrieve an MBeanServerConnection that represent the MBeanServer the
+        // remote
         // connector server is bound to
         MBeanServerConnection connection = connector.getMBeanServerConnection();
-        
-        log.info(connection.getMBeanCount());
 
+        log.info(connection.getMBeanCount());
 
         Set set = connection.queryNames(new ObjectName(connection.getDefaultDomain() + ":*"), null);
         for (Iterator iter = set.iterator(); iter.hasNext();) {
-            ObjectName name = (ObjectName)iter.next();
+            ObjectName name = (ObjectName) iter.next();
             log.info(name.toString());
             MBeanInfo info = connection.getMBeanInfo(name);
             MBeanAttributeInfo[] mia = info.getAttributes();
             String[] attrNames = new String[mia.length];
             for (int i = 0; i < mia.length; i++) {
                 attrNames[i] = mia[i].getName();
-                log.info("attr " + mia[i].getName() + " " + mia[i].getType() + " " + connection.getAttribute(name,mia[i].getName()));
+                log.info("attr " + mia[i].getName() + " " + mia[i].getType() + " " + connection.getAttribute(name, mia[i].getName()));
             }
 
-            AttributeList attributeList = (AttributeList) connection.getAttributes(name,attrNames);
+            AttributeList attributeList = (AttributeList) connection.getAttributes(name, attrNames);
             for (int i = 0; i < attributeList.size(); i++) {
                 Attribute attribute = (Attribute) attributeList.get(i);
                 log.info("bulk " + attribute.getName() + " " + attribute.getValue() + " " + attribute.toString());
@@ -93,7 +94,6 @@
 
         }
 
-        
     }
-    
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/ManagementContextTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/ManagementContextTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/ManagementContextTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/ManagementContextTest.java Fri Aug 10 07:37:46 2007
@@ -16,12 +16,6 @@
  */
 package org.apache.servicemix.jbi.management;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.components.util.EchoComponent;
-import org.apache.servicemix.jbi.container.JBIContainer;
-import org.apache.servicemix.jbi.management.ManagementContext;
-
 import javax.jbi.management.LifeCycleMBean;
 import javax.management.MBeanServerConnection;
 import javax.management.MBeanServerDelegateMBean;
@@ -33,64 +27,68 @@
 
 import junit.framework.TestCase;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.components.util.EchoComponent;
+import org.apache.servicemix.jbi.container.JBIContainer;
+
 /**
  * ManagementContextTest
  */
 public class ManagementContextTest extends TestCase {
 
-	private Log log = LogFactory.getLog(getClass());
-	
+    private Log log = LogFactory.getLog(getClass());
+
     // The host, port and path where the rmiregistry runs.
-	private String namingHost = "localhost";
-	private int namingPort = ManagementContext.DEFAULT_CONNECTOR_PORT;
-	private String jndiPath = ManagementContext.DEFAULT_CONNECTOR_PATH;
-    
-	private ManagementContext context;
-	private JBIContainer container;
+    private String namingHost = "localhost";
+
+    private int namingPort = ManagementContext.DEFAULT_CONNECTOR_PORT;
+
+    private String jndiPath = ManagementContext.DEFAULT_CONNECTOR_PATH;
+
+    private ManagementContext context;
+
+    private JBIContainer container;
 
     protected void setUp() throws Exception {
-    	container = new JBIContainer();
-    	container.setCreateMBeanServer(true);
-    	container.setRmiPort(namingPort);
-    	container.init();
-    	container.start();
-    	context = container.getManagementContext();
-    	/*
-        context = new ManagementContext();
-        context.setCreateMBeanServer(true);
-        context.setNamingPort(namingPort);
-        context.init(container, null);
-        */
+        container = new JBIContainer();
+        container.setCreateMBeanServer(true);
+        container.setRmiPort(namingPort);
+        container.init();
+        container.start();
+        context = container.getManagementContext();
+        /*
+         * context = new ManagementContext();
+         * context.setCreateMBeanServer(true);
+         * context.setNamingPort(namingPort); context.init(container, null);
+         */
     }
-    
+
     protected void tearDown() throws Exception {
-    	container.shutDown();
+        container.shutDown();
     }
 
     public void testRemote() throws Exception {
         // The address of the connector server
-        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"
-                + namingHost + ":" + namingPort + jndiPath);
+        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + namingHost + ":" + namingPort + jndiPath);
         // Connect a JSR 160 JMXConnector to the server side
         JMXConnector connector = JMXConnectorFactory.connect(url);
-        // Retrieve an MBeanServerConnection that represent the MBeanServer the remote
+        // Retrieve an MBeanServerConnection that represent the MBeanServer the
+        // remote
         // connector server is bound to
         MBeanServerConnection connection = connector.getMBeanServerConnection();
         // Call the server side as if it is a local MBeanServer
         ObjectName delegateName = ObjectName.getInstance("JMImplementation:type=MBeanServerDelegate");
-        Object proxy = MBeanServerInvocationHandler.newProxyInstance(connection, delegateName,
-                MBeanServerDelegateMBean.class, true);
+        Object proxy = MBeanServerInvocationHandler.newProxyInstance(connection, delegateName, MBeanServerDelegateMBean.class, true);
         MBeanServerDelegateMBean delegate = (MBeanServerDelegateMBean) proxy;
         // The magic of JDK 1.3 dynamic proxy and JSR 160:
         // delegate.getImplementationVendor() is actually a remote JMX call,
         // but it looks like a local, old-style, java call.
         log.info(delegate.getImplementationVendor() + " is cool !");
-        
+
         ObjectName objName = context.createObjectName(context);
-        
-        
-        proxy = MBeanServerInvocationHandler.newProxyInstance(connection, objName,
-                LifeCycleMBean.class, true);
+
+        proxy = MBeanServerInvocationHandler.newProxyInstance(connection, objName, LifeCycleMBean.class, true);
         LifeCycleMBean mc = (LifeCycleMBean) proxy;
         log.info("STATE = " + mc.getCurrentState());
         mc.start();
@@ -98,18 +96,18 @@
         mc.stop();
         log.info("STATE = " + mc.getCurrentState());
     }
-    
+
     public void testComponent() throws Exception {
-    	ObjectName[] names = context.getPojoComponents();
-    	assertEquals(1, names.length);
-    	EchoComponent echo = new EchoComponent();
-    	container.activateComponent(echo, "echo");
-    	names = context.getPojoComponents();
-    	assertNotNull(names);
-    	assertEquals(2, names.length);
-    	assertEquals(LifeCycleMBean.STARTED, echo.getCurrentState());
-    	context.stopComponent("echo");
-    	assertEquals(LifeCycleMBean.STOPPED, echo.getCurrentState());
+        ObjectName[] names = context.getPojoComponents();
+        assertEquals(1, names.length);
+        EchoComponent echo = new EchoComponent();
+        container.activateComponent(echo, "echo");
+        names = context.getPojoComponents();
+        assertNotNull(names);
+        assertEquals(2, names.length);
+        assertEquals(LifeCycleMBean.STARTED, echo.getCurrentState());
+        context.stopComponent("echo");
+        assertEquals(LifeCycleMBean.STOPPED, echo.getCurrentState());
     }
-    
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/DeployAndListServiceAssemblyTasksTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/DeployAndListServiceAssemblyTasksTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/DeployAndListServiceAssemblyTasksTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/DeployAndListServiceAssemblyTasksTest.java Fri Aug 10 07:37:46 2007
@@ -33,66 +33,64 @@
 
     private static final String XML_OUTPUT_PROPERTY = "test.xml.output";
 
-	private DeployServiceAssemblyTask deployServiceAssembliesTask;
+    private DeployServiceAssemblyTask deployServiceAssembliesTask;
 
-	private File rootDir = new File("target/testWDIR");
+    private File rootDir = new File("target/testWDIR");
 
-	private ListServiceAssembliesTask listServiceAssembliesTask;
+    private ListServiceAssembliesTask listServiceAssembliesTask;
 
-	private Project project = new Project();
+    private Project project = new Project();
 
-	/*
-	 * @see TestCase#setUp()
-	 */
-	protected void setUp() throws Exception {
-		FileUtil.deleteFile(rootDir);
-		this.container.setRootDir(rootDir.getPath());
-		super.setUp();
-		deployServiceAssembliesTask = new DeployServiceAssemblyTask() {
-		};
-		deployServiceAssembliesTask.setProject(new Project());
-		deployServiceAssembliesTask.init();
-
-		listServiceAssembliesTask = new ListServiceAssembliesTask();
-		listServiceAssembliesTask.setProject(project);
-		listServiceAssembliesTask.init();
-	}
-
-	/*
-	 * @see TestCase#tearDown()
-	 */
-	protected void tearDown() throws Exception {
-		deployServiceAssembliesTask.close();
-		super.tearDown();
-	}
-
-	public void testInstallationAndList() throws Exception {
-		URL url = getClass().getClassLoader().getResource(
-				"org/apache/servicemix/jbi/installation/testassembly.jar");
-
-		listServiceAssembliesTask.setServiceAssemblyName("sa");
-		listServiceAssembliesTask.setXmlOutput(XML_OUTPUT_PROPERTY);
-		listServiceAssembliesTask.execute();
-
-		log.info(project.getProperty(XML_OUTPUT_PROPERTY));
-		
-		if (url != null) {
-			String file = url.getFile();
-			deployServiceAssembliesTask.setFile(file);
-			deployServiceAssembliesTask.init();
-			deployServiceAssembliesTask.execute();
-			File testFile = new File(rootDir, "service-assemblies"
-					+ File.separator + "sa");
-			assertTrue(testFile.exists());
-		}
-
-		listServiceAssembliesTask.setServiceAssemblyName("sa");
-		listServiceAssembliesTask.setXmlOutput(XML_OUTPUT_PROPERTY);
-		listServiceAssembliesTask.execute();
+    /*
+     * @see TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        FileUtil.deleteFile(rootDir);
+        this.container.setRootDir(rootDir.getPath());
+        super.setUp();
+        deployServiceAssembliesTask = new DeployServiceAssemblyTask() {
+        };
+        deployServiceAssembliesTask.setProject(new Project());
+        deployServiceAssembliesTask.init();
+
+        listServiceAssembliesTask = new ListServiceAssembliesTask();
+        listServiceAssembliesTask.setProject(project);
+        listServiceAssembliesTask.init();
+    }
+
+    /*
+     * @see TestCase#tearDown()
+     */
+    protected void tearDown() throws Exception {
+        deployServiceAssembliesTask.close();
+        super.tearDown();
+    }
+
+    public void testInstallationAndList() throws Exception {
+        URL url = getClass().getClassLoader().getResource("org/apache/servicemix/jbi/installation/testassembly.jar");
+
+        listServiceAssembliesTask.setServiceAssemblyName("sa");
+        listServiceAssembliesTask.setXmlOutput(XML_OUTPUT_PROPERTY);
+        listServiceAssembliesTask.execute();
+
+        log.info(project.getProperty(XML_OUTPUT_PROPERTY));
+
+        if (url != null) {
+            String file = url.getFile();
+            deployServiceAssembliesTask.setFile(file);
+            deployServiceAssembliesTask.init();
+            deployServiceAssembliesTask.execute();
+            File testFile = new File(rootDir, "service-assemblies" + File.separator + "sa");
+            assertTrue(testFile.exists());
+        }
+
+        listServiceAssembliesTask.setServiceAssemblyName("sa");
+        listServiceAssembliesTask.setXmlOutput(XML_OUTPUT_PROPERTY);
+        listServiceAssembliesTask.execute();
 
-		log.info(project.getProperty(XML_OUTPUT_PROPERTY));
+        log.info(project.getProperty(XML_OUTPUT_PROPERTY));
 
-		FileUtil.deleteFile(rootDir);
+        FileUtil.deleteFile(rootDir);
 
-	}
+    }
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/InstallComponentTaskTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/InstallComponentTaskTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/InstallComponentTaskTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/InstallComponentTaskTest.java Fri Aug 10 07:37:46 2007
@@ -33,22 +33,24 @@
 import org.apache.tools.ant.Project;
 
 /**
- *
+ * 
  * InstallComponentTaskTest
  */
 public class InstallComponentTaskTest extends JbiTaskSupport {
-    
-    
+
     private InstallComponentTask installComponentTask;
+
     private File rootDir = new File("target/testWDIR");
+
     /*
      * @see TestCase#setUp()
      */
     protected void setUp() throws Exception {
         FileUtil.deleteFile(rootDir);
         this.container.setRootDir(rootDir.getPath());
-        super.setUp();        
-        installComponentTask = new InstallComponentTask(){};
+        super.setUp();
+        installComponentTask = new InstallComponentTask() {
+        };
         installComponentTask.setProject(new Project());
         installComponentTask.init();
     }
@@ -60,18 +62,22 @@
         installComponentTask.close();
         super.tearDown();
     }
-    
+
     public void testInstallation() throws Exception {
         Bootstrap1.setDelegate(new Bootstrap() {
             public void cleanUp() throws JBIException {
             }
+
             public ObjectName getExtensionMBeanName() {
                 return null;
             }
+
             public void init(InstallationContext installContext) throws JBIException {
             }
+
             public void onInstall() throws JBIException {
             }
+
             public void onUninstall() throws JBIException {
             }
         });
@@ -79,8 +85,7 @@
         installComponentTask.setFile(installJarUrl);
         installComponentTask.init();
         installComponentTask.execute();
-        File testFile = new File(rootDir, "components" + File.separator
-                + "component1");
+        File testFile = new File(rootDir, "components" + File.separator + "component1");
         assertTrue(testFile.exists());
         FileUtil.deleteFile(rootDir);
     }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskSupport.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskSupport.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskSupport.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskSupport.java Fri Aug 10 07:37:46 2007
@@ -16,11 +16,10 @@
  */
 package org.apache.servicemix.jbi.management.task;
 
+import junit.framework.TestCase;
+
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
-import org.apache.servicemix.jbi.management.task.JbiTask;
-
-import junit.framework.TestCase;
 
 
 /**
@@ -42,10 +41,9 @@
         container.init();
         container.start();
         
-        remoteConnection = new JbiTask(){
+        remoteConnection = new JbiTask() {
             protected void doExecute(AdminCommandsServiceMBean acs) throws Exception {
             }
-            
         };
         remoteConnection.init();
     }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/management/task/JbiTaskTest.java Fri Aug 10 07:37:46 2007
@@ -34,7 +34,7 @@
      */
     protected void setUp() throws Exception {
         super.setUp();        
-        jbiTask = new JbiTask(){
+        jbiTask = new JbiTask() {
             protected void doExecute(AdminCommandsServiceMBean acs) throws Exception {
             }
         };

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractClusteredTransactionTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractClusteredTransactionTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractClusteredTransactionTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractClusteredTransactionTest.java Fri Aug 10 07:37:46 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.servicemix.jbi.messaging;
 
+import javax.jbi.JBIException;
+
 import org.apache.servicemix.jbi.RuntimeJBIException;
 import org.apache.servicemix.jbi.container.ActivationSpec;
 import org.apache.servicemix.jbi.container.JBIContainer;
@@ -27,15 +29,13 @@
 import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.support.TransactionCallback;
 
-import javax.jbi.JBIException;
-
 /**
  * @version $Revision$
  */
 public abstract class AbstractClusteredTransactionTest extends AbstractTransactionTest {
 
     protected JBIContainer receiverContainer;
-    
+
     /*
      * @see TestCase#setUp()
      */
@@ -44,63 +44,63 @@
         receiverContainer = createJbiContainer("receiverContainer");
         Thread.sleep(3000);
     }
-    
+
     protected void tearDown() throws Exception {
         receiverContainer.shutDown();
-    	super.tearDown();
+        super.tearDown();
     }
-    
+
     protected void runClusteredTest(final boolean syncSend, final boolean syncReceive) throws Exception {
         final SenderComponent sender = new SenderComponent();
         sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
         final Receiver receiver;
         if (syncReceive) {
-        	receiver = new ReceiverComponent();
+            receiver = new ReceiverComponent();
         } else {
-        	receiver = new AsyncReceiverPojo();
+            receiver = new AsyncReceiverPojo();
         }
 
         senderContainer.activateComponent(new ActivationSpec("sender", sender));
         receiverContainer.activateComponent(new ActivationSpec("receiver", receiver));
         Thread.sleep(1000);
-        
+
         tt.execute(new TransactionCallback() {
-	  		public Object doInTransaction(TransactionStatus status) {
+            public Object doInTransaction(TransactionStatus status) {
                 try {
                     sender.sendMessages(NUM_MESSAGES, syncSend);
                 } catch (JBIException e) {
                     throw new RuntimeJBIException(e);
                 }
-	  			return null;
-	  		}
+                return null;
+            }
         });
         receiver.getMessageList().assertMessagesReceived(NUM_MESSAGES);
     }
-    
+
     public void testClusteredSyncSendSyncReceive() throws Exception {
-    	try {
-    		runClusteredTest(true, true);
-    		fail("sendSync can not be used on clustered flows with external components");
-    	} catch (Exception e) {
-    		// ok
-    	}
+        try {
+            runClusteredTest(true, true);
+            fail("sendSync can not be used on clustered flows with external components");
+        } catch (Exception e) {
+            // ok
+        }
     }
 
     public void testClusteredAsyncSendSyncReceive() throws Exception {
-    	runClusteredTest(false, true);
+        runClusteredTest(false, true);
     }
 
     public void testClusteredSyncSendAsyncReceive() throws Exception {
-    	try {
-    		runClusteredTest(true, false);
-    		fail("sendSync can not be used on clustered flows with external components");
-    	} catch (Exception e) {
-    		// ok
-    	}
+        try {
+            runClusteredTest(true, false);
+            fail("sendSync can not be used on clustered flows with external components");
+        } catch (Exception e) {
+            // ok
+        }
     }
 
     public void testClusteredAsyncSendAsyncReceive() throws Exception {
-    	runClusteredTest(false, false);
+        runClusteredTest(false, false);
     }
 
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractTransactionTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractTransactionTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractTransactionTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/AbstractTransactionTest.java Fri Aug 10 07:37:46 2007
@@ -41,11 +41,13 @@
 public abstract class AbstractTransactionTest extends TestCase {
 
     protected static final int NUM_MESSAGES = 10;
-    
+
     protected TransactionTemplate tt;
+
     protected TransactionManager tm;
+
     protected JBIContainer senderContainer;
-    
+
     /*
      * @see TestCase#setUp()
      */
@@ -54,19 +56,19 @@
         createTransactionLayer();
         senderContainer = createJbiContainer("senderContainer");
     }
-    
+
     protected void tearDown() throws Exception {
-    	senderContainer.shutDown();
+        senderContainer.shutDown();
     }
-    
+
     protected void createTransactionLayer() throws Exception {
-    	GeronimoPlatformTransactionManager gtm = new GeronimoPlatformTransactionManager();
-    	tm = gtm;
+        GeronimoPlatformTransactionManager gtm = new GeronimoPlatformTransactionManager();
+        tm = gtm;
         tt = new TransactionTemplate(gtm);
     }
-    
+
     protected JBIContainer createJbiContainer(String name) throws Exception {
-    	JBIContainer container = new JBIContainer();
+        JBIContainer container = new JBIContainer();
         container.setTransactionManager(tm);
         container.setName(name);
         container.setFlow(createFlow());
@@ -76,41 +78,41 @@
         container.start();
         return container;
     }
-    
+
     protected abstract Flow createFlow();
-    
+
     protected void runSimpleTest(final boolean syncSend, final boolean syncReceive) throws Exception {
         final SenderComponent sender = new SenderComponent();
         sender.setResolver(new ServiceNameEndpointResolver(ReceiverComponent.SERVICE));
         final Receiver receiver;
         if (syncReceive) {
-        	receiver = new ReceiverComponent();
+            receiver = new ReceiverComponent();
         } else {
-        	receiver = new AsyncReceiverPojo();
+            receiver = new AsyncReceiverPojo();
         }
 
         senderContainer.activateComponent(new ActivationSpec("sender", sender));
         senderContainer.activateComponent(new ActivationSpec("receiver", receiver));
-        
+
         tt.execute(new TransactionCallback() {
-	  		public Object doInTransaction(TransactionStatus status) {
+            public Object doInTransaction(TransactionStatus status) {
                 try {
                     sender.sendMessages(NUM_MESSAGES, syncSend);
                 } catch (JBIException e) {
                     throw new RuntimeJBIException(e);
                 }
-	  			return null;
-	  		}
+                return null;
+            }
         });
         receiver.getMessageList().assertMessagesReceived(NUM_MESSAGES);
     }
-    
+
     public void testSyncSendSyncReceive() throws Exception {
         runSimpleTest(true, true);
     }
 
     public void testAsyncSendSyncReceive() throws Exception {
-    	runSimpleTest(false, true);
+        runSimpleTest(false, true);
     }
 
     public void testSyncSendAsyncReceive() throws Exception {
@@ -118,7 +120,7 @@
     }
 
     public void testAsyncSendAsyncReceive() throws Exception {
-    	runSimpleTest(false, false);
+        runSimpleTest(false, false);
     }
 
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImplTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImplTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImplTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/DeliveryChannelImplTest.java Fri Aug 10 07:37:46 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.servicemix.jbi.messaging;
 
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import javax.jbi.messaging.DeliveryChannel;
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOut;
@@ -26,32 +28,30 @@
 
 import junit.framework.TestCase;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.servicemix.components.util.ComponentSupport;
 import org.apache.servicemix.jbi.container.ActivationSpec;
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.jaxp.StringSource;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.util.concurrent.atomic.AtomicBoolean;
 
 public class DeliveryChannelImplTest extends TestCase {
 
-    private static final Log log = LogFactory.getLog(DeliveryChannelImplTest.class);
+    private static final Log LOG = LogFactory.getLog(DeliveryChannelImplTest.class);
 
     protected JBIContainer container;
-    
+
     protected void setUp() throws Exception {
         container = new JBIContainer();
         container.setEmbedded(true);
         container.init();
         container.start();
     }
-    
+
     protected void tearDown() throws Exception {
         container.shutDown();
     }
-    
+
     public void testExchangeFactoryOnOpenChannel() throws Exception {
         // Retrieve a delivery channel
         TestComponent component = new TestComponent(null, null);
@@ -62,7 +62,7 @@
         assertNotNull(mef);
         assertNotNull(mef.createInOnlyExchange());
     }
-    
+
     public void testExchangeFactoryOnClosedChannel() throws Exception {
         // Retrieve a delivery channel
         TestComponent component = new TestComponent(null, null);
@@ -79,7 +79,7 @@
             // expected
         }
     }
-    
+
     public void testSendSyncOnSameComponent() throws Exception {
         // Retrieve a delivery channel
         TestComponent component = new TestComponent(new QName("service"), "endpoint");
@@ -89,7 +89,7 @@
         final AtomicBoolean done = new AtomicBoolean(false);
 
         // Create another thread
-        new Thread() {
+        Thread t = new Thread() {
             public void run() {
                 try {
                     InOut me = (InOut) channel.accept(5000);
@@ -100,13 +100,14 @@
                     success.set(true);
                     done.set(true);
                 } catch (MessagingException e) {
-                    log.error(e.getMessage(), e);
+                    LOG.error(e.getMessage(), e);
                     success.set(false);
                     done.set(true);
                 }
             }
-        }.start();
-        
+        };
+        t.start();
+
         MessageExchangeFactory factory = channel.createExchangeFactoryForService(new QName("service"));
         InOut me = factory.createInOutExchange();
         NormalizedMessage nm = me.createMessage();
@@ -118,7 +119,7 @@
         channel.send(me);
 
         if (!done.get()) {
-            synchronized(done) {
+            synchronized (done) {
                 done.wait(5000);
             }
         }
@@ -126,14 +127,15 @@
         assertTrue("Secondary thread didn't finish", done.get());
         assertTrue("Exception in secondary thread", success.get());
     }
-    
+
     public static class TestComponent extends ComponentSupport {
         public TestComponent(QName service, String endpoint) {
             super(service, endpoint);
         }
+
         public DeliveryChannel getChannel() throws MessagingException {
             return getContext().getDeliveryChannel();
         }
     }
-    
+
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowPersistentTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowPersistentTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowPersistentTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowPersistentTest.java Fri Aug 10 07:37:46 2007
@@ -27,8 +27,8 @@
  */
 public class JcaFlowPersistentTest extends AbstractPersistenceTest {
 
-	protected BrokerService broker;
-    
+    protected BrokerService broker;
+
     protected void setUp() throws Exception {
         BrokerFactoryBean bfb = new BrokerFactoryBean(new ClassPathResource("org/apache/servicemix/jbi/nmr/flow/jca/broker.xml"));
         bfb.afterPropertiesSet();
@@ -36,41 +36,41 @@
         broker.start();
         super.setUp();
     }
-    
+
     protected void tearDown() throws Exception {
-    	super.tearDown();
-    	broker.stop();
+        super.tearDown();
+        broker.stop();
     }
-    
+
     protected Flow createFlow() {
-    	JCAFlow flow = new JCAFlow("tcp://localhost:61216");
-    	return flow;
+        JCAFlow flow = new JCAFlow("tcp://localhost:61216");
+        return flow;
     }
 
     public void testSyncSendSyncReceive() throws Exception {
-    	try {
-        	runSimpleTest(true, true);
-        	fail("sendSync can not be used");
-    	} catch (Exception e) {
-    		// sendSync can not be used
-    	}
+        try {
+            runSimpleTest(true, true);
+            fail("sendSync can not be used");
+        } catch (Exception e) {
+            // sendSync can not be used
+        }
     }
 
     public void testAsyncSendSyncReceive() throws Exception {
-   		runSimpleTest(false, true);
+        runSimpleTest(false, true);
     }
 
     public void testSyncSendAsyncReceive() throws Exception {
-    	try {
-	    	runSimpleTest(true, false);
-        	fail("sendSync can not be used");
-    	} catch (Exception e) {
-    		// sendSync can not be used
-    	}
+        try {
+            runSimpleTest(true, false);
+            fail("sendSync can not be used");
+        } catch (Exception e) {
+            // sendSync can not be used
+        }
     }
 
     public void testAsyncSendAsyncReceive() throws Exception {
-    	runSimpleTest(false, false);
+        runSimpleTest(false, false);
     }
 
 }

Modified: incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowTransactionTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowTransactionTest.java?view=diff&rev=564607&r1=564606&r2=564607
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowTransactionTest.java (original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/test/java/org/apache/servicemix/jbi/messaging/JcaFlowTransactionTest.java Fri Aug 10 07:37:46 2007
@@ -27,23 +27,23 @@
  */
 public class JcaFlowTransactionTest extends AbstractClusteredTransactionTest {
 
-	protected BrokerService broker;
-    
+    protected BrokerService broker;
+
     protected void setUp() throws Exception {
         BrokerFactoryBean bfb = new BrokerFactoryBean(new ClassPathResource("org/apache/servicemix/jbi/nmr/flow/jca/broker.xml"));
         bfb.afterPropertiesSet();
         broker = bfb.getBroker();
         super.setUp();
     }
-    
+
     protected void tearDown() throws Exception {
-    	super.tearDown();
-    	broker.stop();
+        super.tearDown();
+        broker.stop();
     }
-    
+
     protected Flow createFlow() {
-    	JCAFlow flow = new JCAFlow("tcp://localhost:61216");
-    	return flow;
+        JCAFlow flow = new JCAFlow("tcp://localhost:61216");
+        return flow;
     }
 
     public void testSyncSendSyncReceive() throws Exception {

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



Mime
View raw message