Skip to content
Snippets Groups Projects
Verified Commit 8f048c91 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

fix unit tests

parent abdb59be
Branches
Tags
2 merge requests!21Release v0.4.0,!18fix importance bug
Pipeline #8860 passed
...@@ -2,16 +2,24 @@ package org.caosdb.server.jobs; ...@@ -2,16 +2,24 @@ package org.caosdb.server.jobs;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.caosdb.server.CaosDBServer;
import org.caosdb.server.entity.DeleteEntity; import org.caosdb.server.entity.DeleteEntity;
import org.caosdb.server.entity.InsertEntity; import org.caosdb.server.entity.InsertEntity;
import org.caosdb.server.entity.RetrieveEntity; import org.caosdb.server.entity.RetrieveEntity;
import org.caosdb.server.entity.Role; import org.caosdb.server.entity.Role;
import org.caosdb.server.entity.UpdateEntity; import org.caosdb.server.entity.UpdateEntity;
import org.jdom2.Element; import org.jdom2.Element;
import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
public class JobConfigTest { public class JobConfigTest {
@BeforeClass
public static void setup() throws IOException {
CaosDBServer.initServerProperties();
}
@Test @Test
public void testGetTransactionType() { public void testGetTransactionType() {
final JobConfig jobConfig = JobConfig.getInstance(); final JobConfig jobConfig = JobConfig.getInstance();
......
...@@ -24,10 +24,18 @@ package org.caosdb.server.jobs; ...@@ -24,10 +24,18 @@ package org.caosdb.server.jobs;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import java.io.IOException;
import org.caosdb.server.CaosDBServer;
import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
public class ScheduleTest { public class ScheduleTest {
@BeforeClass
public static void setup() throws IOException {
CaosDBServer.initServerProperties();
}
/** The problem of ticket #297 was that a CHECK job was executed during the ROLL_BACK stage. */ /** The problem of ticket #297 was that a CHECK job was executed during the ROLL_BACK stage. */
@Test @Test
public void testTicket297() { public void testTicket297() {
......
...@@ -4,16 +4,23 @@ import static org.junit.Assert.assertTrue; ...@@ -4,16 +4,23 @@ import static org.junit.Assert.assertTrue;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.caosdb.server.CaosDBServer;
import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
public class TestInsertFilesInDir { public class TestInsertFilesInDir {
@BeforeClass
public static void setup() throws IOException {
CaosDBServer.initServerProperties();
}
@Test @Test
public void testExclude() throws IOException { public void testExclude() throws IOException {
InsertFilesInDir job = new InsertFilesInDir(); final InsertFilesInDir job = new InsertFilesInDir();
job.init(null, null, null); job.init(null, null, null);
job.parseValue("-e ^.*test.*$ test"); job.parseValue("-e ^.*test.*$ test");
File testFile = new File("test.dat"); final File testFile = new File("test.dat");
assertTrue(job.isExcluded(testFile)); assertTrue(job.isExcluded(testFile));
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment