Skip to content

Commit

Permalink
Additional test for default OA - Fix #3348 (#3356)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Jan 14, 2025
1 parent e570ced commit 40af868
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
7 changes: 7 additions & 0 deletions cpp/test/Ice/adapterDeactivation/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,19 @@ allTests(Test::TestHelper* helper)
obj->ice_ping();

test(obj->ice_getCachedConnection()->getAdapter() == adapter);

// Ensure destroying the OA doesn't affect the ability to send outgoing requests.
adapter->destroy();
obj->ice_getCachedConnection()->close().get();
obj->ice_ping();

communicator->setDefaultObjectAdapter(nullptr);

// create new connection
obj->ice_getCachedConnection()->close().get();
obj->ice_ping();

adapter = communicator->createObjectAdapter("");
test(obj->ice_getCachedConnection()->getAdapter() == nullptr);
obj->ice_getCachedConnection()->setAdapter(adapter);
test(obj->ice_getCachedConnection()->getAdapter() == adapter);
Expand Down
7 changes: 7 additions & 0 deletions csharp/test/Ice/adapterDeactivation/AllTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,19 @@ static EndpointInfo getUnderlying(EndpointInfo endpointInfo) =>
await obj.ice_pingAsync();

test(obj.ice_getCachedConnection().getAdapter() == adapter);

// Ensure destroying the OA doesn't affect the ability to send outgoing requests.
adapter.destroy();
await obj.ice_getCachedConnection().closeAsync();
obj.ice_ping();

communicator.setDefaultObjectAdapter(null);

// create new connection
await obj.ice_getCachedConnection().closeAsync();
await obj.ice_pingAsync();

adapter = communicator.createObjectAdapter("");
test(obj.ice_getCachedConnection().getAdapter() is null);
obj.ice_getCachedConnection().setAdapter(adapter);
test(obj.ice_getCachedConnection().getAdapter() == adapter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,20 @@ public static TestIntfPrx allTests(test.TestHelper helper) {
obj.ice_ping();

test(obj.ice_getCachedConnection().getAdapter() == adapter);

// Ensure destroying the OA doesn't affect the ability to send outgoing requests.
adapter.destroy();
obj.ice_getCachedConnection().close();
obj.ice_ping();

communicator.setDefaultObjectAdapter(null);

// create new connection
obj.ice_getCachedConnection().close();
obj.ice_ping();

test(obj.ice_getCachedConnection().getAdapter() == null);

adapter = communicator.createObjectAdapter("");
obj.ice_getCachedConnection().setAdapter(adapter);
test(obj.ice_getCachedConnection().getAdapter() == adapter);
obj.ice_getCachedConnection().setAdapter(null);
Expand Down
11 changes: 9 additions & 2 deletions js/test/Ice/adapterDeactivation/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class Client extends TestHelper {
test(communicator.getDefaultObjectAdapter() === null);
test(obj.ice_getCachedConnection().getAdapter() === null);

const adapter = await communicator.createObjectAdapter("");
let adapter = await communicator.createObjectAdapter("");

communicator.setDefaultObjectAdapter(adapter);
test(communicator.getDefaultObjectAdapter() === adapter);
Expand All @@ -82,13 +82,20 @@ export class Client extends TestHelper {
await obj.ice_ping();

test(obj.ice_getCachedConnection().getAdapter() === adapter);

// Ensure destroying the OA doesn't affect the ability to send outgoing requests.
adapter.destroy();
await obj.ice_getCachedConnection().close();
await obj.ice_ping();

communicator.setDefaultObjectAdapter(null);

// create new connection
await obj.ice_getCachedConnection().close();
await obj.ice_ping();

test(obj.ice_getCachedConnection().getAdapter() === null);

adapter = await communicator.createObjectAdapter("");
obj.ice_getCachedConnection().setAdapter(adapter);
test(obj.ice_getCachedConnection().getAdapter() === adapter);
obj.ice_getCachedConnection().setAdapter(null);
Expand Down

0 comments on commit 40af868

Please sign in to comment.