diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/test/Ice/exceptions/Collocated.java | 58 | ||||
-rw-r--r-- | java/test/Ice/facets/Collocated.java | 62 | ||||
-rw-r--r-- | java/test/Ice/inheritance/Collocated.java | 58 | ||||
-rw-r--r-- | java/test/Ice/objects/Collocated.java | 63 | ||||
-rw-r--r-- | java/test/Ice/operations/Collocated.java | 58 |
5 files changed, 299 insertions, 0 deletions
diff --git a/java/test/Ice/exceptions/Collocated.java b/java/test/Ice/exceptions/Collocated.java new file mode 100644 index 00000000000..6c215ae7fe0 --- /dev/null +++ b/java/test/Ice/exceptions/Collocated.java @@ -0,0 +1,58 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +public class Collocated +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + String endpts = "default -p 12345 -t 2000"; + Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("TestAdapter", endpts); + Ice.Object object = new ThrowerI(adapter); + adapter.add(object, Ice.Util.stringToIdentity("thrower")); + + AllTests.allTests(communicator, true); + + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + communicator = Ice.Util.initialize(args); + status = run(args, communicator); + } + catch (Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + + if (communicator != null) + { + try + { + communicator.destroy(); + } + catch (Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + } + + System.exit(status); + } +} diff --git a/java/test/Ice/facets/Collocated.java b/java/test/Ice/facets/Collocated.java new file mode 100644 index 00000000000..e95bccbc5af --- /dev/null +++ b/java/test/Ice/facets/Collocated.java @@ -0,0 +1,62 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +public class Collocated +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + String endpts = "default -p 12345 -t 2000"; + Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("TestAdapter", endpts); + Ice.Object d = new DI(); + adapter.add(d, Ice.Util.stringToIdentity("d")); + d.ice_addFacet(d, "facetABCD"); + d.ice_addFacet(new FI(), "facetEF"); + d.ice_addFacet(new GI(communicator), "facetG"); + + AllTests.allTests(communicator); + + d.ice_removeAllFacets(); // Break cyclic dependencies + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + communicator = Ice.Util.initialize(args); + status = run(args, communicator); + } + catch (Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + + if (communicator != null) + { + try + { + communicator.destroy(); + } + catch (Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + } + + System.exit(status); + } +} diff --git a/java/test/Ice/inheritance/Collocated.java b/java/test/Ice/inheritance/Collocated.java new file mode 100644 index 00000000000..39281e18d86 --- /dev/null +++ b/java/test/Ice/inheritance/Collocated.java @@ -0,0 +1,58 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +public class Collocated +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + String endpts = "default -p 12345 -t 2000"; + Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("TestAdapter", endpts); + Ice.Object object = new InitialI(adapter); + adapter.add(object, Ice.Util.stringToIdentity("initial")); + + AllTests.allTests(communicator); + + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + communicator = Ice.Util.initialize(args); + status = run(args, communicator); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + + if (communicator != null) + { + try + { + communicator.destroy(); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + } + + System.exit(status); + } +} diff --git a/java/test/Ice/objects/Collocated.java b/java/test/Ice/objects/Collocated.java new file mode 100644 index 00000000000..b9a39de5fc9 --- /dev/null +++ b/java/test/Ice/objects/Collocated.java @@ -0,0 +1,63 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +public class Collocated +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + String endpts = "default -p 12345 -t 2000"; + Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("TestAdapter", endpts); + Initial initial = new InitialI(adapter); + adapter.add(initial, Ice.Util.stringToIdentity("initial")); + // TODO: It should not be necessary to call activate(), but there + // is a JDK bug (4531740) which currently causes the test to hang + // without it. Remove this when the bug is fixed, or a workaround + // is added to ThreadPool. + adapter.activate(); + AllTests.allTests(communicator, true); + // We must call shutdown even in the collocated case for cyclic dependency cleanup + initial.shutdown(null); + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + communicator = Ice.Util.initialize(args); + status = run(args, communicator); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + + if (communicator != null) + { + try + { + communicator.destroy(); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + } + + System.exit(status); + } +} diff --git a/java/test/Ice/operations/Collocated.java b/java/test/Ice/operations/Collocated.java new file mode 100644 index 00000000000..7317b97c3fb --- /dev/null +++ b/java/test/Ice/operations/Collocated.java @@ -0,0 +1,58 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +public class Collocated +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + String endpts = "default -p 12345 -t 2000"; + Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("TestAdapter", endpts); + Ice.Object object = new MyDerivedClassI(adapter, Ice.Util.stringToIdentity("test")); + adapter.add(object, Ice.Util.stringToIdentity("test")); + + AllTests.allTests(communicator); + + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + communicator = Ice.Util.initialize(args); + status = run(args, communicator); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + + if (communicator != null) + { + try + { + communicator.destroy(); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + } + + System.exit(status); + } +} |