summaryrefslogtreecommitdiff
path: root/java/test
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-08-22 06:56:01 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-08-22 06:56:01 +0000
commit358e7805bd59b62548851c0b5da3ed770f256405 (patch)
treeea4e9ed5c7590e61d4a40e341ef39fb385b5b035 /java/test
parentSimplify the operations test. (diff)
downloadice-358e7805bd59b62548851c0b5da3ed770f256405.tar.bz2
ice-358e7805bd59b62548851c0b5da3ed770f256405.tar.xz
ice-358e7805bd59b62548851c0b5da3ed770f256405.zip
Simplified operations test.
Diffstat (limited to 'java/test')
-rw-r--r--java/test/Ice/operations/AllTests.java2
-rw-r--r--java/test/Ice/operations/Collocated.java14
-rw-r--r--java/test/Ice/operations/Server.java15
-rw-r--r--java/test/Ice/operations/TestCheckedCastI.java7
-rw-r--r--java/test/Ice/operationsAMD/Server.java15
-rw-r--r--java/test/Ice/operationsAMD/TestCheckedCastI.java7
6 files changed, 18 insertions, 42 deletions
diff --git a/java/test/Ice/operations/AllTests.java b/java/test/Ice/operations/AllTests.java
index 8fe0b625303..226903de2f7 100644
--- a/java/test/Ice/operations/AllTests.java
+++ b/java/test/Ice/operations/AllTests.java
@@ -46,7 +46,7 @@ public class AllTests
System.out.print("testing checked cast with context... ");
System.out.flush();
- String cref = "test:default -p 12346 -t 10000";
+ String cref = "context:default -p 12345 -t 10000";
Ice.ObjectPrx cbase = communicator.stringToProxy(cref);
test(cbase != null);
diff --git a/java/test/Ice/operations/Collocated.java b/java/test/Ice/operations/Collocated.java
index 5b17140670f..27568f253be 100644
--- a/java/test/Ice/operations/Collocated.java
+++ b/java/test/Ice/operations/Collocated.java
@@ -14,17 +14,9 @@ public class Collocated
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12345 -t 10000");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
- Ice.Object object = new MyDerivedClassI(adapter, Ice.Util.stringToIdentity("test"));
- adapter.add(object, Ice.Util.stringToIdentity("test"));
-
- //
- // Make a separate adapter with a servant locator. We use this to test
- // that ::Ice::Context is correctly passed to checkedCast() operation.
- //
- communicator.getProperties().setProperty("CheckedCastAdapter.Endpoints", "default -p 12346 -t 10000");
- adapter = communicator.createObjectAdapter("CheckedCastAdapter");
- Ice.ServantLocator checkedCastLocator = new CheckedCastLocator();
- adapter.addServantLocator(checkedCastLocator, "");
+ Ice.Identity id = Ice.Util.stringToIdentity("test");
+ adapter.add(new MyDerivedClassI(adapter, id), id);
+ adapter.add(new TestCheckedCastI(), Ice.Util.stringToIdentity("context"));
AllTests.allTests(communicator, true);
diff --git a/java/test/Ice/operations/Server.java b/java/test/Ice/operations/Server.java
index 7c779ab14e8..339964e8081 100644
--- a/java/test/Ice/operations/Server.java
+++ b/java/test/Ice/operations/Server.java
@@ -14,20 +14,11 @@ public class Server
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12345");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
- Ice.Object object = new MyDerivedClassI(adapter, Ice.Util.stringToIdentity("test"));
- adapter.add(object, Ice.Util.stringToIdentity("test"));
+ Ice.Identity id = Ice.Util.stringToIdentity("test");
+ adapter.add(new MyDerivedClassI(adapter, id), id);
+ adapter.add(new TestCheckedCastI(), Ice.Util.stringToIdentity("context"));
adapter.activate();
- //
- // Make a separate adapter with a servant locator. We use this to test
- // that ::Ice::Context is correctly passed to checkedCast() operation.
- //
- communicator.getProperties().setProperty("CheckedCastAdapter.Endpoints", "default -p 12346 -t 10000");
- adapter = communicator.createObjectAdapter("CheckedCastAdapter");
- Ice.ServantLocator checkedCastLocator = new CheckedCastLocator();
- adapter.addServantLocator(checkedCastLocator, "");
- adapter.activate();
-
communicator.waitForShutdown();
return 0;
}
diff --git a/java/test/Ice/operations/TestCheckedCastI.java b/java/test/Ice/operations/TestCheckedCastI.java
index 559c0017656..4b22e5921ae 100644
--- a/java/test/Ice/operations/TestCheckedCastI.java
+++ b/java/test/Ice/operations/TestCheckedCastI.java
@@ -15,10 +15,11 @@ public final class TestCheckedCastI extends Test._TestCheckedCastDisp
return _ctx;
}
- public void
- setContext(java.util.Map ctx)
+ public boolean
+ ice_isA(String s, Ice.Current current)
{
- _ctx = ctx;
+ _ctx = current.ctx;
+ return super.ice_isA(s, current);
}
private java.util.Map _ctx;
diff --git a/java/test/Ice/operationsAMD/Server.java b/java/test/Ice/operationsAMD/Server.java
index 64ea330e44b..2ef56c7ca70 100644
--- a/java/test/Ice/operationsAMD/Server.java
+++ b/java/test/Ice/operationsAMD/Server.java
@@ -14,20 +14,11 @@ public class Server
{
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12345 -t 10000");
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
- Ice.Object object = new MyDerivedClassI(adapter, Ice.Util.stringToIdentity("test"));
- adapter.add(object, Ice.Util.stringToIdentity("test"));
+ Ice.Identity id = Ice.Util.stringToIdentity("test");
+ adapter.add(new MyDerivedClassI(adapter, id), id);
+ adapter.add(new TestCheckedCastI(), Ice.Util.stringToIdentity("context"));
adapter.activate();
- //
- // Make a separate adapter with a servant locator. We use this to test
- // that ::Ice::Context is correctly passed to checkedCast() operation.
- //
- communicator.getProperties().setProperty("CheckedCastAdapter.Endpoints", "default -p 12346 -t 10000");
- adapter = communicator.createObjectAdapter("CheckedCastAdapter");
- Ice.ServantLocator checkedCastLocator = new CheckedCastLocator();
- adapter.addServantLocator(checkedCastLocator, "");
- adapter.activate();
-
communicator.waitForShutdown();
return 0;
}
diff --git a/java/test/Ice/operationsAMD/TestCheckedCastI.java b/java/test/Ice/operationsAMD/TestCheckedCastI.java
index ffecdc06143..3be7691e0ac 100644
--- a/java/test/Ice/operationsAMD/TestCheckedCastI.java
+++ b/java/test/Ice/operationsAMD/TestCheckedCastI.java
@@ -15,10 +15,11 @@ public final class TestCheckedCastI extends Test._TestCheckedCastDisp
cb.ice_response(_ctx);
}
- public void
- setContext(java.util.Map ctx)
+ public boolean
+ ice_isA(String s, Ice.Current current)
{
- _ctx = ctx;
+ _ctx = current.ctx;
+ return super.ice_isA(s, current);
}
private java.util.Map _ctx;