diff options
Diffstat (limited to 'js/test/Ice/inheritance/Server.js')
-rw-r--r-- | js/test/Ice/inheritance/Server.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/js/test/Ice/inheritance/Server.js b/js/test/Ice/inheritance/Server.js new file mode 100644 index 00000000000..3b104cf02c0 --- /dev/null +++ b/js/test/Ice/inheritance/Server.js @@ -0,0 +1,49 @@ +// ********************************************************************** +// +// 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 InitialI = require("InitialI").InitialI; + + var run = function(out, id, ready) + { + 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; + var base = communicator.stringToProxy("initial:default -p 12010"); + adapter.add(new InitialI(adapter, base), Ice.stringToIdentity("initial")); + return echo.setConnection(); + } + ).then(() => + { + echo.ice_getCachedConnection().setAdapter(adapter); + adapter.activate(); + ready.resolve(); + return communicator.waitForShutdown(); + } + ).then(() => + { + return echo.shutdown(); + } + ).finally(() => communicator.destroy()); + }; + exports._server = 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)); |