tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1416568 - in /tomcat/trunk: java/org/apache/tomcat/websocket/ServerContainerImpl.java webapps/examples/WEB-INF/classes/websocket/echo/WsConfigListener.java
Date Mon, 03 Dec 2012 15:51:12 GMT
Author: markt
Date: Mon Dec  3 15:51:12 2012
New Revision: 1416568

URL: http://svn.apache.org/viewvc?rev=1416568&view=rev
Log:
Fix a bunch of failing unit tests.

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/echo/WsConfigListener.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java?rev=1416568&r1=1416567&r2=1416568&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/ServerContainerImpl.java Mon Dec  3 15:51:12
2012
@@ -96,6 +96,11 @@ public class ServerContainerImpl extends
     public void publishServer(Class<? extends Endpoint> clazz)
             throws DeploymentException {
 
+        if (servletContext == null) {
+            throw new IllegalArgumentException(
+                    sm.getString("serverContainer.servletContextMissing"));
+        }
+
         Endpoint ep = null;
         try {
             ep = clazz.newInstance();

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/echo/WsConfigListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/echo/WsConfigListener.java?rev=1416568&r1=1416567&r2=1416568&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/echo/WsConfigListener.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/echo/WsConfigListener.java Mon
Dec  3 15:51:12 2012
@@ -21,14 +21,17 @@ import javax.servlet.ServletContextListe
 import javax.servlet.annotation.WebListener;
 import javax.websocket.ContainerProvider;
 import javax.websocket.DeploymentException;
-import javax.websocket.ServerContainer;
+
+import org.apache.tomcat.websocket.ServerContainerImpl;
 
 @WebListener
 public class WsConfigListener implements ServletContextListener {
 
     @Override
     public void contextInitialized(ServletContextEvent sce) {
-        ServerContainer sc = ContainerProvider.getServerContainer();
+        ServerContainerImpl sc =
+                (ServerContainerImpl) ContainerProvider.getServerContainer();
+        sc.setServletContext(sce.getServletContext());
         try {
             sc.publishServer(EchoEndpoint.class);
         } catch (DeploymentException e) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message