summaryrefslogtreecommitdiff
path: root/java/test/Ice/interceptor/Client.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-07-24 14:32:00 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-07-24 14:32:00 +0200
commit2d88aac37141b6649155bf7cefd926af944be132 (patch)
treea67642698dda213f0b212d6475992e02c3dcc4d7 /java/test/Ice/interceptor/Client.java
parentanother update to CHANGES for ICE-5515 (diff)
downloadice-2d88aac37141b6649155bf7cefd926af944be132.tar.bz2
ice-2d88aac37141b6649155bf7cefd926af944be132.tar.xz
ice-2d88aac37141b6649155bf7cefd926af944be132.zip
Fixed bug with system exceptions not being propagated correctly with collocation optimization + AMD
Diffstat (limited to 'java/test/Ice/interceptor/Client.java')
-rw-r--r--java/test/Ice/interceptor/Client.java81
1 files changed, 52 insertions, 29 deletions
diff --git a/java/test/Ice/interceptor/Client.java b/java/test/Ice/interceptor/Client.java
index c2d4d1cc870..f55d873695d 100644
--- a/java/test/Ice/interceptor/Client.java
+++ b/java/test/Ice/interceptor/Client.java
@@ -90,8 +90,13 @@ public class Client extends test.Util.Application
prx.badSystemAdd(33, 12);
test(false);
}
- catch(Ice.UnknownLocalException e)
+ catch(Ice.UnknownException e)
{
+ test(!prx.ice_isCollocationOptimized());
+ }
+ catch(MySystemException e)
+ {
+ test(prx.ice_isCollocationOptimized());
}
catch(Throwable ex)
{
@@ -100,22 +105,21 @@ public class Client extends test.Util.Application
test(interceptor.getLastOperation().equals("badSystemAdd"));
test(interceptor.getLastStatus() == null);
out.println("ok");
- if(!prx.ice_isCollocationOptimized())
- {
- out.print("testing simple AMD... ");
- out.flush();
- test(prx.amdAdd(33, 12) == 45);
- test(interceptor.getLastOperation().equals("amdAdd"));
- test(interceptor.getLastStatus().equals(Ice.DispatchStatus.DispatchAsync));
- out.println("ok");
- }
+
+ out.print("testing simple AMD... ");
+ out.flush();
+ test(prx.amdAdd(33, 12) == 45);
+ test(interceptor.getLastOperation().equals("amdAdd"));
+ test(interceptor.getLastStatus().equals(Ice.DispatchStatus.DispatchAsync));
+ out.println("ok");
+
return 0;
}
private int
runAmd(MyObjectPrx prx, AMDInterceptorI interceptor, PrintWriter out)
{
- out.print("testing simple interceptor... ");
+ out.print("testing simple interceptor... ");
out.flush();
test(interceptor.getLastOperation() == null);
test(interceptor.getLastStatus() == null);
@@ -171,14 +175,22 @@ public class Client extends test.Util.Application
prx.amdBadSystemAdd(33, 12);
test(false);
}
- catch(Ice.UnknownLocalException e)
+ catch(Ice.UnknownException e)
{
test(!prx.ice_isCollocationOptimized());
}
+ catch(MySystemException e)
+ {
+ test(prx.ice_isCollocationOptimized());
+ }
+ catch(Throwable ex)
+ {
+ test(false);
+ }
test(interceptor.getLastOperation().equals("amdBadSystemAdd"));
test(interceptor.getLastStatus().equals(Ice.DispatchStatus.DispatchAsync));
test(interceptor.getActualStatus() == null);
- test(interceptor.getException() instanceof Ice.InitializationException);
+ test(interceptor.getException() instanceof MySystemException);
out.println("ok");
return 0;
}
@@ -195,31 +207,42 @@ public class Client extends test.Util.Application
Ice.Object servant = new MyObjectI();
InterceptorI interceptor = new InterceptorI(servant);
+ AMDInterceptorI amdInterceptor = new AMDInterceptorI(servant);
MyObjectPrx prx = MyObjectPrxHelper.uncheckedCast(oa.addWithUUID(interceptor));
+ MyObjectPrx prxForAMD = MyObjectPrxHelper.uncheckedCast(oa.addWithUUID(amdInterceptor));
- oa.activate();
-
PrintWriter out = getWriter();
- out.println("Collocation optimization on");
+ out.println("Collocation optimization on");
int rs = run(prx, interceptor);
- if(rs == 0)
+ if(rs != 0)
{
- out.println("Collocation optimization off");
- interceptor.clear();
- prx = MyObjectPrxHelper.uncheckedCast(prx.ice_collocationOptimized(false));
- rs = run(prx, interceptor);
+ return rs;
+ }
- if(rs == 0)
- {
- out.println("Now with AMD");
- AMDInterceptorI amdInterceptor = new AMDInterceptorI(servant);
- prx = MyObjectPrxHelper.uncheckedCast(oa.addWithUUID(amdInterceptor));
- prx = MyObjectPrxHelper.uncheckedCast(prx.ice_collocationOptimized(false));
+ out.println("Now with AMD");
+ rs = runAmd(prxForAMD, amdInterceptor, out);
+ if(rs != 0)
+ {
+ return rs;
+ }
+
+ oa.activate(); // Only necessary for non-collocation optimized tests
- rs = runAmd(prx, amdInterceptor, out);
- }
+ out.println("Collocation optimization off");
+ interceptor.clear();
+ prx = MyObjectPrxHelper.uncheckedCast(prx.ice_collocationOptimized(false));
+ rs = run(prx, interceptor);
+ if(rs != 0)
+ {
+ return rs;
}
+
+ out.println("Now with AMD");
+ amdInterceptor.clear();
+ prxForAMD = MyObjectPrxHelper.uncheckedCast(prxForAMD.ice_collocationOptimized(false));
+ rs = runAmd(prxForAMD, amdInterceptor, out);
+
return rs;
}