diff options
66 files changed, 541 insertions, 255 deletions
diff --git a/config/Make.common.rules b/config/Make.common.rules index 939e23a4769..49f8b807624 100644 --- a/config/Make.common.rules +++ b/config/Make.common.rules @@ -70,11 +70,11 @@ ifeq ($(UNAME),Linux) endif ifeq ($(LP64),yes) - libsubdir := lib$(lp64suffix) - binsubdir := bin$(lp64binsuffix) + libsubdir := lib$(lp64suffix) + binsubdir := bin$(lp64binsuffix) else - libsubdir := lib - binsubdir := bin + libsubdir := lib + binsubdir := bin endif diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules index 359519655fa..f558971f81a 100644 --- a/cpp/config/Make.rules +++ b/cpp/config/Make.rules @@ -130,9 +130,10 @@ USE_READLINE ?= no #GENPIC ?= yes # -# If building with MinGW and Ice third party packages is not installed -# in the default location set THIRDPARTY_HOME to the Ice third party -# installation directory. +# If building with MinGW and if third party libraries are not +# installed in the default location or THIRDPARTY_HOME is not set in +# your environment variables then change the following setting to +# reflect the installation location. # #THIRDPARTY_HOME ?= C:\Program Files\ZeroC\Ice-$(VERSION)-ThirdParty @@ -263,21 +264,21 @@ ifeq ($(ice_dir), /usr) LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) else ifeq ($(MinGW), yes) - includedir_win = $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(includedir)) - CPPFLAGS += -I"$(includedir_win)" - ice_dir_win = $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(ice_dir)) - ifdef ice_src_dist - LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir) - else - LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L"$(ice_dir_win)\$(binsubdir)" - endif + includedir_win = $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(includedir)) + CPPFLAGS += -I"$(includedir_win)" + ice_dir_win = $(shell $(top_srcdir)/../cpp/config/cygpath-win.sh $(ice_dir)) + ifdef ice_src_dist + LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir) + else + LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L"$(ice_dir_win)\$(binsubdir)" + endif else - CPPFLAGS += -I$(includedir) - ifdef ice_src_dist - LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir) - else - LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(ice_dir)/$(libsubdir) - endif + CPPFLAGS += -I$(includedir) + ifdef ice_src_dist + LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(libdir) + else + LDFLAGS = $(LDPLATFORMFLAGS) $(CXXFLAGS) -L$(ice_dir)/$(libsubdir) + endif endif endif @@ -302,19 +303,19 @@ endif ifdef ice_src_dist ifeq ($(MinGW), yes) SLICEPARSERLIB = $(bindir)/$(SLICE_LIBNAME).dll - SLICE2CPP = $(bindir)/slice2cpp.exe + SLICE2CPP = $(bindir)/slice2cpp.exe else SLICEPARSERLIB = $(libdir)/$(call mklibfilename,Slice,$(VERSION)) - SLICE2CPP = $(bindir)/slice2cpp + SLICE2CPP = $(bindir)/slice2cpp SLICE2FREEZE = $(bindir)/slice2freeze endif else ifeq ($(MinGW), yes) SLICEPARSERLIB = $(ice_dir)/$(binsubdir)/$(SLICE_LIBNAME).dll - SLICE2CPP = $(ice_dir)/$(binsubdir)/slice2cpp.exe + SLICE2CPP = $(ice_dir)/$(binsubdir)/slice2cpp.exe else SLICEPARSERLIB = $(ice_dir)/$(libsubdir)/$(call mklibfilename,Slice,$(VERSION)) - SLICE2CPP = $(ice_dir)/$(binsubdir)/slice2cpp + SLICE2CPP = $(ice_dir)/$(binsubdir)/slice2cpp SLICE2FREEZE = $(ice_dir)/$(binsubdir)/slice2freeze endif endif diff --git a/cpp/config/Make.rules.Darwin b/cpp/config/Make.rules.Darwin index 509954efa86..06568790ebf 100644 --- a/cpp/config/Make.rules.Darwin +++ b/cpp/config/Make.rules.Darwin @@ -12,7 +12,7 @@ # ifeq ($(DEVELOPER_PATH),) - DEVELOPER_PATH = $(shell xcode-select -print-path) + DEVELOPER_PATH = $(shell xcode-select -print-path) endif TOOLCHAIN_BIN_DIR = $(DEVELOPER_PATH)/Toolchains/XcodeDefault.xctoolchain/usr/bin @@ -41,14 +41,9 @@ endif endif # -# Avoid OpenSSL deprecation warnings in Os X -# -OPENSSL_FLAGS = -Wno-deprecated-declarations - -# # C++ run-time libraries, necessary for linking some shared libraries. # -CXXLIBS = +CXXLIBS = ifneq ($(embedded_runpath_prefix),) # Only use -rpath if Mac OS X >= 10.5 @@ -103,6 +98,11 @@ ifeq ($(DB_HOME),) endif endif +# +# Avoid OpenSSL deprecation warnings on OS X +# +OPENSSL_FLAGS = -Wno-deprecated-declarations + BASELIBS = -lIceUtil -lpthread LIBS = -lIce $(BASELIBS) diff --git a/cpp/test/FreezeScript/dbmap/run.py b/cpp/test/FreezeScript/dbmap/run.py index 34cfbeaa6f3..b99ed7b78d7 100755 --- a/cpp/test/FreezeScript/dbmap/run.py +++ b/cpp/test/FreezeScript/dbmap/run.py @@ -124,8 +124,8 @@ print("ok") sys.stdout.write("executing default transformations... ") sys.stdout.flush() -command = '"' + transformdb + '" --old "' + testold + '" --new "' + testnew + '" --key int --value ::Test::S "' + init_dbdir + \ - '" default.db "' + check_dbdir + '" ' +command = '"' + transformdb + '" --old "' + testold + '" --new "' + testnew + '" --key int --value ::Test::S "' + \ + init_dbdir + '" default.db "' + check_dbdir + '" ' TestUtil.spawn(command).waitTestSuccess() @@ -134,8 +134,8 @@ print("ok") sys.stdout.write("validating database... ") sys.stdout.flush() -command = '"' + transformdb + '" --old "' + testnew + '" --new "' + testnew + '" -f "' + checkxml + '" "' + check_dbdir + \ - '" default.db "' + tmp_dbdir + '" ' +command = '"' + transformdb + '" --old "' + testnew + '" --new "' + testnew + '" -f "' + checkxml + '" "' + \ + check_dbdir + '" default.db "' + tmp_dbdir + '" ' TestUtil.spawn(command).waitTestSuccess() diff --git a/cpp/test/Ice/enums/run.py b/cpp/test/Ice/enums/run.py index ecadfca52b9..9d197cb0ea6 100755 --- a/cpp/test/Ice/enums/run.py +++ b/cpp/test/Ice/enums/run.py @@ -21,6 +21,8 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with 1.1 encoding.") TestUtil.clientServerTest() diff --git a/cpp/test/Ice/exceptions/Test.ice b/cpp/test/Ice/exceptions/Test.ice index 610c7b6bdf6..5338dac2414 100644 --- a/cpp/test/Ice/exceptions/Test.ice +++ b/cpp/test/Ice/exceptions/Test.ice @@ -18,9 +18,7 @@ interface Empty interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; @@ -70,7 +68,6 @@ module Mod }; }; - ["ami"] interface Thrower { void shutdown(); diff --git a/cpp/test/Ice/exceptions/TestAMD.ice b/cpp/test/Ice/exceptions/TestAMD.ice index f80e031a302..a5c4353e65b 100644 --- a/cpp/test/Ice/exceptions/TestAMD.ice +++ b/cpp/test/Ice/exceptions/TestAMD.ice @@ -18,9 +18,7 @@ interface Empty interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; diff --git a/cpp/test/Ice/exceptions/run.py b/cpp/test/Ice/exceptions/run.py index 35ffcc8f6f7..cc6bc3d6d64 100755 --- a/cpp/test/Ice/exceptions/run.py +++ b/cpp/test/Ice/exceptions/run.py @@ -22,15 +22,27 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with compact (default) format and AMD server.") TestUtil.clientServerTest(server="serveramd") + print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running collocated test.") TestUtil.collocatedTest() diff --git a/cpp/test/Ice/objects/TestI.cpp b/cpp/test/Ice/objects/TestI.cpp index 648dd4df0cf..70c325475bd 100644 --- a/cpp/test/Ice/objects/TestI.cpp +++ b/cpp/test/Ice/objects/TestI.cpp @@ -230,7 +230,7 @@ UnexpectedObjectExceptionTestI::ice_invoke(const std::vector<Ice::Byte>&, { Ice::CommunicatorPtr communicator = current.adapter->getCommunicator(); Ice::OutputStreamPtr out = Ice::createOutputStream(communicator); - out->startEncapsulation(); + out->startEncapsulation(current.encoding, Ice::DefaultFormat); AlsoEmptyPtr ae = new AlsoEmpty; out->write(ae); out->writePendingObjects(); diff --git a/cpp/test/Ice/objects/run.py b/cpp/test/Ice/objects/run.py index b71b37f48fd..abfd9232fad 100755 --- a/cpp/test/Ice/objects/run.py +++ b/cpp/test/Ice/objects/run.py @@ -22,9 +22,14 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running collocated test.") TestUtil.collocatedTest() diff --git a/cpp/test/Ice/servantLocator/AllTests.cpp b/cpp/test/Ice/servantLocator/AllTests.cpp index ff26c1178e1..362116a9332 100644 --- a/cpp/test/Ice/servantLocator/AllTests.cpp +++ b/cpp/test/Ice/servantLocator/AllTests.cpp @@ -89,6 +89,9 @@ testExceptions(const TestIntfPrx& obj, bool collocated) { test(ex.unknown == "Test::TestIntfUserException"); } + catch(const Ice::OperationNotExistException&) + { + } catch(...) { test(false); @@ -101,7 +104,7 @@ testExceptions(const TestIntfPrx& obj, bool collocated) } catch(const UnknownLocalException& ex) { - test(ex.unknown.find("Ice::SocketException:\nsocket exception: unknown error") != string::npos); + test(ex.unknown.find("Ice::SocketException") != string::npos); } catch(...) { @@ -113,6 +116,9 @@ testExceptions(const TestIntfPrx& obj, bool collocated) obj->stdException(); test(false); } + catch(const Ice::OperationNotExistException&) + { + } catch(const UnknownException& ex) { test(ex.unknown == "std::exception: Hello"); @@ -131,6 +137,9 @@ testExceptions(const TestIntfPrx& obj, bool collocated) { test(ex.unknown == "unknown c++ exception"); } + catch(const Ice::OperationNotExistException&) + { + } catch(...) { test(false); diff --git a/cpp/test/Ice/slicing/exceptions/run.py b/cpp/test/Ice/slicing/exceptions/run.py index e5626d35421..b309d3fb701 100755 --- a/cpp/test/Ice/slicing/exceptions/run.py +++ b/cpp/test/Ice/slicing/exceptions/run.py @@ -22,9 +22,15 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with sliced format and AMD server.") TestUtil.clientServerTest(server="serveramd") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/cpp/test/Ice/slicing/objects/run.py b/cpp/test/Ice/slicing/objects/run.py index 7ebf7f11582..caafb5a934c 100755 --- a/cpp/test/Ice/slicing/objects/run.py +++ b/cpp/test/Ice/slicing/objects/run.py @@ -22,9 +22,15 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with sliced format and AMD server.") TestUtil.clientServerTest(server="serveramd") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/cpp/test/Ice/stream/run.py b/cpp/test/Ice/stream/run.py index 85ddafb614f..91717f869da 100755 --- a/cpp/test/Ice/stream/run.py +++ b/cpp/test/Ice/stream/run.py @@ -21,7 +21,9 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil client = os.path.join(os.getcwd(), "client") + print("Running test with default encoding...") TestUtil.simpleTest(client) + print("Running test with 1.0 encoding...") TestUtil.simpleTest(client, "--Ice.Default.EncodingVersion=1.0") diff --git a/cs/test/Ice/enums/run.py b/cs/test/Ice/enums/run.py index ecadfca52b9..9d197cb0ea6 100755 --- a/cs/test/Ice/enums/run.py +++ b/cs/test/Ice/enums/run.py @@ -21,6 +21,8 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with 1.1 encoding.") TestUtil.clientServerTest() diff --git a/cs/test/Ice/exceptions/Test.ice b/cs/test/Ice/exceptions/Test.ice index 86751e0ec2e..9315039c3d0 100644 --- a/cs/test/Ice/exceptions/Test.ice +++ b/cs/test/Ice/exceptions/Test.ice @@ -18,9 +18,7 @@ interface Empty interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; diff --git a/cs/test/Ice/exceptions/TestAMD.ice b/cs/test/Ice/exceptions/TestAMD.ice index fe88f2b2b67..2b59400e385 100644 --- a/cs/test/Ice/exceptions/TestAMD.ice +++ b/cs/test/Ice/exceptions/TestAMD.ice @@ -18,9 +18,7 @@ interface Empty interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; diff --git a/cs/test/Ice/objects/UnexpectedObjectExceptionTestI.cs b/cs/test/Ice/objects/UnexpectedObjectExceptionTestI.cs index 7547ef4600b..3db03773a90 100644 --- a/cs/test/Ice/objects/UnexpectedObjectExceptionTestI.cs +++ b/cs/test/Ice/objects/UnexpectedObjectExceptionTestI.cs @@ -15,7 +15,7 @@ public sealed class UnexpectedObjectExceptionTestI : Ice.Blobject { Ice.Communicator communicator = current.adapter.getCommunicator(); Ice.OutputStream @out = Ice.Util.createOutputStream(communicator); - @out.startEncapsulation(); + @out.startEncapsulation(current.encoding, Ice.FormatType.DefaultFormat); AlsoEmpty ae = new AlsoEmpty(); Test.AlsoEmptyHelper.write(@out, ae); @out.writePendingObjects(); diff --git a/cs/test/Ice/objects/run.py b/cs/test/Ice/objects/run.py index a38bb7ed1b1..55b87c34dff 100755 --- a/cs/test/Ice/objects/run.py +++ b/cs/test/Ice/objects/run.py @@ -22,9 +22,14 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running collocated test.") TestUtil.collocatedTest() diff --git a/cs/test/Ice/servantLocator/AllTests.cs b/cs/test/Ice/servantLocator/AllTests.cs index 04c3f7053c2..60f7ffd2901 100644 --- a/cs/test/Ice/servantLocator/AllTests.cs +++ b/cs/test/Ice/servantLocator/AllTests.cs @@ -90,6 +90,9 @@ public class AllTests : TestCommon.TestApp //Console.Error.WriteLine(ex.unknown); test(ex.unknown.IndexOf("Test::TestIntfUserException") >= 0); } + catch(Ice.OperationNotExistException) + { + } catch(System.Exception) { test(false); @@ -118,6 +121,23 @@ public class AllTests : TestCommon.TestApp { test(ex.unknown.IndexOf("System.Exception") >= 0); } + catch(Ice.OperationNotExistException) + { + } + catch(System.Exception) + { + test(false); + } + + try + { + obj.unknownExceptionWithServantException(); + test(false); + } + catch(UnknownException ex) + { + test(ex.unknown.Equals("reason")); + } catch(System.Exception) { test(false); diff --git a/cs/test/Ice/servantLocator/ServantLocatorI.cs b/cs/test/Ice/servantLocator/ServantLocatorI.cs index 49f64bd87a2..8dc772b47d0 100644 --- a/cs/test/Ice/servantLocator/ServantLocatorI.cs +++ b/cs/test/Ice/servantLocator/ServantLocatorI.cs @@ -145,6 +145,10 @@ public sealed class ServantLocatorI : Ice.ServantLocator { throw new System.Exception("message"); } + else if(current.operation.Equals("unknownExceptionWithServantException")) + { + throw new UnknownException("reason"); + } else if(current.operation.Equals("impossibleException")) { throw new Test.TestIntfUserException(); // Yes, it really is meant to be TestIntfException. diff --git a/cs/test/Ice/servantLocator/Test.ice b/cs/test/Ice/servantLocator/Test.ice index c487446c5b8..3e4cd22817b 100644 --- a/cs/test/Ice/servantLocator/Test.ice +++ b/cs/test/Ice/servantLocator/Test.ice @@ -30,6 +30,8 @@ interface TestIntf void userException(); void csException(); + void unknownExceptionWithServantException(); + string impossibleException(bool throw) throws TestImpossibleException; string intfUserException(bool throw) throws TestIntfUserException, TestImpossibleException; diff --git a/cs/test/Ice/servantLocator/TestAMD.ice b/cs/test/Ice/servantLocator/TestAMD.ice index fa788fb1b69..4f30e093535 100644 --- a/cs/test/Ice/servantLocator/TestAMD.ice +++ b/cs/test/Ice/servantLocator/TestAMD.ice @@ -30,6 +30,8 @@ exception TestImpossibleException void userException(); void csException(); + void unknownExceptionWithServantException(); + string impossibleException(bool throw) throws TestImpossibleException; string intfUserException(bool throw) throws TestIntfUserException, TestImpossibleException; diff --git a/cs/test/Ice/servantLocator/TestAMDI.cs b/cs/test/Ice/servantLocator/TestAMDI.cs index 48d3beb7a2c..b74a97d973c 100644 --- a/cs/test/Ice/servantLocator/TestAMDI.cs +++ b/cs/test/Ice/servantLocator/TestAMDI.cs @@ -46,6 +46,13 @@ public sealed class TestI : TestIntfDisp_ cb.ice_response(); } + public override void + unknownExceptionWithServantException_async(AMD_TestIntf_unknownExceptionWithServantException cb, + Ice.Current current) + { + cb.ice_exception(new Ice.ObjectNotExistException()); + } + public override void impossibleException_async(AMD_TestIntf_impossibleException cb, bool @throw, Ice.Current current) { diff --git a/cs/test/Ice/servantLocator/TestI.cs b/cs/test/Ice/servantLocator/TestI.cs index d29c2de4bc2..3a307128a8a 100644 --- a/cs/test/Ice/servantLocator/TestI.cs +++ b/cs/test/Ice/servantLocator/TestI.cs @@ -39,6 +39,11 @@ public sealed class TestI : TestIntfDisp_ { } + public override void unknownExceptionWithServantException(Ice.Current current) + { + throw new Ice.ObjectNotExistException(); + } + public override string impossibleException(bool @throw, Ice.Current current) { if(@throw) diff --git a/cs/test/Ice/slicing/exceptions/run.py b/cs/test/Ice/slicing/exceptions/run.py index 1e7e887e28a..9d2f6400553 100755 --- a/cs/test/Ice/slicing/exceptions/run.py +++ b/cs/test/Ice/slicing/exceptions/run.py @@ -22,9 +22,15 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with sliced format and AMD server.") TestUtil.clientServerTest(server="serveramd") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/cs/test/Ice/slicing/objects/run.py b/cs/test/Ice/slicing/objects/run.py index 1e7e887e28a..9d2f6400553 100755 --- a/cs/test/Ice/slicing/objects/run.py +++ b/cs/test/Ice/slicing/objects/run.py @@ -22,9 +22,15 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with sliced format and AMD server.") TestUtil.clientServerTest(server="serveramd") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/java/build.xml b/java/build.xml index a50b28c70b0..6d37cf05025 100644 --- a/java/build.xml +++ b/java/build.xml @@ -600,7 +600,7 @@ </target> <target name="test-jar" depends="test-compile, ice-jar, freeze-jar, glacier2-jar, icebox-jar, icestorm-jar, - icegrid-jar"> + icegrid-jar, test-plugins-jar"> <jar jarfile="${lib.dir}/IceTest.jar" basedir="${lib.dir}"> <include name="test/**"/> <exclude name="test/Ice/plugin/plugins/**"/> @@ -639,7 +639,8 @@ </and> </condition> - <target name="icegridadmin-plain-jar" depends="icegridadmin-compile, ice-jar, icebox-jar, glacier2-jar, icestorm-jar, icegrid-jar" + <target name="icegridadmin-plain-jar" depends="icegridadmin-compile, ice-jar, icebox-jar, glacier2-jar, + icestorm-jar, icegrid-jar" if="build-icegridadmin-plain-jar" unless="ice.bin.dist"> <manifest file="${lib.dir}/icegridgui.mf"> <attribute name="Main-Class" value="IceGridGUI.Main"/> @@ -654,7 +655,8 @@ <delete file="${lib.dir}/icegridgui.mf" /> </target> - <target name="icegridadmin-pro-jar" depends="ice-jar, icebox-jar, glacier2-jar, icestorm-jar, icegrid-jar, icegridadmin-compile" + <target name="icegridadmin-pro-jar" depends="ice-jar, icebox-jar, glacier2-jar, icestorm-jar, icegrid-jar, + icegridadmin-compile" if="build-icegridadmin-pro-jar" unless="ice.bin.dist"> <property name="library.jarfiles" value="rt.jar,jsse.jar,jfxrt.jar"/> @@ -773,7 +775,7 @@ </copy> </target> - <target name="install-icegridgui-jar"> + <target name="install-icegridgui-jar" if="build-icegridadmin" unless="ice.bin.dist"> <mkdir dir="${prefix}/help"/> <copy file="${lib.dir}/IceGridGUI.jar" todir="${prefix}/lib"/> <copy todir="${prefix}/help"> diff --git a/java/test/Ice/enums/run.py b/java/test/Ice/enums/run.py index ecadfca52b9..9d197cb0ea6 100755 --- a/java/test/Ice/enums/run.py +++ b/java/test/Ice/enums/run.py @@ -21,6 +21,8 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with 1.1 encoding.") TestUtil.clientServerTest() diff --git a/java/test/Ice/exceptions/Test.ice b/java/test/Ice/exceptions/Test.ice index 35dca6dbfe4..ec93564a599 100644 --- a/java/test/Ice/exceptions/Test.ice +++ b/java/test/Ice/exceptions/Test.ice @@ -19,9 +19,7 @@ interface Empty interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; diff --git a/java/test/Ice/exceptions/TestAMD.ice b/java/test/Ice/exceptions/TestAMD.ice index 9b4514401c8..3cf7b850e77 100644 --- a/java/test/Ice/exceptions/TestAMD.ice +++ b/java/test/Ice/exceptions/TestAMD.ice @@ -15,9 +15,7 @@ module Test interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; diff --git a/java/test/Ice/exceptions/run.py b/java/test/Ice/exceptions/run.py index ac4d21bcedb..fb44c9d33d7 100755 --- a/java/test/Ice/exceptions/run.py +++ b/java/test/Ice/exceptions/run.py @@ -22,15 +22,27 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with compact (default) format and AMD server.") TestUtil.clientServerTest(server="test.Ice.exceptions.AMDServer") + print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="test.Ice.exceptions.AMDServer", additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(server="test.Ice.exceptions.AMDServer", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="test.Ice.exceptions.AMDServer", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="test.Ice.exceptions.AMDServer", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running collocated test.") TestUtil.collocatedTest() diff --git a/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java b/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java index f3dfd26dd3c..3fa16905553 100644 --- a/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java +++ b/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java @@ -20,7 +20,7 @@ public final class UnexpectedObjectExceptionTestI extends Ice.Blobject { Ice.Communicator communicator = current.adapter.getCommunicator(); Ice.OutputStream out = Ice.Util.createOutputStream(communicator); - out.startEncapsulation(); + out.startEncapsulation(current.encoding, Ice.FormatType.DefaultFormat); AlsoEmpty ae = new AlsoEmpty(); AlsoEmptyHelper.write(out, ae); out.writePendingObjects(); diff --git a/java/test/Ice/objects/run.py b/java/test/Ice/objects/run.py index b71b37f48fd..bea008b6d56 100755 --- a/java/test/Ice/objects/run.py +++ b/java/test/Ice/objects/run.py @@ -22,9 +22,14 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running collocated test.") TestUtil.collocatedTest() diff --git a/java/test/Ice/servantLocator/AMDServantLocatorI.java b/java/test/Ice/servantLocator/AMDServantLocatorI.java index f167d52d7fb..37cc3189b31 100644 --- a/java/test/Ice/servantLocator/AMDServantLocatorI.java +++ b/java/test/Ice/servantLocator/AMDServantLocatorI.java @@ -152,6 +152,10 @@ public final class AMDServantLocatorI implements Ice.ServantLocator { throw new java.lang.RuntimeException("message"); } + else if(current.operation.equals("unknownExceptionWithServantException")) + { + throw new UnknownException("reason"); + } else if(current.operation.equals("impossibleException")) { throw new TestIntfUserException(); // Yes, it really is meant to be TestIntfUserException. diff --git a/java/test/Ice/servantLocator/AMDTestI.java b/java/test/Ice/servantLocator/AMDTestI.java index 057884ecba6..882358d9ddc 100644 --- a/java/test/Ice/servantLocator/AMDTestI.java +++ b/java/test/Ice/servantLocator/AMDTestI.java @@ -20,6 +20,7 @@ import test.Ice.servantLocator.AMD.Test.AMD_TestIntf_shutdown; import test.Ice.servantLocator.AMD.Test.AMD_TestIntf_unknownException; import test.Ice.servantLocator.AMD.Test.AMD_TestIntf_unknownLocalException; import test.Ice.servantLocator.AMD.Test.AMD_TestIntf_unknownUserException; +import test.Ice.servantLocator.AMD.Test.AMD_TestIntf_unknownExceptionWithServantException; import test.Ice.servantLocator.AMD.Test.TestImpossibleException; import test.Ice.servantLocator.AMD.Test.TestIntfUserException; import test.Ice.servantLocator.AMD.Test._TestIntfDisp; @@ -68,6 +69,13 @@ public final class AMDTestI extends _TestIntfDisp cb.ice_response(); } + public void + unknownExceptionWithServantException_async(AMD_TestIntf_unknownExceptionWithServantException cb, + Ice.Current current) + { + cb.ice_exception(new Ice.ObjectNotExistException()); + } + public void impossibleException_async(AMD_TestIntf_impossibleException cb, boolean _throw, Ice.Current current) { diff --git a/java/test/Ice/servantLocator/AllTests.java b/java/test/Ice/servantLocator/AllTests.java index aa23d04b40a..794879b5a5c 100644 --- a/java/test/Ice/servantLocator/AllTests.java +++ b/java/test/Ice/servantLocator/AllTests.java @@ -125,6 +125,24 @@ public class AllTests { test(ex.unknown.indexOf("java.lang.RuntimeException: message") >= 0); } + catch(Ice.OperationNotExistException ex) + { + } + catch(Throwable ex) + { + //System.err.println(ex); + test(false); + } + + try + { + obj.unknownExceptionWithServantException(); + test(false); + } + catch(UnknownException ex) + { + test(ex.unknown.equals("reason")); + } catch(Throwable ex) { test(false); diff --git a/java/test/Ice/servantLocator/ServantLocatorI.java b/java/test/Ice/servantLocator/ServantLocatorI.java index 73e1805733c..f4129a5d7c2 100644 --- a/java/test/Ice/servantLocator/ServantLocatorI.java +++ b/java/test/Ice/servantLocator/ServantLocatorI.java @@ -152,6 +152,10 @@ public final class ServantLocatorI implements Ice.ServantLocator { throw new java.lang.RuntimeException("message"); } + else if(current.operation.equals("unknownExceptionWithServantException")) + { + throw new UnknownException("reason"); + } else if(current.operation.equals("impossibleException")) { throw new TestIntfUserException(); // Yes, it really is meant to be TestIntfUserException. diff --git a/java/test/Ice/servantLocator/Test.ice b/java/test/Ice/servantLocator/Test.ice index 713d32b92d7..4a56a194931 100644 --- a/java/test/Ice/servantLocator/Test.ice +++ b/java/test/Ice/servantLocator/Test.ice @@ -31,6 +31,8 @@ interface TestIntf //void userException(); void javaException(); + void unknownExceptionWithServantException(); + string impossibleException(bool throw) throws TestImpossibleException; string intfUserException(bool throw) throws TestIntfUserException, TestImpossibleException; diff --git a/java/test/Ice/servantLocator/TestAMD.ice b/java/test/Ice/servantLocator/TestAMD.ice index ee88d2bd3ea..bf7afe2e1bb 100644 --- a/java/test/Ice/servantLocator/TestAMD.ice +++ b/java/test/Ice/servantLocator/TestAMD.ice @@ -31,6 +31,8 @@ exception TestImpossibleException //void userException(); void javaException(); + void unknownExceptionWithServantException(); + string impossibleException(bool throw) throws TestImpossibleException; string intfUserException(bool throw) throws TestIntfUserException, TestImpossibleException; diff --git a/java/test/Ice/servantLocator/TestI.java b/java/test/Ice/servantLocator/TestI.java index 4d4128ac253..ec0e897c477 100644 --- a/java/test/Ice/servantLocator/TestI.java +++ b/java/test/Ice/servantLocator/TestI.java @@ -50,6 +50,12 @@ public final class TestI extends _TestIntfDisp { } + public void + unknownExceptionWithServantException(Ice.Current current) + { + throw new Ice.ObjectNotExistException(); + } + public String impossibleException(boolean _throw, Ice.Current current) throws TestImpossibleException { diff --git a/java/test/Ice/slicing/exceptions/run.py b/java/test/Ice/slicing/exceptions/run.py index 93a306b63ac..2b00892facf 100755 --- a/java/test/Ice/slicing/exceptions/run.py +++ b/java/test/Ice/slicing/exceptions/run.py @@ -22,9 +22,15 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with sliced format and AMD server.") TestUtil.clientServerTest(server="test.Ice.slicing.exceptions.AMDServer") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="test.Ice.slicing.exceptions.AMDServer", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="test.Ice.slicing.exceptions.AMDServer", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/java/test/Ice/slicing/objects/run.py b/java/test/Ice/slicing/objects/run.py index e3bb98c09c9..04c9c843f43 100755 --- a/java/test/Ice/slicing/objects/run.py +++ b/java/test/Ice/slicing/objects/run.py @@ -22,9 +22,15 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with sliced format and AMD server.") TestUtil.clientServerTest(server="test.Ice.slicing.objects.AMDServer") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="test.Ice.slicing.objects.AMDServer", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="test.Ice.slicing.objects.AMDServer", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/php/test/Ice/enums/run.py b/php/test/Ice/enums/run.py index 3f0d214ab1e..41ab6d9b92b 100755 --- a/php/test/Ice/enums/run.py +++ b/php/test/Ice/enums/run.py @@ -21,6 +21,8 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with 1.1 encoding.") TestUtil.clientServerTest() diff --git a/php/test/Ice/exceptions/Test.ice b/php/test/Ice/exceptions/Test.ice index ee99dfbae42..a2d04ae66df 100644 --- a/php/test/Ice/exceptions/Test.ice +++ b/php/test/Ice/exceptions/Test.ice @@ -18,9 +18,7 @@ interface Empty interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; diff --git a/php/test/Ice/exceptions/run.py b/php/test/Ice/exceptions/run.py index 7732c33648e..f9bcc39e7e9 100755 --- a/php/test/Ice/exceptions/run.py +++ b/php/test/Ice/exceptions/run.py @@ -22,13 +22,24 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with compact (default) format and AMD server.") TestUtil.clientServerTest(server="serveramd") + print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/php/test/Ice/objects/run.py b/php/test/Ice/objects/run.py index 3d61174d3d1..15045e5b3b9 100755 --- a/php/test/Ice/objects/run.py +++ b/php/test/Ice/objects/run.py @@ -22,7 +22,11 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/php/test/Ice/slicing/exceptions/run.py b/php/test/Ice/slicing/exceptions/run.py index 9fde25714bd..fd7be90012e 100755 --- a/php/test/Ice/slicing/exceptions/run.py +++ b/php/test/Ice/slicing/exceptions/run.py @@ -22,5 +22,7 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/php/test/Ice/slicing/objects/run.py b/php/test/Ice/slicing/objects/run.py index 9fde25714bd..fd7be90012e 100755 --- a/php/test/Ice/slicing/objects/run.py +++ b/php/test/Ice/slicing/objects/run.py @@ -22,5 +22,7 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/py/test/Ice/binding/AllTests.py b/py/test/Ice/binding/AllTests.py index 5d4ae944058..52c494813ad 100644 --- a/py/test/Ice/binding/AllTests.py +++ b/py/test/Ice/binding/AllTests.py @@ -340,13 +340,13 @@ def allTests(communicator): while i < nRetry and t.getAdapterName() == "Adapter36": i = i + 1 test(i == nRetry) - t.ice_getConnection().close(True) + t.ice_getConnection().close(False) adapters.append(com.createObjectAdapter("Adapter35", endpoints[1].toString())) i = 0 while i < nRetry and t.getAdapterName() == "Adapter35": i = i + 1 test(i == nRetry) - t.ice_getConnection().close(True) + t.ice_getConnection().close(False) adapters.append(com.createObjectAdapter("Adapter34", endpoints[0].toString())) i = 0 while i < nRetry and t.getAdapterName() == "Adapter34": diff --git a/py/test/Ice/binding/Server.py b/py/test/Ice/binding/Server.py index d9a399ce1af..1c00d1b5557 100755 --- a/py/test/Ice/binding/Server.py +++ b/py/test/Ice/binding/Server.py @@ -15,7 +15,6 @@ Ice.loadSlice('Test.ice') import Test, TestI def run(args, communicator): - communicator.getProperties().setProperty("Ice.Warn.Connections", "0") communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") adapter = communicator.createObjectAdapter("TestAdapter") id = communicator.stringToIdentity("communicator") diff --git a/py/test/Ice/enums/run.py b/py/test/Ice/enums/run.py index ecadfca52b9..9d197cb0ea6 100755 --- a/py/test/Ice/enums/run.py +++ b/py/test/Ice/enums/run.py @@ -21,6 +21,8 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with 1.1 encoding.") TestUtil.clientServerTest() diff --git a/py/test/Ice/exceptions/Test.ice b/py/test/Ice/exceptions/Test.ice index 5c9b79da101..61cd21cc6d1 100644 --- a/py/test/Ice/exceptions/Test.ice +++ b/py/test/Ice/exceptions/Test.ice @@ -18,9 +18,7 @@ interface Empty interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; @@ -48,7 +46,6 @@ module Mod }; }; - ["ami"] interface Thrower { void shutdown(); diff --git a/py/test/Ice/exceptions/TestAMD.ice b/py/test/Ice/exceptions/TestAMD.ice index c2c396f4d69..e92e1e02ccf 100644 --- a/py/test/Ice/exceptions/TestAMD.ice +++ b/py/test/Ice/exceptions/TestAMD.ice @@ -14,9 +14,7 @@ module Test interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; diff --git a/py/test/Ice/exceptions/run.py b/py/test/Ice/exceptions/run.py index f5bfcf34b4b..d8490a69e88 100755 --- a/py/test/Ice/exceptions/run.py +++ b/py/test/Ice/exceptions/run.py @@ -22,15 +22,27 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with compact (default) format and AMD server.") TestUtil.clientServerTest(server="ServerAMD.py") + print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="ServerAMD.py", additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(server="ServerAMD.py", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="ServerAMD.py", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="ServerAMD.py", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running collocated test.") TestUtil.collocatedTest() diff --git a/py/test/Ice/objects/run.py b/py/test/Ice/objects/run.py index b71b37f48fd..abfd9232fad 100755 --- a/py/test/Ice/objects/run.py +++ b/py/test/Ice/objects/run.py @@ -22,9 +22,14 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running collocated test.") TestUtil.collocatedTest() diff --git a/py/test/Ice/servantLocator/AllTests.py b/py/test/Ice/servantLocator/AllTests.py index 4f4cd4a53bb..9aa1df9f449 100644 --- a/py/test/Ice/servantLocator/AllTests.py +++ b/py/test/Ice/servantLocator/AllTests.py @@ -54,6 +54,10 @@ def testExceptions(obj, collocated): test(False) except Ice.UnknownUserException as ex: test(ex.unknown.find("Test::TestIntfUserException") >= 0) + except Ice.OperationNotExistException: + pass + except AttributeError: + pass except: test(False) @@ -62,7 +66,7 @@ def testExceptions(obj, collocated): test(False) except Ice.UnknownLocalException as ex: test(not collocated) - test(ex.unknown.find("Ice.SocketException") >= 0) + test(ex.unknown.find("Ice.SocketException") >= 0 or ex.unknown.find("Ice::SocketException") >= 0) except SocketException: test(collocated) except: @@ -73,6 +77,10 @@ def testExceptions(obj, collocated): test(False) except Ice.UnknownException as ex: test(ex.unknown.find("RuntimeError: message") >= 0) + except Ice.OperationNotExistException: + pass + except AttributeError: + pass except: test(False) diff --git a/py/test/Ice/slicing/exceptions/run.py b/py/test/Ice/slicing/exceptions/run.py index bcd92b267d6..fc2b7f50cd3 100755 --- a/py/test/Ice/slicing/exceptions/run.py +++ b/py/test/Ice/slicing/exceptions/run.py @@ -22,9 +22,15 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with sliced format and AMD server.") TestUtil.clientServerTest(server="ServerAMD.py") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="ServerAMD.py", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="ServerAMD.py", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/py/test/Ice/slicing/objects/run.py b/py/test/Ice/slicing/objects/run.py index bcd92b267d6..8cbe30de77c 100755 --- a/py/test/Ice/slicing/objects/run.py +++ b/py/test/Ice/slicing/objects/run.py @@ -22,9 +22,15 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with sliced format and AMD server.") TestUtil.clientServerTest(server="ServerAMD.py") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="ServerAMD.py", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="ServerAMD.py", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/rb/test/Ice/enums/run.py b/rb/test/Ice/enums/run.py index ecadfca52b9..9d197cb0ea6 100755 --- a/rb/test/Ice/enums/run.py +++ b/rb/test/Ice/enums/run.py @@ -21,6 +21,8 @@ sys.path.append(os.path.join(path[0], "scripts")) import TestUtil print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with 1.1 encoding.") TestUtil.clientServerTest() diff --git a/rb/test/Ice/exceptions/Test.ice b/rb/test/Ice/exceptions/Test.ice index 42f44c65307..5fbc2e73445 100644 --- a/rb/test/Ice/exceptions/Test.ice +++ b/rb/test/Ice/exceptions/Test.ice @@ -18,9 +18,7 @@ interface Empty interface Thrower; -exception Base {}; - -exception A extends Base +exception A { int aMem; }; diff --git a/rb/test/Ice/exceptions/run.py b/rb/test/Ice/exceptions/run.py index 7732c33648e..f8b33b0e567 100755 --- a/rb/test/Ice/exceptions/run.py +++ b/rb/test/Ice/exceptions/run.py @@ -22,13 +22,24 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") + print("Running test with compact (default) format and AMD server.") TestUtil.clientServerTest(server="serveramd") + print("Running test with sliced format and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding and AMD server.") -TestUtil.clientServerTest(server="serveramd", additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(server="serveramd", + additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/rb/test/Ice/objects/run.py b/rb/test/Ice/objects/run.py index 3d61174d3d1..1fa8b357a8b 100755 --- a/rb/test/Ice/objects/run.py +++ b/rb/test/Ice/objects/run.py @@ -22,7 +22,11 @@ import TestUtil print("Running test with compact (default) format.") TestUtil.clientServerTest() + print("Running test with sliced format.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", additionalServerOptions="--Ice.Default.SlicedFormat") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.SlicedFormat", + additionalServerOptions="--Ice.Default.SlicedFormat") + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/rb/test/Ice/slicing/exceptions/run.py b/rb/test/Ice/slicing/exceptions/run.py index 9fde25714bd..fd7be90012e 100755 --- a/rb/test/Ice/slicing/exceptions/run.py +++ b/rb/test/Ice/slicing/exceptions/run.py @@ -22,5 +22,7 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/rb/test/Ice/slicing/objects/run.py b/rb/test/Ice/slicing/objects/run.py index 9fde25714bd..fd7be90012e 100755 --- a/rb/test/Ice/slicing/objects/run.py +++ b/rb/test/Ice/slicing/objects/run.py @@ -22,5 +22,7 @@ import TestUtil print("Running test with sliced format.") TestUtil.clientServerTest() + print("Running test with 1.0 encoding.") -TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", + additionalServerOptions="--Ice.Default.EncodingVersion=1.0") diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py index e09eb2af42f..aa83cc84d36 100755 --- a/scripts/TestUtil.py +++ b/scripts/TestUtil.py @@ -27,6 +27,7 @@ tracefile = None printenv = False cross = [] watchDog = None +clientHome = None sqlType = None sqlDbName = None sqlHost = None @@ -176,82 +177,6 @@ def dumpenv(env, lang): if i in env: print("%s=%s" % (i, env[i])) -def configurePaths(): - if iceHome: - sys.stdout.write("*** using Ice installation from " + iceHome + " ") - if x64: - sys.stdout.write("(64bit) ") - sys.stdout.write("\n") - - # First sanitize the environment. - os.environ["CLASSPATH"] = sanitize(os.getenv("CLASSPATH", "")) - - # - # If Ice is installed from RPMs, just set the CLASSPATH for Java. - # - if iceHome == "/usr": - javaDir = os.path.join("/", "usr", "share", "java") - addClasspath(os.path.join(javaDir, "Ice.jar")) - addClasspath(os.path.join(javaDir, "Glacier2.jar")) - addClasspath(os.path.join(javaDir, "Freeze.jar")) - addClasspath(os.path.join(javaDir, "IceBox.jar")) - addClasspath(os.path.join(javaDir, "IceStorm.jar")) - addClasspath(os.path.join(javaDir, "IceGrid.jar")) - addClasspath(os.path.join(javaDir, "IcePatch2.jar")) - return # That's it, we're done! - - if isWin32(): - libDir = getCppBinDir() - else: - libDir = os.path.join(getIceDir("cpp"), "lib") - if iceHome and x64: - if isSolaris(): - if isSparc(): - libDir = os.path.join(libDir, "sparcv9") - else: - libDir = os.path.join(libDir, "amd64") - elif not isDarwin(): - libDir = libDir + "64" - addLdPath(libDir) - - if getDefaultMapping() == "javae": - javaDir = os.path.join(getIceDir("javae"), "jdk", "lib") - addClasspath(os.path.join(javaDir, "IceE.jar")) - os.environ["CLASSPATH"] = os.path.join(javaDir, "IceE.jar") + os.pathsep + os.getenv("CLASSPATH", "") - else: - # The Ice.jar and Freeze.jar comes from the installation - # directory or the toplevel dir. - javaDir = os.path.join(getIceDir("java"), "lib") - addClasspath(os.path.join(javaDir, "Ice.jar")) - addClasspath(os.path.join(javaDir, "Glacier2.jar")) - addClasspath(os.path.join(javaDir, "Freeze.jar")) - addClasspath(os.path.join(javaDir, "IceBox.jar")) - addClasspath(os.path.join(javaDir, "IceStorm.jar")) - addClasspath(os.path.join(javaDir, "IceGrid.jar")) - addClasspath(os.path.join(javaDir, "IcePatch2.jar")) - addClasspath(os.path.join(javaDir)) - - # - # On Windows, C# assemblies are found thanks to the .exe.config files. - # - if isCompactFramework(): - addPathToEnv("DEVPATH", os.path.join(getIceDir("cs"), "Assemblies", "cf")) - elif isWin32(): - addPathToEnv("DEVPATH", os.path.join(getIceDir("cs"), "Assemblies")) - else: - addPathToEnv("MONO_PATH", os.path.join(getIceDir("cs"), "Assemblies")) - - # - # On Windows x64, set PYTHONPATH to python/x64. - # - pythonDir = os.path.join(getIceDir("py"), "python") - if isWin32() and x64: - addPathToEnv("PYTHONPATH", os.path.join(pythonDir, "x64")) - else: - addPathToEnv("PYTHONPATH", pythonDir) - - addPathToEnv("RUBYLIB", os.path.join(getIceDir("rb"), "ruby")) - def addLdPath(libpath, env = None): if env is None: env = os.environ @@ -284,16 +209,20 @@ crossTests = [ "Ice/adapterDeactivation", "Ice/binding", "Ice/checksum", #"Ice/custom", + "Ice/ami", + "Ice/info", "Ice/exceptions", + "Ice/enums", "Ice/facets", "Ice/hold", "Ice/inheritance", + "Ice/invoke", "Ice/location", "Ice/objects", "Ice/operations", "Ice/proxy", "Ice/retry", - #"Ice/servantLocator", + "Ice/servantLocator", "Ice/timeout", "Ice/slicing/exceptions", "Ice/slicing/objects", @@ -322,6 +251,7 @@ def run(tests, root = False): --ice-home=<path> Use the binary distribution from the given path. --x64 Binary distribution is 64-bit. --cross=lang Run cross language test. + --client-home=<dir> Run cross test clients from the given Ice source distribution. --script Generate a script to run the tests. --env Print important environment variables. --sql-type=<driver> Run IceStorm/IceGrid tests using QtSql with specified driver. (deprecated) @@ -343,9 +273,9 @@ def run(tests, root = False): opts, args = getopt.getopt(sys.argv[1:], "lr:R:", ["start=", "start-after=", "filter=", "rfilter=", "all", "all-cross", "loop", "debug", "protocol=", "compress", "valgrind", "host=", "serialize", "continue", - "ipv6", "no-ipv6", "ice-home=", "cross=", "x64", "script", "env", "sql-type=", - "sql-db=", "sql-host=", "sql-port=", "sql-user=", "sql-passwd=", "service-dir=", - "appverifier", "compact", "silverlight", "winrt", "server", "mx"]) + "ipv6", "no-ipv6", "ice-home=", "cross=", "client-home=", "x64", "script", "env", + "sql-type=", "sql-db=", "sql-host=", "sql-port=", "sql-user=", "sql-passwd=", + "service-dir=", "appverifier", "compact", "silverlight", "winrt", "server", "mx"]) except getopt.GetoptError: usage() @@ -411,7 +341,7 @@ def run(tests, root = False): if o in ( "--cross", "--protocol", "--host", "--debug", "--compress", "--valgrind", "--serialize", "--ipv6", \ "--ice-home", "--x64", "--env", "--sql-type", "--sql-db", "--sql-host", "--sql-port", "--sql-user", \ "--sql-passwd", "--service-dir", "--appverifier", "--compact", "--silverlight", "--winrt", \ - "--server", "--mx"): + "--server", "--mx", "--client-home"): arg += " " + o if len(a) > 0: arg += " " + a @@ -473,7 +403,7 @@ def run(tests, root = False): # Now expand out the tests. We run only tcp for most cross tests. for c in crossLang: a = "--cross=%s --protocol=tcp" % c - expanded.append([ ( "%s/test/%s" % (lang, test), a, []) for test in crossTests if not (test == "Ice/background" and (lang == "cs" or c == "cs"))]) + expanded.append([ ( "%s/test/%s" % (lang, test), a, []) for test in crossTests]) # Add ssl & compress for the operations test. if (compact or mono or silverlight) and c == "cs": # Don't add the ssl tests. @@ -509,7 +439,16 @@ def run(tests, root = False): if not isWin32(): mono = True -def getIceDir(subdir = None): +def getIceDir(subdir = None, testdir = None): + # + # If client-home is set and if the given test directory is from a + # sub-directory of the client home directory, run the test against + # the client-home source distribution. + # + global clientHome + if testdir and clientHome and os.path.commonprefix([testdir, clientHome]) == clientHome: + return os.path.join(clientHome, subdir) + # # If ICE_HOME is set we're running the test against a binary distribution. Otherwise, # we're running the test against a source distribution. @@ -1101,7 +1040,8 @@ def getQtSqlOptions(prefix, dataDir = None): return options import Expect -def spawn(cmd, env=None, cwd=None, startReader=True, lang=None): + +def _spawn(cmd, env=None, cwd=None, startReader=True, lang=None): # Start/Reset the watch dog thread global watchDog if watchDog is None: @@ -1116,14 +1056,18 @@ def spawn(cmd, env=None, cwd=None, startReader=True, lang=None): return Expect.Expect(cmd, startReader=startReader, env=env, logfile=tracefile, cwd=cwd) +def spawn(cmd, cwd=None): + # Spawn given command with test environment. + return _spawn(cmd, getTestEnv(getDefaultMapping(), os.getcwd())) + def spawnClient(cmd, env=None, cwd=None, echo=True, startReader=True, lang=None): - client = spawn(cmd, env, quoteArgument(cwd), startReader=startReader, lang=lang) + client = _spawn(cmd, env, quoteArgument(cwd), startReader=startReader, lang=lang) if echo: client.trace() return client def spawnServer(cmd, env=None, cwd=None, count=1, adapter=None, echo=True, lang=None, mx=False): - server = spawn(cmd, env, quoteArgument(cwd), lang=lang) + server = _spawn(cmd, env, quoteArgument(cwd), lang=lang) # Count + 1 if IceMX enabled if mx: @@ -1141,6 +1085,8 @@ def spawnServer(cmd, env=None, cwd=None, count=1, adapter=None, echo=True, lang= import subprocess def runCommand(command): + env = getTestEnv(getDefaultMapping(), os.getcwd()) + # # popen3 has problems dealing with white spaces in command line. # @@ -1151,10 +1097,10 @@ def runCommand(command): # in directories specified by the PATH environment variable. # p = subprocess.Popen(command, shell=True, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, creationflags = 512) + stderr=subprocess.PIPE, creationflags = 512, env = env) else: - p = subprocess.Popen(command, shell=True, bufsize=1024, stdin=subprocess.PIPE, stdout=subprocess.PIPE, \ - stderr=subprocess.PIPE, close_fds=True) + p = subprocess.Popen(command, shell=True, bufsize=1024, stdin=subprocess.PIPE, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, close_fds=True, env = env) return p; @@ -1170,12 +1116,12 @@ def setAppVerifierSettings(targets, cwd=os.getcwd()): #First enable all appverifier tests cmd = "appverif -enable * -for " + exe - verifier = spawn(cmd, cwd=cwd) + verifier = _spawn(cmd, cwd=cwd) verifier.expect(matchAppVerifierSuccess(), -1) #Now disable all tests we are not intested in cmd = "appverif -disable LuaPriv PrintDriver PrintApi -for " + exe - verifier = spawn(cmd, cwd=cwd) + verifier = _spawn(cmd, cwd=cwd) verifier.expectall(["Application Verifier 4.0","",""], -1) def appVerifierAfterTestEnd(targets, cwd=os.getcwd()): @@ -1189,17 +1135,17 @@ def appVerifierAfterTestEnd(targets, cwd=os.getcwd()): logName = os.path.dirname(exe) logName += "/" + os.path.basename(exe) + "_appverifier_log.xml" cmd = "appverif -export log -for " + exe + " -with To=" + logName - verifier = spawn(cmd, cwd=cwd) + verifier = _spawn(cmd, cwd=cwd) verifier.expect(matchAppVerifierSuccess(), -1) # Delete appverifier logs from registry cmd = "appverif -delete logs -for " + exe - verifier = spawn(cmd, cwd=cwd) + verifier = _spawn(cmd, cwd=cwd) verifier.expect(matchAppVerifierSuccess(), -1) # Delete appverifier settings cmd = "appverif -delete settings -for " + exe - verifier = spawn(cmd, cwd=cwd) + verifier = _spawn(cmd, cwd=cwd) verifier.expect(matchAppVerifierSuccess(), -1) def getMirrorDir(base, mapping): @@ -1217,6 +1163,26 @@ def getMirrorDir(base, mapping): raise "cannot find language dir" return os.path.join(before, mapping, *after) +def getClientCrossTestDir(base): + """Get the client directory from client-home for the given test.""" + global clientHome + if not clientHome: + return base + + lang = getDefaultMapping() + after = [] + before = base + while len(before) > 0: + current = os.path.basename(before) + before = os.path.dirname(before) + if current == lang: + break + after.insert(0, current) + else: + raise "cannot find language dir" + return os.path.join(clientHome, lang, *after) + + def clientServerTest(additionalServerOptions = "", additionalClientOptions = "", server = None, client = None, serverenv = None, clientenv = None): if server is None: @@ -1244,6 +1210,7 @@ def clientServerTest(additionalServerOptions = "", additionalClientOptions = "", if len(cross) == 0: cross.append(lang) + global clientHome for clientLang in cross: clientCfg = DriverConfig("client") if clientLang != lang: @@ -1253,13 +1220,21 @@ def clientServerTest(additionalServerOptions = "", additionalClientOptions = "", clientCfg.lang = clientLang client = getDefaultClientFile(clientLang) - clientdir = getMirrorDir(testdir, clientLang) - print(clientdir) + if clientHome: + clientdir = getMirrorDir(getClientCrossTestDir(testdir), clientLang) + else: + clientdir = getMirrorDir(testdir, clientLang) if not os.path.exists(clientdir): print("** no matching test for %s" % clientLang) return else: - clientdir = testdir + if clientHome: + clientdir = getClientCrossTestDir(testdir) + else: + clientdir = testdir + if not os.path.exists(clientdir): + print("** no matching test for %s" % clientLang) + return if clientLang != "java": client = os.path.join(clientdir, client) @@ -1363,7 +1338,7 @@ def startColloc(exe, args, config=None, env=None): if config is None: config = DriverConfig("colloc") if env is None: - env = getTestEnv(lang, testdir) + env = getTestEnv(config.lang, testdir) cmd = getCommandLine(exe, config, args) return spawnClient(cmd, env = env, lang=config.lang) @@ -1372,16 +1347,16 @@ def simpleTest(exe = None, options = ""): exe = getDefaultClientFile() if appverifier: setAppVerifierSettings([quoteArgument(exe)]) - lang = getDefaultMapping() - config = None + + testdir = os.getcwd() config = DriverConfig("client") - config.lang = lang + env = getTestEnv(config.lang, testdir) sys.stdout.write("starting client... ") sys.stdout.flush() command = getCommandLine(exe, config, options) - client = spawnClient(command, startReader = False, lang = lang) + client = spawnClient(command, startReader = False, env = env, lang = config.lang) print("ok") client.startReader() client.waitTestSuccess() @@ -1398,8 +1373,8 @@ def createConfig(path, lines, enc=None): config.write("%s\n" % l) config.close() -def getCppBinDir(): - binDir = os.path.join(getIceDir("cpp"), "bin") +def getCppBinDir(testdir = None): + binDir = os.path.join(getIceDir("cpp", testdir), "bin") if iceHome: if isVS2010(): binDir = os.path.join(binDir, "vc100") @@ -1424,10 +1399,85 @@ def getServiceDir(): def getTestEnv(lang, testdir): env = os.environ.copy() + + # First sanitize the environment. + env["CLASSPATH"] = sanitize(os.getenv("CLASSPATH", "")) + + # Add test directory to env if lang == "cpp": addLdPath(os.path.join(testdir), env) elif lang == "java": addClasspath(os.path.join(toplevel, "java", "lib", "IceTest.jar"), env) + + # + # If Ice is installed from RPMs, just set the CLASSPATH for Java. + # + if iceHome == "/usr": + if lang == "java": + javaDir = os.path.join("/", "usr", "share", "java") + addClasspath(os.path.join(javaDir, "Ice.jar"), env) + addClasspath(os.path.join(javaDir, "Glacier2.jar"), env) + addClasspath(os.path.join(javaDir, "Freeze.jar"), env) + addClasspath(os.path.join(javaDir, "IceBox.jar"), env) + addClasspath(os.path.join(javaDir, "IceStorm.jar"), env) + addClasspath(os.path.join(javaDir, "IceGrid.jar"), env) + addClasspath(os.path.join(javaDir, "IcePatch2.jar"), env) + return env # That's it, we're done! + + if isWin32(): + libDir = getCppBinDir() + else: + libDir = os.path.join(getIceDir("cpp", testdir), "lib") + if iceHome and x64: + if isSolaris(): + if isSparc(): + libDir = os.path.join(libDir, "sparcv9") + else: + libDir = os.path.join(libDir, "amd64") + elif not isDarwin(): + libDir = libDir + "64" + addLdPath(libDir, env) + + if lang == "javae": + javaDir = os.path.join(getIceDir("javae", testdir), "jdk", "lib") + addClasspath(os.path.join(javaDir, "IceE.jar"), env) + addClasspath(os.path.join(javaDir), env) + elif lang == "java": + # The Ice.jar and Freeze.jar comes from the installation + # directory or the toplevel dir. + javaDir = os.path.join(getIceDir("java", testdir), "lib") + addClasspath(os.path.join(javaDir, "Ice.jar"), env) + addClasspath(os.path.join(javaDir, "Glacier2.jar"), env) + addClasspath(os.path.join(javaDir, "Freeze.jar"), env) + addClasspath(os.path.join(javaDir, "IceBox.jar"), env) + addClasspath(os.path.join(javaDir, "IceStorm.jar"), env) + addClasspath(os.path.join(javaDir, "IceGrid.jar"), env) + addClasspath(os.path.join(javaDir, "IcePatch2.jar"), env) + + # + # On Windows, C# assemblies are found thanks to the .exe.config files. + # + if lang == "cs": + if isCompactFramework(): + addPathToEnv("DEVPATH", os.path.join(getIceDir("cs", testdir), "Assemblies", "cf"), env) + elif isWin32(): + addPathToEnv("DEVPATH", os.path.join(getIceDir("cs", testdir), "Assemblies"), env) + else: + addPathToEnv("MONO_PATH", os.path.join(getIceDir("cs", testdir), "Assemblies"), env) + + # + # On Windows x64, set PYTHONPATH to python/x64. + # + if lang == "py": + pythonDir = os.path.join(getIceDir("py", testdir), "python") + if isWin32() and x64: + addPathToEnv("PYTHONPATH", os.path.join(pythonDir, "x64"), env) + else: + addPathToEnv("PYTHONPATH", pythonDir, env) + + if lang == "rb": + addPathToEnv("RUBYLIB", os.path.join(getIceDir("rb", testdir), "ruby"), env) + return env; def getTestName(): @@ -1511,6 +1561,7 @@ def processCmdLine(): --x64 Binary distribution is 64-bit. --env Print important environment variables. --cross=lang Run cross language test. + --client-home=<dir> Run cross test clients from the given Ice source distribution. --sql-type=<driver> Run IceStorm/IceGrid tests using QtSql with specified driver. (deprecated) --sql-db=<db> Set SQL database name. (deprecated) --sql-host=<host> Set SQL host name. (deprecated) @@ -1529,9 +1580,9 @@ def processCmdLine(): try: opts, args = getopt.getopt( sys.argv[1:], "", ["debug", "trace=", "protocol=", "compress", "valgrind", "host=", "serialize", "ipv6", \ - "ice-home=", "x64", "cross=", "env", "sql-type=", "sql-db=", "sql-host=", "sql-port=", \ - "sql-user=", "sql-passwd=", "service-dir=", "appverifier", "compact", "silverlight", \ - "winrt", "server", "mx"]) + "ice-home=", "x64", "cross=", "client-home=", "env", "sql-type=", "sql-db=", \ + "sql-host=", "sql-port=", "sql-user=", "sql-passwd=", "service-dir=", "appverifier", \ + "compact", "silverlight", "winrt", "server", "mx"]) except getopt.GetoptError: usage() @@ -1544,9 +1595,6 @@ def processCmdLine(): iceHome = a elif o == "--cross": global cross - #testName = getTestName() - #if testName == "Ice/custom": - #if getTestName() not in crossTests: cross.append(a) if not a in ["cpp", "java", "cs", "py", "rb" ]: print("cross must be one of cpp, java, cs, py or rb") @@ -1554,12 +1602,9 @@ def processCmdLine(): if getTestName() not in crossTests: print("*** This test does not support cross language testing") sys.exit(0) - # Temporary. - lang = getDefaultMapping() - if getTestName() == "Ice/background" and (lang == "cs" or cross == "cs"): - print("*** This test does not support cross language testing") - sys.exit(0) - + elif o == "--client-home": + global clientHome + clientHome = a elif o == "--x64": global x64 x64 = True @@ -1654,7 +1699,11 @@ def processCmdLine(): if not x64: x64 = isWin32() and os.environ.get("XTARGET") == "x64" or os.environ.get("LP64") == "yes" - configurePaths() + if iceHome: + sys.stdout.write("*** using Ice installation from " + iceHome + " ") + if x64: + sys.stdout.write("(64bit) ") + sys.stdout.write("\n") def runTests(start, expanded, num = 0, script = False): total = 0 |