Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2011-07-10 22:05:58 -0400
committerJan Bartel2011-07-10 22:05:58 -0400
commit86f7e76c4d506a556485d3ef3684d84d32f7bd4a (patch)
tree35d2bb01eb41684e00a7b6155ea054f1b7cf67ea /jetty-deploy
parentce377db72fc3b7768a4f7a2680a5470f73d9495e (diff)
parent39674f8a8e176d3e56dfc9d16271afcc7d21f7a2 (diff)
downloadorg.eclipse.jetty.project-86f7e76c4d506a556485d3ef3684d84d32f7bd4a.tar.gz
org.eclipse.jetty.project-86f7e76c4d506a556485d3ef3684d84d32f7bd4a.tar.xz
org.eclipse.jetty.project-86f7e76c4d506a556485d3ef3684d84d32f7bd4a.zip
Merge of jetty-7 into jetty-8
Conflicts: VERSION.txt example-jetty-embedded/pom.xml jetty-aggregate/jetty-all-server/pom.xml jetty-aggregate/jetty-all/pom.xml jetty-aggregate/jetty-client/pom.xml jetty-aggregate/jetty-plus/pom.xml jetty-aggregate/jetty-server/pom.xml jetty-aggregate/jetty-servlet/pom.xml jetty-aggregate/jetty-webapp/pom.xml jetty-aggregate/pom.xml jetty-ajp/pom.xml jetty-annotations/pom.xml jetty-client/pom.xml jetty-continuation/pom.xml jetty-deploy/pom.xml jetty-distribution/pom.xml jetty-http/pom.xml jetty-io/pom.xml jetty-jaspi/pom.xml jetty-jmx/pom.xml jetty-jndi/pom.xml jetty-jsp-2.1/pom.xml jetty-nested/pom.xml jetty-osgi/jetty-osgi-boot-jsp/pom.xml jetty-osgi/jetty-osgi-boot-logback/pom.xml jetty-osgi/jetty-osgi-boot-warurl/pom.xml jetty-osgi/jetty-osgi-boot/META-INF/MANIFEST.MF jetty-osgi/jetty-osgi-boot/pom.xml jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiAppProvider.java jetty-osgi/jetty-osgi-equinoxtools/META-INF/MANIFEST.MF jetty-osgi/jetty-osgi-equinoxtools/pom.xml jetty-osgi/jetty-osgi-equinoxtools/src/main/java/org/eclipse/jetty/osgi/equinoxtools/console/EquinoxConsoleContinuationServlet.java jetty-osgi/jetty-osgi-httpservice/pom.xml jetty-osgi/jetty-osgi-servletbridge/pom.xml jetty-osgi/pom.xml jetty-osgi/test-jetty-osgi/pom.xml jetty-overlay-deployer/pom.xml jetty-plus/pom.xml jetty-policy/pom.xml jetty-rewrite/pom.xml jetty-security/pom.xml jetty-server/pom.xml jetty-servlet/pom.xml jetty-servlets/pom.xml jetty-servlets/src/main/java/org/eclipse/jetty/servlets/ProxyServlet.java jetty-start/pom.xml jetty-util/pom.xml jetty-webapp/pom.xml jetty-websocket/pom.xml jetty-xml/pom.xml pom.xml test-continuation-jetty6/pom.xml test-continuation/pom.xml test-jetty-nested/pom.xml test-jetty-servlet/pom.xml test-jetty-webapp/pom.xml tests/pom.xml tests/test-integration/pom.xml tests/test-loginservice/pom.xml tests/test-sessions/pom.xml tests/test-sessions/test-hash-sessions/pom.xml tests/test-sessions/test-jdbc-sessions/pom.xml tests/test-sessions/test-sessions-common/pom.xml tests/test-webapps/pom.xml tests/test-webapps/test-webapp-rfc2616/pom.xml
Diffstat (limited to 'jetty-deploy')
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java2
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBindingTest.java13
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java6
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/test/XmlConfiguredJetty.java2
-rw-r--r--jetty-deploy/src/test/resources/binding-test-contexts-1.xml4
-rw-r--r--jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml2
6 files changed, 22 insertions, 7 deletions
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
index d48592a947..9e9a9cf41f 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
@@ -83,7 +83,7 @@ public class GlobalWebappConfigBinding implements AppLifeCycle.Binding
Log.warn("Binding: global context binding is enabled but no jetty-web.xml file has been registered");
}
- Resource globalContextSettings = new FileResource(new URL(_jettyXml));
+ Resource globalContextSettings = Resource.newResource(_jettyXml);
if (globalContextSettings.exists())
{
diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBindingTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBindingTest.java
index 953c4875f2..4d93154dfa 100644
--- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBindingTest.java
+++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBindingTest.java
@@ -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();
diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java
index 7741259f07..b54addf5e5 100644
--- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java
+++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java
@@ -21,10 +21,12 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.jetty.deploy.AppProvider;
import org.eclipse.jetty.deploy.DeploymentManager;
import org.eclipse.jetty.deploy.test.XmlConfiguredJetty;
+import org.eclipse.jetty.toolchain.test.OS;
import org.eclipse.jetty.toolchain.test.TestingDir;
import org.eclipse.jetty.util.Scanner;
import org.eclipse.jetty.util.log.Log;
import org.junit.After;
+import org.junit.Assume;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -137,6 +139,10 @@ public class ScanningAppProviderRuntimeUpdatesTest
@Test
public void testAfterStartupThenUpdateContext() throws Exception
{
+ // This test will not work on Windows as second war file would
+ // not be written over the first one because of a file lock
+ Assume.assumeTrue(!OS.IS_WINDOWS);
+
jetty.copyWebapp("foo-webapp-1.war","foo.war");
jetty.copyContext("foo.xml","foo.xml");
diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/test/XmlConfiguredJetty.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/test/XmlConfiguredJetty.java
index 62ab9e64da..db047df32e 100644
--- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/test/XmlConfiguredJetty.java
+++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/test/XmlConfiguredJetty.java
@@ -123,7 +123,7 @@ public class XmlConfiguredJetty
properties.setProperty("test.workdir",workishDir.getAbsolutePath());
// Write out configuration for use by ConfigurationManager.
- File testConfig = MavenTestingUtils.getTargetFile("xml-configured-jetty.properties");
+ File testConfig = new File(_jettyHome, "xml-configured-jetty.properties");
FileOutputStream out = new FileOutputStream(testConfig);
properties.store(out,"Generated by " + XmlConfiguredJetty.class.getName());
for (Object key:properties.keySet())
diff --git a/jetty-deploy/src/test/resources/binding-test-contexts-1.xml b/jetty-deploy/src/test/resources/binding-test-contexts-1.xml
index 059fa0bb9c..65e13ab5cf 100644
--- a/jetty-deploy/src/test/resources/binding-test-contexts-1.xml
+++ b/jetty-deploy/src/test/resources/binding-test-contexts-1.xml
@@ -36,7 +36,7 @@
<Call name="addLifeCycleBinding">
<Arg>
<New class="org.eclipse.jetty.deploy.bindings.GlobalWebappConfigBinding">
- <Set name="jettyXml">file://<SystemProperty name="jetty.home" />/context-binding-test-1.xml</Set>
+ <Set name="jettyXml"><SystemProperty name="jetty.home" />/context-binding-test-1.xml</Set>
</New>
</Arg>
</Call>
@@ -52,7 +52,7 @@
<Set name="configurationManager">
<New class="org.eclipse.jetty.deploy.FileConfigurationManager">
<Set name="file">
- <Property name="test.targetdir" default="target" />/xml-configured-jetty.properties
+ <SystemProperty name="jetty.home"/>/xml-configured-jetty.properties
</Set>
</New>
</Set>
diff --git a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
index f383239947..c542672b85 100644
--- a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
+++ b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
@@ -20,7 +20,7 @@
<Set name="configurationManager">
<New class="org.eclipse.jetty.deploy.FileConfigurationManager">
<Set name="file">
- <Property name="test.targetdir" default="target" />/xml-configured-jetty.properties
+ <SystemProperty name="jetty.home"/>/xml-configured-jetty.properties
</Set>
</New>
</Set>

Back to the top