|
16 | 16 | * Achim Kraus (Bosch Software Innovations GmbH) - add tests to ensure, that
|
17 | 17 | * responses/notifies are
|
18 | 18 | * dropped on the server side
|
| 19 | + * Achim Kraus (Bosch Software Innovations GmbH) - ensure, that session is resumed |
| 20 | + * before sending more notifications |
| 21 | + * When fixing issue #23, an |
| 22 | + * additional test should be added. |
19 | 23 | ******************************************************************************/
|
20 | 24 | package org.eclipse.californium.integration.test;
|
21 | 25 |
|
@@ -237,13 +241,18 @@ public void testSecureObserveServerAddressChangedWithResume() throws Exception {
|
237 | 241 | nat.reassignLocalAddresses();
|
238 | 242 | serverConnector.forceResumeAllSessions();
|
239 | 243 |
|
| 244 | + // trigger handshake |
| 245 | + resource.changed("client"); |
| 246 | + // wait for established session |
| 247 | + assertTrue("Missing notifies", handler.waitForLoadCalls(REPEATS + 2, TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS)); |
| 248 | + |
240 | 249 | for (int i = 0; i < REPEATS; ++i) {
|
241 | 250 | resource.changed("client");
|
242 | 251 | Thread.sleep(50);
|
243 | 252 | }
|
244 | 253 |
|
245 | 254 | assertTrue("Missing notifies after address changed",
|
246 |
| - handler.waitForLoadCalls(REPEATS + REPEATS + 1, TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS)); |
| 255 | + handler.waitForLoadCalls(REPEATS + REPEATS + 2, TIMEOUT_IN_MILLIS, TimeUnit.MILLISECONDS)); |
247 | 256 | assertThat("sending response missing", resource.getCurrentResponse(), is(notNullValue()));
|
248 | 257 | assertThat("sending response caused error", resource.getCurrentResponse().getSendError(), is(nullValue()));
|
249 | 258 | }
|
|
0 commit comments