Making test more robust for debugging windows build error.

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3290 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Joakim Erdfelt 2011-05-26 22:53:59 +00:00
parent 54e885d967
commit 2526693ba3
1 changed files with 11 additions and 2 deletions

View File

@ -18,11 +18,13 @@ package org.eclipse.jetty.deploy.bindings;
import static org.hamcrest.Matchers.*;
import java.io.File;
import java.util.List;
import org.eclipse.jetty.deploy.providers.ScanningAppProvider;
import org.eclipse.jetty.deploy.test.XmlConfiguredJetty;
import org.eclipse.jetty.toolchain.test.IO;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.PathAssert;
import org.eclipse.jetty.toolchain.test.TestingDir;
import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.After;
@ -62,13 +64,20 @@ public class GlobalWebappConfigBindingTest
@Test
public void testServerAndSystemClassesOverride() throws Exception
{
IO.copy(MavenTestingUtils.getTestResourceFile("context-binding-test-1.xml"),new File(jetty.getJettyHome(),"context-binding-test-1.xml"));
File srcXml = MavenTestingUtils.getTestResourceFile("context-binding-test-1.xml");
File destXml = new File(jetty.getJettyHome(),"context-binding-test-1.xml");
IO.copy(srcXml,destXml);
PathAssert.assertFileExists("Context Binding XML",destXml);
jetty.addConfiguration("binding-test-contexts-1.xml");
jetty.load();
jetty.start();
WebAppContext context = jetty.getWebAppContexts().get(0);
List<WebAppContext> contexts = jetty.getWebAppContexts();
Assert.assertThat("List of Contexts", contexts, hasSize(greaterThan(0)));
WebAppContext context = contexts.get(0);
Assert.assertNotNull("Context should not be null",context);
String defaultClasses[] = context.getDefaultServerClasses();