Commit Graph

277 Commits

Author SHA1 Message Date
John Blum
171e71a7b8 Refactor IntegrationTestsSupportUnitTests.asDirectoryNameIsCorrect() test case method to be more resilient to temporal-based test failures.
Previously, the test case method could fail based on a race condition involving a timestamp in the (test) working directory name.
2022-10-17 12:50:35 -07:00
John Blum
1522d565e1 Edit Javadoc in IntegrationTestsSupport.
Replace use of Java's @NotNull annotation with Spring's @NonNull annotation.
2022-10-17 12:50:22 -07:00
John Blum
033d7ae7c1 Refactor ProcessWrapper to conditionally, based on System property, to forcibly destroy a forked JVM (child) process on shutdown. 2022-10-17 12:26:12 -07:00
John Blum
8afbb0c80b Refactor IntegrationTestsSupport.asDirectoryName(:Class) logic into descriptive methods.
Adds the asTimestampedDirectoryName(:Class) and asUniqueDirectoryName(:Class) methods to uniquely and temporally identify a forked JVM (child) process (test) working directory.
2022-10-17 12:25:52 -07:00
John Blum
4956998dbe Refactor the conditonal logic used to decide whether to remove the (test) working directory of a forked Process in ForkingClientServerIntegrationTests.
Edit Javadoc.
2022-10-17 10:04:44 -07:00
John Blum
b81c00acec Refactor the ProcessWrapper.shutdown() method.
* Removes the use of the now deprecated signalStop() method.
* Changes safeGetPid() to handle all Throwable objects.
* Changes shutdown() to call stop() and then forcibly destroy the child Process if the child Process is still running.
* Annotates the API with Spring's @NonNull and @Nullable annotations.
* Edits Javadoc.
2022-10-17 10:02:34 -07:00
John Blum
b6d043ae14 Refactor ProcessWrapper.safeGetPid() to ignore all Throwable objects. 2022-10-17 09:18:43 -07:00
John Blum
b8bf39f976 Revert Java 17 syntax to Java 8 in GemFireMockObjectsConfiguration. 2022-10-13 17:17:39 -07:00
John Blum
8efe6d4de2 Conditionally (and recursively) remove the test directory of the forked GemFire/Geode server process. 2022-10-13 17:10:09 -07:00
John Blum
30428f75d0 Refactor asDirectoryName(:Class<?>) to qualify type based on declaring types and include a UUID in the pathname. 2022-10-13 17:09:08 -07:00
John Blum
6b5e7d56e0 Add utility method supporting the (recursive) removal of a (test) directory in IntegrationTestsSupport. 2022-10-13 17:08:10 -07:00
John Blum
82c9407ce2 Declare 'org.jgroups' Logger configuration in JUL, Log4j and Logback properties/XML configuration files. 2022-10-13 17:08:03 -07:00
John Blum
403b853ae2 Format src/test/resources/logback.xml configuration file. 2022-10-13 17:07:58 -07:00
John Blum
3b2cf48faa Edit Javadoc in the GemFireMockObjectsBeanPostProcessor class. 2022-10-13 17:07:52 -07:00
John Blum
98a1e17548 Refactor the GemFireMockObjectsConfiguration class. 2022-10-13 17:07:47 -07:00
John Blum
6f94321dbb Annotate the initialize(:ConfigurableApplicationContext) method parameter with Spring's @NonNull annotation. 2022-10-13 17:07:39 -07:00
John Blum
f06aa90585 Adapt to API changes in Spring Data for Apache Geode (SDG). 2022-09-23 12:38:51 -07:00
John Blum
79df9dc2e6 Update Copyright to 2022. 2022-03-22 17:20:03 -07:00
John Blum
bd087e05fc Add overloaded launch(..) method to ProcessExecutor accepting a Java CLASSPATH, Class type with the main method to run and an array of String arguments passed to the forked Java program. 2021-10-28 16:39:06 -07:00
John Blum
92b26c0d50 Refactor the ProcessExecutor.launch(..) method to register a JRE shutdown hook on the ProcessWrapper representing the forked [Java / JVM] process.
Resolves gh-15.
2021-10-28 15:35:18 -07:00
John Blum
1ef42b374a Return the ProcessWrapper (this) from the ProcessWrapper.registerShutdownHook() method. 2021-10-28 15:32:13 -07:00
John Blum
b5be8da185 Add overloaded startGemFireServer(..) and startGeodeServer(..) methods to the ForkingClientServerIntegrationTestsSupport class to control the working directory and classpath of the forked Java/JVM processes.
Resolves gh-17.
2021-10-28 15:03:12 -07:00
John Blum
900b1aff4d Create a Java FunctionalInterface and extension of the ProcessRunner interface defining a contract, logic and strategy for running (executing) a Java/JVM Process.
Resolves gh-17.
2021-10-28 15:03:12 -07:00
John Blum
14ac8cc780 Create a Java FunctionalInterface defining a contract, logic and strategy for running (executing) an Operating System (OS) Process.
Resolves gh-17.
2021-10-28 15:02:51 -07:00
John Blum
81589fab22 Set the host & port on the ProcessWrapper representing the GemFire/Geode JVM server process forked by the STDG framework.
Return the ProcessWrapper representing the forked GemFire/Geode JVM server process from the startGemFireServer(..) and startGeodeServer(..) methods.

