[jboss-svn-commits] JBL Code SVN: r10349 - in labs/jbossesb/branches/JBESB_4_0_MP1/product/core: listeners/src/org/jboss/soa/esb/listeners/gateway and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Mar 20 12:09:43 EDT 2007


Author: kurt.stam at jboss.com
Date: 2007-03-20 12:09:43 -0400 (Tue, 20 Mar 2007)
New Revision: 10349

Modified:
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/src/org/jboss/soa/esb/actions/Notifier.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/message/Message.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java
   labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java
Log:
Moving 10336 to the 4.0 MP1 branch

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/src/org/jboss/soa/esb/actions/Notifier.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/src/org/jboss/soa/esb/actions/Notifier.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/src/org/jboss/soa/esb/actions/Notifier.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -88,11 +88,11 @@
 	
 	public void notifyOK 	(Message message) 
 	{
-		NotificationList.notifyAll(_notifyOK, messageAsString(message)); 
+		NotificationList.notifyAll(_notifyOK, message); 
 	} //________________________________
 	public void notifyError (Message message) 
 	{ 
-		NotificationList.notifyAll(_notifyError, messageAsString(message)); 
+		NotificationList.notifyAll(_notifyError, message); 
 	} //________________________________
 	
 	public String messageAsString (Message message) 

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -438,6 +438,9 @@
          javax.jms.Message jmsMsg = (javax.jms.Message) obj;
          Message message = MessageFactory.getInstance().getMessage();
          message.getBody().setContents(getMessageContent(jmsMsg));
