[jboss-svn-commits] JBL Code SVN: r5657 - in labs/jbossesb/trunk/qa: . junit junit/src junit/src/org junit/src/org/jboss junit/src/org/jboss/soa junit/src/org/jboss/soa/esb junit/src/org/jboss/soa/esb/listeners

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Aug 9 16:15:46 EDT 2006


Author: tfennelly
Date: 2006-08-09 16:15:41 -0400 (Wed, 09 Aug 2006)
New Revision: 5657

Added:
   labs/jbossesb/trunk/qa/build.xml
   labs/jbossesb/trunk/qa/junit/
   labs/jbossesb/trunk/qa/junit/build.xml
   labs/jbossesb/trunk/qa/junit/readme.txt
   labs/jbossesb/trunk/qa/junit/src/
   labs/jbossesb/trunk/qa/junit/src/org/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SendMessageTest.java
   labs/jbossesb/trunk/qa/test.properties
Log:
forgot to add the test application.xml

Added: labs/jbossesb/trunk/qa/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/build.xml	2006-08-09 19:52:01 UTC (rev 5656)
+++ labs/jbossesb/trunk/qa/build.xml	2006-08-09 20:15:41 UTC (rev 5657)
@@ -0,0 +1,17 @@
+<project name="JBESB" default="test" basedir=".">
+
+	<property id="test.properties" file="test.properties" />
+
+	<target name="test" depends="test.junit" description="Run all QA tests." />
+	
+	<target name="test.junit" description="Run JUnit based QA tests.">
+		<ant dir="junit" target="test" />
+	</target>
+
+	<target name="clean" description="Clean the QA env">
+		<echo message="Cleaning..."/>
+		
+		<delete dir="build" />
+	</target>
+	
+</project>

Added: labs/jbossesb/trunk/qa/junit/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/build.xml	2006-08-09 19:52:01 UTC (rev 5656)
+++ labs/jbossesb/trunk/qa/junit/build.xml	2006-08-09 20:15:41 UTC (rev 5657)
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<project name="JUnit" default="test" basedir=".">
+
+	<property name="product" value="../../product"/>
+	<property name="product.lib" value="${product}/build/dist/lib"/>
+	<property name="build.lib" value="${product}/lib"/>
+	<property name="qa.build" value="../build"/>
+	<property name="qa.junit.src" value="src"/>
+	<property name="qa.junit.classes" value="${qa.build}/junit/classes"/>
+	<property name="qa.junit.report" value="${qa.build}/junit/report" />
+	
+	<path id="qa.junit.cp">
+		<fileset dir="${product.lib}" includes="jbossesb-services.jar,jbossesb-common.jar" />
+		<fileset dir="${build.lib}/ext" includes="log4j.jar" />
+		<fileset dir="${build.lib}/ejb3" includes="jbossall-client.jar" />
+	</path>
+	
+	<target name="test">
+		<echo message="Running JUnit based QA tests..."/>
+		
+		<!-- Build the tests... -->
+		<mkdir dir="${qa.junit.classes}"/>
+		<javac srcdir="${qa.junit.src}" destdir="${qa.junit.classes}" classpathref="qa.junit.cp" debug="on" />
+
+		<!-- Run the tests... -->
+		<mkdir dir="${qa.junit.report}"/>
+        <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
+            <formatter type="plain" usefile="false"/>
+            <formatter type="xml"/>
+            <batchtest todir="${qa.junit.report}">
+                <fileset dir="${qa.junit.src}">
+                    <include name="**/**Test.java"/>
+                </fileset>
+            </batchtest>
+            <classpath>
+                <pathelement location="${qa.junit.classes}"/>
+                <path refid="qa.junit.cp"/>
+                <pathelement location="${qa.junit.src}"/>
+            </classpath>
+
+        	<!-- SystemProperties - pass them through from the test.properties file... -->
+        	<sysproperty key="org.jboss.soa.esb.jndi.server.type" value="${org.jboss.soa.esb.jndi.server.type}" />
+        	<sysproperty key="org.jboss.soa.esb.jndi.server.url" value="${org.jboss.soa.esb.jndi.server.url}" />
+        </junit>
+		
+		<!-- Report on the tests (format results) ... -->
+        <junitreport todir="${qa.junit.report}">
+            <fileset dir="${qa.junit.report}">
+                <include name="*.xml"/>
+            </fileset>
+            <report format="frames" todir="${qa.junit.report}"/>
+            <report format="noframes" todir="${qa.junit.report}"/>
+        </junitreport>
+		
+	</target>
+	
+</project>

