[jboss-svn-commits] JBL Code SVN: r7133 - in labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb: listeners listeners/old util
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Oct 26 00:28:32 EDT 2006
Author: estebanschifman
Date: 2006-10-26 00:28:24 -0400 (Thu, 26 Oct 2006)
New Revision: 7133
Added:
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig2.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig3.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig4.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig5.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig6.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfigX.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/DirectoryPollerConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/DirectoryPollerTest.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/JmsQueueListenerConfig.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/JmsQueueListenerTest.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/ListenerManagerTest.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/MessageBox.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/MultiPollerConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPollerConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPollerTest.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/SQLTablePollerConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/SQLTablePollerTest.java
Removed:
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig2.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig3.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig4.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig5.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig6.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfigX.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerTest.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerConfig.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerTest.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/ListenerManagerTest.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MessageBox.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MultiPollerConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerTest.java
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerConfig1.xml
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerTest.java
Modified:
labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/util/ListenerUtils.java
Log:
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig1.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig1.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,41 +0,0 @@
-<!-- Invalid commandConnFactoryClass -->
-
-<FileCopierExample
- commandConnFactoryClass="X"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actions="FileCopy1, FileCopy2"
- pollLatencySecs="2"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".WORKING"
- errorSuffix=".PROCERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- </PollDirectoryExample>
-
- <Actions>
- <Action name="FileCopy1" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromFirst"/>
- </Action>
- <Action name="FileCopy2" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromSecond"/>
- </Action>
-
- <ProcessorAliases>
- <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
- </ProcessorAliases>
- </Actions>
-
-</FileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig2.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig2.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig2.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,41 +0,0 @@
-<!-- Invalid commandJndiType -->
-
-<FileCopierExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="X"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actions="FileCopy1, FileCopy2"
- pollLatencySecs="2"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".WORKING"
- errorSuffix=".PROCERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- </PollDirectoryExample>
-
- <Actions>
- <Action name="FileCopy1" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromFirst"/>
- </Action>
- <Action name="FileCopy2" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromSecond"/>
- </Action>
-
- <ProcessorAliases>
- <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
- </ProcessorAliases>
- </Actions>
-
-</FileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig3.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig3.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig3.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,41 +0,0 @@
-<!-- Invalid commandJndiURL -->
-
-<FileCopierExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="X"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actions="FileCopy1, FileCopy2"
- pollLatencySecs="2"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".WORKING"
- errorSuffix=".PROCERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- </PollDirectoryExample>
-
- <Actions>
- <Action name="FileCopy1" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromFirst"/>
- </Action>
- <Action name="FileCopy2" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromSecond"/>
- </Action>
-
- <ProcessorAliases>
- <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
- </ProcessorAliases>
- </Actions>
-
-</FileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig4.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig4.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig4.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,41 +0,0 @@
-<!-- Invalid commandIsTopic -->
-
-<FileCopierExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="X"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actions="FileCopy1, FileCopy2"
- pollLatencySecs="2"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".WORKING"
- errorSuffix=".PROCERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- </PollDirectoryExample>
-
- <Actions>
- <Action name="FileCopy1" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromFirst"/>
- </Action>
- <Action name="FileCopy2" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromSecond"/>
- </Action>
-
- <ProcessorAliases>
- <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
- </ProcessorAliases>
- </Actions>
-
-</FileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig5.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig5.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig5.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,41 +0,0 @@
-<!-- Invalid messageSelector -->
-
-<FileCopierExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="X"
- commandJndiName="queue/A"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actions="FileCopy1, FileCopy2"
- pollLatencySecs="2"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".WORKING"
- errorSuffix=".PROCERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- </PollDirectoryExample>
-
- <Actions>
- <Action name="FileCopy1" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromFirst"/>
- </Action>
- <Action name="FileCopy2" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromSecond"/>
- </Action>
-
- <ProcessorAliases>
- <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
- </ProcessorAliases>
- </Actions>
-
-</FileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig6.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig6.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig6.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,41 +0,0 @@
-<!-- Invalid commandJndiName -->
-
-<FileCopierExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="X"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actions="FileCopy1, FileCopy2"
- pollLatencySecs="2"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".WORKING"
- errorSuffix=".PROCERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- </PollDirectoryExample>
-
- <Actions>
- <Action name="FileCopy1" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromFirst"/>
- </Action>
- <Action name="FileCopy2" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromSecond"/>
- </Action>
-
- <ProcessorAliases>
- <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
- </ProcessorAliases>
- </Actions>
-
-</FileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfigX.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfigX.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfigX.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,34 +0,0 @@
-<!-- Invalid ? -->
-
-<FileCopierExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actionClass="org.jboss.soa.esb.actions.routing.FileCopier"
- pollLatencySecs="2"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".COPYING"
- errorSuffix=".COPYERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- <CopyTo
- copyToDirURI="@qa.build@/copiedTo"
- copyToSuffix=".outFromFirst"
- />
- <CopyTo
- copyToDirURI="@qa.build@/copiedTo"
- copyToSuffix=".outFromSecond"
- />
- </PollDirectoryExample>
-
-</FileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerConfig1.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerConfig1.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,39 +0,0 @@
-<FileCopierExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actions="FileCopy1, FileCopy2"
- pollLatencySecs="2"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".WORKING"
- errorSuffix=".PROCERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- </PollDirectoryExample>
-
- <Actions>
- <Action name="FileCopy1" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromFirst"/>
- </Action>
- <Action name="FileCopy2" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromSecond"/>
- </Action>
-
- <ProcessorAliases>
- <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
- </ProcessorAliases>
- </Actions>
-
-</FileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerTest.java
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerTest.java 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,85 +0,0 @@
-/*
- * 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.TestCase;
-
-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;
-import org.jboss.soa.esb.util.ListenerUtils.ListenersManagerExecThread;
-
-/**
- * QA Tests for the DirectoryPoller.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class DirectoryPollerTest extends TestCase {
-
- private ListenersManagerExecThread listenersMgr;
- File inputDir, inputDoneDir, copiedTo;
-
- protected void setUp() throws Exception {
- // Create the directories required by the test...
- inputDir = FileUtils.createTestDir("inputDir");
- inputDoneDir = FileUtils.createTestDir("inputDoneDir");
- copiedTo = FileUtils.createTestDir("copiedTo");
-
- // Start the listener...
- listenersMgr = ListenerUtils.startListeners(ClassUtils.toResourcePath(getClass().getPackage()) + "/DirectoryPollerConfig1.xml");
- }
-
- public void test() throws InterruptedException {
- // Write the input file...
- FileUtils.writeDataToFile(new File(inputDir, "infile1.inp"), "Great goal by Maradona!!".getBytes());
- // Make sure the input gets processed to the "inputDoneDir"
- FileUtils.assertFileExists(new File(inputDoneDir, "infile1.inp.DONE"), 10000);
- // Make sure the input gets removed from the "inputDir"...
- FileUtils.assertFileDoesntExists(new File(inputDir, "infile1.inp"), 10000);
- // Make sure the notifications appear in the "copiedTo" dir...
- FileUtils.assertFileExists(new File(copiedTo, "infile1.inp.outFromFirst"), 10000);
- FileUtils.assertFileExists(new File(copiedTo, "infile1.inp.outFromSecond"), 10000);
-
- // Make sure there's no open file handles on the files created/copied by the ESB...
- FileUtils.assertCanDelete(new File(inputDoneDir, "infile1.inp.DONE"), 10000);
- FileUtils.assertCanDelete(new File(copiedTo, "infile1.inp.outFromFirst"), 10000);
- FileUtils.assertCanDelete(new File(copiedTo, "infile1.inp.outFromSecond"), 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", "test")});
- // Make sure the Shutdown was successful...
- listenersMgr.assertShutdownOK(10000);
- }
-
- protected void tearDown() throws Exception {
- // Remove the directories required by the test...
- FileUtils.assertCanDelete(inputDir, 10000);
- FileUtils.assertCanDelete(inputDoneDir, 10000);
- FileUtils.assertCanDelete(copiedTo, 10000);
- }
-}
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerConfig.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerConfig.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerConfig.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,47 +0,0 @@
-<JmsListenerExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='zambia'"
- commandJndiName="queue/A"
- parameterReloadSecs="20"
->
-
-
- <QueueExample
- listenerClass="org.jboss.soa.esb.listeners.JmsQueueListener"
- actions="CaptureMessage"
- maxThreads="1"
- queueConnFactoryClass="ConnectionFactory"
- listenJndiType="jboss"
- listenJndiURL="localhost"
- listenQueue="queue/A"
- listenMsgSelector="listener='zambia'"
- >
- <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>
- </QueueExample>
-
- <Actions>
- <Action name="CaptureMessage" processor="MessageBox" />
-
- <ProcessorAliases>
- <Alias name="MessageBox" class="org.jboss.soa.esb.listeners.MessageBox" />
- </ProcessorAliases>
- </Actions>
-
-</JmsListenerExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerTest.java
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerTest.java 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,81 +0,0 @@
-/*
-* 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.TestCase;
-
-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 JmsQueueListener.
- *
- */
-public class JmsQueueListenerTest extends TestCase {
-
- private ListenerUtils.ListenersManagerExecThread listenersMgr;
- File notifyDir;
-
- protected void setUp() throws Exception {
- // Create the directories required by the test...
- notifyDir = FileUtils.createTestDir("notifyDir");
- // Start the listener...
- listenersMgr = ListenerUtils.startListeners(ClassUtils.toResourcePath(getClass().getPackage()) + "/JmsQueueListenerConfig.xml");
- }
-
- public void test() throws InterruptedException {
- // There should have been no exceptions...
- listenersMgr.assertNotInException();
-
- MessageBox.messages.clear();
-
- // Send a request via jms
- JMSClientUtil.sendMessageToQueue("hello is anyone there?", JMSClientUtil.QUEUE.A, new KeyValuePair[] {new KeyValuePair("listener", "zambia")});
-
- // Check did the messagebox recevive the message from the JMSListener...
- MessageBox.assertMessageCount(1, 10000);
-
- // Make sure the notifications appear in the "notifyDir" dir...
- FileUtils.assertFileExists(new File(notifyDir, "JmsQueueListenerExample.notifOK"), 10000);
- FileUtils.assertCanDelete(new File(notifyDir, "JmsQueueListenerExample.notifOK"), 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")});
- listenersMgr.assertShutdownOK(10000);
- }
-
- protected void tearDown() throws Exception {
- // Remove the directories required by the test...
- FileUtils.assertCanDelete(notifyDir, 10000);
- }
-
-
-
-}
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/ListenerManagerTest.java
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/ListenerManagerTest.java 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/ListenerManagerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,75 +0,0 @@
-/*
- * 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 javax.naming.CommunicationException;
-import javax.naming.NameNotFoundException;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.command.CommandQueueException;
-import org.jboss.soa.esb.util.ClassUtils;
-import org.jboss.soa.esb.util.ListenerUtils;
-
-/**
- * QA tests for the Listener Manager class - otherwise known as the {@link org.jboss.soa.esb.listeners.GpListener}.
- * <p/>
- * General tests around the command queue, bad configurations etc.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ListenerManagerTest extends TestCase {
-
- protected void setUp() throws Exception {
- }
-
- public void test_BadConfigurations() throws Exception {
- test_BadConfigurations("BadConfig1.xml", "commandConnFactoryClass", NameNotFoundException.class); // REVIEW: Usability - Not getting a specific error message here. How about a "BadListenerConfigurationException"??
- test_BadConfigurations("BadConfig2.xml", "commandJndiType", IllegalArgumentException.class); // REVIEW: Usability - Not getting a specific error message here. How about a "BadListenerConfigurationException"??
- test_BadConfigurations("BadConfig3.xml", "commandJndiURL", CommunicationException.class); // REVIEW: Usability - Not getting a specific error message here. How about a "BadListenerConfigurationException"??
- test_BadConfigurations("BadConfig4.xml", "commandIsTopic", null); // BUG: Exception getting swallowed here!!! Should only accept boolean values.
- test_BadConfigurations("BadConfig5.xml", "messageSelector", null); // BUG: Exception getting swallowed here!!! Sould only accept NV Pairs.
- test_BadConfigurations("BadConfig6.xml", "commandJndiName", NameNotFoundException.class); // REVIEW: Usability - Not getting a specific error message here. How about a "BadListenerConfigurationException"??
- }
-
- public void test_BadConfigurations(String config, String paramName, Class expectedException) throws Exception {
- try {
- ListenerUtils.createGpListener(ClassUtils.toResourcePath(getClass().getPackage()) + "/" + config);
- if(expectedException != null) {
- fail("[Param '" + paramName + "' test] No exception being thrown for bad param config!! Expected Exception: " + expectedException.getName());
- }
- } catch(AssertionFailedError e) {
- throw e;
- } catch(CommandQueueException e) {
- if(expectedException == null) {
- fail("[Param '" + paramName + "' test] Unexpected Exception: " + e.getClass().getName() + ": " + e.getMessage());
- } else if(!expectedException.isInstance(e) && !expectedException.isInstance(e.getCause())) {
- fail("[Param '" + paramName + "' test] Expected Exception: " + expectedException.getName() + ". Got " + e.getClass().getName() + ": " + e.getMessage());
- }
- // Is the expected Exception!!
- }
- }
-
- protected void tearDown() throws Exception {
- }
-}
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MessageBox.java
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MessageBox.java 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MessageBox.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,91 +0,0 @@
-/*
- * 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.Serializable;
-import java.util.List;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionProcessor;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.message.Message;
-
-/**
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class MessageBox implements ActionProcessor {
-
- private static Logger logger = Logger.getLogger(MessageBox.class);
- public static List<Object> messages = new Vector<Object>();
-
- /* (non-Javadoc)
- * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
- */
- public Message process(Message message) throws ActionProcessingException {
- Object oCurr = ActionUtils.getTaskObject(message);
- if (null==oCurr)
- oCurr="<null>";
- logger.info("MessageBox received message: " + message);
- messages.add(oCurr);
- return message;
- }
-
- public static void assertMessageCount(int count, long maxWait) {
- long endTime = System.currentTimeMillis() + maxWait;
-
- while(System.currentTimeMillis() < endTime) {
- if(messages.size() == count) {
- return;
- }
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- logger.error("Thread interupt...", e);
- }
- }
- String errorMsg = "MessageBox failed to receive " + count + " messages. Message count = " + messages.size() + ". Waited for " + maxWait + "ms.";
- logger.error(errorMsg);
- TestCase.fail(errorMsg);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.soa.esb.actions.ActionProcessor#getOkNotification(java.lang.Object)
- */
- public Serializable getOkNotification(Message message) {
- return "OK" + ActionUtils.getTaskObject(message);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.soa.esb.actions.ActionProcessor#getErrorNotification(java.lang.Object)
- */
- public Serializable getErrorNotification(Message message) {
- return "Error" + ActionUtils.getTaskObject(message);
- }
-
-}
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MultiPollerConfig1.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MultiPollerConfig1.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MultiPollerConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,100 +0,0 @@
-<LoanBrokerExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
- parameterReloadSecs="20"
->
- <PollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.DirectoryPoller"
- actionClass="org.jboss.soa.esb.actions.templates.MockFileAction"
- pollLatencySecs="5"
- maxThreads="2"
- inputDirURI="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".INPROC"
- errorDirURI="@qa.build@/errorDir"
- errorSuffix=".ERR"
- postDirURI="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- <NotificationList type="OK">
- <target class="NotifyFiles">
- <file URI="@qa.build@/notifyDir/GpListenerExample.notifOK"
- append="true"
- />
- </target>
- </NotificationList>
-
- <NotificationList type="err">
- <target class="NotifyFiles">
- <file URI="@qa.build@/notifyDir/GpListenerExample.notifErr"
- append="true"
- />
- </target>
- </NotificationList>
- </PollDirectoryExample>
-
- <PollSqlTableExample
- listenerClass="org.jboss.soa.esb.listeners.SqlTablePoller"
- actionClass="org.jboss.soa.esb.actions.templates.MockSqlRowAction"
- pollLatencySecs="2"
- maxThreads="2"
- connection-url="jdbc:postgresql://lavasca:5432/rosetta"
- driver-class="org.postgresql.Driver"
- user-name="postgres"
- password=""
- tableName="test_notif_table"
- selectFields="oid,ref,msg"
- keyFields="oid,ref"
- inProcessField="status"
- whereCondition="src='pepe'"
- >
- <NotificationList type="OK">
- <target class="NotifyFiles">
- <file URI="@qa.build@/notifyDir/GpListenerExample.notifOK"
- append="true"
- />
- </target>
- </NotificationList>
-
- <NotificationList type="err">
- <target class="NotifyFiles">
- <file URI="@qa.build@/notifyDir/GpListenerExample.notifErr"
- append="true"
- />
- </target>
- </NotificationList>
- </PollSqlTableExample>
-
- <ListenJmsQueueExample
- listenerClass="org.jboss.soa.esb.listeners.JmsQueueListener"
- actionClass="org.jboss.soa.esb.actions.templates.MockAction"
- maxThreads="1"
- queueConnFactoryClass="ConnectionFactory"
- listenJndiType="jboss"
- listenJndiURL="localhost"
- listenQueue="queue/A"
- listenMsgSelector="listener='maradona'"
- >
- <NotificationList type="OK">
- <target class="NotifyFiles">
- <file URI="@qa.build@/notifyDir/GpListenerExample.notifOK"
- append="true"
- />
- </target>
- </NotificationList>
-
- <NotificationList type="err">
- <target class="NotifyFiles">
- <file URI="@qa.build@/notifyDir/GpListenerExample.notifErr"
- append="true"
- />
- </target>
- </NotificationList>
- </ListenJmsQueueExample>
-
-</LoanBrokerExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerConfig1.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerConfig1.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,64 +0,0 @@
- <!--
-
- Params from RemoteDirectoryPoller
- public static final String FILE_INPUT_DIR = "inputDir";
- public static final String FILE_INPUT_SFX = "inputSuffix";
- public static final String FILE_WORK_SFX = "workSuffix";
- public static final String FILE_ERROR_DIR = "errorDir";
- public static final String FILE_ERROR_SFX = "errorSuffix";
- public static final String FILE_POST_DIR = "postDir";
- public static final String FILE_POST_SFX = "postSuffix";
- public static final String FILE_POST_DEL = "postDelete";
-
- Params from FtpClientUtil
- public static final String PARMS_FTP_SERVER = "ftpServer";
- public static final String PARMS_USER = "ftpUser";
- public static final String PARMS_PASSWD = "ftpPassword";
- public static final String PARMS_PORT = "ftpPort";
- public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
- public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
- public static final String PARMS_ASCII = "ftpAscii";
- public static final String PARMS_PASSIVE = "ftpPassive";
-
- -->
-
- <RemoteFileCopierExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
->
- <RemotePollDirectoryExample
- listenerClass="org.jboss.soa.esb.listeners.RemoteDirectoryPoller"
- actions="RemoteFileCopy1, RemoteFileCopy2"
- pollLatencySecs="2"
- maxThreads="2"
- inputDir="@qa.build@/inputDir"
- inputSuffix=".inp"
- workSuffix=".WORKING"
- errorSuffix=".PROCERR"
- postDir="@qa.build@/inputDoneDir"
- inputDoneDir="@qa.build@/inputDoneDir"
- postSuffix=".DONE"
- postDelete="n"
- >
- </RemotePollDirectoryExample>
-
- <Actions>
- <Action name="RemoteFileCopy1" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromFirst"/>
- </Action>
- <Action name="RemoteFileCopy2" processor="FileCopier">
- <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
- <property name="copyToSuffix" value=".outFromSecond"/>
- </Action>
-
- <ProcessorAliases>
- <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
- </ProcessorAliases>
- </Actions>
-
-</RemoteFileCopierExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerTest.java
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerTest.java 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,74 +0,0 @@
-/**
- *
- */
-package org.jboss.soa.esb.listeners;
-
-import static org.junit.Assert.fail;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-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;
-import org.jboss.soa.esb.util.ListenerUtils.ListenersManagerExecThread;
-
-/**
- * @author b_georges
- *
- */
-public class RemoteDirectoryPollerTest extends TestCase {
-
- private Logger log = Logger.getLogger(this.getClass());
-
- private ListenersManagerExecThread listenersMgr;
-
- File getDir, putDir;
-
- /**
- * @throws java.lang.Exception
- */
- public void setUp() throws Exception {
- log.debug("====== setUp ==========");
- // Create the directories required by the test...
- getDir = FileUtils.createTestDir("getDir");
- putDir = FileUtils.createTestDir("putdir");
-
- // Start the listener...
- listenersMgr = ListenerUtils.startListeners(ClassUtils
- .toResourcePath(getClass().getPackage())
- + "/RemoteDirectoryPollerConfig1.xml");
- }
-
-
- public void test() throws InterruptedException {
- log.debug("====== test ==========");
- // put a file to the SFTP Server
- // get the file from the SFTP Server
- // the rest can be processed by the DirectoryPoller
- }
-
- /**
- * Test method for {@link org.jboss.soa.esb.listeners.RemoteDirectoryPoller#close()}.
- */
- public void testClose() {
- log.debug("====== testClose ==========");
- fail("Not yet implemented"); // TODO
- }
-
-
- /**
- * @throws java.lang.Exception
- */
- public void tearDown() throws Exception {
- log.debug("====== tearDown ==========");
- FileUtils.assertCanDelete(getDir, 10000);
- FileUtils.assertCanDelete(putDir, 10000);
- }
-
-
-}
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerConfig1.xml
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerConfig1.xml 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,54 +0,0 @@
-<LoanBrokerExample
- commandConnFactoryClass="ConnectionFactory"
- commandJndiType="jboss"
- commandJndiURL="localhost"
- commandIsTopic="false"
- messageSelector="gpMsgSelector='test'"
- commandJndiName="queue/A"
->
-
- <PollSqlTableExample
- listenerClass="org.jboss.soa.esb.listeners.SqlTablePoller"
- actions="CaptureMessage, ProcessMessageFromSQL"
- pollLatencySecs="2"
- maxThreads="2"
- connection-url="@db.url@"
- driver-class="@db.driver@"
- user-name="@db.user@"
- password="@db.password@"
-
- tableName="test_poll_table"
- selectFields="ref,msg,val2"
- keyFields="ref"
- inProcessField="status"
- whereCondition="src='pepe'"
- >
- <NotificationList type="OK">
- <target class="NotifyFiles">
- <file URI="@qa.build@/notifyDir/GpListenerExample.notifOK"
- append="true"
- />
- </target>
- </NotificationList>
-
- <NotificationList type="err">
- <target class="NotifyFiles">
- <file URI="@qa.build@/notifyDir/GpListenerExample.notifErr"
- append="true"
- />
- </target>
- </NotificationList>
-
- <Actions>
- <Action name="CaptureMessage" processor="MessageBox" />
- <Action name="ProcessMessageFromSQL" processor="SQLProcessor"/>
-
- <ProcessorAliases>
- <Alias name="MessageBox" class="org.jboss.soa.esb.listeners.MessageBox" />
- <Alias name="SQLProcessor" class="org.jboss.soa.esb.actions.templates.MockSqlRowAction" />
- </ProcessorAliases>
- </Actions>
-
- </PollSqlTableExample>
-
-</LoanBrokerExample>
Deleted: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerTest.java
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerTest.java 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -1,105 +0,0 @@
-/*
- * 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.sql.SQLException;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.actions.templates.MockSqlRowAction;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.util.ClassUtils;
-import org.jboss.soa.esb.util.DbUtils;
-import org.jboss.soa.esb.util.FileUtils;
-import org.jboss.soa.esb.util.JMSClientUtil;
-import org.jboss.soa.esb.util.ListenerUtils;
-import org.jboss.soa.esb.util.ListenerUtils.ListenersManagerExecThread;
-
-/**
- * QA tests for the SQLTablePoller.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class SQLTablePollerTest extends TestCase {
-
- private ListenersManagerExecThread listenersMgr;
- File notifyDir;
-
- protected void setUp() throws Exception {
- // Create the directories required by the test...
- notifyDir = FileUtils.createTestDir("notifyDir");
-
- createTable();
-
- // Start the listener...
- listenersMgr = ListenerUtils.startListeners(ClassUtils.toResourcePath(getClass().getPackage()) + "/SQLTablePollerConfig1.xml");
- }
-
- public void test() throws InterruptedException, SQLException {
- MessageBox.messages.clear();
- MockSqlRowAction.params.clear();
-
- // Insert the row into the table and wait for the status to go to "P" (Pending) to "D" (Done)...
- int insertCount = DbUtils.executeUpdate("insert into test_poll_table values ('pepe','ref1','An arbitrary message', '1111111111','2222222222','P')");
-
- assertEquals("Failed to create row in table.", 1, insertCount);
-
- // FIXME: This assertion is broken - prob something wrong with the listener config - it's status isn't changing to "D" (Done)
- DbUtils.assertNonEmptyResultSet("select * from test_poll_table where src='pepe' and ref='ref1' and status='D'", 10000);
-
- // Check did the messagebox recevive the message from the JMSListener...
- MessageBox.assertMessageCount(1, 10000);
- assertEquals(1, MockSqlRowAction.params.size());
- Map pollResult = MockSqlRowAction.params.get(0);
-
- // Check the rowset values...
- assertEquals("ref1", pollResult.get("ref"));
- assertEquals("An arbitrary message", pollResult.get("msg"));
- assertEquals("2222222222", pollResult.get("val2"));
-
- // Make sure the notifications appear in the "notifyDir" dir...
- FileUtils.assertFileExists(new File(notifyDir, "GpListenerExample.notifOK"), 10000);
- FileUtils.assertCanDelete(new File(notifyDir, "GpListenerExample.notifOK"), 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", "test")});
- listenersMgr.assertShutdownOK(10000);
- }
-
- protected void tearDown() throws Exception {
- dropTable();
-
- // Remove the directories required by the test...
- FileUtils.assertCanDelete(notifyDir, 10000);
- }
-
- private void createTable() {
- DbUtils.execute("CREATE TABLE test_poll_table (src text, ref text, msg text, val1 text, val2 text, status text)");
- }
- private void dropTable() {
- DbUtils.execute("DROP TABLE test_poll_table");
- }
-}
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig1.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig1.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig1.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,41 @@
+<!-- Invalid commandConnFactoryClass -->
+
+<FileCopierExample
+ commandConnFactoryClass="X"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actions="FileCopy1, FileCopy2"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".WORKING"
+ errorSuffix=".PROCERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ </PollDirectoryExample>
+
+ <Actions>
+ <Action name="FileCopy1" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromFirst"/>
+ </Action>
+ <Action name="FileCopy2" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromSecond"/>
+ </Action>
+
+ <ProcessorAliases>
+ <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
+ </ProcessorAliases>
+ </Actions>
+
+</FileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig2.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig2.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig2.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig2.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,41 @@
+<!-- Invalid commandJndiType -->
+
+<FileCopierExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="X"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actions="FileCopy1, FileCopy2"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".WORKING"
+ errorSuffix=".PROCERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ </PollDirectoryExample>
+
+ <Actions>
+ <Action name="FileCopy1" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromFirst"/>
+ </Action>
+ <Action name="FileCopy2" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromSecond"/>
+ </Action>
+
+ <ProcessorAliases>
+ <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
+ </ProcessorAliases>
+ </Actions>
+
+</FileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig3.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig3.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig3.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig3.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,41 @@
+<!-- Invalid commandJndiURL -->
+
+<FileCopierExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="X"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actions="FileCopy1, FileCopy2"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".WORKING"
+ errorSuffix=".PROCERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ </PollDirectoryExample>
+
+ <Actions>
+ <Action name="FileCopy1" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromFirst"/>
+ </Action>
+ <Action name="FileCopy2" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromSecond"/>
+ </Action>
+
+ <ProcessorAliases>
+ <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
+ </ProcessorAliases>
+ </Actions>
+
+</FileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig4.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig4.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig4.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig4.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,41 @@
+<!-- Invalid commandIsTopic -->
+
+<FileCopierExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="X"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actions="FileCopy1, FileCopy2"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".WORKING"
+ errorSuffix=".PROCERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ </PollDirectoryExample>
+
+ <Actions>
+ <Action name="FileCopy1" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromFirst"/>
+ </Action>
+ <Action name="FileCopy2" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromSecond"/>
+ </Action>
+
+ <ProcessorAliases>
+ <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
+ </ProcessorAliases>
+ </Actions>
+
+</FileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig5.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig5.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig5.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig5.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,41 @@
+<!-- Invalid messageSelector -->
+
+<FileCopierExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="X"
+ commandJndiName="queue/A"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actions="FileCopy1, FileCopy2"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".WORKING"
+ errorSuffix=".PROCERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ </PollDirectoryExample>
+
+ <Actions>
+ <Action name="FileCopy1" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromFirst"/>
+ </Action>
+ <Action name="FileCopy2" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromSecond"/>
+ </Action>
+
+ <ProcessorAliases>
+ <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
+ </ProcessorAliases>
+ </Actions>
+
+</FileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig6.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig6.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfig6.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfig6.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,41 @@
+<!-- Invalid commandJndiName -->
+
+<FileCopierExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="X"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actions="FileCopy1, FileCopy2"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".WORKING"
+ errorSuffix=".PROCERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ </PollDirectoryExample>
+
+ <Actions>
+ <Action name="FileCopy1" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromFirst"/>
+ </Action>
+ <Action name="FileCopy2" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromSecond"/>
+ </Action>
+
+ <ProcessorAliases>
+ <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
+ </ProcessorAliases>
+ </Actions>
+
+</FileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfigX.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfigX.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/BadConfigX.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/BadConfigX.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,34 @@
+<!-- Invalid ? -->
+
+<FileCopierExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actionClass="org.jboss.soa.esb.actions.routing.FileCopier"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".COPYING"
+ errorSuffix=".COPYERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ <CopyTo
+ copyToDirURI="@qa.build@/copiedTo"
+ copyToSuffix=".outFromFirst"
+ />
+ <CopyTo
+ copyToDirURI="@qa.build@/copiedTo"
+ copyToSuffix=".outFromSecond"
+ />
+ </PollDirectoryExample>
+
+</FileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/DirectoryPollerConfig1.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerConfig1.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerConfig1.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/DirectoryPollerConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,39 @@
+<FileCopierExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actions="FileCopy1, FileCopy2"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".WORKING"
+ errorSuffix=".PROCERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ </PollDirectoryExample>
+
+ <Actions>
+ <Action name="FileCopy1" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromFirst"/>
+ </Action>
+ <Action name="FileCopy2" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromSecond"/>
+ </Action>
+
+ <ProcessorAliases>
+ <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
+ </ProcessorAliases>
+ </Actions>
+
+</FileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/DirectoryPollerTest.java (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerTest.java 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/DirectoryPollerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,85 @@
+/*
+ * 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.old;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+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;
+import org.jboss.soa.esb.util.ListenerUtils.ListenersManagerExecThread;
+
+/**
+ * QA Tests for the DirectoryPoller.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class DirectoryPollerTest extends TestCase {
+
+ private ListenersManagerExecThread listenersMgr;
+ File inputDir, inputDoneDir, copiedTo;
+
+ protected void setUp() throws Exception {
+ // Create the directories required by the test...
+ inputDir = FileUtils.createTestDir("inputDir");
+ inputDoneDir = FileUtils.createTestDir("inputDoneDir");
+ copiedTo = FileUtils.createTestDir("copiedTo");
+
+ // Start the listener...
+ listenersMgr = ListenerUtils.startListeners(ClassUtils.toResourcePath(getClass().getPackage()) + "/DirectoryPollerConfig1.xml");
+ }
+
+ public void test() throws InterruptedException {
+ // Write the input file...
+ FileUtils.writeDataToFile(new File(inputDir, "infile1.inp"), "Great goal by Maradona!!".getBytes());
+ // Make sure the input gets processed to the "inputDoneDir"
+ FileUtils.assertFileExists(new File(inputDoneDir, "infile1.inp.DONE"), 10000);
+ // Make sure the input gets removed from the "inputDir"...
+ FileUtils.assertFileDoesntExists(new File(inputDir, "infile1.inp"), 10000);
+ // Make sure the notifications appear in the "copiedTo" dir...
+ FileUtils.assertFileExists(new File(copiedTo, "infile1.inp.outFromFirst"), 10000);
+ FileUtils.assertFileExists(new File(copiedTo, "infile1.inp.outFromSecond"), 10000);
+
+ // Make sure there's no open file handles on the files created/copied by the ESB...
+ FileUtils.assertCanDelete(new File(inputDoneDir, "infile1.inp.DONE"), 10000);
+ FileUtils.assertCanDelete(new File(copiedTo, "infile1.inp.outFromFirst"), 10000);
+ FileUtils.assertCanDelete(new File(copiedTo, "infile1.inp.outFromSecond"), 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", "test")});
+ // Make sure the Shutdown was successful...
+ listenersMgr.assertShutdownOK(10000);
+ }
+
+ protected void tearDown() throws Exception {
+ // Remove the directories required by the test...
+ FileUtils.assertCanDelete(inputDir, 10000);
+ FileUtils.assertCanDelete(inputDoneDir, 10000);
+ FileUtils.assertCanDelete(copiedTo, 10000);
+ }
+}
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/JmsQueueListenerConfig.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerConfig.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerConfig.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/JmsQueueListenerConfig.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,47 @@
+<JmsListenerExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='zambia'"
+ commandJndiName="queue/A"
+ parameterReloadSecs="20"
+>
+
+
+ <QueueExample
+ listenerClass="org.jboss.soa.esb.listeners.old.JmsQueueListener"
+ actions="CaptureMessage"
+ maxThreads="1"
+ queueConnFactoryClass="ConnectionFactory"
+ listenJndiType="jboss"
+ listenJndiURL="localhost"
+ listenQueue="queue/A"
+ listenMsgSelector="listener='zambia'"
+ >
+ <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>
+ </QueueExample>
+
+ <Actions>
+ <Action name="CaptureMessage" processor="MessageBox" />
+
+ <ProcessorAliases>
+ <Alias name="MessageBox" class="org.jboss.soa.esb.listeners.old.MessageBox" />
+ </ProcessorAliases>
+ </Actions>
+
+</JmsListenerExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/JmsQueueListenerTest.java (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/JmsQueueListenerTest.java 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/JmsQueueListenerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -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.old;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+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 JmsQueueListener.
+ *
+ */
+public class JmsQueueListenerTest extends TestCase {
+
+ private ListenerUtils.ListenersManagerExecThread listenersMgr;
+ File notifyDir;
+
+ protected void setUp() throws Exception {
+ // Create the directories required by the test...
+ notifyDir = FileUtils.createTestDir("notifyDir");
+ // Start the listener...
+ listenersMgr = ListenerUtils.startListeners(ClassUtils.toResourcePath(getClass().getPackage()) + "/JmsQueueListenerConfig.xml");
+ }
+
+ public void test() throws InterruptedException {
+ // There should have been no exceptions...
+ listenersMgr.assertNotInException();
+
+ MessageBox.messages.clear();
+
+ // Send a request via jms
+ JMSClientUtil.sendMessageToQueue("hello is anyone there?", JMSClientUtil.QUEUE.A, new KeyValuePair[] {new KeyValuePair("listener", "zambia")});
+
+ // Check did the messagebox recevive the message from the JMSListener...
+ MessageBox.assertMessageCount(1, 10000);
+
+ // Make sure the notifications appear in the "notifyDir" dir...
+ FileUtils.assertFileExists(new File(notifyDir, "JmsQueueListenerExample.notifOK"), 10000);
+ FileUtils.assertCanDelete(new File(notifyDir, "JmsQueueListenerExample.notifOK"), 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")});
+ listenersMgr.assertShutdownOK(10000);
+ }
+
+ protected void tearDown() throws Exception {
+ // Remove the directories required by the test...
+ FileUtils.assertCanDelete(notifyDir, 10000);
+ }
+
+
+
+}
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/ListenerManagerTest.java (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/ListenerManagerTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/ListenerManagerTest.java 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/ListenerManagerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,75 @@
+/*
+ * 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.old;
+
+import javax.naming.CommunicationException;
+import javax.naming.NameNotFoundException;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.command.CommandQueueException;
+import org.jboss.soa.esb.util.ClassUtils;
+import org.jboss.soa.esb.util.ListenerUtils;
+
+/**
+ * QA tests for the Listener Manager class - otherwise known as the {@link org.jboss.soa.esb.listeners.old.GpListener}.
+ * <p/>
+ * General tests around the command queue, bad configurations etc.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ListenerManagerTest extends TestCase {
+
+ protected void setUp() throws Exception {
+ }
+
+ public void test_BadConfigurations() throws Exception {
+ test_BadConfigurations("BadConfig1.xml", "commandConnFactoryClass", NameNotFoundException.class); // REVIEW: Usability - Not getting a specific error message here. How about a "BadListenerConfigurationException"??
+ test_BadConfigurations("BadConfig2.xml", "commandJndiType", IllegalArgumentException.class); // REVIEW: Usability - Not getting a specific error message here. How about a "BadListenerConfigurationException"??
+ test_BadConfigurations("BadConfig3.xml", "commandJndiURL", CommunicationException.class); // REVIEW: Usability - Not getting a specific error message here. How about a "BadListenerConfigurationException"??
+ test_BadConfigurations("BadConfig4.xml", "commandIsTopic", null); // BUG: Exception getting swallowed here!!! Should only accept boolean values.
+ test_BadConfigurations("BadConfig5.xml", "messageSelector", null); // BUG: Exception getting swallowed here!!! Sould only accept NV Pairs.
+ test_BadConfigurations("BadConfig6.xml", "commandJndiName", NameNotFoundException.class); // REVIEW: Usability - Not getting a specific error message here. How about a "BadListenerConfigurationException"??
+ }
+
+ public void test_BadConfigurations(String config, String paramName, Class expectedException) throws Exception {
+ try {
+ ListenerUtils.createGpListener(ClassUtils.toResourcePath(getClass().getPackage()) + "/" + config);
+ if(expectedException != null) {
+ fail("[Param '" + paramName + "' test] No exception being thrown for bad param config!! Expected Exception: " + expectedException.getName());
+ }
+ } catch(AssertionFailedError e) {
+ throw e;
+ } catch(CommandQueueException e) {
+ if(expectedException == null) {
+ fail("[Param '" + paramName + "' test] Unexpected Exception: " + e.getClass().getName() + ": " + e.getMessage());
+ } else if(!expectedException.isInstance(e) && !expectedException.isInstance(e.getCause())) {
+ fail("[Param '" + paramName + "' test] Expected Exception: " + expectedException.getName() + ". Got " + e.getClass().getName() + ": " + e.getMessage());
+ }
+ // Is the expected Exception!!
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ }
+}
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/MessageBox.java (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MessageBox.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MessageBox.java 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/MessageBox.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,91 @@
+/*
+ * 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.old;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Vector;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionProcessor;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class MessageBox implements ActionProcessor {
+
+ private static Logger logger = Logger.getLogger(MessageBox.class);
+ public static List<Object> messages = new Vector<Object>();
+
+ /* (non-Javadoc)
+ * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
+ */
+ public Message process(Message message) throws ActionProcessingException {
+ Object oCurr = ActionUtils.getTaskObject(message);
+ if (null==oCurr)
+ oCurr="<null>";
+ logger.info("MessageBox received message: " + message);
+ messages.add(oCurr);
+ return message;
+ }
+
+ public static void assertMessageCount(int count, long maxWait) {
+ long endTime = System.currentTimeMillis() + maxWait;
+
+ while(System.currentTimeMillis() < endTime) {
+ if(messages.size() == count) {
+ return;
+ }
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ logger.error("Thread interupt...", e);
+ }
+ }
+ String errorMsg = "MessageBox failed to receive " + count + " messages. Message count = " + messages.size() + ". Waited for " + maxWait + "ms.";
+ logger.error(errorMsg);
+ TestCase.fail(errorMsg);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.soa.esb.actions.ActionProcessor#getOkNotification(java.lang.Object)
+ */
+ public Serializable getOkNotification(Message message) {
+ return "OK" + ActionUtils.getTaskObject(message);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.soa.esb.actions.ActionProcessor#getErrorNotification(java.lang.Object)
+ */
+ public Serializable getErrorNotification(Message message) {
+ return "Error" + ActionUtils.getTaskObject(message);
+ }
+
+}
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/MultiPollerConfig1.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MultiPollerConfig1.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/MultiPollerConfig1.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/MultiPollerConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,100 @@
+<LoanBrokerExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+ parameterReloadSecs="20"
+>
+ <PollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.DirectoryPoller"
+ actionClass="org.jboss.soa.esb.actions.templates.MockFileAction"
+ pollLatencySecs="5"
+ maxThreads="2"
+ inputDirURI="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".INPROC"
+ errorDirURI="@qa.build@/errorDir"
+ errorSuffix=".ERR"
+ postDirURI="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ <NotificationList type="OK">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/GpListenerExample.notifOK"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+
+ <NotificationList type="err">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/GpListenerExample.notifErr"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+ </PollDirectoryExample>
+
+ <PollSqlTableExample
+ listenerClass="org.jboss.soa.esb.listeners.old.SqlTablePoller"
+ actionClass="org.jboss.soa.esb.actions.templates.MockSqlRowAction"
+ pollLatencySecs="2"
+ maxThreads="2"
+ connection-url="jdbc:postgresql://lavasca:5432/rosetta"
+ driver-class="org.postgresql.Driver"
+ user-name="postgres"
+ password=""
+ tableName="test_notif_table"
+ selectFields="oid,ref,msg"
+ keyFields="oid,ref"
+ inProcessField="status"
+ whereCondition="src='pepe'"
+ >
+ <NotificationList type="OK">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/GpListenerExample.notifOK"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+
+ <NotificationList type="err">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/GpListenerExample.notifErr"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+ </PollSqlTableExample>
+
+ <ListenJmsQueueExample
+ listenerClass="org.jboss.soa.esb.listeners.old.JmsQueueListener"
+ actionClass="org.jboss.soa.esb.actions.templates.MockAction"
+ maxThreads="1"
+ queueConnFactoryClass="ConnectionFactory"
+ listenJndiType="jboss"
+ listenJndiURL="localhost"
+ listenQueue="queue/A"
+ listenMsgSelector="listener='maradona'"
+ >
+ <NotificationList type="OK">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/GpListenerExample.notifOK"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+
+ <NotificationList type="err">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/GpListenerExample.notifErr"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+ </ListenJmsQueueExample>
+
+</LoanBrokerExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPollerConfig1.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerConfig1.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerConfig1.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPollerConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,64 @@
+ <!--
+
+ Params from RemoteDirectoryPoller
+ public static final String FILE_INPUT_DIR = "inputDir";
+ public static final String FILE_INPUT_SFX = "inputSuffix";
+ public static final String FILE_WORK_SFX = "workSuffix";
+ public static final String FILE_ERROR_DIR = "errorDir";
+ public static final String FILE_ERROR_SFX = "errorSuffix";
+ public static final String FILE_POST_DIR = "postDir";
+ public static final String FILE_POST_SFX = "postSuffix";
+ public static final String FILE_POST_DEL = "postDelete";
+
+ Params from FtpClientUtil
+ public static final String PARMS_FTP_SERVER = "ftpServer";
+ public static final String PARMS_USER = "ftpUser";
+ public static final String PARMS_PASSWD = "ftpPassword";
+ public static final String PARMS_PORT = "ftpPort";
+ public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
+ public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
+ public static final String PARMS_ASCII = "ftpAscii";
+ public static final String PARMS_PASSIVE = "ftpPassive";
+
+ -->
+
+ <RemoteFileCopierExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+>
+ <RemotePollDirectoryExample
+ listenerClass="org.jboss.soa.esb.listeners.old.RemoteDirectoryPoller"
+ actions="RemoteFileCopy1, RemoteFileCopy2"
+ pollLatencySecs="2"
+ maxThreads="2"
+ inputDir="@qa.build@/inputDir"
+ inputSuffix=".inp"
+ workSuffix=".WORKING"
+ errorSuffix=".PROCERR"
+ postDir="@qa.build@/inputDoneDir"
+ inputDoneDir="@qa.build@/inputDoneDir"
+ postSuffix=".DONE"
+ postDelete="n"
+ >
+ </RemotePollDirectoryExample>
+
+ <Actions>
+ <Action name="RemoteFileCopy1" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromFirst"/>
+ </Action>
+ <Action name="RemoteFileCopy2" processor="FileCopier">
+ <property name="copyToDirURI" value="@qa.build@/copiedTo"/>
+ <property name="copyToSuffix" value=".outFromSecond"/>
+ </Action>
+
+ <ProcessorAliases>
+ <Alias name="FileCopier" class="org.jboss.soa.esb.actions.routing.FileCopier" />
+ </ProcessorAliases>
+ </Actions>
+
+</RemoteFileCopierExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPollerTest.java (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/RemoteDirectoryPollerTest.java 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPollerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,70 @@
+/**
+ *
+ */
+package org.jboss.soa.esb.listeners.old;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.util.ClassUtils;
+import org.jboss.soa.esb.util.FileUtils;
+import org.jboss.soa.esb.util.ListenerUtils;
+import org.jboss.soa.esb.util.ListenerUtils.ListenersManagerExecThread;
+
+/**
+ * @author b_georges
+ *
+ */
+public class RemoteDirectoryPollerTest extends TestCase {
+
+ private Logger log = Logger.getLogger(this.getClass());
+
+ ListenersManagerExecThread listenersMgr;
+
+ File getDir, putDir;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ public void setUp() throws Exception {
+ log.debug("====== setUp ==========");
+ // Create the directories required by the test...
+ getDir = FileUtils.createTestDir("getDir");
+ putDir = FileUtils.createTestDir("putdir");
+
+ // Start the listener...
+ listenersMgr = ListenerUtils.startListeners(ClassUtils
+ .toResourcePath(getClass().getPackage())
+ + "/RemoteDirectoryPollerConfig1.xml");
+ }
+
+
+ public void test() throws InterruptedException {
+ log.debug("====== test ==========");
+ // put a file to the SFTP Server
+ // get the file from the SFTP Server
+ // the rest can be processed by the DirectoryPoller
+ }
+
+ /**
+ * Test method for {@link org.jboss.soa.esb.listeners.old.RemoteDirectoryPoller#close()}.
+ */
+ public void testClose() {
+ log.debug("====== testClose ==========");
+ fail("Not yet implemented"); // TODO
+ }
+
+
+ /**
+ * @throws java.lang.Exception
+ */
+ public void tearDown() throws Exception {
+ log.debug("====== tearDown ==========");
+ FileUtils.assertCanDelete(getDir, 10000);
+ FileUtils.assertCanDelete(putDir, 10000);
+ }
+
+
+}
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/SQLTablePollerConfig1.xml (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerConfig1.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerConfig1.xml 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/SQLTablePollerConfig1.xml 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,55 @@
+<LoanBrokerExample
+ commandConnFactoryClass="ConnectionFactory"
+ commandJndiType="jboss"
+ commandJndiURL="localhost"
+ commandIsTopic="false"
+ messageSelector="gpMsgSelector='test'"
+ commandJndiName="queue/A"
+>
+
+ <PollSqlTableExample
+ listenerClass="org.jboss.soa.esb.listeners.old.SqlTablePoller"
+ actions="CaptureMessage, ProcessMessageFromSQL"
+ pollLatencySecs="2"
+ maxThreads="2"
+ connection-url="@db.url@"
+ driver-class="@db.driver@"
+ user-name="@db.user@"
+ password="@db.password@"
+
+ tableName="test_poll_table"
+ selectFields="ref,msg,val2"
+ keyFields="ref"
+ inProcessField="status"
+ whereCondition="src='pepe'"
+ >
+ <NotificationList type="OK">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/GpListenerExample.notifOK"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+
+ <NotificationList type="err">
+ <target class="NotifyFiles">
+ <file URI="@qa.build@/notifyDir/GpListenerExample.notifErr"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+
+
+ </PollSqlTableExample>
+
+ <Actions>
+ <Action name="CaptureMessage" processor="MessageBox" />
+ <Action name="ProcessMessageFromSQL" processor="SQLProcessor"/>
+
+ <ProcessorAliases>
+ <Alias name="MessageBox" class="org.jboss.soa.esb.listeners.old.MessageBox" />
+ <Alias name="SQLProcessor" class="org.jboss.soa.esb.actions.templates.MockSqlRowAction" />
+ </ProcessorAliases>
+ </Actions>
+
+</LoanBrokerExample>
Copied: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/SQLTablePollerTest.java (from rev 7124, labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerTest.java)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SQLTablePollerTest.java 2006-10-26 00:23:51 UTC (rev 7124)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/listeners/old/SQLTablePollerTest.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -0,0 +1,105 @@
+/*
+ * 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.old;
+
+import java.io.File;
+import java.sql.SQLException;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.actions.templates.MockSqlRowAction;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.util.ClassUtils;
+import org.jboss.soa.esb.util.DbUtils;
+import org.jboss.soa.esb.util.FileUtils;
+import org.jboss.soa.esb.util.JMSClientUtil;
+import org.jboss.soa.esb.util.ListenerUtils;
+import org.jboss.soa.esb.util.ListenerUtils.ListenersManagerExecThread;
+
+/**
+ * QA tests for the SQLTablePoller.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class SQLTablePollerTest extends TestCase {
+
+ private ListenersManagerExecThread listenersMgr;
+ File notifyDir;
+
+ protected void setUp() throws Exception {
+ // Create the directories required by the test...
+ notifyDir = FileUtils.createTestDir("notifyDir");
+
+ createTable();
+
+ // Start the listener...
+ listenersMgr = ListenerUtils.startListeners(ClassUtils.toResourcePath(getClass().getPackage()) + "/SQLTablePollerConfig1.xml");
+ }
+
+ public void test() throws InterruptedException, SQLException {
+ MessageBox.messages.clear();
+ MockSqlRowAction.params.clear();
+
+ // Insert the row into the table and wait for the status to go to "P" (Pending) to "D" (Done)...
+ int insertCount = DbUtils.executeUpdate("insert into test_poll_table values ('pepe','ref1','An arbitrary message', '1111111111','2222222222','P')");
+
+ assertEquals("Failed to create row in table.", 1, insertCount);
+
+ // FIXME: This assertion is broken - prob something wrong with the listener config - it's status isn't changing to "D" (Done)
+ DbUtils.assertNonEmptyResultSet("select * from test_poll_table where src='pepe' and ref='ref1' and status='D'", 10000);
+
+ // Check did the messagebox recevive the message from the JMSListener...
+ MessageBox.assertMessageCount(1, 10000);
+ assertEquals(1, MockSqlRowAction.params.size());
+ Map pollResult = MockSqlRowAction.params.get(0);
+
+ // Check the rowset values...
+ assertEquals("ref1", pollResult.get("ref"));
+ assertEquals("An arbitrary message", pollResult.get("msg"));
+ assertEquals("2222222222", pollResult.get("val2"));
+
+ // Make sure the notifications appear in the "notifyDir" dir...
+ FileUtils.assertFileExists(new File(notifyDir, "GpListenerExample.notifOK"), 10000);
+ FileUtils.assertCanDelete(new File(notifyDir, "GpListenerExample.notifOK"), 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", "test")});
+ listenersMgr.assertShutdownOK(10000);
+ }
+
+ protected void tearDown() throws Exception {
+ dropTable();
+
+ // Remove the directories required by the test...
+ FileUtils.assertCanDelete(notifyDir, 10000);
+ }
+
+ private void createTable() {
+ DbUtils.execute("CREATE TABLE test_poll_table (src text, ref text, msg text, val1 text, val2 text, status text)");
+ }
+ private void dropTable() {
+ DbUtils.execute("DROP TABLE test_poll_table");
+ }
+}
Modified: labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/util/ListenerUtils.java
===================================================================
--- labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/util/ListenerUtils.java 2006-10-26 04:20:15 UTC (rev 7132)
+++ labs/jbossesb/workspace/dbrum/trunk/qa/junit/src/org/jboss/soa/esb/util/ListenerUtils.java 2006-10-26 04:28:24 UTC (rev 7133)
@@ -30,7 +30,7 @@
import org.apache.log4j.Logger;
import org.jboss.internal.soa.esb.command.JmsCommandQueue;
import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
-import org.jboss.soa.esb.listeners.GpListener;
+import org.jboss.soa.esb.listeners.old.GpListener;
import org.jboss.soa.esb.parameters.ParamRepositoryException;
import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
More information about the jboss-svn-commits
mailing list