+         if (jmsMsg.getJMSMessageID()!=null) {
+             message.getBody().add("MessageId", jmsMsg.getJMSMessageID());
+         }
          Enumeration<String> EE = jmsMsg.getPropertyNames();
          if (null != EE)
          {

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -1,275 +1,272 @@
-/*
- * 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.listeners.message;
-
-import java.io.File;
-import java.io.InputStream;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.log4j.xml.DOMConfigurator;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.jboss.soa.esb.util.AbstractCommandVehicle;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-class CommandVehicle extends AbstractCommandVehicle
-{
-	private static final long serialVersionUID = 1L;
-
-	@Override
-	public String getCommandValuesTag()
-	{
-		return "foobar";
-	}
-
-	@Override
-	public String getCommandOpcodeKey()
-	{
-		return "barfoo";
-	}
-
-	public enum Operation
-	{
-		SomeOperation
-	}
-
-	public CommandVehicle()
-	{
-		this(CommandVehicle.Operation.SomeOperation);
-	}
-
-	public CommandVehicle(Enum command)
-	{
-		super(command);
-	}
-
-	public CommandVehicle(Message message)
-	{
-		super(message);
-	}
-
-	public Object getReturnCode()
-	{
-		return "ReturnCode";
-	}
-}
-
-public class InvokerUnitTest extends TestCase
-{
-
-	protected final void setup()
-	{
-		try
-		{
-			DOMConfigurator.configure(TestEnvironmentUtil.getUserDir("product",
-					"../product")
-					+ "/etc/test/resources/log4j.xml");
-			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
-					"../product");
-			// Set the juddi properties file in System so juddi will pick it up
-			// later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/juddi-unittest.properties";
-			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
-			// Read this properties file to get the db connection string
-			Properties props = new Properties();
-			InputStream inStream = Class.class
-					.getResourceAsStream(juddiPropertiesFile);
-
-			props.load(inStream);
-			mDbDriver = props.getProperty("juddi.jdbcDriver");
-			mDbUrl = props.getProperty("juddi.jdbcUrl");
-			mDbUsername = props.getProperty("juddi.jdbcUsername");
-			mDbPassword = props.getProperty("juddi.jdbcPassword");
-
-			String database = "not tested yet";
-			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
-			{
-				database = "hsqldb";
-				// Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
-						"product", "../product")
-						+ "/build/hsqltestdb", "juddi");
-			}
-			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
-			{
-				database = "mysql";
-			} // add and test your own database..
-
-			// Get the registry-schema create scripts
-			String sqlDir = TestEnvironmentUtil.getUserDir("product",
-					"../product")
-					+ "/install/jUDDI-registry/sql/" + database + "/";
-			// Drop what is there now, if exists. We want to start fresh.
-			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "drop_database.sql"));
-			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "create_database.sql"));
-			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "insert_publishers.sql"));
-
-			try
-			{
-				Class.forName(mDbDriver);
-			}
-			catch (Exception e)
-			{
-				System.out.println("ERROR: failed to load " + database
-						+ " JDBC driver.");
-				e.printStackTrace();
-				return;
-			}
-			con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
-			Statement stmnt = con.createStatement();
-			stmnt.execute(sqlDropCmd);
-			stmnt.execute(sqlCreateCmd);
-			stmnt.execute(sqlInsertPubCmd);
-			stmnt.close();
-		}
-		catch (Throwable e)
-		{
-			e.printStackTrace();
-			System.out
-					.println("We should stop testing, since we don't have a db.");
-			assertTrue(false);
-		}
-	}
-
-	protected final void tearDown()
-	{
-		try
-		{
-			Thread.sleep(1000);
-			Statement stmnt = con.createStatement();
-
-			stmnt.execute("SHUTDOWN");
-			stmnt.close();
-
-			con.close();
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-		}
-	}
-
-	public void testInvalidParameters() throws Exception
-	{
-		setup();
-
-		CommandVehicle command = new CommandVehicle();
-
-		try
-		{
-			Invoker.invoke(command, null, null);
-			fail();
-		}
-		catch (RegistryException ex)
-		{
-		}
-
-		try
-		{
-			Invoker.invoke(command, "foo", "bar");
-			fail();
-		}
-		catch (RegistryException ex)
-		{
-		}
-
-		final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
-		final String tmpDirForm = tmpDir.toURL().toExternalForm();
-		FileEpr epr = new FileEpr(tmpDirForm);
-
-		epr.setInputSuffix(".testFile");
-		epr.setPostDelete(true);
-		epr.setPostSuffix(".unitProcessedOK");
-
-		ConfigTree tree = new ConfigTree("test");
-
-		tree.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG,
-				"eprmanager");
-		tree.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, "foobar");
-
-		RegistryUtil.register(tree, epr);
-
-		try
-		{
-			Invoker.invoke(command, "eprmanager", "foobar");
-		}
-		catch (Exception ex)
-		{
-			fail();
-		}
-
-		try
-		{
-			Invoker
-					.invokeAndAwaitResponse(command, "eprmanager", "foobar",
-							100);
-		}
-		catch (Exception ex)
-		{
-		}
-		
-		File[] files = tmpDir.listFiles();
-		
-		for (int i = 0; i < files.length; i++)
-		{
-			if ((files[i].getName().endsWith(".unitProcessedOK")) ||
-					(files[i].getName().equals("foobar")))
-			{
-				try
-				{
-					files[i].delete();
-				}
-				catch (Exception ex)
-				{
-				}
-			}
-		}
-	}
-
-	private static String mDbDriver;
-
-	private static String mDbUrl;
-
-	private static String mDbUsername;
-
-	private static String mDbPassword;
-
-	private static Connection con;
-}
+/*
+ * 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.listeners.message;
+
+import java.io.File;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.log4j.xml.DOMConfigurator;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.jboss.soa.esb.util.AbstractCommandVehicle;
+
+import junit.framework.TestCase;
+
+class CommandVehicle extends AbstractCommandVehicle
+{
+	private static final long serialVersionUID = 1L;
+
+	@Override
+	public String getCommandValuesTag()
+	{
+		return "foobar";
+	}
+
+	@Override
+	public String getCommandOpcodeKey()
+	{
+		return "barfoo";
+	}
+
+	public enum Operation
+	{
+		SomeOperation
+	}
+
+	public CommandVehicle()
+	{
+		this(CommandVehicle.Operation.SomeOperation);
+	}
+
+	public CommandVehicle(Enum command)
+	{
+		super(command);
+	}
+
+	public CommandVehicle(Message message)
+	{
+		super(message);
+	}
+
+	public Object getReturnCode()
+	{
+		return "ReturnCode";
+	}
+}
+
+public class InvokerUnitTest extends TestCase
+{
+
+	protected final void setup()
+	{
+		try
+		{
+			DOMConfigurator.configure(TestEnvironmentUtil.getUserDir("product",
+					"../product")
+					+ "/etc/test/resources/log4j.xml");
+			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
+					"../product");
+			// Set the juddi properties file in System so juddi will pick it up
+			// later and use the test values.
+			String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/juddi-unittest.properties";
+			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+			// Read this properties file to get the db connection string
+			Properties props = new Properties();
+			InputStream inStream = Class.class
+					.getResourceAsStream(juddiPropertiesFile);
+
+			props.load(inStream);
+			mDbDriver = props.getProperty("juddi.jdbcDriver");
+			mDbUrl = props.getProperty("juddi.jdbcUrl");
+			mDbUsername = props.getProperty("juddi.jdbcUsername");
+			mDbPassword = props.getProperty("juddi.jdbcPassword");
+
+			String database = "not tested yet";
+			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
+			{
+				database = "hsqldb";
+				// Bring up hsql on default port 9001
+				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
+						"product", "../product")
+						+ "/build/hsqltestdb", "juddi");
+			}
+			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
+			{
+				database = "mysql";
+			} // add and test your own database..
+
+			// Get the registry-schema create scripts
+			String sqlDir = TestEnvironmentUtil.getUserDir("product",
+					"../product")
+					+ "/install/jUDDI-registry/sql/" + database + "/";
+			// Drop what is there now, if exists. We want to start fresh.
+			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "drop_database.sql"));
+			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "create_database.sql"));
+			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "insert_publishers.sql"));
+
+			try
+			{
+				Class.forName(mDbDriver);
+			}
+			catch (Exception e)
+			{
+				System.out.println("ERROR: failed to load " + database
+						+ " JDBC driver.");
+				e.printStackTrace();
+				return;
+			}
+			con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
+			Statement stmnt = con.createStatement();
+			stmnt.execute(sqlDropCmd);
+			stmnt.execute(sqlCreateCmd);
+			stmnt.execute(sqlInsertPubCmd);
+			stmnt.close();
+		}
+		catch (Throwable e)
+		{
+			e.printStackTrace();
+			System.out
+					.println("We should stop testing, since we don't have a db.");
+			assertTrue(false);
+		}
+	}
+
+	protected final void tearDown()
+	{
+		try
+		{
+			Thread.sleep(1000);
+			Statement stmnt = con.createStatement();
+
+			stmnt.execute("SHUTDOWN");
+			stmnt.close();
+
+			con.close();
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+	}
+
+	public void testInvalidParameters() throws Exception
+	{
+		setup();
+
+		CommandVehicle command = new CommandVehicle();
+
+		try
+		{
+			Invoker.invoke(command, null, null);
+			fail();
+		}
+		catch (RegistryException ex)
+		{
+		}
+
+		try
+		{
+			Invoker.invoke(command, "foo", "bar");
+			fail();
+		}
+		catch (RegistryException ex)
+		{
+		}
+
+		final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
+		final String tmpDirForm = tmpDir.toURL().toExternalForm();
+		FileEpr epr = new FileEpr(tmpDirForm);
+
+		epr.setInputSuffix(".testFile");
+		epr.setPostDelete(true);
+		epr.setPostSuffix(".unitProcessedOK");
+
+		ConfigTree tree = new ConfigTree("test");
+
+		tree.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG,
+				"eprmanager");
+		tree.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, "foobar");
+
+		RegistryUtil.register(tree, epr);
+
+		try
+		{
+			Invoker.invoke(command, "eprmanager", "foobar");
+		}
+		catch (Exception ex)
+		{
+			fail();
+		}
+
+		try
+		{
+			Invoker
+					.invokeAndAwaitResponse(command, "eprmanager", "foobar",
+							100);
+		}
+		catch (Exception ex)
+		{
+		}
+		
+		File[] files = tmpDir.listFiles();
+		
+		for (int i = 0; i < files.length; i++)
+		{
+			if ((files[i].getName().endsWith(".unitProcessedOK")) ||
+					(files[i].getName().equals("foobar")))
+			{
+				try
+				{
+					files[i].delete();
+				}
+				catch (Exception ex)
+				{
+				}
+			}
+		}
+	}
+
+	private static String mDbDriver;
+
+	private static String mDbUrl;
+
+	private static String mDbUsername;
+
+	private static String mDbPassword;
+
+	private static Connection con;
+}

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -8,6 +8,7 @@
 import junit.framework.TestCase;
 
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.notification.NotificationException;
 import org.jboss.soa.esb.notification.NotificationTarget;
 
@@ -73,7 +74,7 @@
 	}
 
 	@Override
-	public void sendNotification (Serializable notificationObject)
+	public void sendNotification (Message notificationObject)
 			throws NotificationException
 	{
 		targetList.add(notificationObject);

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/message/Message.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/message/Message.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/message/Message.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -21,6 +21,7 @@
  * @author mark.little at jboss.com
  */
 
+import java.io.Serializable;
 import java.net.URI;
 
 /**
@@ -44,7 +45,7 @@
  *
  */
 
-public interface Message
+public interface Message extends Serializable
 {
 	/**
 	 * @return get the header component of the message.

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -22,11 +22,10 @@
 
 package org.jboss.soa.esb.notification;
 
-import java.io.Serializable;
-
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
 
 /**
  * Holds lists of NotificationTarget objects so that the NotificationHandler EJB
@@ -104,7 +103,7 @@
 	 * @throws NotificationException -
 	 *             use Exception.getMessage() at runtime
 	 */
-	public void sendNotification (Serializable p_o) throws NotificationException
+	public void sendNotification (Message message) throws NotificationException
 	{
 		try
 		{
@@ -112,7 +111,7 @@
 	
 			for (int i1 = 0; i1 < oaTgt.length; i1++)
 			{
-				oaTgt[i1].sendNotification(p_o);
+				oaTgt[i1].sendNotification(message);
 			}
 		}
 		catch (ConfigurationException ex)
@@ -151,7 +150,7 @@
 		return (null == m_sType) ? true : m_sType.startsWith("err");
 	}
 
-	public static void notifyAll (ConfigTree[] list, Serializable content)
+	public static void notifyAll (ConfigTree[] list, Message message)
 	{
 		for (ConfigTree tree : list)
 		{
@@ -162,7 +161,7 @@
 				{
 					NotificationTarget target = NotificationTarget
 							.fromParams(curr);
-					target.sendNotification(content);
+					target.sendNotification(message);
 				}
 				catch (Exception e)
 				{

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -26,6 +26,7 @@
 
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.util.ClassUtil;
 
 /**
@@ -53,7 +54,7 @@
 	 *             invoke Exception.getMessage() at runtime for this object
 	 * @see ConfigTree
 	 */
-	public abstract void sendNotification (java.io.Serializable p_o)
+	public abstract void sendNotification (Message message)
 			throws NotificationException;
 
 	private static final String NOTIF_PFX = NotificationTarget.class

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -1,8 +1,7 @@
 package org.jboss.soa.esb.notification;
 
-import java.io.Serializable;
-
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.util.Util;
 
 public class NotifyConsole extends NotificationTarget 
@@ -14,8 +13,12 @@
 	}
 	
 	@Override
-	public void sendNotification(Serializable content) throws NotificationException 
+	public void sendNotification(Message message) throws NotificationException 
 	{
+        String content=null;  
+        if (message.getBody().getContents()!=null) {
+            content = new String(message.getBody().getContents());
+        }
 		System.out.println
 			("ConsoleNotifier "+Util.getStamp()+"<"+content+">");
 	}

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -31,6 +31,7 @@
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.Email;
+import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.util.Util;
 
 /**
@@ -88,14 +89,17 @@
 	 *            Object - This object's toString() method will supply contents
 	 *            of mail message
 	 */
-	public void sendNotification (Serializable p_o) throws NotificationException
+	public void sendNotification (Message message) throws NotificationException
 	{
 		try
 		{
+            String content=null;
+            if (message.getBody().getContents()!=null) {
+                content = new String(message.getBody().getContents());
+            }
 			ConfigTree oP = m_oParms.cloneObj();
 			String sMsg = oP.getAttribute(Email.MESSAGE);
-			sMsg = ((null == sMsg) ? p_o.toString() : sMsg + "\n") + p_o
-					.toString();
+			sMsg = ((null == sMsg) ? content : sMsg + "\n") + content;
 			oP.setAttribute(Email.MESSAGE, sMsg);
 			sendEmailNotification(oP);
 		}

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -25,10 +25,11 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.ObjectOutputStream;
-import java.io.Serializable;
 import java.net.URI;
 
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
 
 /**
  * Write the notification contents into a list of files specified in the
@@ -141,23 +142,27 @@
 	 * @see NotifyFiles#setFiles(ConfigTree[])
 	 * @see NotifyFiles#m_oaOutF
 	 */
-	public void sendNotification (Serializable p_o) throws NotificationException
+	public void sendNotification (Message message) throws NotificationException
 	{
 		FileOutputStream fileOutStream = null;
-		
+        
 		for (NotificationFile notificationFile : m_oaOutF)
 		{
 			try
 			{
 				fileOutStream = new FileOutputStream(notificationFile,
 						notificationFile.append);
-				if (p_o instanceof String)
+				if (MessageType.JAVA_SERIALIZED.equals(message.getType()))
 				{
-					stringNotification(fileOutStream, (String) p_o);
+                    objectNotification(fileOutStream, message.getBody().getContents());
 				}
 				else
 				{
-					objectNotification(fileOutStream, p_o);
+                    String content=null;
+                    if (message.getBody().getContents()!=null) {
+                        content = new String(message.getBody().getContents());
+                    }
+                    stringNotification(fileOutStream, content);
 				}
 			}
 			catch (Exception e)

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -22,7 +22,6 @@
 
 package org.jboss.soa.esb.notification;
 
-import java.io.Serializable;
 import java.util.Iterator;
 import java.util.Properties;
 
@@ -38,6 +37,7 @@
 import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.format.MessageType;
 
 /**
  * Abstract class that defines the behaviour of NotifyQueues and NotifyTopics
@@ -178,20 +178,27 @@
 	 *            supply contents of JMS message
 	 * @see NotifyJMS#CHILD_MSG_PROP
 	 */
-	public void sendNotification (Serializable p_o) throws NotificationException
+	public void sendNotification (org.jboss.soa.esb.message.Message message) throws NotificationException
 	{
 		try
 		{
 			Message oMsg = null;
 	
-			if (p_o instanceof String)
+			if (MessageType.JAVA_SERIALIZED.equals(message.getType()))
 			{
-				oMsg = m_oSess.createTextMessage(p_o.toString());
+				oMsg = m_oSess.createObjectMessage(message.getBody().getContents());
 			}
 			else
 			{
-				oMsg = m_oSess.createObjectMessage((Serializable) p_o);
+                String content=null;
+                if (message.getBody().getContents()!=null) {
+                    content = new String(message.getBody().getContents());
+                }
+				oMsg = m_oSess.createTextMessage(content);
 			}
+            if (message.getBody().get("MessageId")!=null) {
+                oMsg.setJMSCorrelationID((String)message.getBody().get("MessageId"));
+            }
 	
 			for (Iterator II = m_oProps.keySet().iterator(); II.hasNext();)
 			{

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -29,6 +29,7 @@
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
 import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
+import org.jboss.soa.esb.message.Message;
 
 public class NotifySqlTable extends NotificationTarget
 {
@@ -120,9 +121,13 @@
 		return sbCol.append(")").append(sbPrm).append(")").toString();
 	} // __________________________________
 
-	public void sendNotification (java.io.Serializable p_o) throws NotificationException
+	public void sendNotification (Message message) throws NotificationException
 	{
-		m_oCols.setProperty(m_sDataCol, p_o.toString());
+        String content=null;
+        if (message.getBody().getContents()!=null) {
+            content = new String(message.getBody().getContents());
+        }
+		m_oCols.setProperty(m_sDataCol, content);
 		JdbcCleanConn oConn = null;
 		try
 		{

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -44,6 +44,11 @@
 {
 	
 	/**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
 	 * @return get the header component of the message.
 	 */
 	

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -27,6 +27,9 @@
 import junit.framework.TestCase;
 
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
 
 /**
  * NotificationList unit tests.
@@ -42,7 +45,9 @@
 		TestNotificationTarget1.messageList = messageList; 
 		TestNotificationTarget2.messageList = messageList;
 		
-		nList.sendNotification("tom");
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        message.getBody().setContents("tom".getBytes());
+		nList.sendNotification(message);
 		assertEquals(4, messageList.size());
 		assertEquals("message 1-tom", messageList.get(0));
 		assertEquals("message 2-tom", messageList.get(1));

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -28,6 +28,9 @@
 
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.Email;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
 
 /**
  * NotifyEmail unit tests.
@@ -44,7 +47,9 @@
 		emailMessageEl.setAttribute(Email.MESSAGE, "Hi there!!!");
 		
 		NotifyEmail ne = new TestNotifyEmail(emailMessageEl);
-		ne.sendNotification("Hello");
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        message.getBody().setContents("Hello".getBytes());
+		ne.sendNotification(message);
 	}
 	
 	private class TestNotifyEmail extends NotifyEmail {

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -27,6 +27,9 @@
 import junit.framework.TestCase;
 
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
 
 /**
  * NotifyFiles unit tests.
@@ -74,9 +77,11 @@
 		addFileConfig(rootEl, "file4.notif", null);
 		
 		// Create the class and call the sendNotification method twice...
-		notifyFiles = new NotifyFiles(rootEl);		
-		notifyFiles.sendNotification(obj);
-		notifyFiles.sendNotification(obj);
+		notifyFiles = new NotifyFiles(rootEl);
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+        message.getBody().setContents("object".getBytes());
+		notifyFiles.sendNotification(message);
+		notifyFiles.sendNotification(message);
 
 		// Test the files. Files 1 and 2 should be the same size. Files 3 and 4 should be the
 		// same size. Files 1 and 2 should be twice as big as files 3 and 4 because append was set

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -21,6 +21,8 @@
  */
 package org.jboss.soa.esb.notification;
 
+import java.nio.ByteBuffer;
+
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.ObjectMessage;
@@ -32,6 +34,8 @@
 import junit.framework.TestCase;
 
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
 import org.mockejb.jms.MockQueue;
 import org.mockejb.jms.MockTopic;
 import org.mockejb.jms.QueueConnectionFactoryImpl;
@@ -47,20 +51,24 @@
 	private MockQueue mockQueue2;
 	private NotifyQueues notifyQueues;
 	
-	protected void setUp() throws Exception {
-		MockContextFactory.setAsInitial();		
-		Context ctx = new InitialContext();
-		ctx.rebind(NotifyQueues.CONNECTION_FACTORY, new QueueConnectionFactoryImpl());
-		ctx.close();
-		ConfigTree rootEl = new ConfigTree("rootEl");
-
-		addMessagePropertyConfigs(rootEl);
-		addQueueConfig(rootEl, "queue1");
-		addQueueConfig(rootEl, "queue2");
-		mockQueue1 = createAndBindQueue("queue1");
-		mockQueue2 = createAndBindQueue("queue2");
-		
-		notifyQueues = new NotifyQueues(rootEl);
+	protected void setUp() {
+        try {
+    		MockContextFactory.setAsInitial();		
+    		Context ctx = new InitialContext();
+    		ctx.rebind(NotifyQueues.CONNECTION_FACTORY, new QueueConnectionFactoryImpl());
+    		ctx.close();
+    		ConfigTree rootEl = new ConfigTree("rootEl");
+    
+    		addMessagePropertyConfigs(rootEl);
+    		addQueueConfig(rootEl, "queue1");
+    		addQueueConfig(rootEl, "queue2");
+    		mockQueue1 = createAndBindQueue("queue1");
+    		mockQueue2 = createAndBindQueue("queue2");
+    		
+    		notifyQueues = new NotifyQueues(rootEl);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 	}
 
 	protected void tearDown() throws Exception {
@@ -69,17 +77,21 @@
 	}
 
 	public void test_StringObj() throws Exception {
-		notifyQueues.sendNotification("Hello");
+        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        message.getBody().setContents("Hello".getBytes());
+		notifyQueues.sendNotification(message);
 		
 		checkQueueTextMessage(mockQueue1, 0, "Hello");
 		checkQueueTextMessage(mockQueue2, 0, "Hello");
 	}
 	
 	public void test_NonStringObj() throws Exception {
-		notifyQueues.sendNotification(new Integer(123));
+        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+        message.getBody().setContents(((new Integer(123).toString().getBytes())));
+		notifyQueues.sendNotification(message);
 		
-		checkQueueObjectMessage(mockQueue1, 0, new Integer(123));
-		checkQueueObjectMessage(mockQueue2, 0, new Integer(123));
+		checkQueueObjectMessage(mockQueue1, 0, new Integer(123).toString().getBytes());
+		checkQueueObjectMessage(mockQueue2, 0, new Integer(123).toString().getBytes());
 	}
 
 	private void checkQueueTextMessage(MockQueue mockQueue, int messageIdx, String expectedText) throws JMSException {
@@ -94,7 +106,11 @@
 		assertTrue(mockQueue.getMessages().size() > messageIdx);		
 		Message message = mockQueue.getMessageAt(0);
 		assertTrue(message instanceof ObjectMessage);
-		assertEquals(expectedObj, ((ObjectMessage)message).getObject());
+        
+        ByteBuffer byteBuffer = ByteBuffer.wrap((byte[]) ((ObjectMessage) message).getObject());
+        ByteBuffer expectedByteBuffer = ByteBuffer.wrap((byte[]) (expectedObj));
+        
+		assertEquals(expectedByteBuffer, byteBuffer);
 		
 		// Note that the property bindings don't seem to work in this test i.e.
 		// it's returning null but should be returning the same as for a 

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -21,6 +21,8 @@
  */
 package org.jboss.soa.esb.notification;
 
+import java.nio.ByteBuffer;
+
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.ObjectMessage;
@@ -32,6 +34,8 @@
 import junit.framework.TestCase;
 
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
 import org.mockejb.jms.MockTopic;
 import org.mockejb.jms.TopicConnectionFactoryImpl;
 import org.mockejb.jndi.MockContextFactory;
@@ -68,17 +72,21 @@
 	}
 
 	public void test_StringObj() throws Exception {
-		notifyTopics.sendNotification("Hello");
+        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        message.getBody().setContents("Hello".getBytes());
+		notifyTopics.sendNotification(message);
 		
 		checkTopicTextMessage(mockTopic1, 0, "Hello");
 		checkTopicTextMessage(mockTopic2, 0, "Hello");
 	}
 	
 	public void test_NonStringObj() throws Exception {
-		notifyTopics.sendNotification(new Integer(123));
+        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+        message.getBody().setContents((new Integer(123).toString().getBytes()));
+		notifyTopics.sendNotification(message);
 		
-		checkTopicObjectMessage(mockTopic1, 0, new Integer(123));
-		checkTopicObjectMessage(mockTopic2, 0, new Integer(123));
+		checkTopicObjectMessage(mockTopic1, 0, new Integer(123).toString().getBytes());
+		checkTopicObjectMessage(mockTopic2, 0, new Integer(123).toString().getBytes());
 	}
 
 	private void checkTopicTextMessage(MockTopic mockTopic, int messageIdx, String expectedText) throws JMSException {
@@ -93,7 +101,9 @@
 		assertTrue(mockTopic.getMessages().size() > messageIdx);		
 		Message message = mockTopic.getMessageAt(0);
 		assertTrue(message instanceof ObjectMessage);
-		assertEquals(expectedObj, ((ObjectMessage)message).getObject());
+        ByteBuffer byteBuffer = ByteBuffer.wrap((byte[]) ((ObjectMessage) message).getObject());
+        ByteBuffer expectedByteBuffer = ByteBuffer.wrap((byte[]) (expectedObj));
+		assertEquals(expectedByteBuffer, byteBuffer);
 		
 		// Note that the property bindings don't seem to work in this test i.e.
 		// it's returning null but should be returning the same as for a 

Modified: labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java	2007-03-20 15:12:12 UTC (rev 10348)
+++ labs/jbossesb/branches/JBESB_4_0_MP1/product/core/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java	2007-03-20 16:09:43 UTC (rev 10349)
@@ -1,9 +1,9 @@
 package org.jboss.soa.esb.notification;
 
-import java.io.Serializable;
 import java.util.List;
 
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
 
 public class TestNotificationTarget1 extends NotificationTarget
 {
@@ -19,9 +19,10 @@
 	}
 
 	@Override
-	public void sendNotification (Serializable obj)
+	public void sendNotification (Message message)
 			throws NotificationException
 	{
-		messageList.add(config.getAttribute("message") + "-" + obj);
+        String content = new String(message.getBody().getContents());
+		messageList.add(config.getAttribute("message") + "-" + content);
 	}
 }




More information about the jboss-svn-commits mailing list