test logging
diff --git a/.gitignore b/.gitignore
index 8176c0d..213a85f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,5 @@
logs
cache_store
*.iml
+dependency-reduced-pom.xml
+admin_token
diff --git a/pom.xml b/pom.xml
index cdde2f4..317b9e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -336,7 +336,13 @@
<artifactId>esapi</artifactId>
<version>2.1.0</version>
</dependency>
-
+<!--
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.4.0</version>
+ </dependency>
+-->
<dependency>
<groupId>org.mindrot</groupId>
<artifactId>jbcrypt</artifactId>
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
index f1e4783..5927f83 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
@@ -36,11 +36,10 @@
private static Logger jlog = LoggerFactory
.getLogger(KustvaktEncryption.class);
-
private final boolean nullable;
private final Validator validator;
private final Randomizer randomizer;
- private KustvaktConfiguration config;
+ private final KustvaktConfiguration config;
public KustvaktEncryption (KustvaktConfiguration config) {
diff --git a/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java b/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
index aa1c6d9..6736cf5 100644
--- a/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
+++ b/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
@@ -3,10 +3,7 @@
import com.sun.jersey.api.core.PackagesResourceConfig;
import com.sun.jersey.api.core.ResourceConfig;
import com.sun.jersey.spi.container.servlet.ServletContainer;
-import de.ids_mannheim.korap.config.BeansFactory;
-import de.ids_mannheim.korap.config.KustvaktCacheManager;
-import de.ids_mannheim.korap.config.KustvaktClassLoader;
-import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.config.*;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.web.service.BootableBeanInterface;
import lombok.Getter;
@@ -116,6 +113,7 @@
break;
}
}
+ AdminSetup.getInstance();
}
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
index 21ac9b8..cef07ae 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
@@ -47,7 +47,6 @@
// todo: map in timeutils
private static DateTimeFormatter dtf = DateTimeFormat
.forPattern("dd/MM/yyyy");
- // private AdminQueryController adminController;
private AuthenticationManagerIface controller;
private AuditingIface auditingController;
private DocumentDao documentDao;
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index b51e0b3..521a049 100644
--- a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -18,6 +18,8 @@
import org.flywaydb.core.Flyway;
import org.joda.time.DateTime;
import org.junit.Assert;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.core.RowCallbackHandler;
@@ -44,9 +46,9 @@
*/
public class TestHelper {
+ private static Logger jlog = LoggerFactory.getLogger(TestHelper.class);
private static final String[] credentials = new String[] { "test1",
"testPass2015" };
- private static Class clazz = null;
private ContextHolder beansHolder;
@@ -81,7 +83,7 @@
try {
getUser();
- System.out.println("found user, skipping setup ...");
+ jlog.debug("found user, skipping setup ...");
return this;
}
catch (RuntimeException e) {
@@ -107,7 +109,6 @@
}
catch (KustvaktException e) {
// do nothing
- e.printStackTrace();
assertNotNull("Test user could not be set up", null);
}
assertNotEquals(0, dao.size());
@@ -224,11 +225,11 @@
// do nothing
}
}
- System.out.println("Found boot loading interfaces: " + list);
+ jlog.debug("Found boot loading interfaces: " + list);
while (!set.isEmpty()) {
out_loop: for (BootableBeanInterface iface : new ArrayList<>(list)) {
try {
- System.out.println("Running boot instructions from class "
+ jlog.debug("Running boot instructions from class "
+ iface.getClass().getSimpleName());
for (Class cl : iface.getDependencies()) {
if (set.contains(cl))
@@ -309,12 +310,12 @@
}
- private static PersistenceClient sqlite_db (Class testclass, boolean memory)
+ private static PersistenceClient sqlite_db (boolean memory)
throws InterruptedException {
SingleConnectionDataSource dataSource = new SingleConnectionDataSource();
dataSource.setDriverClassName("org.sqlite.JDBC");
DateTime t = new DateTime();
- String name = testclass != null ? testclass.getSimpleName() + "_" : "";
+ //String name = testclass != null ? testclass.getSimpleName() + "_" : "";
if (memory)
dataSource.setUrl("jdbc:sqlite::memory:");
@@ -322,7 +323,7 @@
File tmp = new File("tmp");
if (!tmp.exists())
tmp.mkdirs();
- dataSource.setUrl("jdbc:sqlite:tmp/sqlite_" + name + t.getMillis()
+ dataSource.setUrl("jdbc:sqlite:tmp/sqlite_" + t.getMillis()
+ ".sqlite");
}
dataSource.setSuppressClose(true);
@@ -387,7 +388,7 @@
public static class AppTestConfig extends TestBeans {
public AppTestConfig () throws InterruptedException, IOException {
- this.dataSource = TestHelper.sqlite_db(TestHelper.clazz, false);
+ this.dataSource = TestHelper.sqlite_db(true);
//this.dataSource = TestHelper.mysql_db();
}