diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-03-23 15:29:25 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-03-23 15:29:25 +0100 |
commit | 1597a75419cd8049252cfbca6fce6ae95ef8b2c7 (patch) | |
tree | 2b2c858df1dbe68c1d576cae06c4713fd2ad5c40 /js/test/Ice/exceptions/ServerAMD.js | |
parent | Use Ice\None with PHP namespace mapping (diff) | |
download | ice-1597a75419cd8049252cfbca6fce6ae95ef8b2c7.tar.bz2 ice-1597a75419cd8049252cfbca6fce6ae95ef8b2c7.tar.xz ice-1597a75419cd8049252cfbca6fce6ae95ef8b2c7.zip |
Fix for ICE-7125 - Added support for Ice.ClassGraphDepthMax
Diffstat (limited to 'js/test/Ice/exceptions/ServerAMD.js')
-rw-r--r-- | js/test/Ice/exceptions/ServerAMD.js | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/js/test/Ice/exceptions/ServerAMD.js b/js/test/Ice/exceptions/ServerAMD.js new file mode 100644 index 00000000000..f6383f2ee3d --- /dev/null +++ b/js/test/Ice/exceptions/ServerAMD.js @@ -0,0 +1,57 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2017 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. +// +// ********************************************************************** + +(function(module, require, exports) +{ + var Ice = require("ice").Ice; + var Test = require("Test").Test; + var AMDThrowerI = require("AMDThrowerI").AMDThrowerI; + + var run = function(out, id, ready) + { + id.properties.setProperty("Ice.MessageSizeMax", "10"); + id.properties.setProperty("Ice.Warn.Dispatch", "0"); + id.properties.setProperty("Ice.Warn.Connections", "0"); + var communicator = Ice.initialize(id); + var adapter; + var echo = Test.EchoPrx.uncheckedCast(communicator.stringToProxy("__echo:default -p 12010")); + return Ice.Promise.try(() => + { + return communicator.createObjectAdapter(""); + } + ).then(adpt => + { + adapter = adpt; + adapter.add(new AMDThrowerI(), Ice.stringToIdentity("thrower")); + return echo.setConnection(); + } + ).then(() => + { + var connection = echo.ice_getCachedConnection(); + connection.setCloseCallback((con) => { + // Re-establish connection if it fails (necessary for MemoryLimitException test) + echo.setConnection().then(() => echo.ice_getCachedConnection().setAdapter(adapter)) + }); + connection.setAdapter(adapter); + echo.ice_getCachedConnection().setAdapter(adapter); + adapter.activate(); + ready.resolve(); + return communicator.waitForShutdown(); + } + ).then(() => + { + return echo.shutdown(); + } + ).finally(() => communicator.destroy()); + }; + exports._serveramd = run; +} +(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined, + typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice._require, + typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this)); |