summaryrefslogtreecommitdiff
path: root/java/test/Ice/exceptions/AllTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/test/Ice/exceptions/AllTests.java')
-rw-r--r--java/test/Ice/exceptions/AllTests.java20
1 files changed, 5 insertions, 15 deletions
diff --git a/java/test/Ice/exceptions/AllTests.java b/java/test/Ice/exceptions/AllTests.java
index ec777e6bf91..a45f8a33430 100644
--- a/java/test/Ice/exceptions/AllTests.java
+++ b/java/test/Ice/exceptions/AllTests.java
@@ -691,28 +691,24 @@ public class AllTests
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter1");
Ice.Object obj = new EmptyI();
adapter.add(obj, Ice.Util.stringToIdentity("x"));
- boolean gotException = false;
try
{
adapter.add(obj, Ice.Util.stringToIdentity("x"));
+ test(false);
}
catch(Ice.AlreadyRegisteredException ex)
{
- gotException = true;
}
- test(gotException);
- gotException = false;
adapter.remove(Ice.Util.stringToIdentity("x"));
try
{
adapter.remove(Ice.Util.stringToIdentity("x"));
+ test(false);
}
catch(Ice.NotRegisteredException ex)
{
- gotException = true;
}
- test(gotException);
adapter.deactivate();
System.out.println("ok");
}
@@ -722,16 +718,14 @@ public class AllTests
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter2");
Ice.ServantLocator loc = new ServantLocatorI();
adapter.addServantLocator(loc, "x");
- boolean gotException = false;
try
{
adapter.addServantLocator(loc, "x");
+ test(false);
}
catch(Ice.AlreadyRegisteredException ex)
{
- gotException = true;
}
- test(gotException);
adapter.deactivate();
System.out.println("ok");
@@ -741,28 +735,24 @@ public class AllTests
System.out.print("testing object factory registration exceptions... ");
Ice.ObjectFactory of = new ObjectFactoryI();
communicator.addObjectFactory(of, "::x");
- boolean gotException = false;
try
{
communicator.addObjectFactory(of, "::x");
+ test(false);
}
catch(Ice.AlreadyRegisteredException ex)
{
- gotException = true;
}
- test(gotException);
- gotException = false;
communicator.removeObjectFactory("::x");
try
{
communicator.removeObjectFactory("::x");
+ test(false);
}
catch(Ice.NotRegisteredException ex)
{
- gotException = true;
}
- test(gotException);
System.out.println("ok");
}