use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class SshComponentConsumerTest method testPollingConsumer.
@Test
public void testPollingConsumer() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(1);
mock.expectedBodiesReceived("test\r");
mock.expectedHeaderReceived(SshResult.EXIT_VALUE, 0);
mock.expectedHeaderReceived(SshResult.STDERR, "Error:test\r");
assertMockEndpointsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class SshComponentProducerTest method testReconnect.
@Test
public void testReconnect() throws Exception {
final String msg = "test\n";
MockEndpoint mock = getMockEndpoint("mock:password");
mock.expectedMinimumMessageCount(1);
mock.expectedBodiesReceived(msg);
template.sendBody("direct:ssh", msg);
assertMockEndpointsSatisfied();
sshd.stop();
sshd.start();
mock.reset();
mock.expectedMinimumMessageCount(1);
mock.expectedBodiesReceived(msg);
template.sendBody("direct:ssh", msg);
assertMockEndpointsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class SshComponentSecurityTest method testRsa.
@Test
public void testRsa() throws Exception {
final String msg = "test\n";
MockEndpoint mock = getMockEndpoint("mock:rsa");
mock.expectedMinimumMessageCount(1);
mock.expectedBodiesReceived(msg);
template.sendBody("direct:ssh-rsa", msg);
assertMockEndpointsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class SshComponentSecurityTest method testRsaFile.
@Test
public void testRsaFile() throws Exception {
final String msg = "test\n";
MockEndpoint mock = getMockEndpoint("mock:rsaFile");
mock.expectedMinimumMessageCount(1);
mock.expectedBodiesReceived(msg);
template.sendBody("direct:ssh-rsaFile", msg);
assertMockEndpointsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class JdbcAggregateSerializedHeadersTest method testLoadTestJdbcAggregate.
@Test
public void testLoadTestJdbcAggregate() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(1);
mock.setResultWaitTime(50 * 1000);
LOG.info("Staring to send " + SIZE + " messages.");
for (int i = 0; i < SIZE; i++) {
final int value = 1;
HeaderDto headerDto = new HeaderDto("org", "company", 1);
LOG.debug("Sending {} with id {}", value, headerDto);
template.sendBodyAndHeader("seda:start?size=" + SIZE, value, "id", headerDto);
}
LOG.info("Sending all " + SIZE + " message done. Now waiting for aggregation to complete.");
assertMockEndpointsSatisfied();
}
Aggregations