summaryrefslogtreecommitdiff
path: root/java/test/IceBox/configuration/AllTests.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-12-21 18:46:48 +0100
committerBenoit Foucher <benoit@zeroc.com>2007-12-21 18:46:48 +0100
commit615be5a748ba8007ada416961c742aaf10628b9a (patch)
tree7164fab9471dcce76f4a704831f31f152922c5d8 /java/test/IceBox/configuration/AllTests.java
parentFix bug 2520: Test suite unsets ICE_CONFIG to avoid configuration conflicts (diff)
downloadice-615be5a748ba8007ada416961c742aaf10628b9a.tar.bz2
ice-615be5a748ba8007ada416961c742aaf10628b9a.tar.xz
ice-615be5a748ba8007ada416961c742aaf10628b9a.zip
- Fixed bug 2482
- Fixed bug 2589 - Fixed bug in Java/C# implementation of Properties clone. The values were not cloned but shared with the clone. - Fixed bug in IceBox where the properties admin facet was removed only for services that had a communicator. - Added IceBox/configuration tests.
Diffstat (limited to 'java/test/IceBox/configuration/AllTests.java')
-rw-r--r--java/test/IceBox/configuration/AllTests.java96
1 files changed, 96 insertions, 0 deletions
diff --git a/java/test/IceBox/configuration/AllTests.java b/java/test/IceBox/configuration/AllTests.java
new file mode 100644
index 00000000000..0c710b4684f
--- /dev/null
+++ b/java/test/IceBox/configuration/AllTests.java
@@ -0,0 +1,96 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+import Test.*;
+
+public class AllTests
+{
+ private static void
+ test(boolean b)
+ {
+ if (!b)
+ {
+ throw new RuntimeException();
+ }
+ }
+
+ public static void
+ allTests(Ice.Communicator communicator)
+ {
+ TestIntfPrx service1 = TestIntfPrxHelper.uncheckedCast(communicator.stringToProxy("test:default -p 12010"));
+ TestIntfPrx service2 = TestIntfPrxHelper.uncheckedCast(communicator.stringToProxy("test:default -p 12011"));
+ TestIntfPrx service3 = TestIntfPrxHelper.uncheckedCast(communicator.stringToProxy("test:default -p 12012"));
+ TestIntfPrx service4 = TestIntfPrxHelper.uncheckedCast(communicator.stringToProxy("test:default -p 12013"));
+
+ if(service1.getProperty("IceBox.InheritProperties").equals(""))
+ {
+ System.out.print("testing service properties... ");
+ System.out.flush();
+
+ test(service1.getProperty("Ice.ProgramName").equals("IceBox-Service1"));
+ test(service1.getProperty("Service").equals("1"));
+ test(service1.getProperty("Service1.Ovrd").equals("2"));
+ test(service1.getProperty("Service1.Unset").equals(""));
+ test(service1.getProperty("Arg").equals("1"));
+
+ String[] args1 = {"-a", "--Arg=2"};
+ test(java.util.Arrays.equals(service1.getArgs(), args1));
+
+ test(service2.getProperty("Ice.ProgramName").equals("Test"));
+ test(service2.getProperty("Service").equals("2"));
+ test(service2.getProperty("Service1.ArgProp").equals(""));
+ test(service2.getProperty("IceBox.InheritProperties").equals("1"));
+
+ String[] args2 = {"--Service1.ArgProp=1"};
+ test(java.util.Arrays.equals(service2.getArgs(), args2));
+
+ System.out.println("ok");
+
+ System.out.print("testing with shared communicator... ");
+ System.out.flush();
+
+ test(service3.getProperty("Ice.ProgramName").equals("IceBox-SharedCommunicator"));
+ test(service3.getProperty("Service").equals("4"));
+ test(service3.getProperty("Prop").equals(""));
+ test(service3.getProperty("Service3.Prop").equals("1"));
+ test(service3.getProperty("Ice.Trace.Network").equals("3"));
+
+ test(service4.getProperty("Ice.ProgramName").equals("IceBox-SharedCommunicator"));
+ test(service4.getProperty("Service").equals("4"));
+ test(service4.getProperty("Prop").equals(""));
+ test(service4.getProperty("Service3.Prop").equals("1"));
+ test(service4.getProperty("Ice.Trace.Network").equals("3"));
+
+ String[] args4 = {"--Service3.Prop=2"};
+ test(java.util.Arrays.equals(service4.getArgs(), args4));
+
+ System.out.println("ok");
+ }
+ else
+ {
+ System.out.print("testing property inheritance... ");
+ System.out.flush();
+
+ test(service1.getProperty("Ice.ProgramName").equals("IceBox2-Service1"));
+ test(service1.getProperty("ServerProp").equals("1"));
+ test(service1.getProperty("OverrideMe").equals("2"));
+ test(service1.getProperty("UnsetMe").equals(""));
+ test(service1.getProperty("Service1.Prop").equals("1"));
+ test(service1.getProperty("Service1.ArgProp").equals("2"));
+
+ test(service2.getProperty("Ice.ProgramName").equals("IceBox2-SharedCommunicator"));
+ test(service2.getProperty("ServerProp").equals("1"));
+ test(service2.getProperty("OverrideMe").equals("3"));
+ test(service2.getProperty("UnsetMe").equals(""));
+ test(service2.getProperty("Service2.Prop").equals("1"));
+
+ System.out.println("ok");
+ }
+ }
+}