diff options
author | Mark Spruiell <mes@zeroc.com> | 2017-01-30 13:45:21 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2017-01-30 13:45:21 -0800 |
commit | 61270a10f980933cf582edb766f10c8ac6d86e8a (patch) | |
tree | 45ab4a7c2986954054fce613bc3c8f7967e7951e /js/test | |
parent | Fix slice2cpp build failure (diff) | |
download | ice-61270a10f980933cf582edb766f10c8ac6d86e8a.tar.bz2 ice-61270a10f980933cf582edb766f10c8ac6d86e8a.tar.xz ice-61270a10f980933cf582edb766f10c8ac6d86e8a.zip |
merging IceBridge into master
Diffstat (limited to 'js/test')
-rw-r--r-- | js/test/Ice/acm/Client.js | 34 | ||||
-rw-r--r-- | js/test/Ice/acm/Test.ice | 3 | ||||
-rw-r--r-- | js/test/Ice/ami/Client.js | 8 | ||||
-rw-r--r-- | js/test/Ice/binding/Client.js | 12 | ||||
-rw-r--r-- | js/test/Ice/hold/Client.js | 2 | ||||
-rw-r--r-- | js/test/Ice/location/Client.js | 2 | ||||
-rw-r--r-- | js/test/Ice/operations/BatchOneways.js | 2 | ||||
-rw-r--r-- | js/test/Ice/timeout/Client.js | 4 |
8 files changed, 50 insertions, 17 deletions
diff --git a/js/test/Ice/acm/Client.js b/js/test/Ice/acm/Client.js index e18f45ec0ac..58f8efdf313 100644 --- a/js/test/Ice/acm/Client.js +++ b/js/test/Ice/acm/Client.js @@ -391,6 +391,37 @@ } } + class HeartbeatManualTest extends TestCase + { + constructor(com, out) + { + super("manual heartbeats", com, out); + // + // Disable heartbeats. + // + this.setClientACM(10, -1, 0); + this.setServerACM(10, -1, 0); + } + + runTestCase(adapter, proxy) + { + function sendHeartbeats(con) + { + var p = Promise.resolve(); + for(var i = 0; i < 5; ++i) + { + p = p.then(con.heartbeat()); + } + return p; + } + + return proxy.startHeartbeatCount().then( + () => proxy.ice_getConnection()).then( + con => sendHeartbeats(con)).then( + () => proxy.waitForHeartbeatCount(5)); + } + } + class SetACMTest extends TestCase { constructor(com, out) @@ -421,7 +452,7 @@ test(acm.close === Ice.ACMClose.CloseOnInvocationAndIdle); test(acm.heartbeat === Ice.ACMHeartbeat.HeartbeatAlways); - return proxy.waitForHeartbeat(2); + return proxy.startHeartbeatCount().then(() => proxy.waitForHeartbeatCount(2)); } } @@ -459,6 +490,7 @@ tests.push(new HeartbeatOnIdleTest(com, out)); tests.push(new HeartbeatAlwaysTest(com, out)); + tests.push(new HeartbeatManualTest(com, out)); tests.push(new SetACMTest(com, out)); } diff --git a/js/test/Ice/acm/Test.ice b/js/test/Ice/acm/Test.ice index 117192a2df8..7f71427c741 100644 --- a/js/test/Ice/acm/Test.ice +++ b/js/test/Ice/acm/Test.ice @@ -18,7 +18,8 @@ interface TestIntf void sleep(int seconds); void sleepAndHold(int seconds); void interruptSleep(); - void waitForHeartbeat(int count); + void startHeartbeatCount(); + void waitForHeartbeatCount(int count); }; interface RemoteObjectAdapter diff --git a/js/test/Ice/ami/Client.js b/js/test/Ice/ami/Client.js index 07b9ae03db4..39b5aeae704 100644 --- a/js/test/Ice/ami/Client.js +++ b/js/test/Ice/ami/Client.js @@ -111,7 +111,7 @@ // test(batchCount === 0); b1.opBatch(); - b1.ice_getCachedConnection().close(false); + b1.ice_getCachedConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait); return communicator.flushBatchRequests().then(() => p.opBatchCount()); } ).then(batchCount => @@ -156,7 +156,7 @@ b2 = prx; b1.opBatch(); b2.opBatch(); - b1.ice_getCachedConnection().close(false); + b1.ice_getCachedConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait); return communicator.flushBatchRequests(); } ).then(() => p.waitForBatch(1) @@ -181,8 +181,8 @@ b2 = prx; b1.opBatch(); b2.opBatch(); - b1.ice_getCachedConnection().close(false); - b2.ice_getCachedConnection().close(false); + b1.ice_getCachedConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait); + b2.ice_getCachedConnection().close(Ice.ConnectionClose.CloseGracefullyAndWait); return communicator.flushBatchRequests(); } ).then(() => p.opBatchCount()); diff --git a/js/test/Ice/binding/Client.js b/js/test/Ice/binding/Client.js index ecba375108b..0e59e8256c7 100644 --- a/js/test/Ice/binding/Client.js +++ b/js/test/Ice/binding/Client.js @@ -260,7 +260,7 @@ ).then( function(conn) { - return conn.close(false); + return conn.close(Ice.ConnectionClose.CloseGracefullyAndWait); } ).then( function() @@ -339,7 +339,7 @@ }).then( function(c) { - return c.close(false); + return c.close(Ice.ConnectionClose.CloseGracefullyAndWait); } ); })); @@ -422,7 +422,7 @@ ).then( function(conn) { - return conn.close(false); + return conn.close(Ice.ConnectionClose.CloseGracefullyAndWait); } ).then( function() @@ -585,7 +585,7 @@ }).then( function(c) { - return c.close(false); + return c.close(Ice.ConnectionClose.CloseGracefullyAndWait); }, function(ex) { @@ -651,7 +651,7 @@ } return prx.ice_getConnection(); } - ).then(conn => conn.close(false) + ).then(conn => conn.close(Ice.ConnectionClose.CloseGracefullyAndWait) ).then(() => names.length > 0 ? f1() : prx); }; @@ -678,7 +678,7 @@ ).then( function(conn) { - return conn.close(false); + return conn.close(Ice.ConnectionClose.CloseGracefullyAndWait); } ).then( function() diff --git a/js/test/Ice/hold/Client.js b/js/test/Ice/hold/Client.js index 51e3bf70c12..03f31d4c353 100644 --- a/js/test/Ice/hold/Client.js +++ b/js/test/Ice/hold/Client.js @@ -230,7 +230,7 @@ ).then( function(con) { - return con.close(false); + return con.close(Ice.ConnectionClose.CloseGracefullyAndWait); } ); } diff --git a/js/test/Ice/location/Client.js b/js/test/Ice/location/Client.js index 5890344ed19..62168831822 100644 --- a/js/test/Ice/location/Client.js +++ b/js/test/Ice/location/Client.js @@ -1110,7 +1110,7 @@ ).then( function(con) { - return con.close(false); + return con.close(Ice.ConnectionClose.CloseGracefullyAndWait); } ).then( function() diff --git a/js/test/Ice/operations/BatchOneways.js b/js/test/Ice/operations/BatchOneways.js index d3a66fa51c1..b6660b97781 100644 --- a/js/test/Ice/operations/BatchOneways.js +++ b/js/test/Ice/operations/BatchOneways.js @@ -82,7 +82,7 @@ ).then(count => batch.ice_flushBatchRequests() ).then(() => prx.opByteSOnewayCallCount() ).then(() => batch.ice_getConnection() - ).then(con => bidir ? undefined : con.close(false) + ).then(con => bidir ? undefined : con.close(Ice.ConnectionClose.CloseGracefullyAndWait) ).then(() => Promise.all([batch.ice_ping(), batch2.ice_ping()]) ).then(() => { diff --git a/js/test/Ice/timeout/Client.js b/js/test/Ice/timeout/Client.js index 62790d63f54..9f2872dfecb 100644 --- a/js/test/Ice/timeout/Client.js +++ b/js/test/Ice/timeout/Client.js @@ -142,7 +142,7 @@ connection = con; return timeout.holdAdapter(1500); } - ).then(() => connection.close(false) + ).then(() => connection.close(Ice.ConnectionClose.CloseGracefullyAndWait) ).then(() => { try @@ -163,7 +163,7 @@ } catch(ex) { - test(ex instanceof Ice.CloseConnectionException); // Expected + test(ex instanceof Ice.ConnectionManuallyClosedException); // Expected } return timeout.op(); } |