Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
  • Loading branch information
olamy committed Oct 16, 2020
1 parent 6726a50 commit 6f98b13
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
Expand Up @@ -18,6 +18,8 @@

package org.eclipse.jetty.server.session;

import java.nio.file.Files;

import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -33,7 +35,7 @@ public class ClusteredOrphanedSessionTest extends AbstractClusteredOrphanedSessi
public static void setup() throws Exception
{
__testSupport = new InfinispanTestSupport();
__testSupport.setup();
__testSupport.setup(Files.createTempDirectory(ClusteredOrphanedSessionTest.class.getName()));
}

@AfterAll
Expand Down
Expand Up @@ -18,6 +18,8 @@

package org.eclipse.jetty.server.session;

import java.nio.file.Files;

import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -36,7 +38,7 @@ public static void setup() throws Exception
__testSupport = new InfinispanTestSupport();
__testSupport.setUseFileStore(true);
__testSupport.setSerializeSessionData(true);
__testSupport.setup();
__testSupport.setup(Files.createTempDirectory(ClusteredSerializedSessionScavengingTest.class.getName()));
}

@AfterAll
Expand Down
Expand Up @@ -18,6 +18,8 @@

package org.eclipse.jetty.server.session;

import java.nio.file.Files;

import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand All @@ -35,7 +37,7 @@ public static void setup() throws Exception
{
__testSupport = new InfinispanTestSupport();
__testSupport.setUseFileStore(true);
__testSupport.setup();
__testSupport.setup(Files.createTempDirectory(ClusteredSessionScavengingTest.class.getName()));
}

@AfterAll
Expand Down
Expand Up @@ -18,20 +18,26 @@

package org.eclipse.jetty.server.session;

import org.eclipse.jetty.toolchain.test.jupiter.WorkDir;
import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;

/**
* HotInitInfinispanSessionDataStoreTest
*/
@ExtendWith(WorkDirExtension.class)
public class InfinispanFileSessionDataStoreTest extends InfinispanSessionDataStoreTest
{

public WorkDir workDir;

@BeforeEach
public void setup() throws Exception
{
_testSupport = new InfinispanTestSupport();
_testSupport.setUseFileStore(true);
_testSupport.setup();
_testSupport.setup(workDir.getEmptyPathDir());
}

}
Expand Up @@ -22,29 +22,35 @@
import org.eclipse.jetty.session.infinispan.InfinispanSessionData;
import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStore;
import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory;
import org.eclipse.jetty.toolchain.test.jupiter.WorkDir;
import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension;
import org.infinispan.query.Search;
import org.infinispan.query.dsl.Query;
import org.infinispan.query.dsl.QueryFactory;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

/**
* InfinispanSessionDataStoreTest
*/
@ExtendWith(WorkDirExtension.class)
public class InfinispanSessionDataStoreTest extends AbstractSessionDataStoreTest
{

public InfinispanTestSupport _testSupport;

public WorkDir workDir;

@BeforeEach
public void setup() throws Exception
{
_testSupport = new InfinispanTestSupport();
_testSupport.setup();
_testSupport.setup(workDir.getEmptyPathDir());
}

@AfterEach
Expand Down
Expand Up @@ -45,10 +45,8 @@
/**
* InfinispanTestSupport
*/
@ExtendWith(WorkDirExtension.class)
public class InfinispanTestSupport
{
public WorkDir workDir;
public static final String DEFAULT_CACHE_NAME = "session_test_cache";
public Cache _cache;

Expand Down Expand Up @@ -100,9 +98,8 @@ public Cache getCache()
return _cache;
}

public void setup() throws Exception
public void setup(Path root) throws Exception
{
Path root = workDir.getEmptyPathDir();
Path indexesDir = root.resolve("indexes");
FS.ensureDirExists(indexesDir);

Expand Down
Expand Up @@ -22,30 +22,36 @@
import org.eclipse.jetty.session.infinispan.InfinispanSessionData;
import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStore;
import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory;
import org.eclipse.jetty.toolchain.test.jupiter.WorkDir;
import org.eclipse.jetty.toolchain.test.jupiter.WorkDirExtension;
import org.infinispan.query.Search;
import org.infinispan.query.dsl.Query;
import org.infinispan.query.dsl.QueryFactory;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

/**
* SerializedInfinispanSessionDataStoreTest
*/
@ExtendWith(WorkDirExtension.class)
public class SerializedInfinispanSessionDataStoreTest extends AbstractSessionDataStoreTest
{

public InfinispanTestSupport _testSupport;

public WorkDir workDir;

@BeforeEach
public void setup() throws Exception
{
_testSupport = new InfinispanTestSupport();
_testSupport.setSerializeSessionData(true);
_testSupport.setup();
_testSupport.setup(workDir.getEmptyPathDir());
}

@AfterEach
Expand Down

0 comments on commit 6f98b13

Please sign in to comment.