-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Find out how to improve the performance.
- Loading branch information
Christian Ribeaud
committed
Mar 10, 2017
1 parent
a244f93
commit 9e39a0a
Showing
4 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...java/org/apache/camel/component/dataprovider/DataProviderComponentMultithreadingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.apache.camel.component.dataprovider; | ||
|
||
import org.apache.camel.builder.RouteBuilder; | ||
import org.apache.camel.component.mock.MockEndpoint; | ||
import org.apache.camel.impl.JndiRegistry; | ||
import org.apache.camel.testng.CamelTestSupport; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* Test cases for corresponding class {@link DataProviderComponent}. | ||
* | ||
* @author <a href="mailto:christian.ribeaud@novartis.com">Christian Ribeaud</a> | ||
*/ | ||
public class DataProviderComponentMultithreadingTest extends CamelTestSupport { | ||
|
||
@Test | ||
public void testDataProvider() throws Exception { | ||
MockEndpoint mock = getMockEndpoint("mock:result"); | ||
// It will wait until it reaches the expected count | ||
mock.expectedMessageCount(1000); | ||
mock.assertIsSatisfied(); | ||
} | ||
|
||
@Override | ||
protected JndiRegistry createRegistry() throws Exception { | ||
JndiRegistry registry = super.createRegistry(); | ||
registry.bind("foo", new StaticDataProvider<>(DataProviderComponentTest.getRandomStrings(1000))); | ||
return registry; | ||
} | ||
|
||
@Override | ||
protected RouteBuilder createRouteBuilder() throws Exception { | ||
return new RouteBuilder() { | ||
public void configure() { | ||
from("dataprovider://foo?consumer.useFixedDelay=true&consumer.delay=20&consumer.maxMessagesPerPoll=20&initialDelay=20"). | ||
to("mock:result"); | ||
} | ||
}; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration debug="true"> | ||
|
||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
<!-- encoders are assigned the type | ||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | ||
<encoder> | ||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
<logger name="org.apache.camel.component.dataprovider" level="DEBUG"/> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="CONSOLE"/> | ||
</root> | ||
</configuration> |