Align setup of SockJS and WebSocket integration tests

Failures in JettySockJsIntegrationTests after the upgrade to 9.4 were
hidden due to the PERFORMANCE test group but were failing on the CI
performance build with IllegalStateException inside Jetty on
"Failure find the required ServletContext attribute
org.eclipse.jetty.util.DecoratedObjectFactory".
This commit is contained in:
Rossen Stoyanchev 2017-01-26 06:10:31 -05:00
parent 871f5efeaa
commit ea67a637ae
1 changed files with 5 additions and 4 deletions

View File

@ -39,7 +39,6 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
@ -111,16 +110,18 @@ public abstract class AbstractSockJsIntegrationTests {
public void setup() throws Exception {
logger.debug("Setting up '" + this.testName.getMethodName() + "'");
this.testFilter = new TestFilter();
this.wac = new AnnotationConfigWebApplicationContext();
this.wac.register(TestConfig.class, upgradeStrategyConfigClass());
this.server = createWebSocketTestServer();
this.server.setup();
this.server.deployConfig(this.wac, this.testFilter);
// Set ServletContext in WebApplicationContext after deployment but before
// starting the server.
this.server.start();
this.wac.setServletContext(this.server.getServletContext());
this.wac.refresh();
this.server.start();
this.baseUrl = "http://localhost:" + this.server.getPort();
}