Skip to content

Commit

Permalink
revert TestDempsy.java
Browse files Browse the repository at this point in the history
  • Loading branch information
tspatel02 committed May 14, 2012
1 parent d443fa6 commit 52896d6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
26 changes: 24 additions & 2 deletions lib-dempsyimpl/src/test/java/com/nokia/dempsy/TestDempsy.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ public TestMp clone() throws CloneNotSupportedException
@Output
public void output()
{

outputCount.incrementAndGet();
outputLatch.countDown();
}
Expand Down Expand Up @@ -460,7 +459,30 @@ public void check(ApplicationContext context) throws Throwable
});
}


@Test
public void testOutPutMessage() throws Throwable
{
runAllCombinations("SinglestageOutputApplicationActx.xml",
new Checker()
{
@Override
public void check(ApplicationContext context) throws Throwable
{
TestAdaptor adaptor = (TestAdaptor)context.getBean("adaptor");
TestMessage message = new TestMessage("output");
adaptor.pushMessage(message); // this causes the container to clone the Mp

// Now wait for the output call to be made 10 times (or so).
Dempsy dempsy = (Dempsy)context.getBean("dempsy");
TestMp mp = (TestMp) getMp(dempsy, "test-app","test-cluster1");
assertTrue(mp.outputLatch.await(baseTimeoutMillis, TimeUnit.MILLISECONDS));
assertTrue(mp.outputCount.get()>=10);
}

public String toString() { return "testOutPutMessage"; }

});
}


@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<property name="messageProcessorPrototype">
<bean class="com.nokia.dempsy.TestDempsy$TestMp" />
</property>
<property name="outputSchedule">
<bean class="com.nokia.dempsy.config.OutputSchedule">
<constructor-arg index="0" type="long" value="100"/>
<constructor-arg index="1" type="java.lang.String" value="MILLISECONDS" />
<property name="outputExecuter">
<bean class="com.nokia.dempsy.output.RelativeOutputSchedule">
<constructor-arg index="0" value="1" />
<constructor-arg index="1" value="SECONDS" type="java.util.concurrent.TimeUnit" />
</bean>
</property>
</bean>
Expand Down

0 comments on commit 52896d6

Please sign in to comment.