Merge pull request #742 from ghillert/INT-2728
This commit is contained in:
@@ -1101,6 +1101,17 @@
|
||||
<xsd:union memberTypes="xsd:boolean xsd:string" />
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="return-value-required" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Indicates the procedure's return value should be included
|
||||
in the results returned.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:union memberTypes="xsd:boolean xsd:string" />
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="channel" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
@@ -89,7 +89,6 @@ public class StoredProcOutboundGatewayParserTests {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSkipUndeclaredResultsAttributeSet() throws Exception {
|
||||
setUp("storedProcOutboundGatewayParserTest.xml", getClass());
|
||||
@@ -103,6 +102,19 @@ public class StoredProcOutboundGatewayParserTests {
|
||||
assertFalse(skipUndeclaredResults);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReturnValueRequiredAttributeSet() throws Exception {
|
||||
setUp("storedProcOutboundGatewayParserTest.xml", getClass());
|
||||
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(this.outboundGateway);
|
||||
Object source = accessor.getPropertyValue("handler");
|
||||
accessor = new DirectFieldAccessor(source);
|
||||
source = accessor.getPropertyValue("executor");
|
||||
accessor = new DirectFieldAccessor(source);
|
||||
boolean returnValueRequired = (Boolean) accessor.getPropertyValue("returnValueRequired");
|
||||
assertTrue(returnValueRequired);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testProcedurepParametersAreSet() throws Exception {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
package org.springframework.integration.jdbc.config;
|
||||
|
||||
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 static org.junit.Assert.assertSame;
|
||||
@@ -118,6 +119,19 @@ public class StoredProcPollingChannelAdapterParserTests {
|
||||
assertTrue("skipUndeclaredResults was not set and should default to 'true'", skipUndeclaredResults);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReturnValueRequiredAttributeSet() throws Exception {
|
||||
setUp("storedProcPollingChannelAdapterParserTest.xml", getClass());
|
||||
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(this.pollingAdapter);
|
||||
Object source = accessor.getPropertyValue("source");
|
||||
accessor = new DirectFieldAccessor(source);
|
||||
source = accessor.getPropertyValue("executor");
|
||||
accessor = new DirectFieldAccessor(source);
|
||||
boolean returnValueRequired = (Boolean) accessor.getPropertyValue("returnValueRequired");
|
||||
assertTrue(returnValueRequired);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testProcedurepParametersAreSet() throws Exception {
|
||||
@@ -235,6 +249,7 @@ public class StoredProcPollingChannelAdapterParserTests {
|
||||
MessageChannel autoChannel = context.getBean("autoChannel", MessageChannel.class);
|
||||
SourcePollingChannelAdapter autoChannelAdapter = context.getBean("autoChannel.adapter", SourcePollingChannelAdapter.class);
|
||||
assertSame(autoChannel, TestUtils.getPropertyValue(autoChannelAdapter, "outputChannel"));
|
||||
assertFalse(TestUtils.getPropertyValue(autoChannelAdapter, "source.executor.returnValueRequired", Boolean.class));
|
||||
}
|
||||
|
||||
@After
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
data-source="datasource" auto-startup="true" id="storedProcedureOutboundGateway"
|
||||
ignore-column-meta-data="false" is-function="false"
|
||||
skip-undeclared-results="false" order="2" reply-channel="replyChannel"
|
||||
reply-timeout="555" return-value-required="false">
|
||||
reply-timeout="555" return-value-required="true">
|
||||
|
||||
<int-jdbc:sql-parameter-definition name="username" direction="IN" type="VARCHAR" />
|
||||
<int-jdbc:sql-parameter-definition name="password" direction="OUT" />
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<int-jdbc:stored-proc-inbound-channel-adapter id="storedProcedurePollingChannelAdapter"
|
||||
data-source="dataSource" channel="target"
|
||||
stored-procedure-name="GET_PRIME_NUMBERS"
|
||||
return-value-required="true"
|
||||
is-function="false">
|
||||
<int-jdbc:sql-parameter-definition name="username" direction="IN" type="VARCHAR"/>
|
||||
<int-jdbc:sql-parameter-definition name="password" direction="OUT" />
|
||||
|
||||
@@ -906,6 +906,7 @@
|
||||
is-function="false"
|
||||
max-rows-per-poll="" ]]><co id="sp-inbound-xml02-co" linkends="sp-inbound-xml02" /><![CDATA[
|
||||
skip-undeclared-results="" ]]><co id="sp-inbound-xml03-co" linkends="sp-inbound-xml03" /><![CDATA[
|
||||
return-value-required="false" ]]><co id="sp-inbound-xml04-co" linkends="sp-inbound-xml04" /><![CDATA[
|
||||
<int:poller/>
|
||||
<int-jdbc:sql-parameter-definition name="" direction="IN"
|
||||
type="STRING"
|
||||
@@ -951,6 +952,13 @@
|
||||
<emphasis>Optional</emphasis>.
|
||||
</para>
|
||||
</callout>
|
||||
<callout arearefs="sp-inbound-xml04-co" id="sp-inbound-xml04">
|
||||
<para>
|
||||
Indicates whether this procedure's return value
|
||||
should be included. Since <emphasis>Spring Integration 3.0.</emphasis>
|
||||
<emphasis>Optional</emphasis>.
|
||||
</para>
|
||||
</callout>
|
||||
</calloutlist></para>
|
||||
<note>
|
||||
When you declare a Poller, you may notice the Poller's
|
||||
@@ -972,7 +980,6 @@
|
||||
id=""
|
||||
ignore-column-meta-data="false"
|
||||
order="" ]]><co id="sp-outbound-xml02-co" linkends="sp-outbound-xml02" /><![CDATA[
|
||||
return-value-required="false" ]]><co id="sp-outbound-xml03-co" linkends="sp-outbound-xml03" /><![CDATA[
|
||||
sql-parameter-source-factory=""
|
||||
use-payload-as-parameter-source="">
|
||||
<int:poller fixed-rate=""/>
|
||||
@@ -999,13 +1006,6 @@
|
||||
<emphasis>Optional</emphasis>.
|
||||
</para>
|
||||
</callout>
|
||||
<callout arearefs="sp-outbound-xml03-co" id="sp-outbound-xml03">
|
||||
<para>
|
||||
Indicates whether this procedure's return value
|
||||
should be included.
|
||||
<emphasis>Optional</emphasis>.
|
||||
</para>
|
||||
</callout>
|
||||
</calloutlist></para>
|
||||
</section>
|
||||
<section id="stored-procedure-outbound-gateway">
|
||||
|
||||
Reference in New Issue
Block a user