[jboss-svn-commits] JBL Code SVN: r6301 - in labs/jbossesb/workspace/rearchitecture: IDE/JBossIDE product/core product/core/listeners product/core/listeners/tests product/core/rosetta/src/org/jboss/internal/soa/esb/addressing product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml product/core/rosetta/src/org/jboss/soa/esb/addressing product/core/rosetta/tests product/core/rosetta/tests/src/org/jboss/soa/esb product/core/rosetta/tests/src/org/jboss/soa/esb/addressing product/core/services product/core/services/tests

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Sep 19 12:16:43 EDT 2006


Author: mark.little at jboss.com
Date: 2006-09-19 12:16:31 -0400 (Tue, 19 Sep 2006)
New Revision: 6301

Added:
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/CallUnitTest.java
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/EPRUnitTest.java
Modified:
   labs/jbossesb/workspace/rearchitecture/IDE/JBossIDE/.classpath
   labs/jbossesb/workspace/rearchitecture/product/core/build.xml
   labs/jbossesb/workspace/rearchitecture/product/core/listeners/build.xml
   labs/jbossesb/workspace/rearchitecture/product/core/listeners/tests/build.xml
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/CallHelper.java
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/soa/esb/addressing/Call.java
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
   labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/build.xml
   labs/jbossesb/workspace/rearchitecture/product/core/services/build.xml
   labs/jbossesb/workspace/rearchitecture/product/core/services/tests/build.xml
Log:
added initial unit tests for messaging and EPRs.

Modified: labs/jbossesb/workspace/rearchitecture/IDE/JBossIDE/.classpath
===================================================================
--- labs/jbossesb/workspace/rearchitecture/IDE/JBossIDE/.classpath	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/IDE/JBossIDE/.classpath	2006-09-19 16:16:31 UTC (rev 6301)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="product/core/common/src"/>
-	<classpathentry kind="src" path="product/core/common/tests/src"/>
+	<classpathentry kind="src" path="product/core/rosetta/src"/>
+	<classpathentry kind="src" path="product/core/rosetta/tests/src"/>
 	<classpathentry kind="src" path="product/core/listeners/src"/>
 	<classpathentry kind="src" path="product/core/listeners/tests/src"/>
 	<classpathentry kind="src" path="product/core/services/src"/>
@@ -20,6 +20,6 @@
 	<classpathentry kind="lib" path="product/lib/ejb3_embedded/jboss-ejb3-all.jar"/>
 	<classpathentry kind="lib" path="product/lib/ejb3_embedded/thirdparty-all.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="lib" path="product/core/common/tests/resources/conf"/>
+	<classpathentry kind="lib" path="product/core/rosetta/tests/resources/conf"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: labs/jbossesb/workspace/rearchitecture/product/core/build.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/build.xml	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/build.xml	2006-09-19 16:16:31 UTC (rev 6301)
@@ -46,7 +46,7 @@
     <!-- =================================================================== -->
     <target name="org.jboss.esb.core.test" depends="org.jboss.esb.core.compile" description="Test subprojects">
         <echo message="Testing submodules"/>
-        <ant dir="rosetta" target="org.jboss.esb.common.test"/>
+        <ant dir="rosetta" target="org.jboss.esb.rosetta.test"/>
         <ant dir="listeners" target="org.jboss.esb.listeners.test"/>
         <ant dir="services" target="org.jboss.esb.services.test"/>
     </target>

Modified: labs/jbossesb/workspace/rearchitecture/product/core/listeners/build.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/listeners/build.xml	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/listeners/build.xml	2006-09-19 16:16:31 UTC (rev 6301)
@@ -21,7 +21,7 @@
 	<path id="org.jboss.esb.listeners.default.classpath">
         <path refid="org.jboss.esb.listeners.base.classpath"/>
 		<pathelement location="${org.jboss.esb.classes.dir}"/>
-		<pathelement location="${org.jboss.esb.internal.dest}/classes/common"/>
+		<pathelement location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
 		<pathelement location="${org.jboss.esb.internal.dest}/classes/services"/>
 		<fileset dir="${org.jboss.esb.ejb3.lib.dir}" includes="*.jar,*.zip"/>
     </path>

Modified: labs/jbossesb/workspace/rearchitecture/product/core/listeners/tests/build.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/listeners/tests/build.xml	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/listeners/tests/build.xml	2006-09-19 16:16:31 UTC (rev 6301)
@@ -24,7 +24,7 @@
 
         <fileset dir="../${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
     	<fileset dir="../${org.jboss.esb.deploy.lib.dir}" includes="*.jar"/>
