[jboss-svn-commits] JBL Code SVN: r5727 - in labs/jbossesb/branches/refactor/product/core/listeners/tests: . resources resources/conf src/org/jboss/soa/esb/listeners
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Aug 10 16:27:03 EDT 2006
Author: arvinder
Date: 2006-08-10 16:26:58 -0400 (Thu, 10 Aug 2006)
New Revision: 5727
Added:
labs/jbossesb/branches/refactor/product/core/listeners/tests/resources/
labs/jbossesb/branches/refactor/product/core/listeners/tests/resources/conf/
labs/jbossesb/branches/refactor/product/core/listeners/tests/resources/conf/log4j.properties
labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/DirectoryPollerUnitTest.java
labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/GpListenerUnitTest.java
labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/SqlTablePollerUnitTest.java
labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/SqlTablePollerUnitTest.xml
Removed:
labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/tests/
Modified:
labs/jbossesb/branches/refactor/product/core/listeners/tests/build.xml
Log:
initial entry of listener tests and skeleton
Modified: labs/jbossesb/branches/refactor/product/core/listeners/tests/build.xml
===================================================================
--- labs/jbossesb/branches/refactor/product/core/listeners/tests/build.xml 2006-08-10 19:14:00 UTC (rev 5726)
+++ labs/jbossesb/branches/refactor/product/core/listeners/tests/build.xml 2006-08-10 20:26:58 UTC (rev 5727)
@@ -2,22 +2,40 @@
<project name="build.listeners.tests" default="org.jboss.esb.listeners.tests.compile" basedir=".">
<property name="org.jboss.esb.module.src.dir" value="../src"/>
+ <property name="org.jboss.esb.module.classes.root.dir" value="${org.jboss.esb.internal.dest}/classes"/>
<property name="org.jboss.esb.module.classes.dir" value="${org.jboss.esb.internal.dest}/classes/listeners"/>
<property name="org.jboss.esb.module.tests.src.dir" value="${basedir}/src"/>
<property name="org.jboss.esb.tests.classes.dir" value="${org.jboss.esb.internal.dest}/tests"/>
<property name="org.jboss.esb.tests.report.dir" value="${org.jboss.esb.internal.dest}/tests/junit"/>
<property name="org.jboss.esb.root.dir" value="../.."/>
+ <property name="org.jboss.esb.deploy.lib.dir" value="${org.jboss.esb.root.dir}/config/lib/"/>
+ <property name="org.jboss.esb.ejb3_embedded.lib.dir" value="${org.jboss.esb.root.dir}/../lib/ejb3_embedded"/>
+ <property name="org.jboss.esb.module.tests.conf.dir" value="${org.jboss.esb.root.dir}/listeners/tests/resources/conf"/>
+
<property environment="env"/>
<property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/>
+
<condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client">
<equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
</condition>
<path id="org.jboss.esb.tests.base.classpath">
+
+ <fileset dir="../${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
+ <fileset dir="../${org.jboss.esb.deploy.lib.dir}" includes="*.jar"/>
+ <pathelement location="${org.jboss.esb.module.classes.root.dir}/common"/>
+ <pathelement location="${org.jboss.esb.module.classes.root.dir}/services"/>
+ <pathelement location="${org.jboss.esb.module.classes.dir}"/>
+ <pathelement location="${org.jboss.esb.module.tests.conf.dir}"/>
+ <!-- Needed as the listeners import javax.jms.* -->
+ <fileset dir="${org.jboss.esb.ejb3_embedded.lib.dir}" includes="jboss-ejb3-all.jar hibernate-all.jar thirdparty-all.jar"/>
+
+ <!--
<fileset dir="../${org.jboss.esb.ext.lib.dir}"
includes="activation.jar jbossall-client.jar log4j.jar mail.jar junit.jar emma.jar emma_ant.jar"/>
<pathelement location="${org.jboss.esb.module.classes.dir}"/>
+ -->
</path>
<target name="org.jboss.esb.tests.init">
@@ -58,17 +76,19 @@
<!-- Instrument the code for code coverage - using emma... -->
<delete dir="${org.jboss.esb.module.tests.coverage.dir}" />
<mkdir dir="${org.jboss.esb.module.tests.coverage.dir}" />
- <emma>
+ <!--
+ <emma>
<instr instrpath="${org.jboss.esb.module.classes.dir}"
destdir="${org.jboss.esb.module.classes.instr.dir}"
metadatafile="${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
</emma>
-
+ -->
<!-- Run the tests -->
<antcall target="org.jboss.esb.services.internal.test.exec"/>
<!-- Generate the coverage report -->
- <emma>
+ <!--
+ <emma>
<report sourcepath="${org.jboss.esb.module.src.dir}" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100">
<fileset dir="${org.jboss.esb.module.tests.coverage.dir}" >
<include name="*.emma" />
@@ -76,6 +96,7 @@
<html outfile="${org.jboss.esb.module.tests.coverage.dir}/index.html" depth="method" columns="name,line,class,method,block"/>
</report>
</emma>
+ -->
</target>
<!-- ====================================================================== -->
Added: labs/jbossesb/branches/refactor/product/core/listeners/tests/resources/conf/log4j.properties
===================================================================
--- labs/jbossesb/branches/refactor/product/core/listeners/tests/resources/conf/log4j.properties 2006-08-10 19:14:00 UTC (rev 5726)
+++ labs/jbossesb/branches/refactor/product/core/listeners/tests/resources/conf/log4j.properties 2006-08-10 20:26:58 UTC (rev 5727)
@@ -0,0 +1,7 @@
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+log4j.rootLogger=info, stdout
\ No newline at end of file
Added: labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/DirectoryPollerUnitTest.java
===================================================================
--- labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/DirectoryPollerUnitTest.java 2006-08-10 19:14:00 UTC (rev 5726)
+++ labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/DirectoryPollerUnitTest.java 2006-08-10 20:26:58 UTC (rev 5727)
@@ -0,0 +1,57 @@
+/*
+* 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 org.jboss.soa.esb.common.tests.BaseTest;
+
+/**
+ * Test the DirectoryPoller
+ *
+ * @author <a href="mailto:arvinder.singh at indigo-logic.com">Arvinder Singh</a>
+ * @version <tt>$Revision:$</tt>
+ * $Id:$
+ */
+public class DirectoryPollerUnitTest extends BaseTest {
+
+
+ /**
+ * Basic construction test
+ * @throws Exception
+ */
+ public void test_Empty_Construction() throws Exception {
+ log.info("Constructing instance of DirectoryPoller");
+ // This should fail
+ DirectoryPoller dirPoller = null;
+ try {
+ dirPoller = new DirectoryPoller(null,null);
+ fail("GpListener should fail with empty constructor string");
+ } catch (Exception e) {
+ }
+ }
+
+
+
+
+
+
+
+}
Added: labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/GpListenerUnitTest.java
===================================================================
--- labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/GpListenerUnitTest.java 2006-08-10 19:14:00 UTC (rev 5726)
+++ labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/GpListenerUnitTest.java 2006-08-10 20:26:58 UTC (rev 5727)
@@ -0,0 +1,56 @@
+/*
+* 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 org.jboss.soa.esb.common.tests.BaseTest;
+
+/**
+ * Test the GpListener
+ *
+ * @author <a href="mailto:arvinder.singh at indigo-logic.com">Arvinder Singh</a>
+ * @version <tt>$Revision:$</tt>
+ * $Id:$
+ */
+public class GpListenerUnitTest extends BaseTest {
+
+
+ /**
+ * Basic construction test
+ * @throws Exception
+ */
+ public void test_Empty_Construction() throws Exception {
+ log.info("Constructing instance of GpListener");
+ // This should fail
+ GpListener gpListener = null;
+ try {
+ gpListener = new GpListener("");
+ fail("GpListener should fail with empty constructor string");
+ } catch (Exception e) {
+ }
+ }
+
+
+
+
+
+
+}
Added: labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/SqlTablePollerUnitTest.java
===================================================================
--- labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/SqlTablePollerUnitTest.java 2006-08-10 19:14:00 UTC (rev 5726)
+++ labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/SqlTablePollerUnitTest.java 2006-08-10 20:26:58 UTC (rev 5727)
@@ -0,0 +1,72 @@
+/*
+* 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 org.jboss.soa.esb.common.tests.BaseTest;
+
+/**
+ * Test the SqlTablePoller
+ *
+ * @author <a href="mailto:arvinder.singh at indigo-logic.com">Arvinder Singh</a>
+ * @version <tt>$Revision:$</tt>
+ * $Id:$
+ */
+public class SqlTablePollerUnitTest extends BaseTest {
+
+ /**
+ * Test basic construction.
+ * @throws Exception
+ */
+ public void test_Empty_Construction() throws Exception {
+ log.info("Constructing instance of SqlTablePoller");
+ // This should fail
+ SqlTablePoller sqlPoller = null;
+ try {
+ sqlPoller = new SqlTablePoller(null, null);
+ fail("SqlTablePoller should fail with empty constructor string");
+ } catch (Exception e) {
+ }
+ }
+
+
+ /*
+ public void test_Construction() throws Exception {
+
+ DomElement domElement = DomElement.fromInputStream(
+ getClass().getResourceAsStream("SqlTablePollerUnitTest.xml"));
+
+
+ log.info("Loaded - " + domElement.toXml());
+ }
+ */
+
+
+
+
+
+
+
+
+
+
+
+}
Added: labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/SqlTablePollerUnitTest.xml
===================================================================
--- labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/SqlTablePollerUnitTest.xml 2006-08-10 19:14:00 UTC (rev 5726)
+++ labs/jbossesb/branches/refactor/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/SqlTablePollerUnitTest.xml 2006-08-10 20:26:58 UTC (rev 5727)
@@ -0,0 +1,35 @@
+<DocumentElementName>
+ <ExampleListenChapter
+ maxThreads="2"
+ listenerClass="org.jboss.soa.esb.listeners.SqlTablePoller"
+ actionClass="org.jboss.soa.esb.actions.DummySqlRowAction"
+
+ driver-class="org.hsqldb.jdbcDriver"
+ connection-url="jdbc:hsqldb:."
+ user-name="sa"
+ password=""
+
+ tableName="test_notif_table"
+ selectFields="oid,ref,msg"
+ keyFields="oid,ref"
+ inProcessField="statusCol"
+ whereCondition="src='pepe'"
+ orderBy="oid desc"
+ >
+ <NotificationList type="OK">
+ <target class="NotifyFiles">
+ <file URI="file:///tmp/jbossEsb/notifyDir/ListenOnNotifTable.notifOK"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+
+ <NotificationList type="err">
+ <target class="NotifyFiles">
+ <file URI="file:///tmp/jbossEsb/notifyDir/ListenOnNotifTable.notifErr"
+ append="true"
+ />
+ </target>
+ </NotificationList>
+ </ExampleListenChapter>
+</DocumentElementName>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list