Fixed ClosedChannelException in various integration tests
This commit is contained in:
parent
27cc323dce
commit
ef6404ae0c
@ -146,8 +146,8 @@ public abstract class AbstractSocketEchoTest {
|
||||
}
|
||||
}
|
||||
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sh.channel.close().awaitUninterruptibly();
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sc.close().awaitUninterruptibly();
|
||||
|
||||
if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
|
||||
@ -191,11 +191,12 @@ public abstract class AbstractSocketEchoTest {
|
||||
for (int i = 0; i < actual.length; i ++) {
|
||||
assertEquals(data[i + lastIdx], actual[i]);
|
||||
}
|
||||
counter += actual.length;
|
||||
|
||||
if (channel.getParent() != null) {
|
||||
channel.write(m);
|
||||
}
|
||||
|
||||
counter += actual.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,8 +148,8 @@ public abstract class AbstractSocketFixedLengthEchoTest {
|
||||
}
|
||||
}
|
||||
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sh.channel.close().awaitUninterruptibly();
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sc.close().awaitUninterruptibly();
|
||||
|
||||
if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
|
||||
@ -195,11 +195,12 @@ public abstract class AbstractSocketFixedLengthEchoTest {
|
||||
for (int i = 0; i < actual.length; i ++) {
|
||||
assertEquals(data[i + lastIdx], actual[i]);
|
||||
}
|
||||
counter += actual.length;
|
||||
|
||||
if (channel.getParent() != null) {
|
||||
channel.write(m);
|
||||
}
|
||||
|
||||
counter += actual.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -155,8 +155,8 @@ public abstract class AbstractSocketCompatibleObjectStreamEchoTest {
|
||||
}
|
||||
}
|
||||
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sh.channel.close().awaitUninterruptibly();
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sc.close().awaitUninterruptibly();
|
||||
|
||||
if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
|
||||
@ -196,11 +196,11 @@ public abstract class AbstractSocketCompatibleObjectStreamEchoTest {
|
||||
String m = (String) e.getMessage();
|
||||
assertEquals(data[counter], m);
|
||||
|
||||
counter ++;
|
||||
|
||||
if (channel.getParent() != null) {
|
||||
channel.write(m);
|
||||
}
|
||||
|
||||
counter ++;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -155,8 +155,8 @@ public abstract class AbstractSocketObjectStreamEchoTest {
|
||||
}
|
||||
}
|
||||
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sh.channel.close().awaitUninterruptibly();
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sc.close().awaitUninterruptibly();
|
||||
|
||||
if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
|
||||
@ -196,11 +196,11 @@ public abstract class AbstractSocketObjectStreamEchoTest {
|
||||
String m = (String) e.getMessage();
|
||||
assertEquals(data[counter], m);
|
||||
|
||||
counter ++;
|
||||
|
||||
if (channel.getParent() != null) {
|
||||
channel.write(m);
|
||||
}
|
||||
|
||||
counter ++;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -160,8 +160,8 @@ public abstract class AbstractSocketStringEchoTest {
|
||||
}
|
||||
}
|
||||
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sh.channel.close().awaitUninterruptibly();
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sc.close().awaitUninterruptibly();
|
||||
|
||||
if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
|
||||
|
@ -158,8 +158,8 @@ public abstract class AbstractSocketSslEchoTest {
|
||||
}
|
||||
}
|
||||
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sh.channel.close().awaitUninterruptibly();
|
||||
ch.channel.close().awaitUninterruptibly();
|
||||
sc.close().awaitUninterruptibly();
|
||||
|
||||
if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
|
||||
@ -203,11 +203,12 @@ public abstract class AbstractSocketSslEchoTest {
|
||||
for (int i = 0; i < actual.length; i ++) {
|
||||
assertEquals(data[i + lastIdx], actual[i]);
|
||||
}
|
||||
counter += actual.length;
|
||||
|
||||
if (channel.getParent() != null) {
|
||||
channel.write(m);
|
||||
}
|
||||
|
||||
counter += actual.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user