-        <pathelement location="${org.jboss.esb.module.classes.root.dir}/common"/>
+        <pathelement location="${org.jboss.esb.module.classes.root.dir}/rosetta"/>
         <pathelement location="${org.jboss.esb.module.classes.root.dir}/services"/>
         <pathelement location="${org.jboss.esb.module.classes.dir}"/>
         <pathelement location="${org.jboss.esb.module.tests.conf.dir}"/>

Modified: labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/CallHelper.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/CallHelper.java	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/addressing/CallHelper.java	2006-09-19 16:16:31 UTC (rev 6301)
@@ -87,9 +87,11 @@
 	
 	public static Call fromXML (Element header)
 	{
+		Call call = null;
+		
 		try
 		{
-			Call call = new Call();
+			call = new Call();
 			
 			NodeList nl = header.getChildNodes();
 			
@@ -188,6 +190,8 @@
 			
 			ex.printStackTrace();
 		}
+		
+		return call;
 	}
 	
 } 
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java	2006-09-19 16:16:31 UTC (rev 6301)
@@ -26,11 +26,6 @@
 import org.jboss.soa.esb.message.Header;
 import org.jboss.soa.esb.addressing.Call;
 
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
 /**
  * The message header. Contains such things as routing information.
  */
@@ -55,41 +50,6 @@
 	{
 		_call = call;
 	}
-	
-	public Element toXML (Document doc, Element envelope)
-	{
-		// TODO remove MAGIC strings!!
-		
-		Element headerElement = doc.createElement("header");
-		
-		envelope.appendChild(headerElement);
-		
-		return _call.toXML(doc, headerElement);
-	}
-	
-	public void fromXML (Element envelope)
-	{
-		_call = new Call();
-		
-		NodeList nl = envelope.getChildNodes();
-		Element headerElement = null;
-		
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			Node n = nl.item(i);
-			
-			if (n.getNodeName().equals("header"))
-			{
-				headerElement = (Element) n;
-				break;
-			}
-		}
-		
-		// TODO error handling!!
-		
-		if (headerElement != null)
-			_call.fromXML(headerElement);
-	}
-	
+
 	private Call _call;
 }
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java	2006-09-19 16:16:31 UTC (rev 6301)
@@ -21,6 +21,7 @@
  * @author mark.little at jboss.com
  */
 
+import org.jboss.internal.soa.esb.addressing.CallHelper;
 import org.jboss.soa.esb.message.Header;
 import org.jboss.soa.esb.addressing.Call;
 
@@ -60,7 +61,7 @@
 		
 		envelope.appendChild(headerElement);
 		
-		return _call.toXML(doc, headerElement);
+		return CallHelper.toXML(_call, doc, headerElement);
 	}
 	
 	public void fromXML (Element envelope)
@@ -84,7 +85,7 @@
 		// TODO error handling!!
 		
 		if (headerElement != null)
-			_call.fromXML(headerElement);
+			_call = CallHelper.fromXML(headerElement);
 	}
 	
 	private Call _call;

Modified: labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/soa/esb/addressing/Call.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/soa/esb/addressing/Call.java	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/soa/esb/addressing/Call.java	2006-09-19 16:16:31 UTC (rev 6301)
@@ -35,16 +35,11 @@
 {
 	public Call ()
 	{
-		_to = _from = _replyTo = _relatesTo = _faultTo = null;
-		_action = _messageID = null;
 	}
 	
 	public Call (EPR epr)
 	{
 		_to = epr;
-		
-		_from = _replyTo = _relatesTo = _faultTo = null;
-		_action = _messageID = null;
 	}
 	
 	public void setTo (EPR epr)
@@ -87,12 +82,12 @@
 		return _faultTo;
 	}
 	
-	public void setRelatesTo (EPR uri)
+	public void setRelatesTo (URI uri)
 	{
 		_relatesTo = uri;
 	}
 	
-	public EPR getRelatesTo () throws URISyntaxException
+	public URI getRelatesTo () throws URISyntaxException
 	{
 		return _relatesTo;
 	}
@@ -139,12 +134,12 @@
 		return "To: "+_to+" From: "+_from+" ReplyTo: "+_replyTo+" FaultTo: "+_faultTo+" Action: "+_action;
 	}
 	
