[jboss-svn-commits] JBL Code SVN: r16914 - in labs/jbossesb/branches/JBESB_4_2_1_GA_CP: product/samples/quickstarts/bpm_orchestration1 and 36 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Nov 29 11:43:39 EST 2007
Author: kevin.conner at jboss.com
Date: 2007-11-29 11:43:38 -0500 (Thu, 29 Nov 2007)
New Revision: 16914
Added:
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/resources/server/
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/resources/server/META-INF/
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/resources/server/META-INF/jboss-service.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java
Removed:
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java
Modified:
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/business_rules_service/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/deadletter/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/exceptions_faults/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/fun_cbr/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/groovy_gateway/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_action/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_topic/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/load_generator/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/messagefilter/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/messagestore/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/scheduled_services/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/scripting_groovy/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/simple_cbr/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_aop/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_helloworld/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_mtom/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_producer/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/wiretap/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/build.xml
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java
Log:
Moved tests to in-vm mechanism: JBESB-1154
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/StoreMessageToFile.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -31,7 +31,6 @@
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.listeners.message.ActionProcessingPipeline;
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Body;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.MessagePayloadProxy;
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -0,0 +1,193 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006
+ */
+package org.jboss.soa.esb.actions;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.ActionProcessingPipeline;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+
+/**
+ * Simple action that passes the message to a logging mechanism.
+ * This action is primarily used for testing the quickstarts.
+ *
+ * @author Kevin Conner
+ */
+public class TestMessageStore extends AbstractActionPipelineProcessor
+{
+ /**
+ * The message content location.
+ */
+ public static final String LOCATION = "location" ;
+ /**
+ * The log success flag.
+ */
+ public static final String LOG_SUCCESS = "logSuccess" ;
+ /**
+ * The log exception flag.
+ */
+ public static final String LOG_EXCEPTION = "logException" ;
+
+ /**
+ * The global test message store sink.
+ */
+ private static TestMessageStoreSink testMessageStoreSink ;
+
+ /**
+ * The message payload proxy.
+ */
+ private final MessagePayloadProxy payloadProxy ;
+ /**
+ * Should we log the success notification?
+ */
+ private final boolean logSuccess ;
+ /**
+ * Should we log the exception notification?
+ */
+ private final boolean logException ;
+
+ /**
+ * Create the action with the specified configuration.
+ *
+ * @param config The action configuration.
+ */
+ public TestMessageStore(final ConfigTree config)
+ {
+ String location = config.getAttribute(LOCATION) ;
+ if(location != null)
+ {
+ config.setAttribute(MessagePayloadProxy.GET_PAYLOAD_LOCATION, location) ;
+ }
+ payloadProxy = new MessagePayloadProxy(config) ;
+ payloadProxy.setNullGetPayloadHandling(MessagePayloadProxy.NullPayloadHandling.LOG) ;
+ logSuccess = config.getBooleanAttribute(LOG_SUCCESS, false) ;
+ logException = config.getBooleanAttribute(LOG_EXCEPTION, false) ;
+ }
+
+ /**
+ * Process the message.
+ *
+ * @param message The current message.
+ * @throws ActionProcessingPipeline for errors in processing.
+ */
+ public Message process(final Message message)
+ throws ActionProcessingException
+ {
+ logContents(getContents(message)) ;
+ return message ;
+ }
+
+ /**
+ * Process the exception notification.
+ * @param message The associated message.
+ * @param th The throwable causing the exception.
+ */
+ public void processException(final Message message, final Throwable th)
+ {
+ if (logException)
+ {
+ try
+ {
+ logContents(th.getLocalizedMessage() + ':' + getContents(message)) ;
+ }
+ catch (final ActionProcessingException ape)
+ {
+ logContents(ape.getLocalizedMessage()) ;
+ }
+ }
+ }
+
+ /**
+ * Process the success notification.
+ * @param message The associated message.
+ */
+ public void processSuccess(final Message message)
+ {
+ if (logSuccess)
+ {
+ try
+ {
+ logContents("Success:" + getContents(message)) ;
+ }
+ catch (final ActionProcessingException ape)
+ {
+ logContents(ape.getLocalizedMessage()) ;
+ }
+ }
+ }
+
+ /**
+ * Get the message contents.
+ * @param message The message.
+ * @return the message contents as a string or null if no contents.
+ * @throws ActionProcessingException for errors in processing.
+ */
+ private String getContents(final Message message)
+ throws ActionProcessingException
+ {
+ final Object contents;
+
+ try
+ {
+ contents = payloadProxy.getPayload(message) ;
+ }
+ catch (final MessageDeliverException mde)
+ {
+ throw new ActionProcessingException(mde) ;
+ }
+
+ if (contents != null)
+ {
+ final String messageVal ;
+ if (contents instanceof byte[])
+ {
+ messageVal = new String((byte[])contents) ;
+ }
+ else
+ {
+ messageVal = contents.toString() ;
+ }
+ return messageVal ;
+ }
+ return null ;
+ }
+
+ /**
+ * Set the message store sink.
+ * @param testMessageStoreSink The test message store sink.
+ */
+ public static synchronized void setMessageStoreSink(final TestMessageStoreSink testMessageStoreSink)
+ {
+ TestMessageStore.testMessageStoreSink = testMessageStoreSink ;
+ }
+
+ /**
+ * Log the contents to the message store sink.
+ * @param message The current message.
+ */
+ private static synchronized void logContents(final String message)
+ {
+ if (testMessageStoreSink != null)
+ {
+ testMessageStoreSink.logMessage(message) ;
+ }
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStore.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006
+ */
+package org.jboss.soa.esb.actions;
+
+import java.util.ArrayList;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * Simple action that passes the message to a logging mechanism.
+ * This action is primarily used for testing the quickstarts.
+ *
+ * @author Kevin Conner
+ */
+public class TestMessageStoreSink
+{
+ /**
+ * The list of messages.
+ */
+ private final ArrayList<String> list = new ArrayList<String>() ;
+ /**
+ * The lock for the sink.
+ */
+ private final Lock lock = new ReentrantLock() ;
+ /**
+ * The condition for notifying messages.
+ */
+ private final Condition waitCondition = lock.newCondition() ;
+
+ /**
+ * Wait for the specified number of messages to appear in the sink.
+ * @param numberOfMessages The number of messages.
+ * @param maxDelay The maximum delay for waiting.
+ */
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ {
+ final long startTime = System.currentTimeMillis() ;
+ final long endTime = startTime + maxDelay ;
+ lock.lock() ;
+ try
+ {
+ while (list.size() != numberOfMessages)
+ {
+ final long now = System.currentTimeMillis() ;
+ final long waitPeriod = endTime - now ;
+ if (waitPeriod > 0)
+ {
+ try
+ {
+ waitCondition.await(waitPeriod, TimeUnit.MILLISECONDS) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ }
+ else
+ {
+ break ;
+ }
+ }
+ final String[] results = list.toArray(new String[0]) ;
+ list.clear() ;
+ final int numResults = results.length ;
+ System.out.println("TestMessageStoreSink: Returning " + numResults + " message" + (numResults == 1 ? "" : "s")) ;
+ for(int count = 0 ; count < numResults ; count++)
+ {
+ System.out.println("TestMessageStoreSink: Returning message[" + count + "]: " + results[count]) ;
+ }
+ return results ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+
+ /**
+ * Log the message in the sink.
+ * @param message The current message.
+ */
+ public void logMessage(final String message)
+ {
+ lock.lock() ;
+ try
+ {
+ list.add(message) ;
+ System.out.println("TestMessageStoreSink: Adding message: " + message) ;
+ waitCondition.signal() ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+
+ /**
+ * Clear the messages in the sink.
+ */
+ public void clearMessages()
+ {
+ lock.lock() ;
+ try
+ {
+ list.clear() ;
+ System.out.println("TestMessageStoreSink: Clearing messages") ;
+ }
+ finally
+ {
+ lock.unlock() ;
+ }
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/soa/esb/actions/TestMessageStoreSink.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration1/jboss-esb-unfiltered.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -85,11 +85,9 @@
maxThreads="1"/>
</listeners>
<actions>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="BPMOrchestration1Test.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
+ </action>
<action name="DeployFromFile"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="DeployProcessDefinition" />
@@ -111,11 +109,7 @@
<actions>
<action name="spy1"
class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="BPMOrchestration1Test.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<!-- move the body.getContents() into jBPM -->
<action name="create_new_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
@@ -175,7 +169,7 @@
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/service2.groovy" />
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration_Service3" name="Service3"
@@ -188,7 +182,7 @@
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/service3.groovy" />
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration_ResultsService" name="ResultsService"
@@ -200,7 +194,7 @@
<actions>
<action name="spy"
class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.esb_actions.MessageSpy"/>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -72,11 +72,9 @@
maxThreads="1"/>
</listeners>
<actions>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="BPMOrchestration2Test.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
+ </action>
<action name="DeployFromFile"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="DeployProcessDefinition" />
@@ -98,11 +96,7 @@
maxThreads="1"/>
</listeners>
<actions>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="BPMOrchestration2Test.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true"/>
</action>
@@ -140,6 +134,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service1_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service2" name="Service2"
@@ -157,6 +152,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service2_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service3" name="Service3"
@@ -174,6 +170,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service3_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -190,6 +187,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service4_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service5" name="Service5"
@@ -205,6 +203,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service5_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service6" name="Service6"
@@ -221,6 +220,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service6_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration2_Service7" name="Service7"
@@ -237,6 +237,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service7_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -255,6 +256,7 @@
<action name="alert" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.esb_actions.SimpleJMSNotifier">
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_results_Alert" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="results-message" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="message" value="SUCCESS!" />
</action>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/bpm_orchestration3/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -58,11 +58,9 @@
maxThreads="1"/>
</listeners>
<actions>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="BPMOrchestration3Test.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
+ </action>
<action name="DeployFromFile"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="DeployProcessDefinition" />
@@ -90,11 +88,7 @@
<property name="message" value="After" />
<property name="printfull" value="true"/>
</action>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="BPMOrchestration3Test.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="start_a_new_process_instance"
class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
<property name="command" value="StartProcessInstanceCommand" />
@@ -141,7 +135,7 @@
<property name="printfull" value="true"/>
</action>
-->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -168,7 +162,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration3_service1_Alert" />
</action>
-->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration3_Service2" name="Service2"
@@ -191,7 +185,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service2_Alert" />
</action>
-->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BPM_Orchestration3_Service3" name="Service3"
@@ -214,7 +208,7 @@
<property name="ALERT_QUEUE_NAME" value="quickstart_bpm_orchestration2_service3_Alert" />
</action>
-->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/business_rules_service/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/business_rules_service/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/business_rules_service/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -128,7 +128,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Concierge"/>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
@@ -144,7 +144,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Distribution"/>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
<service category="BasicShipping"
@@ -159,7 +159,7 @@
class="org.jboss.soa.esb.samples.quickstart.businessrules.ReviewMessage">
<property name="stuff" value="Shipping"/>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/deadletter/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/deadletter/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/deadletter/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -54,7 +54,7 @@
<action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true"/>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/exceptions_faults/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/exceptions_faults/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/exceptions_faults/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -60,16 +60,15 @@
<action name="A Good Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
process="displayMessage" >
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logException" value="true"/>
+ </action>
<action name="Bad Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
process="causesMyException" >
</action>
<action name="Final Good Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.JustAnotherAction"
process="displayMessage" >
</action>
- <action name="AddProperty" class="org.jboss.soa.esb.actions.PropertySetter>
- <property name="jbesbfilename" value="ExceptionsFaultsTest.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
</actions>
</service>
@@ -99,11 +98,13 @@
process="displayMessage" >
<property name="exceptionMethod" value="catchesException" />
</action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logException" value="true"/>
+ </action>
<action name="Bad Action" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
process="causesException"/>
<action name="Never Reached" class="org.jboss.soa.esb.samples.quickstart.exceptions.MyBasicAction"
process="displayMessage"/>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/fun_cbr/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/fun_cbr/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/fun_cbr/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -45,7 +45,6 @@
</jms-listener>
</listeners>
<actions mep="OneWay">
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
<action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
<property name="ruleSet" value="FunCBRRules-XPath.drl"/>
<property name="ruleLanguage" value="XPathLanguage.dsl"/>
@@ -72,6 +71,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -102,6 +102,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -132,6 +133,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<!-- Inject the transformer actions here -->
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/groovy_gateway/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/groovy_gateway/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/groovy_gateway/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -30,7 +30,7 @@
<actions mep="RequestResponse">
<action name="greeting1" class="org.jboss.soa.esb.samples.quickstart.groovygateway.GreeterAction"/>
<action name="greeting2" class="org.jboss.soa.esb.samples.quickstart.groovygateway.AnotherAction"/>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -47,7 +47,7 @@
<property name="printfull" value="true"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_action/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_action/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -51,8 +51,6 @@
<property name="exceptionMethod" value="exceptionHandler"/>
</action>
- <!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
<action name="notificationAction"
class="org.jboss.soa.esb.actions.Notifier">
<property name="okMethod" value="notifyOK" />
@@ -66,7 +64,8 @@
</NotificationList>
</property>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <!-- The next action is for Continuous Integration testing -->
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_file_action/jboss-esb-unfiltered.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -62,7 +62,7 @@
<property name="printfull" value="true"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_topic/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_topic/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/jms_topic/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -72,11 +72,7 @@
</listeners>
<actions mep="OneWay">
<action name="target" class="org.jboss.soa.esb.samples.quickstart.jmstopic.TargetServiceAction" />
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="JMSTopicTest.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/load_generator/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/load_generator/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/load_generator/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -59,7 +59,7 @@
class="org.jboss.soa.esb.actions.SystemPrintln">
<property name="printfull" value="true" />
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/messagefilter/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/messagefilter/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/messagefilter/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -75,11 +75,7 @@
</NotificationList>
</property>
</action>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="MessageFilterTest.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/messagestore/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/messagestore/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/messagestore/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -48,11 +48,9 @@
</NotificationList>
</property>
</action>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="MessageStoreTest.log"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore">
+ <property name="logSuccess" value="true"/>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
<!-- Check that the message is really there (executes on success of pipeline) -->
<action name="CheckMessageStore" class="org.jboss.soa.esb.samples.quickstart.messagestore.CheckMessageStoreAction" />
<!-- Add a copy of the message to the message store under categorization 'test' -->
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/scheduled_services/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/scheduled_services/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/scheduled_services/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -28,7 +28,7 @@
<action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor">
<property name="script" value="/scripts/iTunesTop5.groovy" />
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/scripting_groovy/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/scripting_groovy/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/scripting_groovy/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -51,7 +51,7 @@
<property name="script" value="/scripts/messagePlay.groovy" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/simple_cbr/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/simple_cbr/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/simple_cbr/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -54,7 +54,6 @@
</jms-listener>
</listeners>
<actions mep="OneWay">
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
<action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="ContentBasedRouter">
<property name="ruleSet" value="SimpleCBRRules-XPath.drl"/>
<property name="ruleLanguage" value="XPathLanguage.dsl"/>
@@ -80,6 +79,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="displayMessageAction"
class="org.jboss.soa.esb.samples.quickstart.simplecbr.MyJMSListenerAction"
process="displayMessage"
@@ -105,6 +105,7 @@
/>
</listeners>
<actions mep="OneWay">
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
<action name="displayMessageAction"
class="org.jboss.soa.esb.samples.quickstart.simplecbr.MyJMSListenerAction"
process="displayMessage"
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_aop/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_aop/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_aop/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -43,7 +43,7 @@
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="spring-context.xml"/>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_helloworld/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_helloworld/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -55,7 +55,7 @@
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="spring-context-goodbye.xml,spring-context-hello.xml"/>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -43,7 +43,7 @@
<property name="exceptionMethod" value="exceptionHandler"/>
<property name="springContextXml" value="applicationContext.xml,dataAccessContext-local.xml"/>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -64,9 +64,7 @@
<property name="message" value=">>>> Message after Smooks intermediate xml -> target xml : " />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -37,9 +37,7 @@
<property name="message" value="[transform_EDI2XML_Groovy_XSLT] Message after transformation" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2POJO/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -57,9 +57,7 @@
<property name="message" value=">>>> Message after Smooks intermediate xml -> target pojos : " />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -39,9 +39,7 @@
value="[transform_XML2XML_date_manipulation] Message after transformation"/>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -37,9 +37,7 @@
<property name="message" value="[transform_XML2XML_simple] Message after transformation" />
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile">
- <property name="raw" value="true"/>
- </action>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_consumer1/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -37,11 +37,7 @@
<action name="response-mapper"
class="org.jboss.soa.esb.samples.quickstart.webservice_consumer1.MyResponseAction">
</action>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="WebServiceConsumer1Test.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_consumer2/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -37,11 +37,7 @@
<action name="response-mapper"
class="org.jboss.soa.esb.samples.quickstart.webservice_consumer2.MyResponseAction">
</action>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="BPMOrchestration2Test.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
</services>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_mtom/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_mtom/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_mtom/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -39,11 +39,7 @@
<property name="message"
value="[Quickstart_webservice_producer] Message after invoking jbossws endpoint"/>
</action>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="WebServiceMTOMTest.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_producer/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_producer/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/webservice_producer/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -49,11 +49,7 @@
<property name="message"
value="[Quickstart_webservice_producer] AFTER invoking jbossws endpoint"/>
</action>
- <action name="AddProperty"
- class="org.jboss.soa.esb.actions.PropertySetter">
- <property name="jbesbfilename" value="WebServiceProducerTest.log"/>
- </action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile"/>
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/wiretap/jboss-esb.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/wiretap/jboss-esb.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/samples/quickstarts/wiretap/jboss-esb.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -80,7 +80,7 @@
</property>
</action>
<!-- The next action is for Continuous Integration testing -->
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
@@ -103,7 +103,7 @@
</NotificationList>
</property>
</action>
- <action name="testStore" class="org.jboss.soa.esb.actions.StoreMessageToFile" />
+ <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore" />
</actions>
</service>
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/build.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/build.xml 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/build.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -18,7 +18,7 @@
<property name="qa.quickstarts.build" location="${qa.build}/quickstarts"/>
<property name="qa.quickstarts.build.lib" location="${qa.quickstarts.build}/lib"/>
<property name="qa.quickstarts.classes" location="${qa.quickstarts.build}/classes"/>
- <property name="qa.junit.resources" location="resources"/>
+ <property name="qa.quickstarts.resources" location="resources"/>
<property name="qa.quickstarts.report" location="${qa.quickstarts.build}/report"/>
<property name="qa.quickstarts.memory" value="128m"/>
@@ -125,7 +125,7 @@
<fileset dir="${product.lib.ext}" includes="*.jar"/>
<fileset dir="${product.lib}" includes="*.jar"/>
- <pathelement location="${qa.junit.resources}"/>
+ <pathelement location="${qa.quickstarts.resources}"/>
<path refid="base.cp"/>
</path>
@@ -180,7 +180,12 @@
<mkdir dir="${qa.quickstarts.classes}"/>
<javac srcdir="${qa.quickstarts.src}" destdir="${qa.quickstarts.classes}" classpathref="qa.quickstarts.cp" debug="on"/>
-
+ <jar jarfile="${qa.quickstarts.build.lib}/QuickstartMessageStoreServer.sar">
+ <fileset dir="${qa.quickstarts.classes}">
+ <include name="org/jboss/soa/esb/server/*.class"/>
+ </fileset>
+ <fileset dir="${qa.quickstarts.resources}/server"/>
+ </jar>
</target>
<target name="clean-esb" if="quickstarts.exist">
@@ -344,6 +349,8 @@
<exclude name="**/SpringJPetStoreTest.java"/>
<exclude name="**/HelloWorldSQLActionTest.java"/>
<exclude name="**/BPMOrchestration1Test.java"/>
+ <!-- The following quickstart is broken -->
+ <exclude name="**/BPMOrchestration3Test.java"/>
<exclude name="**/HelloWorldFileNotifierTest.java"/>
<exclude name="**/RecipientlistTest.java"/>
<exclude name="**/ExceptionsFaultsTest.java"/>
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/resources/server/META-INF/jboss-service.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/resources/server/META-INF/jboss-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/resources/server/META-INF/jboss-service.xml 2007-11-29 16:43:38 UTC (rev 16914)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+ <mbean code="org.jboss.soa.esb.server.QuickstartMessageStoreImpl"
+ name="jboss.esb:test=QuickstartMessageStoreServer"/>
+</server>
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/resources/server/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.quickstart.test;
+
+import java.lang.reflect.UndeclaredThrowableException;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+import org.jboss.soa.esb.server.QuickstartMessageStore;
+import org.jboss.soa.esb.server.QuickstartMessageStoreImplMBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Abstract test case for Quickstart tests
+ *
+ * @author <a href="mailto:kconner at redhat.com">Kevin Conner</a>
+ */
+public abstract class AbstractQuickstartTestCase extends JBossTestCase
+{
+ /**
+ * Construct the test case with the specified name.
+ * @param name The test name.
+ */
+ protected AbstractQuickstartTestCase(final String name)
+ {
+ super(name) ;
+ }
+
+ /**
+ * Clear the messages in the sink.
+ * @throws Exception for unexpected errors.
+ */
+ protected void clearMessages()
+ throws Exception
+ {
+ getQuickstartMessageStore().clearMessages() ;
+ }
+
+ /**
+ * Wait for the specified count of messages.
+ * @param numberOfMessages The expected number of messages.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @return The message list if present, otherwise current contents.
+ * @throws Exception for unexpected errors.
+ */
+ protected String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ throws Exception
+ {
+ final String[] sinkMessages = getQuickstartMessageStore().waitForMessages(numberOfMessages, maxDelay) ;
+ final int numberOfSinkMessages = (sinkMessages == null ? 0 : sinkMessages.length) ;
+ assertEquals("Message count", numberOfMessages, numberOfSinkMessages) ;
+ return sinkMessages ;
+ }
+
+ /**
+ * Check the stored messages against the expected messages.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @param expectedMessages The expected messages.
+ * @throws Exception for unexpected errors.
+ */
+ protected void checkMessages(final long maxDelay, String ... expectedMessages)
+ throws Exception
+ {
+ final int numberOfMessages = (expectedMessages == null ? 0 : expectedMessages.length) ;
+ final String[] sinkMessages = waitForMessages(numberOfMessages, maxDelay) ;
+
+ for(int count = 0 ; count < numberOfMessages ; count++)
+ {
+ assertEquals("Message: " + count, expectedMessages[count],
+ sinkMessages[count]) ;
+ }
+ }
+
+ /**
+ * Check the stored messages against the expected patterns.
+ * @param maxDelay The maximum delay to wait for the messages.
+ * @param expectedPatterns The patterns of the expected messages.
+ * @throws Exception for unexpected errors.
+ */
+ protected void checkPatternMessages(final long maxDelay, String ... expectedPatterns)
+ throws Exception
+ {
+ final int numberOfMessages = (expectedPatterns == null ? 0 : expectedPatterns.length) ;
+ final String[] sinkMessages = waitForMessages(numberOfMessages, maxDelay) ;
+ for(int count = 0 ; count < numberOfMessages ; count++)
+ {
+ final String sinkMessage = sinkMessages[count] ;
+ assertTrue("Message: " + count, (sinkMessage != null) && sinkMessage.matches(expectedPatterns[count])) ;
+ }
+ }
+
+ /**
+ * Get a proxy to the quickstart message store MBean.
+ * @return The mbean proxy.
+ * @throws Exception for unexpected errors.
+ */
+ private QuickstartMessageStore getQuickstartMessageStore()
+ throws Exception
+ {
+ return new QuickstartMessageStoreProxy(getServer()) ;
+ }
+
+ /**
+ * Proxy class to simplify the interactions with the MBean.
+ * @author kevin
+ */
+ private static final class QuickstartMessageStoreProxy implements QuickstartMessageStore
+ {
+ private final MBeanServerConnection serverConnection ;
+
+ QuickstartMessageStoreProxy(final MBeanServerConnection serverConnection)
+ {
+ this.serverConnection = serverConnection ;
+ }
+
+ public void clearMessages()
+ {
+ try
+ {
+ serverConnection.invoke(new ObjectName(QuickstartMessageStoreImplMBean.objectName), "clearMessages",
+ null, null) ;
+ }
+ catch (final RuntimeException re)
+ {
+ throw re ;
+ }
+ catch (final Error error)
+ {
+ throw error ;
+ }
+ catch (final Throwable th)
+ {
+ throw new UndeclaredThrowableException(th) ;
+ }
+ }
+
+ public String[] waitForMessages(int numberOfMessages, long maxDelay)
+ {
+ try
+ {
+ return (String[])serverConnection.invoke(new ObjectName(QuickstartMessageStoreImplMBean.objectName), "waitForMessages",
+ new Object[] {Integer.valueOf(numberOfMessages), Long.valueOf(maxDelay)},
+ new String[] {Integer.TYPE.getName(), Long.TYPE.getName()}) ;
+ }
+ catch (final RuntimeException re)
+ {
+ throw re ;
+ }
+ catch (final Error error)
+ {
+ throw error ;
+ }
+ catch (final Throwable th)
+ {
+ throw new UndeclaredThrowableException(th) ;
+ }
+ }
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/AbstractQuickstartTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration1Test.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,65 +20,44 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the bpmorchestration1 test.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class BPMOrchestration1Test extends JBossTestCase {
+public class BPMOrchestration1Test extends AbstractQuickstartTestCase {
private static final String DEPLOY_MESSAGE = "Go Deploy It";
private static final String START_MESSAGE = "Start It Up";
-
- private static final String FILE_NAME = "BPMOrchestration1Test.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public BPMOrchestration1Test(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
+ clearMessages() ;
+ sendDeployMessage() ;
+ checkMessages(30000, DEPLOY_MESSAGE) ;
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String deployMessage = (String) theTable.get("Message1");
- String startMessage = (String) theTable.get("Message2");
- assertEquals("The strings should match", DEPLOY_MESSAGE, deployMessage);
- assertEquals("The strings should match", START_MESSAGE, startMessage);
+ clearMessages() ;
+ sendStartMessage() ;
+ checkMessages(30000, START_MESSAGE) ;
}
- public void sendMessage() throws Exception {
+ public void sendDeployMessage() throws Exception {
SendTestMessage sm = new SendTestMessage();
sm.sendMessage(Helpers.getQuickstartLocation("bpm_orchestration1/build/inputdir"), ".deployProcessGW", DEPLOY_MESSAGE);
- Thread.sleep(4000);
+ }
+
+ public void sendStartMessage() throws Exception {
SendTestMessage stm = new SendTestMessage();
stm.sendMessage(Helpers.getQuickstartLocation("bpm_orchestration1/build/inputdir"), ".startProcessGW", START_MESSAGE);
- Thread.sleep(4000);
}
public static Test suite() throws Exception {
- return getDeploySetup(BPMOrchestration1Test.class, "Quickstart_bpm_orchestration1.esb");
+ return getDeploySetup(BPMOrchestration1Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration1.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration2Test.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,73 +20,62 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.test.SendJMSMessageDeploy;
import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration2.test.SendJMSMessageStart;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the bpmorchestration3 test.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class BPMOrchestration2Test extends JBossTestCase {
- private static final String JMS_MESSAGE = "Getting Started 'Receive Order' 'Credit Check' "
- + "'Validate Order' 'Inventory Check' 'Los Angeles' 'Atlanta' 'Dallas' ";
-
- private static final String FILE_NAME = "BPMOrchestration2Test.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
+public class BPMOrchestration2Test extends AbstractQuickstartTestCase {
private static final String DEPLOY_DEF_MESSAGE = "Hello World: Deploy the process def";
+
private static final String GETTING_STARTED_MESSAGE = "Getting Started";
+ private static final String RECEIVE_ORDER_MESSAGE = GETTING_STARTED_MESSAGE + " 'Receive Order' " ;
+ private static final String CREDIT_CHECK_MESSAGE = RECEIVE_ORDER_MESSAGE + " 'Credit Check' " ;
+ private static final String VALIDATE_ORDER_MESSAGE = CREDIT_CHECK_MESSAGE + " 'Validate Order' " ;
+ private static final String INVENTORY_CHECK_MESSAGE = VALIDATE_ORDER_MESSAGE + " 'Inventory Check' " ;
+ private static final String SHIPPED_MESSAGE = " 'Shipped' " ;
public BPMOrchestration2Test(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String deployMessage = (String) theTable.get("Message1");
- String startedMessage = (String) theTable.get("Message2");
- assertEquals("The strings should match", DEPLOY_DEF_MESSAGE, deployMessage);
- assertEquals("The strings should match", GETTING_STARTED_MESSAGE, startedMessage);
+ clearMessages() ;
+ sendDeployMessage() ;
+ checkMessages(30000, DEPLOY_DEF_MESSAGE, "Success:" + DEPLOY_DEF_MESSAGE) ;
+
+ clearMessages() ;
+ sendStartMessage() ;
+
+ final String[] messages = waitForMessages(9, 30000) ;
+ assertEquals(GETTING_STARTED_MESSAGE, messages[0]) ;
+ assertEquals(RECEIVE_ORDER_MESSAGE, messages[1]) ;
+ assertEquals(CREDIT_CHECK_MESSAGE, messages[2]) ;
+ assertEquals(VALIDATE_ORDER_MESSAGE, messages[3]) ;
+ assertEquals(INVENTORY_CHECK_MESSAGE, messages[4]) ;
+ assertTrue("Shipped triggered", (messages[8] != null) && messages[8].endsWith(SHIPPED_MESSAGE)) ;
}
- public void sendMessage() throws Exception {
+ public void sendDeployMessage() throws Exception {
SendJMSMessageDeploy sd = new SendJMSMessageDeploy();
sd.setupConnection();
sd.sendAMessage(DEPLOY_DEF_MESSAGE);
sd.stop();
- Thread.sleep(4000);
+ }
+
+ public void sendStartMessage() throws Exception {
SendJMSMessageStart sm = new SendJMSMessageStart();
sm.setupConnection();
sm.sendAMessage(GETTING_STARTED_MESSAGE);
sm.stop();
- Thread.sleep(8000);
}
public static Test suite() throws Exception {
- return getDeploySetup(BPMOrchestration2Test.class, "Quickstart_bpm_orchestration2.esb");
+ return getDeploySetup(BPMOrchestration2Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration2.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestration3Test.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,73 +20,52 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstarts.bpm_orchestration3.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the bpmorchestration3 test.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class BPMOrchestration3Test extends JBossTestCase {
- private static final String JMS_MESSAGE = "Hello start";
-
- private static final String FILE_NAME = "BPMOrchestration3Test.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
+public class BPMOrchestration3Test extends AbstractQuickstartTestCase {
private static final String DEPLOY_MESSAGE = "Hello Deploy";
private static final String START_MESSAGE = "Hello start";
+ private static final String SERVICE_1_MESSAGE = START_MESSAGE + " 'Service 1' ";
+ private static final String SERVICE_2_MESSAGE = SERVICE_1_MESSAGE + " 'Service 2' ";
+ private static final String SERVICE_3_MESSAGE = SERVICE_2_MESSAGE + " 'Service 3' ";
public BPMOrchestration3Test(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String deployMessage = (String) theTable.get("Message1");
- String startMessage = (String) theTable.get("Message2");
-
- assertEquals("The strings should match", DEPLOY_MESSAGE, deployMessage);
- assertEquals("The strings should match", START_MESSAGE, startMessage);
-
+ clearMessages() ;
+ sendDeployMessage() ;
+ checkMessages(30000, DEPLOY_MESSAGE, "Success:" + DEPLOY_MESSAGE) ;
+
+ clearMessages() ;
+ sendStartMessage() ;
+ checkMessages(30000, START_MESSAGE, SERVICE_1_MESSAGE,
+ SERVICE_2_MESSAGE, SERVICE_3_MESSAGE) ;
}
- public void sendMessage() throws Exception {
+ public void sendDeployMessage() throws Exception {
SendJMSMessage sdm = new SendJMSMessage();
sdm.setupConnection("queue/quickstart_bpm_orchestration3_deploy_Request_gw");
sdm.sendAMessage("Hello Deploy", null);
sdm.stop();
- Thread.sleep(8000);
+ }
+
+ public void sendStartMessage() throws Exception {
SendJMSMessage ssm = new SendJMSMessage();
ssm.setupConnection("queue/quickstart_bpm_orchestration3_start_Request_gw");
ssm.sendAMessage("Hello start", "${token}");
ssm.stop();
- Thread.sleep(4000);
}
public static Test suite() throws Exception {
- return getDeploySetup(BPMOrchestration3Test.class, "Quickstart_bpm_orchestration3.esb");
+ return getDeploySetup(BPMOrchestration3Test.class, "QuickstartMessageStoreServer.sar, Quickstart_bpm_orchestration3.esb");
}
}
Deleted: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BPMOrchestrationTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -1,56 +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.quickstart.test;
-
-import junit.framework.Test;
-
-import org.jboss.test.JBossTestCase;
-
-
-/**
- * Sample client for the jboss container.
- *
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- */
-public class BPMOrchestrationTest
- extends JBossTestCase
-{
- public BPMOrchestrationTest(String name)
- {
- super(name);
- }
-
- public void testMessage() throws Exception
- {
- sendMessage();
- Thread.sleep(10000); // wait for message to post.
- }
-
- public void sendMessage() throws Exception
- {
- }
-
- public static Test suite() throws Exception
- {
- return getDeploySetup(BPMOrchestrationTest.class, "Quickstart_bpm_orchestration1.esb");
- }
-}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/BusinessRulesServiceTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,73 +20,50 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.businessrules.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the businessrulesservice quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class BusinessRulesServiceTest extends JBossTestCase {
- private static final String JMS_MESSAGE = "<Order netAmount=\"59.97\" orderDate=\"([^\"]+)\" "
- + "orderId=\"1\" statusCode=\"0\" "
- + "tax=\"4.95\" totalAmount=\"64.92\"> "
- + "<Customer firstName=\"Harry\" lastName=\"Fletcher\" state=\"SD\" userName=\"user1\">"
- + "</Customer> <OrderLines> <OrderLine position=\"1\" quantity=\"1\">([\\s]+)"
- + "<Product price=\"29.98\" productId=\"364\" title=\"The 40-Year-Old Virgin \"></Product>([\\s]+)"
- + "</OrderLine>([\\s]+)<OrderLine position=\"2\" quantity=\"1\">([\\s]+)"
- + "<Product price=\"29.99\" productId=\"299\" title=\"Pulp Fiction\"></Product>([\\s]+)"
- + "</OrderLine>[\\s]+</OrderLines></Order>.*";
+public class BusinessRulesServiceTest extends AbstractQuickstartTestCase {
+ private static final String JMS_MESSAGE =
+ "<Order netAmount=\"59.97\" orderDate=\"Wed Nov 15 13:45:28 EST 2006\" orderId=\"1\" statusCode=\"0\" tax=\"4.95\" totalAmount=\"64.92\">" +
+ " <Customer firstName=\"Harry\" lastName=\"Fletcher\" state=\"SD\" userName=\"user1\"/>" +
+ " <OrderLines>" +
+ " <OrderLine position=\"1\" quantity=\"1\">" +
+ " <Product price=\"29.98\" productId=\"364\" title=\"The 40-Year-Old Virgin \"/>" +
+ " </OrderLine>" +
+ " <OrderLine position=\"2\" quantity=\"1\">" +
+ " <Product price=\"29.99\" productId=\"299\" title=\"Pulp Fiction\"/>" +
+ " </OrderLine>" +
+ " </OrderLines>" +
+ "</Order>" ;
- private static final String FILE_NAME = "BusinessRulesServiceTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public BusinessRulesServiceTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete());
- }
-
+ clearMessages();
sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertTrue("String found [" + theMessage + "] should match pattern [" + JMS_MESSAGE + "]",
- theMessage.matches(JMS_MESSAGE));
+ final String[] messages = waitForMessages(1, 30000) ;
+ assertTrue("XML response message", Helpers.compareXMLContent(JMS_MESSAGE, messages[0])) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
String fileContent = sm.readAsciiFile(Helpers.getQuickstartLocation("business_rules_service/SampleOrder.xml"));
- System.out.println("FILECONTENT [" + fileContent + "]");
sm.sendAMessage(fileContent) ;
sm.stop();
- Thread.sleep(8000);
}
public static Test suite() throws Exception {
- return getDeploySetup(BusinessRulesServiceTest.class, "Quickstart_business_rules_service.esb");
+ return getDeploySetup(BusinessRulesServiceTest.class, "QuickstartMessageStoreServer.sar, Quickstart_business_rules_service.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DeadLetterTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,22 +21,9 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.io.RandomAccessFile;
-import java.util.Hashtable;
-import java.util.Map;
-import java.net.URI;
-import java.util.Date;
import junit.framework.Test;
-import org.junit.Assert.*;
-import java.util.Properties;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.samples.quickstart.deadletter.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
-import org.jboss.soa.esb.services.persistence.MessageStore;
-import org.jboss.soa.esb.services.persistence.MessageStoreException;
/**
@@ -44,73 +31,27 @@
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class DeadLetterTest extends JBossTestCase {
+public class DeadLetterTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "DeadLetterTest message";
- private static final String FILE_NAME = "DeadLetterTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public DeadLetterTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- try {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
-
- }
-
- /* Send the message to trigger the start of the test */
- sendMessage();
-
- /* Verify that the message file is created */
-
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
-
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
-
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
-
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
-
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage = (String) theTable.get("Message1");
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
+ clearMessages() ;
+ sendMessage();
+ checkPatternMessages(30000, '^' + JMS_MESSAGE + ".*$") ;
} /* method */
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END) ;
+ sm.sendAMessage(JMS_MESSAGE) ;
sm.stop();
}
public static Test suite() throws Exception {
- return getDeploySetup(DeadLetterTest.class, "Quickstart_deadletter.esb");
+ return getDeploySetup(DeadLetterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_deadletter.esb");
}
} /* class */
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/DynamicRouterTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,27 +21,19 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.dynamicRouter.test.ReceiveJMSMessage;
import org.jboss.soa.esb.samples.quickstart.dynamicRouter.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the dynamicouter QS.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class DynamicRouterTest extends JBossTestCase
+public class DynamicRouterTest extends AbstractQuickstartTestCase
{
private static final String JMS_MESSAGE = "DynamicRouterTest message";
- private static final String FILE_NAME = "DynamicRouterTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 3;
public DynamicRouterTest(String name)
{
@@ -50,35 +42,9 @@
public void testMessage() throws Exception
{
- sendMessage();
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
- String theMessage3 = (String) theTable.get("Message3");
-
- assertEquals("The strings1 should match", theMessage1, JMS_MESSAGE);
- assertEquals("The strings2 should match", theMessage2, JMS_MESSAGE);
- assertEquals("The strings3 should match", theMessage3, JMS_MESSAGE);
-
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception
@@ -92,12 +58,12 @@
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception
{
- return getDeploySetup(DynamicRouterTest.class, "Quickstart_dynamic_router.esb");
+ return getDeploySetup(DynamicRouterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_dynamic_router.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ExceptionsFaultsTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,14 +21,9 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.exceptions.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the exceptionsfaults quickstart.
@@ -36,37 +31,17 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
* @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
*/
-public class ExceptionsFaultsTest extends JBossTestCase {
+public class ExceptionsFaultsTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldTest message";
- private static final String FILE_NAME = "ExceptionsFaultsTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public ExceptionsFaultsTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, "CHECK") ;
}
public void sendMessage() throws Exception {
@@ -74,10 +49,9 @@
sm.setupConnection("queue/quickstart_exceptions_faults_GW");
sm.sendAMessage("ExceptionCaughtService", "Via Gateway");
sm.stop();
- Thread.sleep(8000);
}
public static Test suite() throws Exception {
- return getDeploySetup(ExceptionsFaultsTest.class, "Quickstart_exceptions_faults.esb");
+ return getDeploySetup(ExceptionsFaultsTest.class, "QuickstartMessageStoreServer.sar, Quickstart_exceptions_faults.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/FunCBRTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -22,12 +22,8 @@
package org.jboss.soa.esb.quickstart.test;
import junit.framework.Test;
-import java.io.File;
-import java.util.Hashtable;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.funcbr.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
@@ -37,63 +33,23 @@
* @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
*/
public class FunCBRTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
- private static final String JMS_MESSAGE = "FunCBRTest message";
-
- private static final String FILE_NAME = "FunCBRTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
-
- /* Need to handle situation unique to this test's use of XML in message */
- // private static String LOCAL_END_TAG = Helpers.END_TAG.trim();
- private static String TEST_STRING = JMS_MESSAGE
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END;
private static String theXML = "<Order orderId=\"1\" "
+ "orderDate=\"Wed Nov 15 13:45:28 EST 2006\" "
+ "statusCode=\"0\" " + "netAmount=\"59.97\" "
- + "totalAmount=\"64.92\" " + "tax=\"4.95\" " + "junk=\""
- + TEST_STRING + " \"></Order>\n";
- private static String returnedXML = theXML.substring(0, theXML
- .indexOf(StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START))
- + " \"></Order>";
+ + "totalAmount=\"64.92\" " + "tax=\"4.95\" "
+ + "junk=\"FunCBRTest message\"></Order>";
public FunCBRTest(String name) {
super(name);
} /* method */
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String,String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String,String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", theMessage, returnedXML);
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
+ assertTrue("XML Content", Helpers.compareXMLContent(theXML, messages[0])) ;
} /* method */
public void sendMessage() throws Exception {
@@ -104,7 +60,7 @@
} /* method */
public static Test suite() throws Exception {
- return getDeploySetup(FunCBRTest.class, "Quickstart_fun_cbr.esb");
+ return getDeploySetup(FunCBRTest.class, "QuickstartMessageStoreServer.sar, Quickstart_fun_cbr.esb");
} /* method */
} /* class */
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldActionTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,14 +21,9 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworldaction.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the helloworldaction quickstart.
@@ -36,52 +31,29 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldActionTest extends JBossTestCase {
+public class HelloWorldActionTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldActionTest message";
- private static final String RESPONSE_MESSAGE = "BEFORE**" + JMS_MESSAGE + "AFTER**" ;
- private static final String FILE_NAME = "HelloWorldActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
+ private static final String RESPONSE_MESSAGE = "\nBEFORE**\n" + JMS_MESSAGE + "\nAFTER**\n" ;
public HelloWorldActionTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", RESPONSE_MESSAGE, theMessage);
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESPONSE_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldActionTest.class,
- "Quickstart_helloworld_action.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_helloworld_action.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,69 +21,37 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworlddbregistration.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the helloworlddbregistration quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldDBRegistrationTest extends JBossTestCase {
+public class HelloWorldDBRegistrationTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldDBRegistrationTest message";
- private static final String FILE_NAME = "HelloWorldDBRegistrationTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
public HelloWorldDBRegistrationTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", theMessage, JMS_MESSAGE);
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldDBRegistrationTest.class,
- "Quickstart_db_registration.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_db_registration.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileActionTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -24,30 +24,21 @@
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
-import java.util.Hashtable;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.test.JBossTestCase;
-
/**
* CI test for the helloworldfileaction quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class HelloWorldFileActionTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
- private static final String FILE_NAME = "HelloWorldFileActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
private static final String INPUT_DIRECTORY = "helloworld_file_action/build/dirs/input/";
private static final String INPUT_FILE_NAME = "MyInput.dat";
- private static final String OUTPUT_DIRECTORY = "helloworld_file_action/build/dirs/output/";
- private static final String OUTPUT_FILE_NAME = OUTPUT_DIRECTORY + "MyInput.dat.sentToEsb";
private static final String FILE_CONTENTS = "Hello World In A File";
- private static final String RESPONSE_CONTENTS = "BEFORE"+FILE_CONTENTS+"AFTER";
+ private static final String RESPONSE_CONTENTS = "\nBEFORE\n"+FILE_CONTENTS+"\nAFTER\n";
public HelloWorldFileActionTest(String name)
{
@@ -56,79 +47,23 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
- final String outputFileName = Helpers.getQuickstartLocation(OUTPUT_FILE_NAME) ;
-
- createFileAction();
-
- /* Verify that the output file is created */
- boolean fileExists = Helpers.checkForFile(outputFileName);
- if (!fileExists) {
- fail("File " + outputFileName
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is created */
- fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the log file is complete */
- boolean logFileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!logFileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("File Action Output file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- /* Check the log file */
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings in the log file should match", RESPONSE_CONTENTS, theMessage);
-
- /* Verify that the output file is complete */
- boolean fileComplete = Helpers.checkFileContent(outputFileName,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(outputFileName);
- fail("File Action Output file " + outputFileName + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- theTable = Helpers.getMessageString(outputFileName);
- theMessage = (String) theTable.get("Message1");
- assertEquals("The strings in output file should match", FILE_CONTENTS, theMessage);
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ createFileAction();
+ checkMessages(30000, RESPONSE_CONTENTS) ;
} /* method */
public void createFileAction() throws Exception
{
- String tempStr = FILE_CONTENTS + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END;
final String inputDirectory = Helpers.getQuickstartLocation(INPUT_DIRECTORY) ;
File x = new File(inputDirectory, INPUT_FILE_NAME);
- try {
BufferedWriter out = new BufferedWriter(new FileWriter(x));
- out.write(tempStr.toCharArray());
+ out.write(FILE_CONTENTS);
out.close();
- } catch (Exception e) {
- System.out.println("Error while writing the file: " + x.getAbsolutePath());
- System.out.println(e.getMessage());
- }
} /* method */
public static Test suite() throws Exception
{
- return getDeploySetup(HelloWorldFileActionTest.class, "Quickstart_helloworld_file_action.esb");
+ return getDeploySetup(HelloWorldFileActionTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld_file_action.esb");
} /* method */
} /*/class */
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldFileNotifierTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,90 +21,36 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworldfilenotifier.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the helloworldfilenotifier quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldFileNotifierTest extends JBossTestCase {
+public class HelloWorldFileNotifierTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldFileNotifierTest message";
- private static final String FILE_NAME = "HelloWorldFileNotifierTest.log";
- private static final String RESULTS_FILE = "results.log";
- private static final String QUICKSTART_NAME = "helloworld_file_notifier";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
public HelloWorldFileNotifierTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- String quickstartDir = System.getProperty("org.jboss.esb.test.quickstarts.dir");
- sendMessage();
-
- String fileName = quickstartDir + File.separator + QUICKSTART_NAME
- + File.separator + RESULTS_FILE;
- /* Verify that the results file is created */
- File tempFile = new File(fileName);
- boolean fileExists = tempFile.exists();
- if (!fileExists) {
- fail("File " + RESULTS_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify results file contents */
- boolean fileComplete = Helpers.checkFileContent(fileName,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String,String> temp = Helpers.getMessageString(fileName);
- File target = new File(RESULTS_FILE);
- //target.delete();
- fail("Results file " + RESULTS_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable <String,String>theTable = Helpers.getMessageString(fileName);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", theMessage, JMS_MESSAGE);
- File target = new File(RESULTS_FILE);
-
- /* Verify that the message file is complete */
-
- fileComplete = Helpers.checkFileContent(fileName,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String,String> temp = Helpers.getMessageString(fileName);
- target = new File(fileName);
- fail("Event file " + fileName + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- theTable = Helpers.getMessageString(fileName);
- theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", theMessage, JMS_MESSAGE);
- target = new File(fileName);
+ clearMessages() ;
+ sendMessage();
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
- return getDeploySetup(HelloWorldFileNotifierTest.class, "Quickstart_helloworld_file_notifier.esb");
+ return getDeploySetup(HelloWorldFileNotifierTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld_file_notifier.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldSQLActionTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,32 +21,27 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import junit.framework.Test;
-
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.test.JBossTestCase;
-
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
import java.util.Vector;
+import junit.framework.Test;
+
/**
* CI test for the helloworldsqlaction quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldSQLActionTest extends JBossTestCase {
+public class HelloWorldSQLActionTest extends AbstractQuickstartTestCase {
- private static final String FILE_NAME = "HelloWorldSQLActionTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
-
-
public HelloWorldSQLActionTest(String name) {
super(name);
}
public void testMessage() throws Exception {
+ fail("Not supported yet") ;
sendMessage();
// Commented out 20070824 - ldimaggi - the log file is not
@@ -102,22 +97,21 @@
// Could not connect to the database
}
- String loggingInfo = StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + LOG_FILE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END;
Vector<String> theRecords = new Vector<String>();
- String tempStr = "insert into gateway_table values(0,'data 111111 " + loggingInfo + " ','p')";
+ String tempStr = "insert into gateway_table values(0,'data 111111','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data 22 " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data 22','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data 333333333333111111 " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data 333333333333111111','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data d d d d " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data d d d d','p')";
theRecords.add(tempStr);
- tempStr = "insert into gateway_table values(0,'data data last record " + loggingInfo + " ','p')";
+ tempStr = "insert into gateway_table values(0,'data data last record','p')";
theRecords.add(tempStr);
for (int i = 0; i < theRecords.size(); i++) {
@@ -134,7 +128,7 @@
public static Test suite() throws Exception {
return getDeploySetup(HelloWorldSQLActionTest.class,
- "Quickstart_helloworld_SQL_action.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_helloworld_SQL_action.esb");
}/* method */
} /* class */
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,75 +21,36 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the helloworld quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class HelloWorldTest extends JBossTestCase {
+public class HelloWorldTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldTest message";
- private static final String FILE_NAME = "HelloWorldTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public HelloWorldTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END) ;
+ sm.sendAMessage(JMS_MESSAGE) ;
sm.stop();
}
public static Test suite() throws Exception {
- return getDeploySetup(HelloWorldTest.class, "Quickstart_helloworld.esb");
+ return getDeploySetup(HelloWorldTest.class, "QuickstartMessageStoreServer.sar, Quickstart_helloworld.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/Helpers.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -23,134 +23,26 @@
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileReader;
import java.io.IOException;
import java.io.StringReader;
-import java.util.Hashtable;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.quickstart.test.util.IdentitySAXHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import junit.framework.Assert;
-
/**
* Helper class for quickstart tests
*
*/
public class Helpers {
- public static final int FILE_TIMER = 3000;
- public static final int FILE_COUNTER = 5;
- /* Read the message files into a hash */
- public static Hashtable<String, String> getMessageString(String fileName) {
- Hashtable<String,String> returnTable = new Hashtable<String,String>();
- int theCounter = 1;
- try {
- BufferedReader in = new BufferedReader(new FileReader(fileName));
- String str;
- while ((str = in.readLine()) != null) {
- final int startTag = str.indexOf(StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START);
- if (startTag == -1) {
- break ;
- }
- final int endTag = str.indexOf(StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END) ;
- final String returnString ;
- if (endTag > startTag) {
- final int endIndex = endTag + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END.length() ;
- if (endIndex < str.length()-1) {
- returnString = str.substring(0, startTag) + str.substring(endIndex) ;
- } else {
- returnString = str.substring(0, startTag) ;
- }
- } else {
- returnString = str ;
- }
- returnTable.put("Message" + theCounter++, returnString);
- }
- in.close();
- } catch (IOException e) {
- Assert.fail("Cannot read file: " + fileName);
- }
- return returnTable;
- } /* method */
-
- /* Read the message files into a hash- used by HelloWorldFileActionTest */
- public static Hashtable<String, String> getFileActionMessageString(String fileName) {
- Hashtable<String,String> returnTable = new Hashtable<String,String>();
- int theCounter = 1;
- try {
- BufferedReader in = new BufferedReader(new FileReader(fileName));
- String str;
- while ((str = in.readLine()) != null) {
- returnTable.put("Message" + theCounter++, str);
- }
- in.close();
- } catch (IOException e) {
- Assert.fail("Cannot read file: " + fileName);
- }
- return returnTable;
- } /* method */
-
- /* Determine if the event file has been written */
- public static boolean checkForFile(String fileName) throws Exception {
- boolean wasFileFound = false;
- /* Look for file, if it's there, set the boolean and return, if it's
- * not, wait and try again */
- final File file = new File(fileName) ;
- for (int i = 0; i < FILE_COUNTER; i++) {
- boolean exists = file.exists();
- if (exists) {
- wasFileFound = true;
- break;
- }
- else {
- Thread.sleep(FILE_TIMER);
- }
- }
- return wasFileFound;
- } /* method */
-
- /* Determine if the event file has the correct # of entries written to it - this is probably
- * only needed for tests that write the same message to multiple queues - for example,
- * the RecipientlistTest */
- public static boolean checkFileContent(String fileName, int recordCount) throws Exception {
- boolean correctFileSize = false;
-
- /* Determine the number of records in the file, if it's not correct
- * wait and try again */
- for (int i = 0; i < FILE_COUNTER; i++) {
- Hashtable<String, String> theTable = getMessageString(fileName);
- int theKeys = theTable.size();
- if (theKeys == recordCount){
- correctFileSize = true;
- break;
- }
- else {
- Thread.sleep(FILE_TIMER);
- }
- }
- return correctFileSize;
- } /* method */
-
-
- public static String getTempDir(String filename)
- {
- String tmpDir="";
- if (!filename.startsWith(File.separator)) {
- tmpDir = System.getProperty("java.io.tmpdir") + File.separator;
- }
- return tmpDir;
- }
-
public static String getQuickstartLocation(final String location)
throws IOException
{
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/JMSTopicTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,61 +21,26 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Properties;
-
-import javax.naming.Context;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.soa.esb.helpers.KeyValuePair;
import org.jboss.soa.esb.samples.quickstart.jmstopic.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
-import org.jboss.soa.esb.testutils.JMSUtil;
/**
* CI test for the jmstopic quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class JMSTopicTest extends JBossTestCase {
+public class JMSTopicTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "JMSTopic message";
- private static final String FILE_NAME = "JMSTopicTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public JMSTopicTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String firstMessage = (String) theTable.get("Message1");
- String secondMessage = (String) theTable.get("Message2");
- assertEquals("The strings should match", JMS_MESSAGE, firstMessage);
- assertEquals("The strings should match", JMS_MESSAGE, secondMessage);
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
@@ -86,6 +51,6 @@
}
public static Test suite() throws Exception {
- return getDeploySetup(JMSTopicTest.class, "Quickstart_jms_topic.esb");
+ return getDeploySetup(JMSTopicTest.class, "QuickstartMessageStoreServer.sar, Quickstart_jms_topic.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/LoadGeneratorTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,63 +20,23 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.test.JBossTestCase;
-
/**
* CI test for the loadgenerator quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class LoadGeneratorTest extends JBossTestCase {
+public class LoadGeneratorTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "HelloWorldTest message";
- private static final String FILE_NAME = "HelloWorldTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public LoadGeneratorTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
+ fail("Not yet implemented") ;
sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
}
public void sendMessage() throws Exception {
@@ -90,6 +50,6 @@
}
public static Test suite() throws Exception {
- return getDeploySetup(LoadGeneratorTest.class, "Quickstart_load_generator.esb");
+ return getDeploySetup(LoadGeneratorTest.class, "QuickstartMessageStoreServer.sar, Quickstart_load_generator.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageFilterTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,55 +20,28 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.messagefilter.Order;
import org.jboss.soa.esb.samples.quickstart.messagefilter.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the messagefilter quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class MessageFilterTest extends JBossTestCase {
+public class MessageFilterTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "10";
private static final String RESULT_PATTERN = "org.jboss.soa.esb.samples.quickstart.messagefilter.Order.*";
- private static final String FILE_NAME = "MessageFilterTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public MessageFilterTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- if (!theMessage.matches(RESULT_PATTERN)) {
- fail("The result [" + theMessage + "] should match pattern" + RESULT_PATTERN);
- }
+ clearMessages() ;
+ sendMessage() ;
+ checkPatternMessages(30000, RESULT_PATTERN) ;
}
public void sendMessage() throws Exception {
@@ -78,10 +51,9 @@
sm.setupConnection();
sm.sendAMessage(order);
sm.stop();
- Thread.sleep(4000);
}
public static Test suite() throws Exception {
- return getDeploySetup(MessageFilterTest.class, "Quickstart_messagefilter.esb");
+ return getDeploySetup(MessageFilterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_messagefilter.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/MessageStoreTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,54 +20,26 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.messagestore.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the messagestore quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class MessageStoreTest extends JBossTestCase {
+public class MessageStoreTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "MessageStoreTest message";
- private static final String FILE_NAME = "MessageStoreTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public MessageStoreTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE, "Success:" + JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
@@ -75,10 +47,9 @@
sm.setupConnection();
sm.sendAMessage(JMS_MESSAGE);
sm.stop();
- Thread.sleep(4000);
}
public static Test suite() throws Exception {
- return getDeploySetup(MessageStoreTest.class, "Quickstart_messagestore.esb");
+ return getDeploySetup(MessageStoreTest.class, "QuickstartMessageStoreServer.sar, Quickstart_messagestore.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/RecipientlistTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,27 +21,20 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.recipientList.test.SendCBRJMSMessage;
import org.jboss.soa.esb.samples.quickstart.recipientList.test.SendStaticRouterJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the recipientlist quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class RecipientlistTest extends JBossTestCase {
+public class RecipientlistTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "RecipientlistTest message";
- private static final String FILE_NAME = "RecipientlistTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
private static final String JMS_CBR_MESSAGE = "<Order sampleData=\"CBR test\" testDate=\"20070518\" routeToFollow=\"both\"><Customer userName=\"user1\" firstName=\"Harry\" lastName=\"Fletcher\" state=\"SD\"/></Order>";
- private static final int EXPECTED_RECORD_COUNT = 3;
public RecipientlistTest(String name) {
super(name);
@@ -56,56 +49,27 @@
}
public void testStaticMessage() throws Exception {
- sendStaticRouterJMSMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
- String theMessage3 = (String) theTable.get("Message3");
-
- assertEquals("The strings should match1", theMessage1, JMS_MESSAGE);
- assertEquals("The strings should match2", theMessage2, JMS_MESSAGE);
- assertEquals("The strings should match3", theMessage3, JMS_MESSAGE);
-
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendStaticRouterJMSMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE, JMS_MESSAGE) ;
}
public void sendCBRJMSMessage() throws Exception {
SendCBRJMSMessage sm = new SendCBRJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_CBR_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_CBR_MESSAGE);
sm.stop();
}
public void sendStaticRouterJMSMessage() throws Exception {
SendStaticRouterJMSMessage sm = new SendStaticRouterJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
return getDeploySetup(RecipientlistTest.class,
- "Quickstart_recipient_list.esb");
+ "QuickstartMessageStoreServer.sar, Quickstart_recipient_list.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScheduledServicesTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,63 +20,27 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
-import org.jboss.soa.esb.samples.quickstart.scheduler.test.SendEsbMessage;
-import org.jboss.test.JBossTestCase;
-
/**
* CI test for the scheduledservices quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class ScheduledServicesTest extends JBossTestCase {
+public class ScheduledServicesTest extends AbstractQuickstartTestCase {
private static final String RESULT = "Hello Scheduled World .*";
- private static final String FILE_NAME = "ScheduledServices.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public ScheduledServicesTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- if (!theMessage.matches(RESULT)) {
- fail("The result [" + theMessage + "] did not match the expected pattern ["
- + FILE_NAME + "]");
- }
+ clearMessages() ;
+ // No send on this
+ checkPatternMessages(30000, RESULT, RESULT) ;
}
- public void sendMessage() throws Exception {
- Thread.sleep(4000);
- }
-
public static Test suite() throws Exception {
- return getDeploySetup(ScheduledServicesTest.class, "Quickstart_scheduled_services.esb");
+ return getDeploySetup(ScheduledServicesTest.class, "QuickstartMessageStoreServer.sar, Quickstart_scheduled_services.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/ScriptingGroovyTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -22,76 +22,37 @@
package org.jboss.soa.esb.quickstart.test;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
+
import org.jboss.soa.esb.samples.quickstart.scriptinggroovy.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
-import java.io.File;
-import java.util.Hashtable;
-
/**
* CI test for the scriptinggroovy quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class ScriptingGroovyTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "ScriptingGroovyTest message";
- private static final String FILE_NAME = "ScriptingGroovyTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public ScriptingGroovyTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE);
- if (logFile.exists()) {
- assertTrue("Deleting logfile", logFile.delete());
- }
-
+ clearMessages() ;
sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = theTable.get("Message1");
-
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete());
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
- Thread.sleep(4000);
}
public static Test suite() throws Exception {
- return getDeploySetup(ScriptingGroovyTest.class, "scripting-groovy-quickstart.esb");
+ return getDeploySetup(ScriptingGroovyTest.class, "QuickstartMessageStoreServer.sar, scripting-groovy-quickstart.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SimpleCBRTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -23,13 +23,7 @@
import junit.framework.Test;
-import java.io.File;
-import java.util.Hashtable;
-import junit.framework.Test;
-
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.simplecbr.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
@@ -39,65 +33,22 @@
* @author <a href="mailto:ldimaggi at redhat.com">Len Dimaggio</a>
*/
public class SimpleCBRTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
- private static final String JMS_MESSAGE = "SimpleCBRTest message";
- private static final String FILE_NAME = "SimpleCBRTest.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 1;
-
- /* Need to handle situation unique to this test's use of XML in message */
- // private static String LOCAL_END_TAG = Helpers.END_TAG.trim();
- private static String TEST_STRING = JMS_MESSAGE
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END;
private static String theXML = "<Order orderId=\"1\" "
+ "orderDate=\"Wed Nov 15 13:45:28 EST 2006\" "
+ "statusCode=\"0\" " + "netAmount=\"59.97\" "
- + "totalAmount=\"64.92\" " + "tax=\"4.95\" " + "junk=\""
- + TEST_STRING + " \"></Order>\n";
- private static String returnedXML = theXML.substring(0, theXML
- .indexOf(StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START))
- + " \"></Order>";
+ + "totalAmount=\"64.92\" " + "tax=\"4.95\" "
+ + "junk=\"SimpleCBRTest message\"></Order>";
public SimpleCBRTest(String name) {
super(name);
} /* method */
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String,String> temp = Helpers.getMessageString(LOG_FILE);
- File target = new File(LOG_FILE);
- target.delete();
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String,String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", theMessage, returnedXML);
- File target = new File(LOG_FILE);
- target.delete();
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, theXML) ;
} /* method */
public void sendMessage() throws Exception {
@@ -108,7 +59,7 @@
} /* method */
public static Test suite() throws Exception {
- return getDeploySetup(SimpleCBRTest.class, "Quickstart_simple_cbr.esb");
+ return getDeploySetup(SimpleCBRTest.class, "QuickstartMessageStoreServer.sar, Quickstart_simple_cbr.esb");
} /* method */
} /* class */
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringAOPTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,15 +21,9 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.spring_aop.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the springAOP quickstart.
@@ -37,40 +31,18 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class SpringAOPTest extends JBossTestCase {
+public class SpringAOPTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "SpringAOPTest message";
private static final String RESULT_MESSAGE = "I used AOP to change the greeting! JMS has got nothin on me!";
- private static final String FILE_NAME = "SpringAOPTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public SpringAOPTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", RESULT_MESSAGE, theMessage);
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESULT_MESSAGE) ;
}
public void sendMessage() throws Exception {
@@ -78,11 +50,10 @@
sm.setupConnection();
sm.sendAMessage(JMS_MESSAGE) ;
sm.stop();
- Thread.sleep(4000);
}
public static Test suite() throws Exception {
- return getDeploySetup(SpringAOPTest.class, "Quickstart_spring_aop.esb");
+ return getDeploySetup(SpringAOPTest.class, "QuickstartMessageStoreServer.sar, Quickstart_spring_aop.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringHelloWorldTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,14 +21,9 @@
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.spring_helloworld.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the SpringHelloWorld quickstart.
@@ -36,40 +31,18 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class SpringHelloWorldTest extends JBossTestCase {
+public class SpringHelloWorldTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "SpringHelloWorldTest message";
- private static final String RESULT_MESSAGE = "SpringHelloWorldTest messagehello from Springgoodbye from Springhello from Springgoodbye from Spring";
+ private static final String RESULT_MESSAGE = "SpringHelloWorldTest message\nhello from Spring\ngoodbye from Spring\nhello from Spring\ngoodbye from Spring";
- private static final String FILE_NAME = "SpringHelloWorldTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public SpringHelloWorldTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", RESULT_MESSAGE, theMessage);
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, RESULT_MESSAGE) ;
}
public void sendMessage() throws Exception {
@@ -80,7 +53,7 @@
}
public static Test suite() throws Exception {
- return getDeploySetup(SpringHelloWorldTest.class, "spring_helloworld.esb");
+ return getDeploySetup(SpringHelloWorldTest.class, "QuickstartMessageStoreServer.sar, spring_helloworld.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/SpringJPetStoreTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -23,14 +23,11 @@
package org.jboss.soa.esb.quickstart.test;
import java.io.File;
-import java.util.Hashtable;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.spring_jpetstore.test.SendJMSMessage;
import org.jboss.soa.esb.util.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the SpringJPetStore quickstart.
@@ -38,39 +35,17 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class SpringJPetStoreTest extends JBossTestCase {
+public class SpringJPetStoreTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "SpringJPetStoreTest message";
- private static final String FILE_NAME = "SpringJPetStoreTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public SpringJPetStoreTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getFileActionMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
@@ -84,7 +59,7 @@
}
public static Test suite() throws Exception {
- return getDeploySetup(SpringJPetStoreTest.class, "spring_jpetstore.esb");
+ return getDeploySetup(SpringJPetStoreTest.class, "QuickstartMessageStoreServer.sar, spring_jpetstore.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/StaticRouterTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
* Sample client for the jboss container.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class StaticRouterTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public StaticRouterTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(StaticRouterTest.class, "Quickstart_static_router.esb");
+ return getDeploySetup(StaticRouterTest.class, "QuickstartMessageStoreServer.sar, Quickstart_static_router.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformCSV2XMLTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,12 +21,10 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
import org.jboss.soa.esb.samples.quickstart.transformcsv2xml.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
@@ -36,10 +34,8 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformCSV2XMLTest
- extends JBossTestCase {
+ extends AbstractQuickstartTestCase {
private static final String FILE_NAME = "transformedmessageCSV2XML.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
public TransformCSV2XMLTest(String name)
@@ -49,30 +45,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -85,6 +73,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformCSV2XMLTest.class, "transformation-CSV2XML-quickstart.esb");
+ return getDeploySetup(TransformCSV2XMLTest.class, "QuickstartMessageStoreServer.sar, transformation-CSV2XML-quickstart.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformDateManipulationTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,14 +21,12 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformxml2xmldatemanipulation.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
@@ -37,11 +35,9 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformDateManipulationTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageDateManipulation.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
public TransformDateManipulationTest(String name)
{
@@ -50,30 +46,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -86,6 +74,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformDateManipulationTest.class, "transformation-date-manipulation-quickstart.esb");
+ return getDeploySetup(TransformDateManipulationTest.class, "QuickstartMessageStoreServer.sar, transformation-date-manipulation-quickstart.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformEDI2XMLGroovyXSLTTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,14 +21,12 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformedi2xmlgroovyxslt.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
@@ -37,13 +35,10 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformEDI2XMLGroovyXSLTTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageEDI2XMLGroovyXSL.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public TransformEDI2XMLGroovyXSLTTest(String name)
{
super(name);
@@ -51,30 +46,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -83,11 +70,10 @@
sm.setupConnection();
sm.sendAMessage(Helpers.getQuickstartLocation("transform_EDI2XML_Groovy_XSLT/SampleOrder.edi"));
sm.stop();
- Thread.sleep(4000);
}
public static Test suite() throws Exception
{
- return getDeploySetup(TransformEDI2XMLGroovyXSLTTest.class, "transformation-edi2xml_groovy-quickstart.esb");
+ return getDeploySetup(TransformEDI2XMLGroovyXSLTTest.class, "QuickstartMessageStoreServer.sar, transformation-edi2xml_groovy-quickstart.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXML2PojoTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -20,14 +20,12 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
import org.jboss.soa.esb.samples.quickstart.transformxml2pojo.test.SendJMSMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
/**
@@ -36,12 +34,9 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformXML2PojoTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageXML2POJO.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
public TransformXML2PojoTest(String name)
{
@@ -50,30 +45,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareNonXMLContent(expectedString, targetString, true);
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareNonXMLContent(expectedString, messages[0], true);
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -84,11 +71,10 @@
System.out.println("FILECONTENT[" + fileContent + "]");
sm.sendAMessage(fileContent);
sm.stop();
- Thread.sleep(4000);
}
public static Test suite() throws Exception
{
- return getDeploySetup(TransformXML2PojoTest.class, "transformation-pojo-quickstart.esb");
+ return getDeploySetup(TransformXML2PojoTest.class, "QuickstartMessageStoreServer.sar, transformation-pojo-quickstart.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/TransformXMLSimpleTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,14 +21,12 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
import java.io.InputStream;
import junit.framework.Test;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
import org.jboss.soa.esb.samples.quickstart.transformxml2xmlsimple.test.SendJMSMessage;
+import org.jboss.soa.esb.testutils.FileUtil;
/**
* CI test for the transformXMLSimple quickstart.
@@ -36,11 +34,9 @@
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class TransformXMLSimpleTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
private static final String FILE_NAME = "transformedmessageXML2Simple.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
public TransformXMLSimpleTest(String name)
{
@@ -49,30 +45,22 @@
public void testMessage() throws Exception
{
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
+ clearMessages() ;
+ sendMessage() ;
+ final String[] messages = waitForMessages(1, 30000) ;
// Make sure the file matches expected output
final InputStream is = getClass().getClassLoader().getResourceAsStream(FILE_NAME) ;
- File target = new File(LOG_FILE);
- String targetString = FileUtil.readTextFile(target);
- String expectedString = FileUtil.readStream(is);
- final boolean match = Helpers.compareXMLContent(expectedString, targetString) ;
- assertTrue("Unexpected response: " + targetString, match) ;
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ final String expectedString ;
+ try
+ {
+ expectedString = FileUtil.readStream(is);
+ }
+ finally
+ {
+ is.close() ;
+ }
+ final boolean match = Helpers.compareXMLContent(expectedString, messages[0]) ;
+ assertTrue("Unexpected response: " + messages[0], match) ;
}
public void sendMessage() throws Exception
@@ -85,6 +73,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(TransformXMLSimpleTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(TransformXMLSimpleTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer1Test.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,74 +21,35 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the webservice_consumer1 quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class WebServiceConsumer1Test extends JBossTestCase {
+public class WebServiceConsumer1Test extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "WebServiceConsumer1Test message";
- private static final String FILE_NAME = "WebServiceConsumer1Test.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public WebServiceConsumer1Test(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete());
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.sendAMessage("Jimbo");
sm.stop();
- Thread.sleep(4000);
}
public static Test suite() throws Exception {
- return getDeploySetup(WebServiceConsumer1Test.class, "Quickstart_webservice_consumer1.esb");
+ return getDeploySetup(WebServiceConsumer1Test.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_consumer1.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceConsumer2Test.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,75 +21,36 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.helloworld.test.SendJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* CI test for the webservice_consumer2 quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class WebServiceConsumer2Test extends JBossTestCase {
+public class WebServiceConsumer2Test extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "WebServiceConsumer2Test message";
- private static final String FILE_NAME = "WebServiceConsumer2Test.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public WebServiceConsumer2Test(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME
- + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END) ;
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
}
public static Test suite() throws Exception {
- return getDeploySetup(WebServiceConsumer2Test.class, "Quickstart_webservice_consumer2.esb");
+ return getDeploySetup(WebServiceConsumer2Test.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_consumer2.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebServiceProducerTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -1,64 +1,28 @@
package org.jboss.soa.esb.quickstart.test;
import java.io.File;
-import java.util.Hashtable;
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.webserviceproducer.test.SendMessage;
import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.test.JBossTestCase;
-
/**
* CI test for the webservice_producer quickstart.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
-public class WebServiceProducerTest extends JBossTestCase {
+public class WebServiceProducerTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "WebServiceProducerTest message";
- private static final String FILE_NAME = "WebServiceProducerTest.log";
-
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME)
- + FILE_NAME;
-
- private static final int EXPECTED_RECORD_COUNT = 1;
-
public WebServiceProducerTest(String name) {
super(name);
}
public void testMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail("Event file " + LOG_FILE
- + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE,
- EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail("Event file " + LOG_FILE + " not complete - expected "
- + EXPECTED_RECORD_COUNT + " records - found " + temp.size()
- + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
- String theMessage = (String) theTable.get("Message1");
- assertEquals("The strings should match", JMS_MESSAGE, theMessage);
+ clearMessages() ;
+ sendMessage() ;
+ checkMessages(30000, JMS_MESSAGE) ;
}
public void sendMessage() throws Exception {
@@ -70,6 +34,6 @@
}
public static Test suite() throws Exception {
- return getDeploySetup(WebServiceProducerTest.class, "Quickstart_webservice_producer.esb");
+ return getDeploySetup(WebServiceProducerTest.class, "QuickstartMessageStoreServer.sar, Quickstart_webservice_producer.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceAdapterTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
* Sample client for the jboss container.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class WebserviceAdapterTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public WebserviceAdapterTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(WebserviceAdapterTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(WebserviceAdapterTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WebserviceBPELTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -23,16 +23,14 @@
import junit.framework.Test;
-import org.jboss.test.JBossTestCase;
-
/**
* Sample client for the jboss container.
*
* @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
*/
public class WebserviceBPELTest
- extends JBossTestCase
+ extends AbstractQuickstartTestCase
{
public WebserviceBPELTest(String name)
{
@@ -41,6 +39,7 @@
public void testMessage() throws Exception
{
+ fail("Not yet implemented") ;
sendMessage();
Thread.sleep(10000); // wait for message to post.
}
@@ -51,6 +50,6 @@
public static Test suite() throws Exception
{
- return getDeploySetup(WebserviceBPELTest.class, "transformation-simple-quickstart.esb");
+ return getDeploySetup(WebserviceBPELTest.class, "QuickstartMessageStoreServer.sar, transformation-simple-quickstart.esb");
}
}
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java 2007-11-29 15:29:50 UTC (rev 16913)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/WiretapTest.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -21,14 +21,9 @@
*/
package org.jboss.soa.esb.quickstart.test;
-import java.io.File;
-import java.util.Hashtable;
-
import junit.framework.Test;
-import org.jboss.soa.esb.actions.StoreMessageToFile;
import org.jboss.soa.esb.samples.quickstart.wiretap.test.SendStaticRouterJMSMessage;
-import org.jboss.test.JBossTestCase;
/**
* Sample client for the jboss container.
@@ -37,59 +32,28 @@
* @version $Id: $
*/
-public class WiretapTest extends JBossTestCase {
+public class WiretapTest extends AbstractQuickstartTestCase {
private static final String JMS_MESSAGE = "Wiretap Message";
- private static final String FILE_NAME = "Wiretap.log";
- private static final String LOG_FILE = Helpers.getTempDir(FILE_NAME) + FILE_NAME;
- private static final int EXPECTED_RECORD_COUNT = 2;
public WiretapTest(String name) {
super(name);
} /* method */
public void testStaticRouterMessage() throws Exception {
- final File logFile = new File(LOG_FILE) ;
- if (logFile.exists())
- {
- assertTrue("Deleting logfile", logFile.delete()) ;
- }
-
- sendStaticRouterJMSMessage();
-
- /* Verify that the message file is created */
- boolean fileExists = Helpers.checkForFile(LOG_FILE);
- if (!fileExists) {
- fail ("Event file " + LOG_FILE + " not created - test marked as failing");
- }
-
- /* Verify that the message file is complete */
- boolean fileComplete = Helpers.checkFileContent(LOG_FILE, EXPECTED_RECORD_COUNT);
- if (!fileComplete) {
- Hashtable<String, String> temp = Helpers.getMessageString(LOG_FILE);
- fail ("Event file " + LOG_FILE + " not complete - expected " + EXPECTED_RECORD_COUNT
- + " records - found " + temp.size() + ", test marked as failing");
- }
-
- Hashtable<String, String> theTable = Helpers.getMessageString(LOG_FILE);
-
- String theMessage1 = (String) theTable.get("Message1");
- String theMessage2 = (String) theTable.get("Message2");
-
- assertEquals("The strings1 should match", theMessage1, JMS_MESSAGE);
- assertEquals("The strings2 should match", theMessage2, JMS_MESSAGE);
-
- assertTrue("Deleting logfile", logFile.delete()) ;
+ clearMessages() ;
+ sendStaticRouterJMSMessage() ;
+ checkMessages(30000, JMS_MESSAGE, JMS_MESSAGE) ;
} /* method */
public void sendStaticRouterJMSMessage() throws Exception {
SendStaticRouterJMSMessage sm = new SendStaticRouterJMSMessage();
sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_START + FILE_NAME + StoreMessageToFile.MESSAGE_CONTENT_FILENAME_END);
+ sm.sendAMessage(JMS_MESSAGE);
sm.stop();
} /* method */
public static Test suite() throws Exception {
- return getDeploySetup(WiretapTest.class, "Quickstart_wiretap.esb");
+ return getDeploySetup(WiretapTest.class, "QuickstartMessageStoreServer.sar, Quickstart_wiretap.esb");
} /* method */
} /* class */
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -0,0 +1,34 @@
+/*
+* 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.server;
+
+/**
+ * Interface to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public interface QuickstartMessageStore
+{
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay) ;
+
+ public void clearMessages() ;
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStore.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -0,0 +1,62 @@
+/*
+* 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.server;
+
+import org.jboss.soa.esb.actions.TestMessageStore;
+import org.jboss.soa.esb.actions.TestMessageStoreSink;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * MBean to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public class QuickstartMessageStoreImpl extends ServiceMBeanSupport implements QuickstartMessageStoreImplMBean
+{
+ private TestMessageStoreSink sink = new TestMessageStoreSink() ;
+
+ @Override
+ protected void startService() throws Exception
+ {
+ System.out.println("Starting service " + QuickstartMessageStoreImplMBean.objectName) ;
+ super.startService();
+ TestMessageStore.setMessageStoreSink(sink) ;
+ }
+
+ @Override
+ protected void stopService() throws Exception
+ {
+ System.out.println("Stopping service " + QuickstartMessageStoreImplMBean.objectName) ;
+ TestMessageStore.setMessageStoreSink(null) ;
+ super.stopService();
+ }
+
+ public String[] waitForMessages(final int numberOfMessages, final long maxDelay)
+ {
+ return sink.waitForMessages(numberOfMessages, maxDelay) ;
+ }
+
+ public void clearMessages()
+ {
+ sink.clearMessages() ;
+ }
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImpl.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java 2007-11-29 16:43:38 UTC (rev 16914)
@@ -0,0 +1,34 @@
+/*
+* 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.server;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * MBean to monitor message flow in quickstart tests.
+ *
+ * @author <a href="kevin.conner at jboss.com">Kevin Conner</a>
+ */
+public interface QuickstartMessageStoreImplMBean extends ServiceMBean, QuickstartMessageStore
+{
+ public static final String objectName = "jboss.esb:test=QuickstartMessageStoreServer";
+}
Property changes on: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/qa/quickstarts/src/org/jboss/soa/esb/server/QuickstartMessageStoreImplMBean.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
More information about the jboss-svn-commits
mailing list