Excluded admin service to load-cache VC from the test suite.
Change-Id: Id26883bd201ec1d243c047647daf25e0083cddac
diff --git a/full/Changes b/full/Changes
index 0b1e34e..d18590e 100644
--- a/full/Changes
+++ b/full/Changes
@@ -3,6 +3,7 @@
- Moved the service path of VC admin services to admin/vc (closed #543)
- Added an admin service to load and cache system vc (solved #268)
- Move oauth2 admin service path (closed #544)
+- Excluded admin service to load-cache VC from the test suite
# version 0.69.2
diff --git a/full/pom.xml b/full/pom.xml
index bc97a61..4647042 100644
--- a/full/pom.xml
+++ b/full/pom.xml
@@ -149,6 +149,7 @@
<exclude>de/ids_mannheim/korap/authentication/LdapTest.java</exclude>
<exclude>de/ids_mannheim/korap/authentication/Random*.java</exclude>
<exclude>de/ids_mannheim/korap/web/controller/TokenExpiryTest.java</exclude>
+ <exclude>de/ids_mannheim/korap/web/controller/AdminLoadVCTest.java</exclude>
</excludes>
<includes>
<include>de/ids_mannheim/korap/**/*.java</include>
diff --git a/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java b/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
index 9c55449..1816a19 100644
--- a/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/cache/NamedVCLoaderTest.java
@@ -1,6 +1,5 @@
package de.ids_mannheim.korap.cache;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -9,17 +8,9 @@
import java.io.IOException;
import java.util.Map;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.Form;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
-import com.google.common.net.HttpHeaders;
-
import de.ids_mannheim.korap.collection.DocBits;
import de.ids_mannheim.korap.config.NamedVCLoader;
import de.ids_mannheim.korap.config.SpringJerseyTest;
@@ -54,24 +45,4 @@
vc = dao.retrieveQueryByName(vcId, "system");
assertNull(vc);
}
-
- @Test
- public void testLoadCacheVC () throws KustvaktException, InterruptedException {
- assertFalse(VirtualCorpusCache.contains("named-vc1"));
- Form f = new Form();
- f.param("token", "secret");
-
- Response response = target().path(API_VERSION).path("admin").path("vc")
- .path("load-cache").request()
- .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED)
- .post(Entity.form(f));
-
- assertEquals(Status.OK.getStatusCode(), response.getStatus());
-
- Thread.sleep(100);
- assertTrue(VirtualCorpusCache.contains("named-vc1"));
-
- VirtualCorpusCache.reset();
- assertFalse(VirtualCorpusCache.contains("named-vc1"));
- }
}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/AdminLoadVCTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/AdminLoadVCTest.java
new file mode 100644
index 0000000..709d6f1
--- /dev/null
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/AdminLoadVCTest.java
@@ -0,0 +1,42 @@
+package de.ids_mannheim.korap.web.controller;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.Form;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import org.junit.Test;
+
+import com.google.common.net.HttpHeaders;
+
+import de.ids_mannheim.korap.cache.VirtualCorpusCache;
+import de.ids_mannheim.korap.config.SpringJerseyTest;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+
+public class AdminLoadVCTest extends SpringJerseyTest {
+
+ @Test
+ public void testLoadCacheVC () throws KustvaktException, InterruptedException {
+ assertFalse(VirtualCorpusCache.contains("named-vc1"));
+ Form f = new Form();
+ f.param("token", "secret");
+
+ Response response = target().path(API_VERSION).path("admin").path("vc")
+ .path("load-cache").request()
+ .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED)
+ .post(Entity.form(f));
+
+ assertEquals(Status.OK.getStatusCode(), response.getStatus());
+
+ Thread.sleep(100);
+ assertTrue(VirtualCorpusCache.contains("named-vc1"));
+
+ VirtualCorpusCache.reset();
+ assertFalse(VirtualCorpusCache.contains("named-vc1"));
+ }
+}