asynchronousFacade2.getId());
}
public static void test2AsynchronousCallOnSameInstance() {
BusinessModel bm1 = new BusinessModel();
long res1 = bm1.processBusinessModel2(15);
AsynchronousFacade asynchronousFacade = (AsynchronousFacade)bm1;
AsynchronousTask asynchronousTask1 =
asynchronousFacade.getAsynchronousTask();
long res2 = bm1.processBusinessModel2(10);
AsynchronousTask asynchronousTask2 =
asynchronousFacade.getAsynchronousTask();
assertEquals(
"Method is not succesfull !",
OK,
asynchronousFacade.getResponseCode(asynchronousTask1));
assertTrue(
"value returned is not an instance of Long",
asynchronousFacade.getReturnValue(asynchronousTask1)
instanceof Long);
assertEquals(
"Method does not return the right value !"
+ ((Long)asynchronousFacade.getReturnValue(asynchronousTask1))
.longValue(),
((Long)asynchronousFacade.getReturnValue(asynchronousTask1))
.longValue(),
15);
assertEquals(
"Method is not succesfull !",
asynchronousFacade.getResponseCode(asynchronousTask2),
OK);
assertTrue(
"value returned is not an instance of Long",
asynchronousFacade.getReturnValue(asynchronousTask2)
instanceof Long);
assertEquals(
"Method does not return the right value !"
+ ((Long)asynchronousFacade.getReturnValue(asynchronousTask2))
.longValue(),
((Long)asynchronousFacade.getReturnValue(asynchronousTask2))
.longValue(),
10);
}