-	private EPR _to;
-	private EPR _from;
-	private EPR _faultTo;
-	private EPR _replyTo;
-	private EPR _relatesTo;
-	private URI _action;
-	private URI _messageID;
+	private EPR _to = null;
+	private EPR _from = null;
+	private EPR _faultTo = null;
+	private EPR _replyTo = null;
+	private URI _relatesTo = null;
+	private URI _action = null;
+	private URI _messageID = null;
 	
 } 
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/soa/esb/addressing/EPR.java	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/rosetta/src/org/jboss/soa/esb/addressing/EPR.java	2006-09-19 16:16:31 UTC (rev 6301)
@@ -40,7 +40,7 @@
 	{
 		_addr = addr;
 	}
-	
+
 	public EPR (URI uri)
 	{
 		_addr = new PortReference(uri.toString());
@@ -72,6 +72,19 @@
 		return "EPR: "+_addr;
 	}
 
+	public boolean equals (Object obj)
+	{
+		if (obj == this)
+			return true;
+		else
+		{
+			if (obj instanceof EPR)
+				return ((EPR) obj)._addr.equals(_addr);
+		}
+		
+		return false;
+	}
+	
 	private PortReference _addr;
 
 } 
\ No newline at end of file

Modified: labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/build.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/build.xml	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/build.xml	2006-09-19 16:16:31 UTC (rev 6301)
@@ -3,12 +3,12 @@
 
 	<property name="org.jboss.esb.internal.dest" value="${basedir}/../../../build"/>
     <property name="org.jboss.esb.module.src.dir" value="../src"/>
-    <property name="org.jboss.esb.module.classes.dir" value="${org.jboss.esb.internal.dest}/classes/common"/>
+    <property name="org.jboss.esb.module.classes.dir" value="${org.jboss.esb.internal.dest}/classes/rosetta"/>
     <property name="org.jboss.esb.module.tests.src.dir" value="${basedir}/src"/>
     <property name="org.jboss.esb.tests.classes.dir" value="${org.jboss.esb.internal.dest}/tests"/>
     <property name="org.jboss.esb.tests.report.dir" value="${org.jboss.esb.internal.dest}/tests/junit"/>
     <property name="org.jboss.esb.root.dir" value="../.."/>
-    <property name="org.jboss.esb.module.tests.coverage.dir" value="${org.jboss.esb.internal.dest}/tests/coverage/common"/>
+    <property name="org.jboss.esb.module.tests.coverage.dir" value="${org.jboss.esb.internal.dest}/tests/coverage/rosetta"/>
     <property name="org.jboss.esb.module.classes.instr.dir" value="${org.jboss.esb.module.tests.coverage.dir}/instr" />
     <property environment="env"/>
 	<property name="org.jboss.esb.ejb3_embedded.lib.dir" value="${org.jboss.esb.root.dir}/../lib/ejb3_embedded"/>
@@ -19,7 +19,7 @@
 	<property name="org.jboss.esb.deployment.properties" value="../../../config/deployment.properties"/>
 	<!-- Load deployment properties File -->
 	<property file="${org.jboss.esb.deployment.properties}"/>
-	<property name="org.jboss.esb.ejb3_conf.tests.src.dir" value="${org.jboss.esb.root.dir}/common/tests/resources/conf"/>
+	<property name="org.jboss.esb.ejb3_conf.tests.src.dir" value="${org.jboss.esb.root.dir}/rosetta/tests/resources/conf"/>
 	
     <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client">
         <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
@@ -64,7 +64,7 @@
 	<!-- ====================================================================== -->
     <!--                             T E S T                                    -->
     <!-- ====================================================================== -->
-    <target name="org.jboss.esb.common.internal.test">
+    <target name="org.jboss.esb.rosetta.internal.test">
 		<!-- Instrument the code for code coverage - using emma... -->
     	<delete dir="${org.jboss.esb.module.tests.coverage.dir}" />
 	    <mkdir dir="${org.jboss.esb.module.classes.instr.dir}" />

