[jboss-svn-commits] JBL Code SVN: r5738 - in labs/jbossesb/trunk/qa: . junit junit/src/org/jboss/soa/esb/listeners junit/src/org/jboss/soa/esb/util
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Aug 11 04:43:13 EDT 2006
Author: tfennelly
Date: 2006-08-11 04:43:08 -0400 (Fri, 11 Aug 2006)
New Revision: 5738
Added:
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerConfig1.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerTest.java
Removed:
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SimpleListenerConfig.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SimpleListenersTest.java
Modified:
labs/jbossesb/trunk/qa/README.TXT
labs/jbossesb/trunk/qa/junit/build.xml
labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/FileUtils.java
Log:
Renamed the simple testcase to be the DirectoryPoller test - going to add testcases for each listener type.
Modified: labs/jbossesb/trunk/qa/README.TXT
===================================================================
--- labs/jbossesb/trunk/qa/README.TXT 2006-08-11 00:03:51 UTC (rev 5737)
+++ labs/jbossesb/trunk/qa/README.TXT 2006-08-11 08:43:08 UTC (rev 5738)
@@ -22,9 +22,12 @@
the utility classes (in the org.jboss.soa.esb.util package) as much as possible. Always run the tests through the ant
scripts i.e. not through your IDE (as outlined above).
+See the org.jboss.soa.esb.listeners.DirectoryPollerTest and org.jboss.soa.esb.listeners.DirectoryPollerConfig1.xml
+files as examples.
+
Notes on Listener Configurations:
1. All Listener configurations must be located in the src folder (just put them in the same package as your TestCase class).
2. When specifying directory URI attributes on the Listener configurations (e.g. DirectoryPoller input dirs), be sure
not to commit absolute URIs relative to your file system. Instead, use "@qa.build@" tokens in conjunction with the
- ListenerUtils and FileUtils classes. See the org.jboss.soa.esb.listeners.SimpleListenersTest and
- org.jboss.soa.esb.listeners.SimpleListenerConfig.xml files as examples.
\ No newline at end of file
+ ListenerUtils and FileUtils classes. Again, see the org.jboss.soa.esb.listeners.DirectoryPollerTest and
+ org.jboss.soa.esb.listeners.DirectoryPollerConfig1.xml files as examples.
\ No newline at end of file
Modified: labs/jbossesb/trunk/qa/junit/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/build.xml 2006-08-11 00:03:51 UTC (rev 5737)
+++ labs/jbossesb/trunk/qa/junit/build.xml 2006-08-11 08:43:08 UTC (rev 5738)
@@ -13,8 +13,9 @@
<path id="qa.junit.cp">
<fileset dir="${coverage}/all/" includes="jbossesb-instr-all.jar" />
- <fileset dir="${build.lib}/ejb3" includes="jbossall-client.jar" />
- <fileset dir="${build.lib}/ext" includes="log4j.jar,emma*.jar" />
+ <fileset dir="${build.lib}/ext" includes="*.jar" />
+ <fileset dir="${build.lib}/ejb3" includes="*.jar" />
+ <!-- fileset dir="${build.lib}/ejb3_embedded" includes="*.jar" / -->
<pathelement location="../" />
</path>
@@ -42,7 +43,7 @@
</classpath>
<!-- emma jvm args -->
- <jvmarg value="-Demma.coverage.out.file=${coverage}/all/coverage.emma" />
+ <jvmarg value="-Demma.coverage.out.file=../product/build/tests/coverage/all/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
<!-- Listener Sys Props... -->
Added: 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-08-11 00:03:51 UTC (rev 5737)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerConfig1.xml 2006-08-11 08:43:08 UTC (rev 5738)
@@ -0,0 +1,32 @@
+<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.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>
Added: 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-08-11 00:03:51 UTC (rev 5737)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/DirectoryPollerTest.java 2006-08-11 08:43:08 UTC (rev 5738)
@@ -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;
+
+import java.io.File;
+
+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;
+
+import junit.framework.TestCase;
+
+/**
+ * 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 "inputDoneDir"...
+ FileUtils.assertFileDoesntExists(new File(inputDir, "infile1.inp"), 10000);
+
+ //listenersMgr.assertShutdownOK(10000);
+
+ // 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 {
+ // Remove the directories required by the test...
+ inputDir.delete();
+ inputDoneDir.delete();
+ copiedTo.delete();
+ }
+}
Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SimpleListenerConfig.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SimpleListenerConfig.xml 2006-08-11 00:03:51 UTC (rev 5737)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SimpleListenerConfig.xml 2006-08-11 08:43:08 UTC (rev 5738)
@@ -1,32 +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"
- actionClass="org.jboss.soa.esb.actions.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/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SimpleListenersTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SimpleListenersTest.java 2006-08-11 00:03:51 UTC (rev 5737)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SimpleListenersTest.java 2006-08-11 08:43:08 UTC (rev 5738)
@@ -1,70 +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 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;
-
-import junit.framework.TestCase;
-
-/**
- * Simple QA Test of the Listener framework.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class SimpleListenersTest 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()) + "/SimpleListenerConfig.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 get processed to the "inputDoneDir"
- FileUtils.assertFileExists(new File(inputDoneDir, "infile1.inp.DONE"), 10000);
- // Make sure the input gets removed from the "inputDoneDir"...
- FileUtils.assertFileDoesntExists(new File(inputDir, "infile1.inp"), 10000);
-
- // 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 {
- // No Teardown tasks for this test :-)
- }
-}
Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/FileUtils.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/FileUtils.java 2006-08-11 00:03:51 UTC (rev 5737)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/FileUtils.java 2006-08-11 08:43:08 UTC (rev 5738)
@@ -51,7 +51,7 @@
* <p/>
* If the directory already exists, it gets recreated.
* @param name Directory name.
- * @return The newly created.recreated directory.
+ * @return The newly created/recreated directory.
*/
public static File createTestDir(String name) {
File dir = new File(getEnvBuildDir(), name);
More information about the jboss-svn-commits
mailing list