Quantcast

[mule-scm] [mule] [22013] branches/mule-3.x/transports/jdbc/src/test/resources: More test cases for ZML (BL-589): JDBC transport

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[mule-scm] [mule] [22013] branches/mule-3.x/transports/jdbc/src/test/resources: More test cases for ZML (BL-589): JDBC transport

tcarlson
[mule] [22013] branches/mule-3.x/transports/jdbc/src/test/resources: More test cases for ZML (BL-589): JDBC transport
Revision
22013
Author
tcarlson
Date
2011-05-27 13:56:22 -0500 (Fri, 27 May 2011)

Log Message

More test cases for ZML (BL-589): JDBC transport

Modified Paths

Added Paths

Diff

Modified: branches/mule-3.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageReceiver.java (22012 => 22013)

--- branches/mule-3.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageReceiver.java	2011-05-27 17:21:56 UTC (rev 22012)
+++ branches/mule-3.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageReceiver.java	2011-05-27 18:56:22 UTC (rev 22013)
@@ -127,6 +127,7 @@
         {
             con = this.connector.getConnection();
             MuleMessage muleMessage = createMuleMessage(message, endpoint.getEncoding());
+            routeMessage(muleMessage);
             if (hasAckStatement())
             {
                 if (aggregateResult)
@@ -150,8 +151,6 @@
                     }
                 }
             }