Added: labs/jbossesb/trunk/qa/junit/readme.txt
===================================================================
--- labs/jbossesb/trunk/qa/junit/readme.txt	2006-08-09 19:52:01 UTC (rev 5656)
+++ labs/jbossesb/trunk/qa/junit/readme.txt	2006-08-09 20:15:41 UTC (rev 5657)
@@ -0,0 +1,6 @@
+
+This file hierarchy contains JUnit based QA tests.  Note these tests are NOT "Unit Tests", we're simply utilising the
+Ant and JUnit frameworks for running QA level tests.  
+
+These tests depend on a running JBoss AS, installed JBoss ESB (and whatever it depends on - DB etc), configured
+JMS Queues etc.  Each test should outline whatever its dependencies.
\ No newline at end of file

Added: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SendMessageTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SendMessageTest.java	2006-08-09 19:52:01 UTC (rev 5656)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/SendMessageTest.java	2006-08-09 20:15:41 UTC (rev 5657)
@@ -0,0 +1,53 @@
+package org.jboss.soa.esb.listeners;
+
+import javax.jms.*;
+import javax.naming.*;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.common.SystemProperties;
+import org.jboss.soa.esb.helpers.*;
+
+/**
+ * QA test for testing ??? TODO: Esteban, please fill in the gaps here!!!
+ * @author Esteban
+ */
+public class SendMessageTest extends TestCase {
+	
+	private Context m_oCtx;
+	QueueSession	m_oQsess;
+	
+	public void test_SendMessage() throws Exception
+	{
+		initializeJms();
+		Queue oQ  = (Queue)m_oCtx.lookup("queue/A");
+		MessageProducer oSnd = m_oQsess.createSender(oQ);
+
+		TextMessage oMsg = m_oQsess.createTextMessage();
+
+		
+		oMsg.setStringProperty("gpMsgSelector","test");
+		oMsg.setText("shutdown");
+//		oMsg.setText("reload param");
+//		oMsg.setText("endTime 20060803 16:10:00");
+//		oMsg.setStringProperty("listener","maradona");
+//		oMsg.setText("MESSAGE TO MARADONA");
+		
+		oSnd.send(oMsg);
+		
+	} //________________________________
+	
+	private void initializeJms () throws Exception
+	{
+		m_oCtx = AppServerContext.getServerContext
+		(SystemProperties.getJndiServerType()
+		,SystemProperties.getJndiServerURL()
+		);
+	    QueueConnectionFactory qcf = (QueueConnectionFactory)
+        m_oCtx.lookup("ConnectionFactory");
+		QueueConnection oQconn = qcf.createQueueConnection();
+		m_oQsess = oQconn.createQueueSession(false
+		            ,QueueSession.AUTO_ACKNOWLEDGE);
+
+	} //________________________________
+} //____________________________________________________________________________

Added: labs/jbossesb/trunk/qa/test.properties
===================================================================
--- labs/jbossesb/trunk/qa/test.properties	2006-08-09 19:52:01 UTC (rev 5656)
+++ labs/jbossesb/trunk/qa/test.properties	2006-08-09 20:15:41 UTC (rev 5657)
@@ -0,0 +1,8 @@
+###################################################################################################
+#
+# Env specific test properties.
+#
+###################################################################################################
+
+org.jboss.soa.esb.jndi.server.type=jboss
+org.jboss.soa.esb.jndi.server.url=localhost
\ No newline at end of file




More information about the jboss-svn-commits mailing list