Resolves gh-14.
2021-10-28 14:10:11 -07:00
John Blum
d9bfbd479d Add configurable 'host' and 'port' properties to the ProcessWrapper class.
The 'host' property represents the system (computer in the network) that is running the Process.

The 'port' property represents the host system port on wich the Process is listening for client connections.

Resolves gh-14.
2021-10-28 14:09:11 -07:00
John Blum
7602f7d704 Increase the 'order' precedence of the CloseApplicationContextAfterTestClassTestExecutionListener to occur after all Spring TestContext framework provided TestExecutionListeners. 2021-10-28 11:06:29 -07:00
John Blum
d971817a7e Add logic to the ConfigurableCacheAwareContextLoaderDelegate to guard against inactive ApplicationContexts.
Edit Javadoc.
2021-10-28 11:06:25 -07:00
John Blum
2ae2f84779 Add utility function in SpringUtils to determine the 'active' state of the given ApplicationContext. 2021-10-28 11:06:12 -07:00
John Blum
96e864c319 Refactor CloseApplicationContextAfterTestClassTestExecutionListener to extend AbstractTestExecutionListener and override the getOrder() method. 2021-10-28 10:12:49 -07:00
John Blum
7573c08af2 Add Spring TestExecutionListener to close the ApplicationContext associated with the Spring TestContext for the currently executing test class after test class execution. 2021-10-27 17:17:55 -07:00
John Blum
eb9f44606e Rename GeodeContextCustomizer and GeodeContextCustomizerFactory classes to DependencyOfAnnotationContextCustomizer and DependencyOfAnnotationContextCustomizerFactory, respectively.
Move classes to the org.springframework.data.gemfire.tests.extensions.sppring.test.context package.
2021-10-27 17:17:48 -07:00
John Blum
675456ea8b Refactor the ConfigurableCacheAwareContextLoaderDelegate class to remember and reference the current ApplicationContext in use by the Spring TestContext framework and currently executing test class.
This is necessary in order to properly close the ApplicationContext and release all Spring bean resources after use (e.g. after the test class executes).
2021-10-27 17:17:14 -07:00
John Blum
6fab602cdf Refactor the STDG SpringUtils class to extend the SDG SpringUtils class.
Add and edit Javadoc.
2021-10-27 15:27:33 -07:00
John Blum
050d1167d2 Add abstract utility class for working with Spring Framework objects and components (beans). 2021-10-27 15:24:09 -07:00
John Blum
85e280c3be Fix logic in isSpringTestContextCacheEnabled() method. 2021-10-27 11:01:14 -07:00
John Blum
4016e3c5a1 Add custom implementation of the Spring TestContext framework CacheAwareContextLoaderDelegate interface to enable/disable caching of the Spring TestContext using SpringProperties and Java System properties. 2021-10-26 21:22:12 -07:00
John Blum
67b8b03f33 Edit Javadoc description of the META-INF/spring.factories configuration file. 2021-10-26 21:21:03 -07:00
John Blum
3fa2da7203 Replace STDG's JavaVersion class with SDG's JavaVersion class. 2021-09-27 14:26:41 -07:00
John Blum
d23c4933b6 Copy SDG's JavaVersion class to STDG.
STDG's JavaVersion clone will be replaced by SDG's JavaVersion class once STDG is based on SDG 2.5.6.
2021-09-27 14:02:13 -07:00
John Blum
ff597803c1 Add Javadoc to the ProcessExecutor.launch(..) methods. 2021-09-27 13:46:35 -07:00
John Blum
dc444686de Switch the RegionDataInitializingPostProcessor from a Spring BeanPostProcess to a Spring @Component @EventListener. 2021-09-24 18:00:59 -07:00
John Blum
fcf1842e02 Add Spring BeanPostProcessor to initialize an Apache Geode Region (bean) with data on Spring container initialization. 2021-09-24 16:45:07 -07:00
John Blum
0978f22061 Set JRE version check to Java 16 when adding additional JVM options. 2021-09-20 17:00:03 -07:00
John Blum
49df59f159 Add JRE version specific JVM options to reliably run (fork) GemFire/Geode servers. 2021-09-20 16:27:43 -07:00
John Blum
fcafd5ca46 Add additional overloaded closeGemFireCacheWaitOnCacheClosedEvent(..) methods to control how the GemFireCache object (instance) is closed using a java.util.function.Function. 2021-09-20 11:55:45 -07:00
John Blum
fef16bf957 Add overloaded closeGemFireCacheWaitOnCacheClosedEvent(..) methods accepting a Supplier for a GemFireCache object to close. 2021-09-20 11:55:23 -07:00
John Blum
84442946bd Unregister all Functions from Apache Geode's FunctionService after test class/suite execution. 2021-09-16 22:57:04 -07:00
John Blum
61316b8631 Change all JUnit declared @BeforeClass Spring and Apache Geode object and resource cleanup to occur after test (class/suite) execution using JUnit's @AfterClass.
Edit Javadoc.
2021-09-16 22:56:50 -07:00
John Blum
e188e9f48e Add test class cleanup method to delete all Apache Geode/VMware GemFire process .pid files. 2021-09-15 18:16:18 -07:00