Author: markt Date: Fri Jan 10 11:03:01 2014 New Revision: 1557080 URL: http://svn.apache.org/r1557080 Log: Refactor to aid re-use
Modified: tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java Modified: tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java?rev=1557080&r1=1557079&r2=1557080&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java (original) +++ tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java Fri Jan 10 11:03:01 2014 @@ -218,7 +218,7 @@ public class TestUpgrade extends TomcatB } sis.setReadListener(new EchoReadListener()); - sos.setWriteListener(new EchoWriteListener()); + sos.setWriteListener(new NoOpWriteListener()); } @Override @@ -226,7 +226,7 @@ public class TestUpgrade extends TomcatB // NO-OP } - private class EchoReadListener implements ReadListener { + private class EchoReadListener extends NoOpReadListener { private byte[] buffer = new byte[8096]; @@ -248,29 +248,38 @@ public class TestUpgrade extends TomcatB throw new RuntimeException(ioe); } } + } + } - @Override - public void onAllDataRead() { - // NO-OP for HTTP Upgrade - } - @Override - public void onError(Throwable throwable) { - // NO-OP - } + private static class NoOpReadListener implements ReadListener { + + @Override + public void onDataAvailable() { + // NO-OP } - private class EchoWriteListener implements WriteListener { + @Override + public void onAllDataRead() { + // Always NO-OP for HTTP Upgrade + } - @Override - public void onWritePossible() { - // NO-OP - } + @Override + public void onError(Throwable throwable) { + // NO-OP + } + } - @Override - public void onError(Throwable throwable) { - // NO-OP - } + private static class NoOpWriteListener implements WriteListener { + + @Override + public void onWritePossible() { + // NO-OP + } + + @Override + public void onError(Throwable throwable) { + // NO-OP } } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org