Fixed ClosedChannelException in various integration tests

This commit is contained in:
Trustin Lee 2008-09-05 02:07:10 +00:00
parent 27cc323dce
commit ef6404ae0c
6 changed files with 16 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)) {

View File

@ -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