Refactor Apache Geode client/server integration tests and simplify the (test) working directory setup and cleanup.
Resolves #623.
This commit is contained in:
@@ -17,11 +17,8 @@ package org.springframework.data.gemfire.client;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -35,8 +32,6 @@ import org.apache.geode.cache.query.QueryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -59,25 +54,12 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
@SuppressWarnings("unused")
|
||||
public class ClientCacheIndexingIntegrationTests extends ForkingClientServerIntegrationTestsSupport {
|
||||
|
||||
private static File serverWorkingDirectory;
|
||||
|
||||
@BeforeClass
|
||||
public static void startGeodeServer() throws IOException {
|
||||
|
||||
serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ClientCacheIndexingIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
startGemFireServer(ServerProcess.class,
|
||||
getServerContextXmlFileLocation(ClientCacheIndexingIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ClientCache clientCache;
|
||||
|
||||
|
||||
@@ -18,10 +18,6 @@ package org.springframework.data.gemfire.client;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -36,8 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -62,21 +56,10 @@ public class ClientCachePoolIntegrationTests extends ForkingClientServerIntegrat
|
||||
|
||||
@BeforeClass
|
||||
public static void startGeodeServer() throws Exception {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ClientCachePoolIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
startGemFireServer(ServerProcess.class,
|
||||
getServerContextXmlFileLocation(ClientCachePoolIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
@Qualifier("Factorials")
|
||||
private Region<Long, Long> factorials;
|
||||
|
||||
@@ -17,13 +17,10 @@ package org.springframework.data.gemfire.client;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -38,8 +35,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -61,9 +56,6 @@ public class ClientCacheSecurityIntegrationTests extends ForkingClientServerInte
|
||||
@BeforeClass
|
||||
public static void startGeodeServer() throws IOException {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ClientCacheSecurityIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
List<String> arguments = new ArrayList<String>();
|
||||
|
||||
org.springframework.core.io.Resource trustedKeystore = new ClassPathResource("trusted.keystore");
|
||||
@@ -75,18 +67,11 @@ public class ClientCacheSecurityIntegrationTests extends ForkingClientServerInte
|
||||
|
||||
arguments.add(getServerContextXmlFileLocation(ClientCacheSecurityIntegrationTests.class));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class, arguments.toArray(new String[arguments.size()]));
|
||||
startGemFireServer(ServerProcess.class, arguments.toArray(new String[arguments.size()]));
|
||||
|
||||
System.setProperty("javax.net.ssl.keyStore", trustedKeystore.getFile().getAbsolutePath());
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
@Qualifier("Example")
|
||||
private Region<String, String> example;
|
||||
|
||||
@@ -17,12 +17,9 @@ package org.springframework.data.gemfire.client;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@@ -39,8 +36,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -69,20 +64,10 @@ public class ClientCacheVariableLocatorsIntegrationTests extends ForkingClientSe
|
||||
|
||||
System.setProperty("spring.data.gemfire.locator.port", String.valueOf(locatorPort));
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ClientCacheVariableLocatorsIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
startGemFireServer(ServerProcess.class,
|
||||
getServerContextXmlFileLocation(ClientCacheVariableLocatorsIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
@Qualifier("Example")
|
||||
private Region<String, Integer> example;
|
||||
|
||||
@@ -17,13 +17,11 @@ package org.springframework.data.gemfire.client;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
@@ -46,8 +44,6 @@ import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.data.gemfire.util.CollectionUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
@@ -84,23 +80,13 @@ public class ClientCacheVariableServersIntegrationTests extends ForkingClientSer
|
||||
System.setProperty("test.cache.server.port.one", String.valueOf(cacheServerPortOne));
|
||||
System.setProperty("test.cache.server.port.two", String.valueOf(cacheServerPortTwo));
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ClientCacheVariableServersIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
List<String> arguments = new ArrayList<>();
|
||||
|
||||
arguments.add(String.format("-Dtest.cache.server.port.one=%d", cacheServerPortOne));
|
||||
arguments.add(String.format("-Dtest.cache.server.port.two=%d", cacheServerPortTwo));
|
||||
arguments.add(getServerContextXmlFileLocation(ClientCacheVariableServersIntegrationTests.class));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class, arguments.toArray(new String[0]));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
startGemFireServer(ServerProcess.class, arguments.toArray(new String[0]));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
|
||||
@@ -17,10 +17,6 @@ package org.springframework.data.gemfire.client;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -33,8 +29,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.gemfire.GemfireTemplate;
|
||||
import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -57,19 +51,7 @@ public class ClientSubRegionIntegrationTests extends ForkingClientServerIntegrat
|
||||
|
||||
@BeforeClass
|
||||
public static void startGeodeServer() throws Exception {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ClientSubRegionIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
getServerContextXmlFileLocation(ClientSubRegionIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
startGemFireServer(ServerProcess.class, getServerContextXmlFileLocation(ClientSubRegionIntegrationTests.class));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.data.gemfire.client;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -26,14 +25,12 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.FixMethodOrder;
|
||||
@@ -58,8 +55,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.data.gemfire.util.DistributedSystemUtils;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -105,21 +100,10 @@ public class DurableClientCacheIntegrationTests extends ForkingClientServerInteg
|
||||
|
||||
@BeforeClass
|
||||
public static void startGeodeServer() throws IOException {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(DurableClientCacheIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
startGemFireServer(ServerProcess.class,
|
||||
getServerContextXmlFileLocation(DurableClientCacheIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
private static boolean isAfterDirtiesContext() {
|
||||
return dirtiesContext.get();
|
||||
}
|
||||
|
||||
@@ -17,13 +17,10 @@ package org.springframework.data.gemfire.client;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -37,8 +34,6 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.gemfire.GemfireUtils;
|
||||
import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -66,10 +61,6 @@ public class GemFireDataSourceIntegrationTest extends ForkingClientServerIntegra
|
||||
@BeforeClass
|
||||
public static void startGeodeServer() throws IOException {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(
|
||||
org.springframework.data.gemfire.tests.util.FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(GemFireDataSourceIntegrationTest.class)), UUID.randomUUID().toString()));
|
||||
|
||||
List<String> arguments = new ArrayList<>();
|
||||
|
||||
arguments.add(String.format("-Dgemfire.name=%s",
|
||||
@@ -77,14 +68,7 @@ public class GemFireDataSourceIntegrationTest extends ForkingClientServerIntegra
|
||||
|
||||
arguments.add(getServerContextXmlFileLocation(GemFireDataSourceIntegrationTest.class));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class, arguments.toArray(new String[0]));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
startGemFireServer(ServerProcess.class, arguments.toArray(new String[0]));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -14,13 +14,10 @@ package org.springframework.data.gemfire.client;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -36,8 +33,6 @@ import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.repository.sample.Person;
|
||||
import org.springframework.data.gemfire.repository.sample.PersonRepository;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -62,21 +57,10 @@ public class GemFireDataSourceIntegrationTests extends ForkingClientServerIntegr
|
||||
|
||||
@BeforeClass
|
||||
public static void startGeodeServer() throws Exception {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(GemFireDataSourceIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
startGemFireServer(ServerProcess.class,
|
||||
getServerContextXmlFileLocation(GemFireDataSourceIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
|
||||
@@ -85,19 +85,7 @@ public class EnableClusterConfigurationIntegrationTests extends ForkingClientSer
|
||||
|
||||
@BeforeClass
|
||||
public static void startGemFireServer() throws Exception {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(
|
||||
org.springframework.data.gemfire.tests.util.FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(EnableClusterConfigurationIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, GeodeServerTestConfiguration.class);
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
startGemFireServer(GeodeServerTestConfiguration.class);
|
||||
}
|
||||
|
||||
@Before
|
||||
|
||||
@@ -17,15 +17,12 @@ package org.springframework.data.gemfire.function;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -45,8 +42,6 @@ import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.function.annotation.GemfireFunction;
|
||||
import org.springframework.data.gemfire.function.sample.ApplicationDomainFunctionExecutions;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -86,21 +81,10 @@ public class ClientCacheFunctionExecutionWithPdxIntegrationTest extends ForkingC
|
||||
|
||||
@BeforeClass
|
||||
public static void startGemFireServer() throws Exception {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ClientCacheFunctionExecutionWithPdxIntegrationTest.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
startGemFireServer(ServerProcess.class,
|
||||
getServerContextXmlFileLocation(ClientCacheFunctionExecutionWithPdxIntegrationTest.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
private PdxInstance toPdxInstance(Map<String, Object> pdxData) {
|
||||
|
||||
PdxInstanceFactory pdxInstanceFactory =
|
||||
|
||||
@@ -17,11 +17,8 @@ package org.springframework.data.gemfire.function;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -35,7 +32,6 @@ import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.function.sample.ExceptionThrowingFunctionExecution;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -68,21 +64,10 @@ public class ExceptionThrowingFunctionExecutionIntegrationTests extends ForkingC
|
||||
|
||||
@BeforeClass
|
||||
public static void startGeodeServer() throws IOException {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ExceptionThrowingFunctionExecutionIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
startGemFireServer(ServerProcess.class,
|
||||
getServerContextXmlFileLocation(ExceptionThrowingFunctionExecutionIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
@Test(expected = FunctionException.class)
|
||||
public void exceptionThrowingFunctionExecutionRethrowsException() {
|
||||
|
||||
|
||||
@@ -14,15 +14,12 @@ package org.springframework.data.gemfire.function.execution;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@@ -37,8 +34,6 @@ import org.springframework.data.gemfire.fork.ServerProcess;
|
||||
import org.springframework.data.gemfire.function.annotation.GemfireFunction;
|
||||
import org.springframework.data.gemfire.function.annotation.RegionData;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
@@ -63,19 +58,7 @@ public class FunctionIntegrationTests extends ForkingClientServerIntegrationTest
|
||||
|
||||
@BeforeClass
|
||||
public static void startGemFireServer() throws Exception {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(FunctionIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
getServerContextXmlFileLocation(FunctionIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
startGemFireServer(ServerProcess.class, getServerContextXmlFileLocation(FunctionIntegrationTests.class));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -14,10 +14,6 @@ package org.springframework.data.gemfire.repository.config;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -31,8 +27,6 @@ import org.springframework.data.gemfire.repository.sample.Person;
|
||||
import org.springframework.data.gemfire.repository.sample.PersonRepository;
|
||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.objects.geode.cache.RegionDataInitializingPostProcessor;
|
||||
import org.springframework.data.gemfire.tests.process.ProcessWrapper;
|
||||
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@@ -56,21 +50,10 @@ public class ClientRegionNamespaceRepositoryIntegrationTests extends ForkingClie
|
||||
|
||||
@BeforeClass
|
||||
public static void startGemFireServer() throws Exception {
|
||||
|
||||
File serverWorkingDirectory = createDirectory(new File(new File(FileSystemUtils.WORKING_DIRECTORY,
|
||||
asDirectoryName(ClientRegionNamespaceRepositoryIntegrationTests.class)), UUID.randomUUID().toString()));
|
||||
|
||||
startGemFireServer(serverWorkingDirectory, ServerProcess.class,
|
||||
startGemFireServer(ServerProcess.class,
|
||||
getServerContextXmlFileLocation(ClientRegionNamespaceRepositoryIntegrationTests.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void removeServerWorkingDirectory() {
|
||||
getGemFireServerProcess()
|
||||
.map(ProcessWrapper::getWorkingDirectory)
|
||||
.ifPresent(FileSystemUtils::deleteRecursive);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private PersonRepository repository;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user