2013/2/12 <[email protected]>:
> Author: rjung
> Date: Tue Feb 12 16:13:40 2013
> New Revision: 1445231
>
> URL: http://svn.apache.org/r1445231
> Log:
> Stop ServerContainerImpl in contextDestroyed
> by basing the test listeners on WsListener.
>
> ServerContainerImpl.stop() is protected so not
> directly accessable.
>
> stop() needs to be called in order to stop
> websocket timeout threads.
>
> Modified:
>
> tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
> tomcat/trunk/test/org/apache/tomcat/websocket/TesterEchoServer.java
>
> Modified:
> tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java?rev=1445231&r1=1445230&r2=1445231&view=diff
> ==============================================================================
> ---
> tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
> (original)
> +++
> tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
> Tue Feb 12 16:13:40 2013
> @@ -403,7 +403,7 @@ public class TestWsWebSocketContainer ex
> }
>
>
> - public static class BlockingConfig implements ServletContextListener {
> + public static class BlockingConfig extends WsListener {
>
> public static final String PATH = "/block";
>
> @@ -415,7 +415,7 @@ public class TestWsWebSocketContainer ex
>
> @Override
> public void contextDestroyed(ServletContextEvent sce) {
> - // NO-OP
> + super.contextDestroyed(sce);
> }
> }
>
> @@ -524,14 +524,14 @@ public class TestWsWebSocketContainer ex
> }
>
>
> - public static class ConstantTxConfig implements ServletContextListener {
> + public static class ConstantTxConfig extends WsListener {
>
> private static final String PATH = "/test";
>
> @Override
> public void contextInitialized(ServletContextEvent sce) {
> + super.contextInitialized(sce);
Shoudn't the other two listeners changed by this commit call
super.contextInitialized(sce);
as well?
a) TestWsWebSocketContainer.BlockingConfig
b) TesterEchoServer.Config
If not, maybe add a comment?
> ServerContainerImpl sc =
> ServerContainerImpl.getServerContainer();
> - sc.setServletContext(sce.getServletContext());
> try {
> sc.publishServer(ConstantTxEndpoint.class, PATH,
> DefaultServerConfiguration.class);
> @@ -545,7 +545,7 @@ public class TestWsWebSocketContainer ex
>
> @Override
> public void contextDestroyed(ServletContextEvent sce) {
> - // NO-OP
> + super.contextDestroyed(sce);
> }
> }
> }
>
> Modified: tomcat/trunk/test/org/apache/tomcat/websocket/TesterEchoServer.java
> URL:
> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TesterEchoServer.java?rev=1445231&r1=1445230&r2=1445231&view=diff
> ==============================================================================
> --- tomcat/trunk/test/org/apache/tomcat/websocket/TesterEchoServer.java
> (original)
> +++ tomcat/trunk/test/org/apache/tomcat/websocket/TesterEchoServer.java Tue
> Feb 12 16:13:40 2013
> @@ -25,10 +25,11 @@ import javax.websocket.Session;
> import javax.websocket.WebSocketMessage;
>
> import org.apache.tomcat.websocket.server.ServerContainerImpl;
> +import org.apache.tomcat.websocket.server.WsListener;
>
> public class TesterEchoServer {
>
> - public static class Config implements ServletContextListener {
> + public static class Config extends WsListener {
>
> public static final String PATH_ASYNC = "/echoAsync";
> public static final String PATH_BASIC = "/echoBasic";
> @@ -43,7 +44,7 @@ public class TesterEchoServer {
>
> @Override
> public void contextDestroyed(ServletContextEvent sce) {
> - // NO-OP
> + super.contextDestroyed(sce);
> }
> }
>
> @@ -106,4 +107,4 @@ public class TesterEchoServer {
> }
> }
> }
> -}
> \ No newline at end of file
> +}
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]