[jboss-svn-commits] JBL Code SVN: r6761 - labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Oct 12 16:11:04 EDT 2006
Author: jokum
Date: 2006-10-12 16:11:02 -0400 (Thu, 12 Oct 2006)
New Revision: 6761
Added:
labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners/HttpListenerConfig.xml
labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners/HttpListenerTest.java
Log:
HttpListener test added
Added: labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners/HttpListenerConfig.xml
===================================================================
--- labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners/HttpListenerConfig.xml 2006-10-12 18:05:45 UTC (rev 6760)
+++ labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners/HttpListenerConfig.xml 2006-10-12 20:11:02 UTC (rev 6761)
@@ -0,0 +1,20 @@
+<HttpListenerExample commandConnFactoryClass="ConnectionFactory" commandJndiType="jboss" commandJndiURL="localhost" commandIsTopic="false" messageSelector="gpMsgSelector='zambia'" commandJndiName="queue/A" parameterReloadSecs="20">
+ <HttpExample listenerClass="org.jboss.soa.esb.listeners.HttpListener" actions="CaptureMessage" maxThreads="1">
+ <NotificationList type="OK">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/JmsQueueListenerExample.notifOK" append="true"/>
+ </target>
+ </NotificationList>
+ <NotificationList type="err">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/JmsQueueListenerExample.notifErr" append="true"/>
+ </target>
+ </NotificationList>
+ </HttpExample>
+ <Actions>
+ <Action name="CaptureMessage" processor="MessageBox"/>
+ <ProcessorAliases>
+ <Alias name="MessageBox" class="org.jboss.soa.esb.listeners.MessageBox"/>
+ </ProcessorAliases>
+ </Actions>
+</HttpListenerExample>
Added: labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners/HttpListenerTest.java
===================================================================
--- labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners/HttpListenerTest.java 2006-10-12 18:05:45 UTC (rev 6760)
+++ labs/jbossesb/workspace/jokum/qa/junit/src/org/jboss/soa/esb/listeners/HttpListenerTest.java 2006-10-12 20:11:02 UTC (rev 6761)
@@ -0,0 +1,81 @@
+/*
+ * 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 junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.util.ClassUtils;
+import org.jboss.soa.esb.util.FileUtils;
+import org.jboss.soa.esb.util.JMSClientUtil;
+import org.jboss.soa.esb.util.ListenerUtils;
+
+/**
+ * QA Tests for the HttpListener.
+ *
+ */
+public class HttpListenerTest extends TestCase {
+
+ private ListenerUtils.ListenersManagerExecThread listenersMgr;
+
+ protected void setUp() throws Exception {
+ // Start the listener...
+ listenersMgr = ListenerUtils.startListeners(ClassUtils
+ .toResourcePath(getClass().getPackage())
+ + "/HttpListenerConfig.xml");
+ }
+
+ public void test() throws Throwable {
+ // There should have been no exceptions...
+ listenersMgr.assertNotInException();
+
+ MessageBox.messages.clear();
+
+ String locatorURI = "http://localhost:5400";
+ InvokerLocator locator = new InvokerLocator(locatorURI);
+
+ Client remotingClient = new Client(locator);
+ remotingClient.connect();
+
+ remotingClient.invoke("test string", null);
+
+ MessageBox.assertMessageCount(1, 10000);
+
+ // There should have been no exceptions...
+ listenersMgr.assertNotInException();
+
+ // Send a Shutdown message to the command queue...
+ JMSClientUtil
+ .sendMessageToQueue("shutdown", JMSClientUtil.QUEUE.A,
+ new KeyValuePair[] { new KeyValuePair("gpMsgSelector",
+ "zambia") });
+ }
+
+ protected void tearDown() throws Exception {
+ }
+
+}
More information about the jboss-svn-commits
mailing list