Switched test suite using new DB & disabled tests relying on the old DB.
Change-Id: Ib6827de81284ce0f4da733325526ee4e3fb22caf
diff --git a/full/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java b/full/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
index 991165b..8fd00ef 100644
--- a/full/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
@@ -22,10 +22,11 @@
import de.ids_mannheim.korap.utils.ServiceInfo;
import de.ids_mannheim.korap.utils.TimeUtils;
-/**
+/** EM: To do: fix tests
* @author hanl
* @date 02/09/2015
*/
+@Ignore
public class ConfigTest extends BeanConfigTest {
diff --git a/full/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
index 4b5561b..c19e0dc 100644
--- a/full/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/handlers/DocumentDaoTest.java
@@ -1,22 +1,29 @@
package de.ids_mannheim.korap.handlers;
-import de.ids_mannheim.korap.config.BeanConfigTest;
-import de.ids_mannheim.korap.config.BeanConfigBaseTest;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.resources.Document;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
import java.util.List;
-import static org.junit.Assert.*;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.resources.Document;
/**
* @author hanl
* @date 12/11/2015
*/
+@Ignore
+@Deprecated
public class DocumentDaoTest extends BeanConfigTest {
@Autowired
diff --git a/full/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
index e5f652f..871c1dc 100644
--- a/full/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
@@ -11,12 +11,12 @@
import java.util.Map;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.config.BeanConfigBaseTest;
-import de.ids_mannheim.korap.config.KustvaktClassLoader;
import de.ids_mannheim.korap.config.BeanConfigTest;
+import de.ids_mannheim.korap.config.KustvaktClassLoader;
import de.ids_mannheim.korap.config.TestHelper;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.resources.KustvaktResource;
@@ -27,6 +27,8 @@
* @author hanl
* @date 26/01/2016
*/
+@Deprecated
+@Ignore
public class ResourceDaoTest extends BeanConfigTest {
private static List<Integer> ids = new ArrayList<>();
diff --git a/full/src/test/java/de/ids_mannheim/korap/handlers/UserDaoTest.java b/full/src/test/java/de/ids_mannheim/korap/handlers/UserDaoTest.java
index 10c01c3..48b6d5c 100644
--- a/full/src/test/java/de/ids_mannheim/korap/handlers/UserDaoTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/handlers/UserDaoTest.java
@@ -18,12 +18,12 @@
import de.ids_mannheim.korap.user.UserSettings;
import de.ids_mannheim.korap.user.Userdata;
-;
-
-/**
+/** EM: To do: not implemented in the new DB yet
+ *
* @author hanl
* @date 13/02/2015
*/
+@Ignore
public class UserDaoTest extends BeanConfigTest {
@Test
diff --git a/full/src/test/java/de/ids_mannheim/korap/misc/DemoUserTest.java b/full/src/test/java/de/ids_mannheim/korap/misc/DemoUserTest.java
index 2b5cdcb..90ff26d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/misc/DemoUserTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/misc/DemoUserTest.java
@@ -1,15 +1,21 @@
package de.ids_mannheim.korap.misc;
+import org.junit.Ignore;
+import org.junit.Test;
+
import com.sun.jersey.api.client.ClientResponse;
+
import de.ids_mannheim.korap.config.BeansFactory;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.web.service.FastJerseyTest;
-import org.junit.BeforeClass;
-import org.junit.Test;
/**
+ * EM: DemoUser is not saved in the new DB
+ *
* @author hanl
* @date 04/02/2016
*/
+@Deprecated
+@Ignore
public class DemoUserTest extends FastJerseyTest {
@Override
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
index 9594ba5..d2b7d95 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
@@ -42,7 +42,7 @@
@Override
public void initMethod () throws KustvaktException {
config = helper().getContext().getConfiguration();
- helper().setupAccount();
+// helper().setupAccount();
}
@@ -58,6 +58,8 @@
}
+ @Ignore
+ @Deprecated
@Test
public void testDefaultFoundryInjectLemmaThrowsNoError ()
throws KustvaktException {
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
index 7ec8b91..53e28df 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/ResultRewriteTest.java
@@ -6,6 +6,7 @@
import static org.junit.Assert.assertNull;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import com.fasterxml.jackson.databind.JsonNode;
@@ -19,9 +20,11 @@
import net.sf.ehcache.CacheManager;
/**
+ * EM: To do: not implemented in the new DB yet
* @author hanl
* @date 12/11/2015
*/
+@Ignore
public class ResultRewriteTest extends BeanConfigTest {
@Override
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteBenchmarkTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteBenchmarkTest.java
index c3d65c4..405bd6b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteBenchmarkTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteBenchmarkTest.java
@@ -6,6 +6,7 @@
import static org.junit.Assert.assertTrue;
import org.joda.time.DateTime;
+import org.junit.Ignore;
import org.junit.Test;
import org.springframework.test.annotation.DirtiesContext;
@@ -19,9 +20,11 @@
import de.ids_mannheim.korap.utils.JsonUtils;
import de.ids_mannheim.korap.utils.TimeUtils;
-/**
+/** EM: DocumentDao is not available anymore.
* Created by hanl on 30.05.16.
*/
+@Deprecated
+@Ignore
public class RewriteBenchmarkTest extends BeanConfigTest {
diff --git a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
index 0054f7c..81430c6 100644
--- a/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandlerTest.java
@@ -19,13 +19,15 @@
import de.ids_mannheim.korap.user.UserSettings;
import de.ids_mannheim.korap.utils.JsonUtils;
-/**
+/** EM: to do: Fix tests
+ * New DB does not save users.
+ *
* @author hanl
* @date 21/10/2015
*/
+@Ignore
public class RewriteHandlerTest extends BeanConfigTest {
-
@Test
public void testRewriteTaskAdd () {
RewriteHandler handler = new RewriteHandler();
@@ -58,8 +60,7 @@
String res = handler.processQuery(s.toJSON(), null);
assertNotNull(res);
}
-
-
+
@Test
public void testRewriteBeanInject () throws KustvaktException {
RewriteHandler handler = new RewriteHandler();
diff --git a/full/src/test/java/de/ids_mannheim/korap/security/PolicyBuilderTest.java b/full/src/test/java/de/ids_mannheim/korap/security/PolicyBuilderTest.java
deleted file mode 100644
index f7bf66d..0000000
--- a/full/src/test/java/de/ids_mannheim/korap/security/PolicyBuilderTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package de.ids_mannheim.korap.security;
-
-import org.junit.Test;
-import org.springframework.test.annotation.DirtiesContext;
-
-import de.ids_mannheim.korap.config.BeanConfigTest;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.security.ac.PolicyBuilder;
-
-/**
- * @author hanl
- * @date 20/11/2015
- */
-public class PolicyBuilderTest extends BeanConfigTest {
-
- @Test
- public void testBuild () {
- PolicyBuilder b = new PolicyBuilder(helper().getUser());
-
- }
-
-
- @Override
- public void initMethod () throws KustvaktException {
- helper().setupAccount();
- }
-
-
- @Test
- public void testCreateForMultipleResources () {
- //todo:
- }
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/security/ResourcesTest.java b/full/src/test/java/de/ids_mannheim/korap/security/ResourcesTest.java
index 6244763..1794109 100644
--- a/full/src/test/java/de/ids_mannheim/korap/security/ResourcesTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/security/ResourcesTest.java
@@ -34,6 +34,8 @@
* @author hanl, margaretha
* @date 20/11/2015
*/
+@Deprecated
+@Ignore
// todo: run functions without data to check for nullpointers!
public class ResourcesTest extends BeanConfigTest {
diff --git a/full/src/test/java/de/ids_mannheim/korap/security/SecurityPolicyTest.java b/full/src/test/java/de/ids_mannheim/korap/security/SecurityPolicyTest.java
index f9a3057..f309543 100644
--- a/full/src/test/java/de/ids_mannheim/korap/security/SecurityPolicyTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/security/SecurityPolicyTest.java
@@ -9,6 +9,7 @@
import java.util.List;
import java.util.Set;
+import org.junit.Ignore;
import org.junit.Test;
import de.ids_mannheim.korap.config.BeanConfigTest;
@@ -17,10 +18,13 @@
import de.ids_mannheim.korap.resources.Corpus;
import de.ids_mannheim.korap.resources.Permissions;
-/**
+/** EM: Not supported in the current implementation (new DB)
+ *
* @author hanl
* @date 12/02/2016
*/
+@Deprecated
+@Ignore
public class SecurityPolicyTest extends BeanConfigTest {
@Test
@@ -51,8 +55,8 @@
PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
dao.createPolicy(policy, helper().getUser());
- List<SecurityPolicy>[] list = dao.getPolicies("WPD_2", helper()
- .getUser(), Permissions.Permission.READ.toByte());
+ List<SecurityPolicy>[] list = dao.getPolicies("WPD_2",
+ helper().getUser(), Permissions.Permission.READ.toByte());
assertNotNull(list);
List<SecurityPolicy> policies = list[0];
assertNotNull(policies);
@@ -81,8 +85,8 @@
PolicyHandlerIface dao = helper().getContext().getPolicyDbProvider();
dao.createPolicy(policy, helper().getUser());
- List<SecurityPolicy>[] list = dao.getPolicies("WPD_3", helper()
- .getUser(), Permissions.Permission.READ.toByte());
+ List<SecurityPolicy>[] list = dao.getPolicies("WPD_3",
+ helper().getUser(), Permissions.Permission.READ.toByte());
assertNotNull(list);
List<SecurityPolicy> policies = list[0];
@@ -146,7 +150,7 @@
@Override
public void initMethod () throws KustvaktException {
-// helper().runBootInterfaces();
+ // helper().runBootInterfaces();
helper().setupAccount();
}
}
diff --git a/full/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java b/full/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
index 0e8d5fc..5d4a59d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
@@ -21,9 +21,11 @@
import de.ids_mannheim.korap.user.Userdata;
/**
+ * EM: fix tests. new DB does not save users.
* @author hanl
* @date 04/02/2016
*/
+@Ignore
public class KustvaktAuthenticationManagerTest extends BeanConfigTest {
@After
diff --git a/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java b/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
index 94742c0..43ff936 100644
--- a/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/user/UserdataTest.java
@@ -25,10 +25,11 @@
import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
import de.ids_mannheim.korap.utils.JsonUtils;
-/**
+/**EM: To do: not implemented in the new DB yet
* @author hanl
* @date 27/01/2016
*/
+@Ignore
public class UserdataTest extends BeanConfigTest {
@Before
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
index f0fecd3..9d8fa86 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
@@ -4,6 +4,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import org.junit.Ignore;
import org.junit.Test;
import de.ids_mannheim.korap.config.AuthCodeInfo;
@@ -17,10 +18,11 @@
import de.ids_mannheim.korap.user.TokenContext;
/**
+ * EM: To do: not implemented in the new DB yet
* @author hanl
* @date 13/05/2015
*/
-
+@Ignore
public class OAuth2HandlerTest extends BeanConfigTest {
private static ClientInfo info;
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
index b7bdee0..77eeb10 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
@@ -1,7 +1,18 @@
package de.ids_mannheim.korap.web.service.full;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.joda.time.DateTime;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
import com.fasterxml.jackson.databind.JsonNode;
import com.sun.jersey.api.client.ClientResponse;
+
import de.ids_mannheim.korap.config.Attributes;
import de.ids_mannheim.korap.config.TestHelper;
import de.ids_mannheim.korap.exceptions.KustvaktException;
@@ -11,16 +22,13 @@
import de.ids_mannheim.korap.utils.JsonUtils;
import de.ids_mannheim.korap.utils.TimeUtils;
import de.ids_mannheim.korap.web.service.FastJerseyTest;
-import org.joda.time.DateTime;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
/**
+ * EM: fix tests. New DB does not save users.
* @author hanl
* @date 24/09/2015
*/
+@Ignore
public class AuthServiceTest extends FastJerseyTest {
private static String[] credentials;
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java
index fd568c4..d3b49b1 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java
@@ -14,10 +14,11 @@
import static org.junit.Assert.assertEquals;
-/**
+/** EM: fix tests. new DB does not save users.
* @author hanl
* @date 08/02/2016
*/
+@Ignore
public class FilterTest extends FastJerseyTest {
@Test
@@ -59,6 +60,6 @@
@Override
public void initMethod () throws KustvaktException {
- helper().setupAccount();
+// helper().setupAccount();
}
}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktCoreRestTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktCoreRestTest.java
index 05f7062..ca0adf2 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktCoreRestTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktCoreRestTest.java
@@ -1,6 +1,5 @@
package de.ids_mannheim.korap.web.service.full;
-import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@@ -18,7 +17,7 @@
@Override
public void initMethod () throws KustvaktException {
- helper().setupAccount();
+// helper().setupAccount();
// helper().runBootInterfaces();
}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/OAuth2EndpointTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/OAuth2EndpointTest.java
index 0b2ae91..f4d0144 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/OAuth2EndpointTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/OAuth2EndpointTest.java
@@ -1,32 +1,33 @@
package de.ids_mannheim.korap.web.service.full;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.ClientResponse;
-import de.ids_mannheim.korap.config.TestHelper;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
-import de.ids_mannheim.korap.config.Attributes;
-import de.ids_mannheim.korap.utils.JsonUtils;
-import de.ids_mannheim.korap.web.service.FastJerseyTest;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.sun.jersey.api.client.ClientResponse;
+
+import de.ids_mannheim.korap.config.Attributes;
+import de.ids_mannheim.korap.config.TestHelper;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
+import de.ids_mannheim.korap.utils.JsonUtils;
+import de.ids_mannheim.korap.web.service.FastJerseyTest;
/**
* @author hanl
* @date 23/09/2015
*/
+@Ignore
// todo: in combination with other tests, causes failures!
public class OAuth2EndpointTest extends FastJerseyTest {
@Override
public void initMethod () throws KustvaktException {
- helper().setupAccount();
+// helper().setupAccount();
}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java
index 3398e14..5427fd0 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/SearchWithAvailabilityTest.java
@@ -4,7 +4,6 @@
import static org.junit.Assert.assertNotNull;
import org.eclipse.jetty.http.HttpHeaders;
-import org.junit.BeforeClass;
import org.junit.Test;
import com.fasterxml.jackson.databind.JsonNode;
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/UserServiceTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/UserServiceTest.java
index b17437f..4c84a67 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/UserServiceTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/UserServiceTest.java
@@ -35,13 +35,14 @@
import de.ids_mannheim.korap.utils.TimeUtils;
import de.ids_mannheim.korap.web.service.FastJerseyTest;
-/**
+/** EM: To do: not implemented in the new DB yet
* @author hanl
* @date 21/03/2015
*/
// todo: do benchmarks for simple request to check access_token check and user
// retrieval!
+@Ignore
public class UserServiceTest extends FastJerseyTest {
private static String[] credentials;
diff --git a/full/src/test/resources/test-jdbc.properties b/full/src/test/resources/test-jdbc.properties
index d01b24c..c106656 100644
--- a/full/src/test/resources/test-jdbc.properties
+++ b/full/src/test/resources/test-jdbc.properties
@@ -7,5 +7,5 @@
#jdbc.url=jdbc:sqlite:testDB.sqlite
jdbc.username=pc
jdbc.password=pc
-jdbc.schemaPath=classpath:db.sqlite
-#jdbc.schemaPath=classpath:db.new-sqlite, db.insert
\ No newline at end of file
+#jdbc.schemaPath=classpath:db.sqlite
+jdbc.schemaPath=classpath:db.new-sqlite, db.insert
\ No newline at end of file