diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-11-25 13:13:22 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-11-25 13:13:22 +0100 |
commit | dcdc32af1fced49d80a8ccd93230e15d91ab45d8 (patch) | |
tree | eb69e2555fbd54496fce8a33f4dd610e1473ff51 /js/test/Ice/inheritance | |
parent | C# IceSSL/configuration log expired certificate exceptions. (diff) | |
download | ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.bz2 ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.xz ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.zip |
Refactored test scripts
Diffstat (limited to 'js/test/Ice/inheritance')
-rw-r--r-- | js/test/Ice/inheritance/ClientBidir.js | 75 | ||||
-rw-r--r-- | js/test/Ice/inheritance/InitialI.js | 215 | ||||
-rw-r--r-- | js/test/Ice/inheritance/Test.ice | 7 | ||||
-rwxr-xr-x | js/test/Ice/inheritance/run.py | 23 |
4 files changed, 297 insertions, 23 deletions
diff --git a/js/test/Ice/inheritance/ClientBidir.js b/js/test/Ice/inheritance/ClientBidir.js new file mode 100644 index 00000000000..b06209be418 --- /dev/null +++ b/js/test/Ice/inheritance/ClientBidir.js @@ -0,0 +1,75 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2016 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 Client = require("Client"); + + var Promise = Ice.Promise; + + var allTests = function(out, communicator) + { + return Promise.try( + function() + { + return communicator.createObjectAdapter("").then( + function(adapter) + { + var base = communicator.stringToProxy("initial:default -p 12010"); + adapter.add(new InitialI(adapter, base), Ice.stringToIdentity("initial")); + return base.ice_getConnection().then( + function(conn) + { + conn.setAdapter(adapter); + return Client.__clientAllTests__(out, communicator); + }); + }); + }); + }; + + var run = function(out, id) + { + var communicator = Ice.initialize(id); + return Promise.try( + function() + { + out.writeLine("testing bidir callbacks with synchronous dispatch..."); + return allTests(out, communicator); + } + ).then( + function() + { + return communicator.destroy(); + } + ).then( + function() + { + communicator = Ice.initialize(id); + return Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:default -p 12010")); + } + ).then( + function(prx) + { + return prx.shutdown(); + } + ).finally( + function() + { + return communicator.destroy(); + } + ); + }; + exports.__testBidir__ = 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)); diff --git a/js/test/Ice/inheritance/InitialI.js b/js/test/Ice/inheritance/InitialI.js new file mode 100644 index 00000000000..d373cec8008 --- /dev/null +++ b/js/test/Ice/inheritance/InitialI.js @@ -0,0 +1,215 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2016 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; + + class CAI extends Test.MA.CA + { + caop(p, current) + { + return p; + } + } + + class CBI extends Test.MB.CB + { + caop(p, current) + { + return p; + } + + cbop(p, current) + { + return p; + } + } + + class CCI extends Test.MA.CC + { + caop(p, current) + { + return p; + } + + ccop(p, current) + { + return p; + } + + cbop(p, current) + { + return p; + } + } + + class CDI extends Test.MA.CD + { + caop(p, current) + { + return p; + } + + ccop(p, current) + { + return p; + } + + cdop(p, current) + { + return p; + } + + iaop(p, current) + { + return p; + } + + cbop(p, current) + { + return p; + } + + ib1op(p, current) + { + return p; + } + + ib2op(p, current) + { + return p; + } + } + + class IAI extends Test.MA.IA + { + iaop(p, current) + { + return p; + } + } + + class IB1I extends Test.MB.IB1 + { + iaop(p, current) + { + return p; + } + + ib1op(p, current) + { + return p; + } + } + + class IB2I extends Test.MB.IB2 + { + iaop(p, current) + { + return p; + } + + ib2op(p, current) + { + return p; + } + } + + class ICI extends Test.MA.IC + { + iaop(p, current) + { + return p; + } + + icop(p, current) + { + return p; + } + + ib1op(p, current) + { + return p; + } + + ib2op(p, current) + { + return p; + } + } + + class InitialI extends Test.Initial + { + constructor(adapter, obj) + { + super(); + var endpts = obj.ice_getEndpoints(); + this._ca = Test.MA.CAPrx.uncheckedCast(adapter.addWithUUID(new CAI()).ice_endpoints(endpts)); + this._cb = Test.MB.CBPrx.uncheckedCast(adapter.addWithUUID(new CBI()).ice_endpoints(endpts)); + this._cc = Test.MA.CCPrx.uncheckedCast(adapter.addWithUUID(new CCI()).ice_endpoints(endpts)); + this._cd = Test.MA.CDPrx.uncheckedCast(adapter.addWithUUID(new CDI()).ice_endpoints(endpts)); + this._ia = Test.MA.IAPrx.uncheckedCast(adapter.addWithUUID(new IAI()).ice_endpoints(endpts)); + this._ib1 = Test.MB.IB1Prx.uncheckedCast(adapter.addWithUUID(new IB1I()).ice_endpoints(endpts)); + this._ib2 = Test.MB.IB2Prx.uncheckedCast(adapter.addWithUUID(new IB2I()).ice_endpoints(endpts)); + this._ic = Test.MA.ICPrx.uncheckedCast(adapter.addWithUUID(new ICI()).ice_endpoints(endpts)); + } + + caop(current) + { + return this._ca; + } + + cbop(current) + { + return this._cb; + } + + ccop(current) + { + return this._cc; + } + + cdop(current) + { + return this._cd; + } + + iaop(current) + { + return this._ia; + } + + ib1op(current) + { + return this._ib1; + } + + ib2op(current) + { + return this._ib2; + } + + icop(current) + { + return this._ic; + } + + shutdown(current) + { + current.adapter.getCommunicator().shutdown(); + } + } + + exports.InitialI = InitialI; +} +(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)); diff --git a/js/test/Ice/inheritance/Test.ice b/js/test/Ice/inheritance/Test.ice index b563c607a49..7be1091796e 100644 --- a/js/test/Ice/inheritance/Test.ice +++ b/js/test/Ice/inheritance/Test.ice @@ -231,4 +231,11 @@ class D extends C }; +interface Echo +{ + void startBatch(); + void flushBatch(); + void shutdown(); +}; + }; diff --git a/js/test/Ice/inheritance/run.py b/js/test/Ice/inheritance/run.py deleted file mode 100755 index 3fc6200cd00..00000000000 --- a/js/test/Ice/inheritance/run.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# ********************************************************************** -# -# Copyright (c) 2003-2016 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 os, sys - -path = [ ".", "..", "../..", "../../..", "../../../.." ] -head = os.path.dirname(sys.argv[0]) -if len(head) > 0: - path = [os.path.join(head, p) for p in path] -path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] -if len(path) == 0: - raise RuntimeError("can't find toplevel directory!") -sys.path.append(os.path.join(path[0], "scripts")) -import TestUtil - -TestUtil.clientServerTest() |