Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2012-10-15 11:05:33 +0000
committerGreg Wilkins2012-10-15 11:05:33 +0000
commitf5d3fec4f817cb0f669294e10912c59a0f14c9ad (patch)
treec607e94f2b666293d8d7ef6da2d30ecc0ce8806b /jetty-deploy/src/test
parent9d62229dec84bfb5a2a652bb353abe6e82ec4ac8 (diff)
downloadorg.eclipse.jetty.project-f5d3fec4f817cb0f669294e10912c59a0f14c9ad.tar.gz
org.eclipse.jetty.project-f5d3fec4f817cb0f669294e10912c59a0f14c9ad.tar.xz
org.eclipse.jetty.project-f5d3fec4f817cb0f669294e10912c59a0f14c9ad.zip
jetty-9 removed context deployer and merged context and webapps directory
Diffstat (limited to 'jetty-deploy/src/test')
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBindingTest.java2
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java10
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderStartupTest.java2
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/WebAppProviderTest.java1
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/test/XmlConfiguredJetty.java30
-rw-r--r--jetty-deploy/src/test/resources/binding-test-contexts-1.xml11
-rw-r--r--jetty-deploy/src/test/resources/jetty-deploy-wars.xml2
-rw-r--r--jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml13
-rw-r--r--jetty-deploy/src/test/resources/jetty-logging.properties2
-rw-r--r--jetty-deploy/src/test/resources/webapps/foo.xml (renamed from jetty-deploy/src/test/resources/contexts/foo.xml)0
10 files changed, 19 insertions, 54 deletions
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 79e837193a..d2031ffe21 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
@@ -55,7 +55,7 @@ public class GlobalWebappConfigBindingTest
jetty.addConfiguration("jetty.xml");
// Setup initial context
- jetty.copyContext("foo.xml","foo.xml");
+ jetty.copyWebapp("foo.xml","foo.xml");
jetty.copyWebapp("foo-webapp-1.war","foo.war");
}
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 17ffd94b9f..6008c5aa44 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
@@ -112,7 +112,7 @@ public class ScanningAppProviderRuntimeUpdatesTest
public void testAfterStartupContext() throws IOException
{
jetty.copyWebapp("foo-webapp-1.war","foo.war");
- jetty.copyContext("foo.xml","foo.xml");
+ jetty.copyWebapp("foo.xml","foo.xml");
waitForDirectoryScan();
waitForDirectoryScan();
@@ -127,14 +127,14 @@ public class ScanningAppProviderRuntimeUpdatesTest
public void testAfterStartupThenRemoveContext() throws IOException
{
jetty.copyWebapp("foo-webapp-1.war","foo.war");
- jetty.copyContext("foo.xml","foo.xml");
+ jetty.copyWebapp("foo.xml","foo.xml");
waitForDirectoryScan();
waitForDirectoryScan();
jetty.assertWebAppContextsExists("/foo");
- jetty.removeContext("foo.xml");
+ jetty.removeWebapp("foo.xml");
waitForDirectoryScan();
waitForDirectoryScan();
@@ -155,7 +155,7 @@ public class ScanningAppProviderRuntimeUpdatesTest
jetty.copyWebapp("foo-webapp-1.war","foo.war");
- jetty.copyContext("foo.xml","foo.xml");
+ jetty.copyWebapp("foo.xml","foo.xml");
waitForDirectoryScan();
waitForDirectoryScan();
@@ -167,7 +167,7 @@ public class ScanningAppProviderRuntimeUpdatesTest
waitForDirectoryScan();
//System.err.println("Updating war files");
- jetty.copyContext("foo.xml","foo.xml"); // essentially "touch" the context xml
+ jetty.copyWebapp("foo.xml","foo.xml"); // essentially "touch" the context xml
jetty.copyWebapp("foo-webapp-2.war","foo.war");
// This should result in the existing foo.war being replaced with the new foo.war
diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderStartupTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderStartupTest.java
index a468771358..c117332248 100644
--- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderStartupTest.java
+++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderStartupTest.java
@@ -42,7 +42,7 @@ public class ScanningAppProviderStartupTest
jetty.addConfiguration("jetty-deploymgr-contexts.xml");
// Setup initial context
- jetty.copyContext("foo.xml","foo.xml");
+ jetty.copyWebapp("foo.xml","foo.xml");
jetty.copyWebapp("foo-webapp-1.war","foo.war");
// Should not throw an Exception
diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/WebAppProviderTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/WebAppProviderTest.java
index 65fbf73187..8e31c17786 100644
--- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/WebAppProviderTest.java
+++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/WebAppProviderTest.java
@@ -43,7 +43,6 @@ public class WebAppProviderTest
jetty.addConfiguration("jetty-deploy-wars.xml");
// Setup initial context
- jetty.copyContext("foo.xml","foo.xml");
jetty.copyWebapp("foo-webapp-1.war","foo.war");
// Should not throw an Exception
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 2afd52841f..5bb3c2a46d 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
@@ -87,13 +87,6 @@ public class XmlConfiguredJetty
IO.copyFile(MavenTestingUtils.getTestResourceFile("etc/realm.properties"),new File(etcDir,"realm.properties"));
IO.copyFile(MavenTestingUtils.getTestResourceFile("etc/webdefault.xml"),new File(etcDir,"webdefault.xml"));
- File contextsDir = new File(_jettyHome,"contexts");
- if (contextsDir.exists())
- {
- deleteContents(contextsDir);
- }
- contextsDir.mkdirs();
-
File webappsDir = new File(_jettyHome,"webapps");
if (webappsDir.exists())
{
@@ -182,7 +175,7 @@ public class XmlConfiguredJetty
public void assertResponseContains(String path, String needle) throws IOException
{
- System.err.println("Issuing request to " + path);
+ // System.err.println("Issuing request to " + path);
String content = getResponse(path);
Assert.assertTrue("Content should contain <" + needle + ">, instead got <" + content + ">",content.contains(needle));
}
@@ -220,18 +213,6 @@ public class XmlConfiguredJetty
}
}
- public void copyContext(String srcName, String destName) throws IOException
- {
- System.err.printf("Copying Context: %s -> %s%n",srcName,destName);
- File srcDir = MavenTestingUtils.getTestResourceDir("contexts");
- File destDir = new File(_jettyHome,"contexts");
-
- File srcFile = new File(srcDir,srcName);
- File destFile = new File(destDir,destName);
-
- copyFile("Context",srcFile,destFile);
- }
-
private void copyFile(String type, File srcFile, File destFile) throws IOException
{
PathAssert.assertFileExists(type + " File",srcFile);
@@ -255,7 +236,7 @@ public class XmlConfiguredJetty
private void deleteContents(File dir)
{
- System.err.printf("Delete (dir) %s/%n",dir);
+ // System.err.printf("Delete (dir) %s/%n",dir);
if (!dir.exists())
{
return;
@@ -319,7 +300,6 @@ public class XmlConfiguredJetty
{
List<WebAppContext> contexts = new ArrayList<>();
HandlerCollection handlers = (HandlerCollection)_server.getHandler();
- System.err.println(_server.dump());
Handler children[] = handlers.getChildHandlers();
for (Handler handler : children)
@@ -379,13 +359,13 @@ public class XmlConfiguredJetty
this._server.setStopTimeout(10);
}
- public void removeContext(String name)
+ public void removeWebapp(String name)
{
- File destDir = new File(_jettyHome,"contexts");
+ File destDir = new File(_jettyHome,"webapps");
File contextFile = new File(destDir,name);
if (contextFile.exists())
{
- Assert.assertTrue("Delete of Context file: " + contextFile.getAbsolutePath(),contextFile.delete());
+ Assert.assertTrue("Delete of Webapp file: " + contextFile.getAbsolutePath(),contextFile.delete());
}
}
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 38979a28ab..1614056f43 100644
--- a/jetty-deploy/src/test/resources/binding-test-contexts-1.xml
+++ b/jetty-deploy/src/test/resources/binding-test-contexts-1.xml
@@ -46,8 +46,8 @@
<Set name="appProviders">
<Array type="org.eclipse.jetty.deploy.AppProvider">
<Item>
- <New class="org.eclipse.jetty.deploy.providers.ContextProvider">
- <Set name="monitoredDirName"><SystemProperty name="jetty.home" />/contexts</Set>
+ <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
+ <Set name="monitoredDirName"><SystemProperty name="jetty.home" />/webapps</Set>
<Set name="scanInterval">1</Set>
<Set name="configurationManager">
<New class="org.eclipse.jetty.deploy.FileConfigurationManager">
@@ -58,13 +58,6 @@
</Set>
</New>
</Item>
- <Item>
- <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
- <Set name="monitoredDirName"><SystemProperty name="jetty.home" />/webapps</Set>
- <Set name="scanInterval">1</Set>
- <Set name="contextXmlDir"><SystemProperty name="jetty.home" />/contexts</Set>
- </New>
- </Item>
</Array>
</Set>
</New>
diff --git a/jetty-deploy/src/test/resources/jetty-deploy-wars.xml b/jetty-deploy/src/test/resources/jetty-deploy-wars.xml
index 859887b555..8ef3a1792f 100644
--- a/jetty-deploy/src/test/resources/jetty-deploy-wars.xml
+++ b/jetty-deploy/src/test/resources/jetty-deploy-wars.xml
@@ -17,7 +17,7 @@
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<Set name="monitoredDirName"><SystemProperty name="jetty.home" />/webapps</Set>
<Set name="scanInterval">1</Set>
- <Set name="tempDir"><Property name="jetty.home" default="target" />/workish</Set>
+ <Set name="tempDir"><Property name="jetty.home" default="target" />/workish</Set>
</New>
</Item>
</Array>
diff --git a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
index 9442aab418..acf69585ff 100644
--- a/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
+++ b/jetty-deploy/src/test/resources/jetty-deploymgr-contexts.xml
@@ -13,9 +13,9 @@
<Set name="appProviders">
<Array type="org.eclipse.jetty.deploy.AppProvider">
<Item>
- <New class="org.eclipse.jetty.deploy.providers.ContextProvider">
- <Set name="monitoredDirName"><SystemProperty name="jetty.home" />/contexts</Set>
- <Set name="scanInterval">1</Set>
+ <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
+ <Set name="monitoredDirName"><SystemProperty name="jetty.home" />/webapps</Set>
+ <Set name="scanInterval">1</Set>
<Set name="configurationManager">
<New class="org.eclipse.jetty.deploy.FileConfigurationManager">
<Set name="file">
@@ -25,13 +25,6 @@
</Set>
</New>
</Item>
- <Item>
- <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
- <Set name="monitoredDirName"><SystemProperty name="jetty.home" />/webapps</Set>
- <Set name="scanInterval">1</Set>
- <Set name="contextXmlDir"><SystemProperty name="jetty.home" />/contexts</Set>
- </New>
- </Item>
</Array>
</Set>
</New>
diff --git a/jetty-deploy/src/test/resources/jetty-logging.properties b/jetty-deploy/src/test/resources/jetty-logging.properties
index 9bad879708..9d7bbe4489 100644
--- a/jetty-deploy/src/test/resources/jetty-logging.properties
+++ b/jetty-deploy/src/test/resources/jetty-logging.properties
@@ -1,3 +1,3 @@
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
org.eclipse.jetty.deploy.LEVEL=WARN
-
+org.eclipse.jetty.util.Scanner=WARN
diff --git a/jetty-deploy/src/test/resources/contexts/foo.xml b/jetty-deploy/src/test/resources/webapps/foo.xml
index 4c730f0b49..4c730f0b49 100644
--- a/jetty-deploy/src/test/resources/contexts/foo.xml
+++ b/jetty-deploy/src/test/resources/webapps/foo.xml

Back to the top