INT-3982: Fix XSD declaration ambiguity

JIRA: https://jira.spring.io/browse/INT-3982

Also fix some sporadic, timing issues in tests
This commit is contained in:
Artem Bilan
2016-04-18 21:04:20 -04:00
parent 9e092d44f7
commit 818387f0a4
4 changed files with 13 additions and 21 deletions

View File

@@ -923,7 +923,7 @@
</xsd:choice>
</xsd:sequence>
<xsd:sequence>
<xsd:choice minOccurs="0" maxOccurs="1" >
<xsd:choice>
<xsd:element name="expression" type="innerExpressionType"/>
<xsd:any namespace="##other"/>
</xsd:choice>

View File

@@ -72,7 +72,8 @@ public class ConnectionFactoryShutDownTests {
watch.start();
factory.stop();
watch.stop();
assertTrue("Expected < 1000, was:" + watch.getLastTaskTimeMillis(), watch.getLastTaskTimeMillis() < 1000);
assertTrue("Expected < 10000, was:" + watch.getLastTaskTimeMillis(), watch.getLastTaskTimeMillis() < 10000);
assertTrue(latch1.await(10, TimeUnit.SECONDS));
}
}

View File

@@ -42,11 +42,9 @@
<int-jdbc:returning-resultset name="out" row-mapper="org.springframework.integration.jdbc.storedproc.UserMapper" />
</int-jdbc:stored-proc-outbound-gateway>
<int:channel id="outputChannel"/>
<int:service-activator id="consumerEndpoint" input-channel="outputChannel" ref="consumer" />
<bean id="consumer" class="org.springframework.integration.jdbc.StoredProcOutboundGatewayWithSpelIntegrationTests$Consumer"/>
<int:channel id="outputChannel">
<int:queue/>
</int:channel>
<int:logging-channel-adapter channel="errorChannel" log-full-message="true"/>

View File

@@ -23,9 +23,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.sql.CallableStatement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
@@ -71,13 +69,13 @@ public class StoredProcOutboundGatewayWithSpelIntegrationTests {
@Autowired
private AbstractApplicationContext context;
@Autowired
private Consumer consumer;
@Autowired
@Qualifier("startChannel")
MessageChannel channel;
@Autowired
PollableChannel outputChannel;
@Autowired
@Qualifier("startErrorsChannel")
PollableChannel startErrorsChannel;
@@ -111,13 +109,8 @@ public class StoredProcOutboundGatewayWithSpelIntegrationTests {
channel.send(user1Message);
channel.send(user2Message);
List<Message<Collection<User>>> received = new ArrayList<Message<Collection<User>>>();
received.add(consumer.poll(2000));
Assert.assertEquals(Integer.valueOf(1), Integer.valueOf(received.size()));
Message<Collection<User>> message = received.get(0);
@SuppressWarnings("unchecked")
Message<Collection<User>> message = (Message<Collection<User>>) this.outputChannel.receive(10000);
context.stop();
assertNotNull(message);
@@ -141,7 +134,7 @@ public class StoredProcOutboundGatewayWithSpelIntegrationTests {
this.channel.send(user1Message);
Message<?> receive = this.startErrorsChannel.receive(1000);
Message<?> receive = this.startErrorsChannel.receive(10000);
assertNotNull(receive);
assertThat(receive, instanceOf(ErrorMessage.class));
@@ -163,7 +156,7 @@ public class StoredProcOutboundGatewayWithSpelIntegrationTests {
this.jdbcTemplate.update("INSERT INTO json_message VALUES (?,?)", messageId, jsonMessage);
this.getMessageChannel.send(new GenericMessage<String>(messageId));
Message<?> resultMessage = this.output2Channel.receive(1000);
Message<?> resultMessage = this.output2Channel.receive(10000);
assertNotNull(resultMessage);
Object resultPayload = resultMessage.getPayload();
assertTrue(resultPayload instanceof String);