Added: labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/CallUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/CallUnitTest.java	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/CallUnitTest.java	2006-09-19 16:16:31 UTC (rev 6301)
@@ -0,0 +1,194 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.addressing;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.Call;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class CallUnitTest extends TestCase
+{
+	public void testConstructor ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			assertEquals((call.getTo() == null), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testEPRConstructor ()
+	{
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			Call call = new Call(epr);
+			
+			assertEquals(call.getTo().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetTo ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			
+			call.setTo(epr);
+			
+			assertEquals(call.getTo().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetFrom ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			
+			call.setFrom(epr);
+			
+			assertEquals(call.getFrom().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetReplyTo ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			
+			call.setReplyTo(epr);
+			
+			assertEquals(call.getReplyTo().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetFaultTo ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			
+			call.setFaultTo(epr);
+			
+			assertEquals(call.getFaultTo().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetRelatesTo ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			URI uri = new URI("urn:1234");
+			
+			call.setRelatesTo(uri);
+			
+			assertEquals(call.getRelatesTo().equals(uri), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetAction ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			URI uri = new URI("urn:1234");
+			
+			call.setAction(uri);
+			
+			assertEquals(call.getAction().equals(uri), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetMessageID ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			URI uri = new URI("urn:1234");
+			
+			call.setMessageID(uri);
+			
+			assertEquals(call.getMessageID().equals(uri), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+}

Added: labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/EPRUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/EPRUnitTest.java	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/rosetta/tests/src/org/jboss/soa/esb/addressing/EPRUnitTest.java	2006-09-19 16:16:31 UTC (rev 6301)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.addressing;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+
+import java.net.URI;
+
+/**
+ * Unit tests for the EPR class.
+ * 
+ * @author Mark Little
+ */
+
+public class EPRUnitTest extends TestCase
+{
+
+	public void testConstructor ()
+	{
+		EPR epr = new EPR();
+		
+		System.err.println("Default EPR: "+epr);
+	}
+	
+	public void testPortReferenceConstructor ()
+	{
+		EPR epr = new EPR(new PortReference("http://localhost:8080"));
+		
+		assertEquals(epr.toString(), "EPR: PortReference < http://localhost:8080 >");
+	}
+	
+	public void testURIConstructor ()
+	{
+		try
+		{
+			EPR epr = new EPR(new URI("urn:foo:bar"));
+			
+			assertEquals(epr.toString(), "EPR: PortReference < urn:foo:bar >");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testGetAddr ()
+	{
+		try
+		{
+			EPR epr = new EPR(new URI("urn:foo:bar"));
+		
+			assertEquals(epr.getAddr().getAddress(), "urn:foo:bar");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetAddr ()
+	{
+		EPR epr = new EPR();
+		
+		epr.setAddr(new PortReference("http://localhost"));
+
+		try
+		{
+			assertEquals(epr.getAddr().getAddress(), "http://localhost");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testEquals ()
+	{
+		try
+		{
+			EPR epr1 = new EPR(new URI("http://localhost"));
+			EPR epr2 = new EPR(new URI("http://localhost"));
+			EPR epr3 = new EPR(new URI("http://localhost:8080"));
+			
+			assertEquals(epr1.equals(epr2), true);
+			assertEquals(epr1.equals(epr3), false);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+}

Modified: labs/jbossesb/workspace/rearchitecture/product/core/services/build.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/services/build.xml	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/services/build.xml	2006-09-19 16:16:31 UTC (rev 6301)
@@ -102,7 +102,7 @@
 	
     <path id="org.jboss.esb.services.default.classpath">
         <path refid="org.jboss.esb.services.base.classpath"/>
-		<pathelement location="${org.jboss.esb.internal.dest}/classes/common"/>
+		<pathelement location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
     	<pathelement location="${org.jboss.esb.internal.dest}/classes/listeners"/>
     </path>
 

Modified: labs/jbossesb/workspace/rearchitecture/product/core/services/tests/build.xml
===================================================================
--- labs/jbossesb/workspace/rearchitecture/product/core/services/tests/build.xml	2006-09-19 15:20:37 UTC (rev 6300)
+++ labs/jbossesb/workspace/rearchitecture/product/core/services/tests/build.xml	2006-09-19 16:16:31 UTC (rev 6301)
@@ -16,7 +16,7 @@
 
     <property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/>
 	<property name="org.jboss.esb.ejb3_embedded.lib.dir" value="${org.jboss.esb.root.dir}/../lib/ejb3_embedded"/>
-	<property name="org.jboss.esb.ejb3_conf.tests.src.dir" value="${org.jboss.esb.root.dir}/common/tests/resources/conf"/>
+	<property name="org.jboss.esb.ejb3_conf.tests.src.dir" value="${org.jboss.esb.root.dir}/rosetta/tests/resources/conf"/>
     <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client">
         <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
     </condition>
@@ -25,7 +25,7 @@
         <fileset dir="../${org.jboss.esb.ext.lib.dir}"
                  includes="activation.jar log4j.jar mail.jar junit.jar emma.jar emma_ant.jar"/>
         <pathelement location="${org.jboss.esb.module.classes.dir}"/>
-        <pathelement location="${org.jboss.esb.internal.dest}/classes/common"/>
+        <pathelement location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
     	<pathelement location="${org.jboss.esb.ejb3_conf.tests.src.dir}"/>
     	<fileset dir="${org.jboss.esb.ejb3_embedded.lib.dir}" includes="*.jar"/>
     </path>




More information about the jboss-svn-commits mailing list