Added Shutdown handler to Jetty server and fixed NamedVCLoader.
Change-Id: I18fe51031103deb966843cc248e154011efb8abe
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java
new file mode 100644
index 0000000..e2127ea
--- /dev/null
+++ b/full/src/test/java/de/ids_mannheim/korap/web/JettyServerTest.java
@@ -0,0 +1,36 @@
+package de.ids_mannheim.korap.web;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.handler.HandlerList;
+import org.eclipse.jetty.server.handler.ShutdownHandler;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class JettyServerTest {
+
+ @BeforeClass
+ public static void testServerStarts () throws Exception {
+ Server server = new Server(8000);
+ HandlerList handlers = new HandlerList();
+ handlers.setHandlers(
+ new Handler[] { new ShutdownHandler("secret", true, true) });
+ server.setHandler(handlers);
+ server.start();
+ }
+
+ @Test
+ public void testShutdown () throws IOException {
+ URL url = new URL(
+ "http://localhost:8000/shutdown?token=secret");
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod("POST");
+ assertEquals(200, connection.getResponseCode());
+ }
+}
diff --git a/full/src/test/resources/test-jdbc.properties b/full/src/test/resources/test-jdbc.properties
index db40081..bbf5f6b 100644
--- a/full/src/test/resources/test-jdbc.properties
+++ b/full/src/test/resources/test-jdbc.properties
@@ -8,4 +8,4 @@
jdbc.username=pc
jdbc.password=pc
#jdbc.schemaPath=classpath:db.sqlite
-jdbc.schemaPath=classpath:db.new-sqlite, db.insert, db.predefined
\ No newline at end of file
+jdbc.schemaPath=classpath:db.sqlite, db.insert, db.predefined
\ No newline at end of file