[jboss-svn-commits] JBL Code SVN: r14345 - labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Aug 18 05:40:11 EDT 2007
Author: mark.little at jboss.com
Date: 2007-08-18 05:40:11 -0400 (Sat, 18 Aug 2007)
New Revision: 14345
Added:
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/ExampleObject.java
Modified:
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java
Log:
Testing object transmission.
Added: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/ExampleObject.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/ExampleObject.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/ExampleObject.java 2007-08-18 09:40:11 UTC (rev 14345)
@@ -0,0 +1,39 @@
+/*
+ * 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.internal.soa.esb.couriers.tests;
+
+import java.io.Serializable;
+
+public class ExampleObject implements Serializable
+{
+ public static final long serialVersionUID = 0x0123L;
+
+ public ExampleObject (String n, int v)
+ {
+ name = n;
+ value = v;
+ }
+
+ public String name;
+ public int value;
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java 2007-08-18 06:10:51 UTC (rev 14344)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java 2007-08-18 09:40:11 UTC (rev 14345)
@@ -199,9 +199,6 @@
{
Assert.assertEquals(ex.getMessage(), errorMessage);
Assert.assertEquals(ex.getCode(), code);
-
- System.err.println("**got "+ex.getCause());
-
Assert.assertEquals(ex.getCause() instanceof IOException, true);
}
catch (CourierException ex)
@@ -264,7 +261,8 @@
Message msg = MessageFactory.getInstance().getMessage();
msg.getBody().setByteArray(contents.getBytes());
-
+ msg.getBody().add(new ExampleObject("hello", 1234));
+
Call call = new Call(toEpr);
final String uid = UUID.randomUUID().toString();
call.setMessageID(new URI(uid));
@@ -288,6 +286,15 @@
Assert.assertEquals(contents,back);
_logger.info("Contents of retrieved msg equal original text <"+back+">");
+ Object payload = retrieved.getBody().get();
+
+ Assert.assertEquals(payload instanceof ExampleObject, true);
+
+ ExampleObject payloadType = (ExampleObject) payload;
+
+ Assert.assertEquals(payloadType.name, "hello");
+ Assert.assertEquals(payloadType.value, 1234);
+
FileFilter ff = new FileFilter()
{ public boolean accept(File file)
{return file.getName().startsWith(uid); }
More information about the jboss-svn-commits
mailing list