-            routeMessage(muleMessage);
-
         }
         catch (Exception ex)
         {

Modified: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcFunctionalTestCase.java (22012 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcFunctionalTestCase.java	2011-05-27 17:21:56 UTC (rev 22012)
+++ branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcFunctionalTestCase.java	2011-05-27 18:56:22 UTC (rev 22013)
@@ -22,8 +22,6 @@
 
 public class JdbcFunctionalTestCase extends AbstractJdbcFunctionalTestCase
 {
-    public static final String DEFAULT_MESSAGE = "Test Message";
-    
     public JdbcFunctionalTestCase()
     {
         setPopulateTestData(false);
@@ -41,7 +39,7 @@
         assertResultSetEmpty(message);
         
         QueryRunner qr = jdbcConnector.getQueryRunner();
-        int updated = qr.update(jdbcConnector.getConnection(), "INSERT INTO TEST(TYPE, DATA) VALUES (1, '" + DEFAULT_MESSAGE + "')");
+        int updated = qr.update(jdbcConnector.getConnection(), "INSERT INTO TEST(TYPE, DATA) VALUES (1, '" + TEST_MESSAGE + "')");
         assertEquals(1, updated);
         message = client.request("jdbc://SELECT * FROM TEST", 1000);
         assertResultSetNotEmpty(message);
@@ -50,21 +48,21 @@
     public void testSend() throws Exception
     {
         MuleClient client = new MuleClient(muleContext);
-        client.send("jdbc://writeTest?type=2", new DefaultMuleMessage(DEFAULT_MESSAGE, muleContext));
+        client.send("jdbc://writeTest?type=2", new DefaultMuleMessage(TEST_MESSAGE, muleContext));
 
         QueryRunner qr = jdbcConnector.getQueryRunner();
         Object[] obj2 = 
             (Object[]) qr.query(jdbcConnector.getConnection(), "SELECT DATA FROM TEST WHERE TYPE = 2", new ArrayHandler());
         assertNotNull(obj2);
         assertEquals(1, obj2.length);
-        assertEquals(DEFAULT_MESSAGE, obj2[0]);
+        assertEquals(TEST_MESSAGE, obj2[0]);
     }
 
     public void testSendMap() throws Exception
     {
         MuleClient client = new MuleClient(muleContext);
         Map map = new HashMap();
-        map.put("data", DEFAULT_MESSAGE);
+        map.put("data", TEST_MESSAGE);
         client.send("jdbc://writeMap?type=2", new DefaultMuleMessage(map, muleContext));
 
         QueryRunner qr = jdbcConnector.getQueryRunner();
@@ -72,7 +70,7 @@
             (Object[]) qr.query(jdbcConnector.getConnection(), "SELECT DATA FROM TEST WHERE TYPE = 2", new ArrayHandler());
         assertNotNull(obj2);
         assertEquals(1, obj2.length);
-        assertEquals(DEFAULT_MESSAGE, obj2[0]);
+        assertEquals(TEST_MESSAGE, obj2[0]);
     }
 
     public void testReceive() throws Exception
@@ -82,7 +80,7 @@
         assertResultSetEmpty(message);
 
         QueryRunner qr = jdbcConnector.getQueryRunner();
-        int updated = qr.update(jdbcConnector.getConnection(), "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (1, '" + DEFAULT_MESSAGE
+        int updated = qr.update(jdbcConnector.getConnection(), "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (1, '" + TEST_MESSAGE
             + "', NULL, NULL)");
         assertEquals(1, updated);
 
@@ -94,7 +92,7 @@
     {
         QueryRunner qr = jdbcConnector.getQueryRunner();
         qr.update(jdbcConnector.getConnection(), 
-            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (1, '" + DEFAULT_MESSAGE + "', NULL, NULL)");
+            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (1, '" + TEST_MESSAGE + "', NULL, NULL)");
 
         long t0 = System.currentTimeMillis();
         while (System.currentTimeMillis() - t0 < 20000)
@@ -114,6 +112,6 @@
             (Object[]) qr.query(jdbcConnector.getConnection(), "SELECT DATA FROM TEST WHERE TYPE = 2", new ArrayHandler());
         assertNotNull(obj2);
         assertEquals(1, obj2.length);
-        assertEquals(DEFAULT_MESSAGE + " Received", obj2[0]);
+        assertEquals(TEST_MESSAGE + " Received", obj2[0]);
     }
 }

Added: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossFlowTestCase.java (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossFlowTestCase.java	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossFlowTestCase.java	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,58 @@
+/*
+ * $Id$
+ * --------------------------------------------------------------------------------------
+ * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
+ *
+ * The software in this package is published under the terms of the CPAL v1.0
+ * license, a copy of which has been included with this distribution in the
+ * LICENSE.txt file.
+ */
+
+package org.mule.transport.jdbc.reliability;
+
+import org.apache.commons.dbutils.handlers.ArrayHandler;
+
+
+public class InboundMessageLossFlowTestCase extends InboundMessageLossTestCase
+{
+    @Override
+    protected String getConfigResources()
+    {
+        return "reliability/jdbc-connector.xml, reliability/inbound-message-loss-flow.xml";
+    }
+
+    @Override
+    public void testTransformerException() throws Exception
+    {
+        assertEquals(1, qr.update(jdbcConnector.getConnection(), 
+            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (2, '" + TEST_MESSAGE + "', NULL, NULL)"));
+
+        Thread.sleep(DELAY);
+        
+        Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(), 
+            "SELECT DATA FROM TEST WHERE TYPE = 2 AND ACK IS NULL", new ArrayHandler());
+        // Exception occurs after the SEDA queue for an asynchronous request, so from the client's
+        // perspective, the message has been delivered successfully.
+        // Note that this behavior is different from services because the exception occurs before
+        // the SEDA queue for services.
+        assertNull(queryResult);
+    }
+    
+    @Override
+    public void testRouterException() throws Exception
+    {
+        assertEquals(1, qr.update(jdbcConnector.getConnection(), 
+            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (3, '" + TEST_MESSAGE + "', NULL, NULL)"));
+
+        Thread.sleep(DELAY);
+
+        Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(), 
+            "SELECT DATA FROM TEST WHERE TYPE = 3 AND ACK IS NULL", new ArrayHandler());
+        // Exception occurs after the SEDA queue for an asynchronous request, so from the client's
+        // perspective, the message has been delivered successfully.
+        // Note that this behavior is different from services because the exception occurs before
+        // the SEDA queue for services.
+        assertNull(queryResult);
+    }    
+}
+
Property changes on: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossFlowTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossFlowTransactionsTestCase.java (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossFlowTransactionsTestCase.java	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossFlowTransactionsTestCase.java	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,22 @@
+/*
+ * $Id$
+ * --------------------------------------------------------------------------------------
+ * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
+ *
+ * The software in this package is published under the terms of the CPAL v1.0
+ * license, a copy of which has been included with this distribution in the
+ * LICENSE.txt file.
+ */
+
+package org.mule.transport.jdbc.reliability;
+
+
+
+public class InboundMessageLossFlowTransactionsTestCase extends InboundMessageLossTransactionsTestCase
+{
+    @Override
+    protected String getConfigResources()
+    {
+        return "reliability/jdbc-connector.xml, reliability/inbound-message-loss-flow-transactions.xml";
+    }
+}
Property changes on: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossFlowTransactionsTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossTestCase.java (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossTestCase.java	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossTestCase.java	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,103 @@
+/*
+ * $Id$
+ * --------------------------------------------------------------------------------------
+ * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
+ *
+ * The software in this package is published under the terms of the CPAL v1.0
+ * license, a copy of which has been included with this distribution in the
+ * LICENSE.txt file.
+ */
+
+package org.mule.transport.jdbc.reliability;
+
+import org.mule.exception.DefaultSystemExceptionStrategy;
+import org.mule.routing.filters.WildcardFilter;
+import org.mule.transport.jdbc.functional.AbstractJdbcFunctionalTestCase;
+
+import org.apache.commons.dbutils.QueryRunner;
+import org.apache.commons.dbutils.handlers.ArrayHandler;
+
+public class InboundMessageLossTestCase extends AbstractJdbcFunctionalTestCase
+{
+    /** Delay (in ms) to wait for row to be processed */
+    public static final int DELAY = 1000;
+    
+    protected QueryRunner qr;
+    
+    public InboundMessageLossTestCase()
+    {
+        setPopulateTestData(false);
+    }
+    
+    @Override
+    protected String getConfigResources()
+    {
+        return "reliability/jdbc-connector.xml, reliability/inbound-message-loss.xml";
+    }
+
+    @Override
+    protected void doSetUp() throws Exception
+    {
+        super.doSetUp();
+        
+        // Set SystemExceptionStrategy to redeliver messages (this can only be configured programatically for now)
+        ((DefaultSystemExceptionStrategy) muleContext.getExceptionListener()).setRollbackTxFilter(new WildcardFilter("*"));
+
+        qr = jdbcConnector.getQueryRunner();
+    }
+
+    public void testNoException() throws Exception
+    {
+        assertEquals(1, qr.update(jdbcConnector.getConnection(), 
+            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (1, '" + TEST_MESSAGE + "', NULL, NULL)"));
+
+        Thread.sleep(DELAY);
+
+        Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(), 
+            "SELECT DATA FROM TEST WHERE TYPE = 1 AND ACK IS NULL", new ArrayHandler());
+        // Delivery was successful so row should be acknowledged (marked read).
+        assertNull(queryResult);
+    }
+    
+    public void testTransformerException() throws Exception
+    {
+        assertEquals(1, qr.update(jdbcConnector.getConnection(), 
+            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (2, '" + TEST_MESSAGE + "', NULL, NULL)"));
+
+        Thread.sleep(DELAY);
+        
+        Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(), 
+            "SELECT DATA FROM TEST WHERE TYPE = 2 AND ACK IS NULL", new ArrayHandler());
+        // Delivery failed so row should not be acknowledged (marked read).
+        assertNotNull(queryResult);
+        assertEquals(1, queryResult.length);
+    }
+    
+    public void testRouterException() throws Exception
+    {
+        assertEquals(1, qr.update(jdbcConnector.getConnection(), 
+            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (3, '" + TEST_MESSAGE + "', NULL, NULL)"));
+
+        Thread.sleep(DELAY);
+
+        Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(), 
+            "SELECT DATA FROM TEST WHERE TYPE = 3 AND ACK IS NULL", new ArrayHandler());
+        // Delivery failed so row should not be acknowledged (marked read).
+        assertNotNull(queryResult);
+        assertEquals(1, queryResult.length);
+    }
+    
+    public void testComponentException() throws Exception
+    {
+        assertEquals(1, qr.update(jdbcConnector.getConnection(), 
+            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (4, '" + TEST_MESSAGE + "', NULL, NULL)"));
+
+        Thread.sleep(DELAY);
+
+        Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(), 
+            "SELECT DATA FROM TEST WHERE TYPE = 4 AND ACK IS NULL", new ArrayHandler());
+        // Exception occurs after the SEDA queue for an asynchronous request, so from the client's
+        // perspective, the message has been delivered successfully.
+        assertNull(queryResult);
+    }    
+}
Property changes on: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossTransactionsTestCase.java (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossTransactionsTestCase.java	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossTransactionsTestCase.java	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,39 @@
+/*
+ * $Id$
+ * --------------------------------------------------------------------------------------
+ * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
+ *
+ * The software in this package is published under the terms of the CPAL v1.0
+ * license, a copy of which has been included with this distribution in the
+ * LICENSE.txt file.
+ */
+
+package org.mule.transport.jdbc.reliability;
+
+import org.apache.commons.dbutils.handlers.ArrayHandler;
+
+
+public class InboundMessageLossTransactionsTestCase extends InboundMessageLossTestCase
+{
+    @Override
+    protected String getConfigResources()
+    {
+        return "reliability/jdbc-connector.xml, reliability/inbound-message-loss-transactions.xml";
+    }
+    
+    @Override
+    public void testComponentException() throws Exception
+    {
+        assertEquals(1, qr.update(jdbcConnector.getConnection(), 
+            "INSERT INTO TEST(TYPE, DATA, ACK, RESULT) VALUES (4, '" + TEST_MESSAGE + "', NULL, NULL)"));
+
+        Thread.sleep(DELAY);
+
+        Object[] queryResult = (Object[]) qr.query(jdbcConnector.getConnection(), 
+            "SELECT DATA FROM TEST WHERE TYPE = 4 AND ACK IS NULL", new ArrayHandler());
+        // Although a component exception occurs after the SEDA queue, the use of transactions 
+        // bypasses the SEDA queue, so message should get redelivered.
+        assertNotNull(queryResult);
+        assertEquals(1, queryResult.length);
+    }    
+}
Property changes on: branches/mule-3.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/reliability/InboundMessageLossTransactionsTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-flow-transactions.xml (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-flow-transactions.xml	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-flow-transactions.xml	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesoft.org/schema/mule/core"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:mule="http://www.mulesoft.org/schema/mule/core"
+      xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
+      xmlns:test="http://www.mulesoft.org/schema/mule/test"
+      xsi:schemaLocation="
+       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
+       http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.2/mule-test.xsd
+       http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.2/mule-jdbc.xsd">
+
+    <flow name="NoException">
+        <jdbc:inbound-endpoint queryKey="getTest1">
+			<jdbc:transaction action="ALWAYS_BEGIN" />
+        </jdbc:inbound-endpoint>
+        <test:component />
+    </flow>
+    <flow name="TransformerException">
+        <jdbc:inbound-endpoint queryKey="getTest2">
+			<jdbc:transaction action="ALWAYS_BEGIN" />
+        </jdbc:inbound-endpoint>
+        <custom-transformer class="org.mule.tck.testmodels.mule.FailingTransformer" />
+        <test:component />
+    </flow>
+    <flow name="RouterException">
+        <jdbc:inbound-endpoint queryKey="getTest3">
+			<jdbc:transaction action="ALWAYS_BEGIN" />
+        </jdbc:inbound-endpoint>
+        <custom-processor class="org.mule.tck.testmodels.mule.FailingRouter" />
+        <test:component />
+    </flow>
+    <flow name="ComponentException">
+        <jdbc:inbound-endpoint queryKey="getTest4">
+			<jdbc:transaction action="ALWAYS_BEGIN" />
+        </jdbc:inbound-endpoint>
+        <test:component throwException="true" />
+    </flow>
+</mule>
Property changes on: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-flow-transactions.xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-flow.xml (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-flow.xml	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-flow.xml	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesoft.org/schema/mule/core"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:mule="http://www.mulesoft.org/schema/mule/core"
+      xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
+      xmlns:test="http://www.mulesoft.org/schema/mule/test"
+      xsi:schemaLocation="
+       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
+       http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.2/mule-test.xsd
+       http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.2/mule-jdbc.xsd">
+
+    <flow name="NoException">
+        <jdbc:inbound-endpoint queryKey="getTest1" />
+        <test:component />
+    </flow>
+    <flow name="TransformerException">
+        <jdbc:inbound-endpoint queryKey="getTest2" />
+        <custom-transformer class="org.mule.tck.testmodels.mule.FailingTransformer" />
+        <test:component />
+    </flow>
+    <flow name="RouterException">
+        <jdbc:inbound-endpoint queryKey="getTest3" />
+        <custom-processor class="org.mule.tck.testmodels.mule.FailingRouter" />
+        <test:component />
+    </flow>
+    <flow name="ComponentException">
+        <jdbc:inbound-endpoint queryKey="getTest4" />
+        <test:component throwException="true" />
+    </flow>
+</mule>
Property changes on: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-flow.xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-transactions.xml (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-transactions.xml	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-transactions.xml	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesoft.org/schema/mule/core"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:mule="http://www.mulesoft.org/schema/mule/core"
+      xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
+      xmlns:test="http://www.mulesoft.org/schema/mule/test"
+      xsi:schemaLocation="
+       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
+       http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.2/mule-test.xsd
+       http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.2/mule-jdbc.xsd">
+
+    <model>
+        <service name="NoException">
+            <inbound>
+                <jdbc:inbound-endpoint queryKey="getTest1">
+			        <jdbc:transaction action="ALWAYS_BEGIN" />
+                </jdbc:inbound-endpoint>
+            </inbound>
+            <test:component />
+        </service>
+        <service name="TransformerException">
+            <inbound>
+                <jdbc:inbound-endpoint queryKey="getTest2">
+			        <jdbc:transaction action="ALWAYS_BEGIN" />
+                </jdbc:inbound-endpoint>
+                <custom-transformer class="org.mule.tck.testmodels.mule.FailingTransformer" />
+            </inbound>
+            <test:component />
+        </service>
+        <service name="RouterException">
+            <inbound>
+                <jdbc:inbound-endpoint queryKey="getTest3">
+			        <jdbc:transaction action="ALWAYS_BEGIN" />
+                </jdbc:inbound-endpoint>
+                <custom-inbound-router class="org.mule.tck.testmodels.mule.FailingRouter" />
+            </inbound>
+            <test:component />
+        </service>
+        <service name="ComponentException">
+            <inbound>
+                <jdbc:inbound-endpoint queryKey="getTest4">
+			        <jdbc:transaction action="ALWAYS_BEGIN" />
+                </jdbc:inbound-endpoint>
+            </inbound>
+            <test:component throwException="true" />
+        </service>
+    </model>
+</mule>
Property changes on: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss-transactions.xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss.xml (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss.xml	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss.xml	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesoft.org/schema/mule/core"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:mule="http://www.mulesoft.org/schema/mule/core"
+      xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
+      xmlns:test="http://www.mulesoft.org/schema/mule/test"
+      xsi:schemaLocation="
+       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
+       http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.2/mule-test.xsd
+       http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.2/mule-jdbc.xsd">
+
+    <model>
+        <service name="NoException">
+            <inbound>
+                <jdbc:inbound-endpoint queryKey="getTest1" />
+            </inbound>
+            <test:component />
+        </service>
+        <service name="TransformerException">
+            <inbound>
+                <jdbc:inbound-endpoint queryKey="getTest2" />
+                <custom-transformer class="org.mule.tck.testmodels.mule.FailingTransformer" />
+            </inbound>
+            <test:component />
+        </service>
+        <service name="RouterException">
+            <inbound>
+                <jdbc:inbound-endpoint queryKey="getTest3" />
+                <custom-inbound-router class="org.mule.tck.testmodels.mule.FailingRouter" />
+            </inbound>
+            <test:component />
+        </service>
+        <service name="ComponentException">
+            <inbound>
+                <jdbc:inbound-endpoint queryKey="getTest4" />
+            </inbound>
+            <test:component throwException="true" />
+        </service>
+    </model>
+</mule>
Property changes on: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/inbound-message-loss.xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/jdbc-connector.xml (0 => 22013)

--- branches/mule-3.x/transports/jdbc/src/test/resources/reliability/jdbc-connector.xml	                        (rev 0)
+++ branches/mule-3.x/transports/jdbc/src/test/resources/reliability/jdbc-connector.xml	2011-05-27 18:56:22 UTC (rev 22013)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mule xmlns="http://www.mulesoft.org/schema/mule/core"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:spring="http://www.springframework.org/schema/beans"
+      xmlns:mule="http://www.mulesoft.org/schema/mule/core"
+      xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
+      xmlns:test="http://www.mulesoft.org/schema/mule/test"
+      xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
+       http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.2/mule-test.xsd
+       http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/3.2/mule-jdbc.xsd">
+
+    <spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
+        <spring:property name="driverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+        <spring:property name="url" value="jdbc:derby:muleEmbeddedDB;create=true"/>
+    </spring:bean>
+
+    <jdbc:connector name="jdbcConnector" pollingFrequency="1000" dataSource-ref="jdbcDataSource" queryTimeout="3000">
+        <jdbc:query key="getTest1"
+                    value="SELECT ID, TYPE, DATA, ACK, RESULT FROM TEST WHERE TYPE = 1 AND ACK IS NULL"/>
+        <jdbc:query key="getTest1.ack"
+                    value="UPDATE TEST SET ACK = #[function:NOW] WHERE TYPE = 1"/>
+        <jdbc:query key="getTest2"
+                    value="SELECT ID, TYPE, DATA, ACK, RESULT FROM TEST WHERE TYPE = 2 AND ACK IS NULL"/>
+        <jdbc:query key="getTest2.ack"
+                    value="UPDATE TEST SET ACK = #[function:NOW] WHERE TYPE = 2"/>
+        <jdbc:query key="getTest3"
+                    value="SELECT ID, TYPE, DATA, ACK, RESULT FROM TEST WHERE TYPE = 3 AND ACK IS NULL"/>
+        <jdbc:query key="getTest3.ack"
+                    value="UPDATE TEST SET ACK = #[function:NOW] WHERE TYPE = 3"/>
+        <jdbc:query key="getTest4"
+                    value="SELECT ID, TYPE, DATA, ACK, RESULT FROM TEST WHERE TYPE = 4 AND ACK IS NULL"/>
+        <jdbc:query key="getTest4.ack"
+                    value="UPDATE TEST SET ACK = #[function:NOW] WHERE TYPE = 4"/>
+    </jdbc:connector>
+</mule>
Property changes on: branches/mule-3.x/transports/jdbc/src/test/resources/reliability/jdbc-connector.xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [mule-scm] [mule] [22013] branches/mule-3.x/transports/jdbc/src/test/resources: More test cases for ZML (BL-589): JDBC transport

xiaoyuandlg
This post has NOT been accepted by the mailing list yet.
It is quite strange that my search engine took me here, where has nothing to do with my headaching problems on qr encoding using java, with out any reasons. Anyway, I happen to find this to be the forum which suits for my problems with Mule.
Loading...