Pablo Kraan
2012-07-28 11:35:43 UTC
This change breaks JdbcMessagePropertiesCopyingTestCase.
Also fix the name of
JdbcSessionVarablesCopyingTestCase.java<https://mail.google.com/mail/u/0/?ui=2&view=bsp&ver=ohhl4rw8mbn4#138c963687e315ad_branchesmule32xtransportsjdbcsrctestjavaorgmuletransportjdbcfunctionalJdbcSessionVarablesCopyingTestCasejava>
Pablo
Also fix the name of
JdbcSessionVarablesCopyingTestCase.java<https://mail.google.com/mail/u/0/?ui=2&view=bsp&ver=ohhl4rw8mbn4#138c963687e315ad_branchesmule32xtransportsjdbcsrctestjavaorgmuletransportjdbcfunctionalJdbcSessionVarablesCopyingTestCasejava>
Pablo
**
Revision 24684 <http://fisheye.codehaus.org/changelog/mule/?cs=24684>
Author svacas Date 2012-07-27 12:01:50 -0500 (Fri, 27 Jul 2012) Log
Message
MULE-6366: JDBC Outbound endpoint, loss of session properties when outbound endpoint is request response
Modified Paths
-
branches/mule-3.2.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageDispatcher.java<#138c963687e315ad_branchesmule32xtransportsjdbcsrcmainjavaorgmuletransportjdbcJdbcMessageDispatcherjava>
Added Paths
-
branches/mule-3.2.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcSessionVarablesCopyingTestCase.java<#138c963687e315ad_branchesmule32xtransportsjdbcsrctestjavaorgmuletransportjdbcfunctionalJdbcSessionVarablesCopyingTestCasejava>
-
branches/mule-3.2.x/transports/jdbc/src/test/resources/jdbc-session-variables-copying-flow.xml<#138c963687e315ad_branchesmule32xtransportsjdbcsrctestresourcesjdbcsessionvariablescopyingflowxml>
Diff
branches/mule-3.2.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageDispatcher.java
(24683 => 24684)
--- branches/mule-3.2.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageDispatcher.java 2012-07-27 16:03:45 UTC (rev 24683)
branches/mule-3.2.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcSessionVarablesCopyingTestCase.java
(0 => 24684)
--- branches/mule-3.2.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcSessionVarablesCopyingTestCase.java (rev 0)
+ * $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.functional;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.mule.DefaultMuleMessage;
+import org.mule.api.MuleMessage;
+import org.mule.module.client.MuleClient;
+import org.mule.transport.NullPayload;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.junit.Test;
+import org.junit.runners.Parameterized.Parameters;
+
+public class JdbcSessionVarablesCopyingTestCase extends AbstractJdbcFunctionalTestCase
+{
+
+ public JdbcSessionVarablesCopyingTestCase(ConfigVariant variant, String configResources)
+ {
+ super(variant, configResources);
+ }
+
+ public static Collection<Object[]> parameters()
+ {
+ return Arrays.asList(new Object[][]{
+ {ConfigVariant.FLOW, "jdbc-session-variables-copying-flow.xml"}
+ });
+ }
+
+ public void testMessagePropertiesCopying() throws Exception
+ {
+ MuleClient client = new MuleClient(muleContext);
+
+ MuleMessage message = new DefaultMuleMessage(TEST_MESSAGE, muleContext);
+ // provide a valid type header so the JDBC query actually returns something
+ message.setOutboundProperty("type", 1);
+
+ MuleMessage result = client.send("vm://in", message);
+ assertNotNull(result);
+ assertNull(result.getExceptionPayload());
+ assertFalse(result.getPayload() instanceof NullPayload);
+ assertEquals("test", result.getSessionProperty("test"));
+ }
+
+}Property changes on: branches/mule-3.2.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcSessionVarablesCopyingTestCase.java___________________________________________________________________
Added: svn:keywords
Added: svn:eol-style
branches/mule-3.2.x/transports/jdbc/src/test/resources/jdbc-session-variables-copying-flow.xml
(0 => 24684)
--- branches/mule-3.2.x/transports/jdbc/src/test/resources/jdbc-session-variables-copying-flow.xml (rev 0)
+<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:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
+ xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
+ xsi:schemaLocation="
+ http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
+ http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
+ http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+ <jdbc:derby-data-source name="jdbcDataSource" url="jdbc:derby:muleEmbeddedDB;create=true"/>
+
+ <jdbc:connector name="jdbcConnector" pollingFrequency="1000" dataSource-ref="jdbcDataSource" queryTimeout="3000">
+ <service-overrides sessionHandler="org.mule.session.SerializeAndEncodeSessionHandler"/>
+ <jdbc:query key="getTest" value="SELECT ID, TYPE, DATA, ACK, RESULT FROM TEST WHERE TYPE = #[type] AND ACK IS NULL"/>
+ </jdbc:connector>
+
+ <flow name="testService">
+ <vm:inbound-endpoint path="in" exchange-pattern="request-response"/>
+ <message-properties-transformer scope="session">
+ <add-message-property key="test" value="test" />
+ </message-properties-transformer>
+ <jdbc:outbound-endpoint queryKey="getTest" exchange-pattern="request-response"/>
+ </flow>
+
+</mule>Property changes on: branches/mule-3.2.x/transports/jdbc/src/test/resources/jdbc-session-variables-copying-flow.xml___________________________________________________________________
Added: svn:keywords
Added: svn:eol-style
------------------------------
http://xircles.codehaus.org/manage_email
Revision 24684 <http://fisheye.codehaus.org/changelog/mule/?cs=24684>
Author svacas Date 2012-07-27 12:01:50 -0500 (Fri, 27 Jul 2012) Log
Message
MULE-6366: JDBC Outbound endpoint, loss of session properties when outbound endpoint is request response
Modified Paths
-
branches/mule-3.2.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageDispatcher.java<#138c963687e315ad_branchesmule32xtransportsjdbcsrcmainjavaorgmuletransportjdbcJdbcMessageDispatcherjava>
Added Paths
-
branches/mule-3.2.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcSessionVarablesCopyingTestCase.java<#138c963687e315ad_branchesmule32xtransportsjdbcsrctestjavaorgmuletransportjdbcfunctionalJdbcSessionVarablesCopyingTestCasejava>
-
branches/mule-3.2.x/transports/jdbc/src/test/resources/jdbc-session-variables-copying-flow.xml<#138c963687e315ad_branchesmule32xtransportsjdbcsrctestresourcesjdbcsessionvariablescopyingflowxml>
Diff
branches/mule-3.2.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageDispatcher.java
(24683 => 24684)
--- branches/mule-3.2.x/transports/jdbc/src/main/java/org/mule/transport/jdbc/JdbcMessageDispatcher.java 2012-07-27 16:03:45 UTC (rev 24683)
branches/mule-3.2.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcSessionVarablesCopyingTestCase.java
(0 => 24684)
--- branches/mule-3.2.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcSessionVarablesCopyingTestCase.java (rev 0)
+ * $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.functional;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.mule.DefaultMuleMessage;
+import org.mule.api.MuleMessage;
+import org.mule.module.client.MuleClient;
+import org.mule.transport.NullPayload;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.junit.Test;
+import org.junit.runners.Parameterized.Parameters;
+
+public class JdbcSessionVarablesCopyingTestCase extends AbstractJdbcFunctionalTestCase
+{
+
+ public JdbcSessionVarablesCopyingTestCase(ConfigVariant variant, String configResources)
+ {
+ super(variant, configResources);
+ }
+
+ public static Collection<Object[]> parameters()
+ {
+ return Arrays.asList(new Object[][]{
+ {ConfigVariant.FLOW, "jdbc-session-variables-copying-flow.xml"}
+ });
+ }
+
+ public void testMessagePropertiesCopying() throws Exception
+ {
+ MuleClient client = new MuleClient(muleContext);
+
+ MuleMessage message = new DefaultMuleMessage(TEST_MESSAGE, muleContext);
+ // provide a valid type header so the JDBC query actually returns something
+ message.setOutboundProperty("type", 1);
+
+ MuleMessage result = client.send("vm://in", message);
+ assertNotNull(result);
+ assertNull(result.getExceptionPayload());
+ assertFalse(result.getPayload() instanceof NullPayload);
+ assertEquals("test", result.getSessionProperty("test"));
+ }
+
+}Property changes on: branches/mule-3.2.x/transports/jdbc/src/test/java/org/mule/transport/jdbc/functional/JdbcSessionVarablesCopyingTestCase.java___________________________________________________________________
Added: svn:keywords
Added: svn:eol-style
branches/mule-3.2.x/transports/jdbc/src/test/resources/jdbc-session-variables-copying-flow.xml
(0 => 24684)
--- branches/mule-3.2.x/transports/jdbc/src/test/resources/jdbc-session-variables-copying-flow.xml (rev 0)
+<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:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
+ xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
+ xsi:schemaLocation="
+ http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
+ http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
+ http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+ <jdbc:derby-data-source name="jdbcDataSource" url="jdbc:derby:muleEmbeddedDB;create=true"/>
+
+ <jdbc:connector name="jdbcConnector" pollingFrequency="1000" dataSource-ref="jdbcDataSource" queryTimeout="3000">
+ <service-overrides sessionHandler="org.mule.session.SerializeAndEncodeSessionHandler"/>
+ <jdbc:query key="getTest" value="SELECT ID, TYPE, DATA, ACK, RESULT FROM TEST WHERE TYPE = #[type] AND ACK IS NULL"/>
+ </jdbc:connector>
+
+ <flow name="testService">
+ <vm:inbound-endpoint path="in" exchange-pattern="request-response"/>
+ <message-properties-transformer scope="session">
+ <add-message-property key="test" value="test" />
+ </message-properties-transformer>
+ <jdbc:outbound-endpoint queryKey="getTest" exchange-pattern="request-response"/>
+ </flow>
+
+</mule>Property changes on: branches/mule-3.2.x/transports/jdbc/src/test/resources/jdbc-session-variables-copying-flow.xml___________________________________________________________________
Added: svn:keywords
Added: svn:eol-style
------------------------------
http://xircles.codehaus.org/manage_email