[jboss-svn-commits] JBL Code SVN: r8493 - in labs/jbossesb/trunk/product: core/listeners/tests/src/org/jboss/soa/esb/listeners docs docs/config
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Dec 21 08:05:40 EST 2006
Author: mark.little at jboss.com
Date: 2006-12-21 08:05:29 -0500 (Thu, 21 Dec 2006)
New Revision: 8493
Added:
labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java
Removed:
labs/jbossesb/trunk/product/docs/config/ConfiguringHypersonicDatabase.pdf
labs/jbossesb/trunk/product/docs/config/ConfiguringHypersonicDatabase.sxw
labs/jbossesb/trunk/product/docs/config/DatabaseConfiguration.pdf
labs/jbossesb/trunk/product/docs/config/DatabaseConfiguration.sxw
Modified:
labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml
labs/jbossesb/trunk/product/docs/AdministrationGuide.odt
labs/jbossesb/trunk/product/docs/GettingStarted.sxw
labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
labs/jbossesb/trunk/product/docs/ReleaseNotes.odt
Log:
http://jira.jboss.com/jira/browse/JBESB-288
Added: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java 2006-12-21 13:00:05 UTC (rev 8492)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java 2006-12-21 13:05:29 UTC (rev 8493)
@@ -0,0 +1,143 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URI;
+import java.util.UUID;
+
+import junit.framework.Assert;
+
+import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class ListenerManagerJMSXntegrationTest extends ListenerManagerBaseTest
+{
+ public ListenerManagerJMSXntegrationTest ()
+ {
+ this("listenerJms.xml");
+ }
+
+ public ListenerManagerJMSXntegrationTest (String configFile)
+ {
+ _file = configFile;
+ }
+
+ public void setUp()
+ {
+ _logger.info("Writing temp files to " + TMP_DIR);
+
+ // delete this one just to make sure asserts take the new ones
+ _returnFile.delete();
+
+ // initialize registry
+ runBeforeAllTests();
+ }
+
+ public void testListener () throws Exception
+ {
+ _logger.info("___Test for FILENAME: " + _file
+ + " starting ____________________");
+
+ oneTest(_file);
+
+ _logger.info("___Test for FILENAME: " + _file
+ + " FINISHED ____________________");
+ }
+
+ protected void oneTest (String fileName) throws Exception
+ {
+ // Write wome messages to EPR obtained from configuration file
+ String configFile = getClass().getResource(fileName).getFile();
+ ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
+ configFile));
+ ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
+
+ EPR toEPR = ListenerUtil.assembleEpr(eprElement);
+
+ if (toEPR instanceof JMSEpr)
+ {
+ // good, just checking!
+ }
+ else
+ Assert.fail();
+
+ String THE_TEXT = "___Config=" + fileName + "___ Message Content ___";
+
+ int howMany = 10; // how many messages do you want to send before the
+ // listener comes up
+
+ DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
+
+ Message message = MessageFactory.getInstance().getMessage();
+ message.getHeader().setCall(new Call(toEPR));
+ message.getBody().setContents(THE_TEXT.getBytes());
+
+ for (int i1 = 0; i1 < howMany; i1++)
+ {
+ URI uri = new URI(UUID.randomUUID().toString());
+ message.getHeader().getCall().setMessageID(uri);
+ sender.deliver(message);
+ }
+
+ _returnFile.delete();
+
+ // launch listener manager in a child thread
+ final ConfigTree newTree = ConfigTree.fromInputStream(new FileInputStream(
+ configFile));
+
+ _manager = ListenerUtil.launchManager(newTree, true);
+ _logger.debug("Waiting for all child listeners to start");
+ _manager.waitUntilReady();
+ _logger.debug(" All child listeners ready");
+
+ // JUST FOR THIS TEST:
+ // Give your listener some time to process queued messages (see howMany
+ // above)
+ // Time allowed, and maxThreads in config file will impact how many
+ // messages
+ // will be processed, and how many will remain unprocessed
+
+ Thread.sleep(150 * howMany);
+
+ _logger.debug("going to EndRequested");
+ _manager.requestEnd();
+ _logger.debug("back from EndRequested");
+
+ Assert.assertEquals(THE_TEXT, stringFromFile(_returnFile));
+
+ _returnFile.delete();
+ }
+
+ protected String _file;
+
+}
Modified: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml 2006-12-21 13:00:05 UTC (rev 8492)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml 2006-12-21 13:05:29 UTC (rev 8493)
@@ -16,7 +16,7 @@
message-selector="messSelector='testJmsGateway'"
/>
- <action class="org.jboss.soa.esb.listeners.ListenerManagerUnitTest$MockMessageAwareAction" process="writeToDisk" />
+ <action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="writeToDisk" />
<action class="org.jboss.soa.esb.actions.Notifier" okMethod="notifyOK">
<NotificationList type="OK">
<target class="NotifyConsole" />
Modified: labs/jbossesb/trunk/product/docs/AdministrationGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/GettingStarted.sxw
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/trunk/product/docs/ReleaseNotes.odt
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/docs/config/ConfiguringHypersonicDatabase.pdf
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/docs/config/ConfiguringHypersonicDatabase.sxw
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/docs/config/DatabaseConfiguration.pdf
===================================================================
(Binary files differ)
Deleted: labs/jbossesb/trunk/product/docs/config/DatabaseConfiguration.sxw
===================================================================
(Binary files differ)
More information about the jboss-svn-commits
mailing list