}
@Test
public void testSimple() {
final OtterDownStreamHandler handler = new OtterDownStreamHandler();
handler.setPipelineId(388L);
handler.setDetectingIntervalInSeconds(1);
((AutowireCapableBeanFactory) TestedObject.getSpringBeanFactory()).autowireBeanProperties(handler,
AutowireCapableBeanFactory.AUTOWIRE_BY_NAME,
false);
final CountDownLatch count = new CountDownLatch(1);
ExecutorService executor = Executors.newFixedThreadPool(1);
executor.submit(new Runnable() {
public void run() {
int times = 50;
handler.before(Arrays.asList(buildEvent()));
while (--times > 0) {
try {
Thread.sleep(50000);
} catch (InterruptedException e) {
}
handler.before(Arrays.asList(buildEvent()));
}
count.countDown();
}
});