Commit Graph

162 Commits

Author SHA1 Message Date
John Blum
e718b595f6 Mock the Region.localInvalidate(key) operation; call mock Region.invalidate(key). 2020-09-16 13:35:57 -07:00
John Blum
ab686fe92c Mock the Region.localClear() operation; call mock Region.clear(). 2020-09-16 13:32:07 -07:00
John Blum
1a10296740 Mock the Map/Region.keySet() operation. 2020-09-16 13:23:37 -07:00
John Blum
f5fe40dfcd Mock the Map/Region.isEmpty() operation. 2020-09-16 13:14:24 -07:00
John Blum
051447a76d Mock the Region.getParentRegion() operation for sub-Regions. 2020-09-16 12:51:02 -07:00
John Blum
74634337fb Mock the Map.getOrDefault(key, defaultValue) operation. 2020-09-16 12:20:28 -07:00
John Blum
2e94141994 Use doAnser(..) instead of thenAnser(..) Mockito mock stubbing for getSubregions(..) and subregions(..) operations on mock Region. 2020-09-16 12:13:05 -07:00
John Blum
f896abd33b Refactor all mock Region data access operations into a separate method. 2020-09-16 12:08:59 -07:00
John Blum
16c7ddeeb9 Mock the Region.getAll(:Collection<K>) operation. 2020-09-16 12:02:46 -07:00
John Blum
028f9c16da Use doAnswer(..) instead of thenAnser(..) Mockito mock stubbing for Map/Region.get(key). 2020-09-15 19:42:58 -07:00
John Blum
ea2241847a Mock the Map.forEach(:BiConsumer<K, V>) operation. 2020-09-15 19:35:55 -07:00
John Blum
06cdda618d Mock the Region.containsValueForKey(key) operation. 2020-09-15 19:11:41 -07:00
John Blum
e7c106f4ca Mock the Map/Region.containsValue(value) operation. 2020-09-15 18:58:05 -07:00
John Blum
ed94c009bb Write test for the Map/Region.containsKey(key) operation. 2020-09-15 18:58:05 -07:00
John Blum
301deb1330 Mock the Map/Region.clear() operation. 2020-09-15 18:50:46 -07:00
John Blum
528818b9fd Mock SelectResults.iterator().
Change access modifier on GemFireMockObjectsSupport.mockSelectResults() to private.
2020-08-28 15:07:36 -07:00
John Blum
f2779cd8d7 Mock ClientCache.getQueryService(poolName:String).
Mock QueryService.newQuery(:String).

Mock Query.execute(..).

Mock SelectResults<?>, ObjectType and CollectionType.
2020-08-28 14:50:10 -07:00
John Blum
cb28c5f4df If trying to delete a file fails then schedule the file to be deleted on exit. 2020-08-28 10:41:13 -07:00
John Blum
d9b3ac9ce3 Recurse on collectGemFireResources(:File) when deleting a target GemFire/Geode directory.
Replaces FileSystemUtils.deleteRecursive(:File).

Edit Javadoc.
2020-08-27 16:29:09 -07:00
John Blum
73c900d4e8 Add tryDelete(:File) method to try to delete a given File in a given number of attempts and wait duration between attempts. 2020-08-27 16:26:08 -07:00
John Blum
4ab9090350 Change GemFireResourceCollectorApplicationListener constructor argument to DEFAULT_SEARCH_DIRECTORY. 2020-08-27 15:58:16 -07:00
John Blum
eb8eafe111 Add mock functionality and support for Cache.getGatewaySenders() and Cache.getGatewaySender(id:String). 2020-08-17 23:13:38 -07:00
John Blum
ab8af5abfa Add mock functionality and support for Cache.getGatewayReceivers(). 2020-08-17 23:10:48 -07:00
John Blum
2d92d65831 Add mock functionality and support for Cache.getAsyncEventQueues() and Cache.getAsyncEventQueue(id:String). 2020-08-17 23:08:42 -07:00
John Blum
d2bd431e43 Replace all references to 'Pivotal GemFire' with 'VMware GemFire'. 2020-07-26 22:30:20 -07:00
John Blum
3961cce1c8 Add test cases proving the OOTB, unsupported putAll(:Map<?, ?>) and putIfAbsent(key, value) Map methods of Region can be mocked by end-users. 2020-07-26 21:22:03 -07:00
John Blum
32c664db07 Remove uses of deprecated Mockito APIs. 2020-07-26 21:22:03 -07:00
John Blum
9c693001fd Change return type of setField(..) from Object to T.
Annotate makeAccessibleReturnConstructor(:Constructor) with @SuppresssWarnings('rawtypes').
2020-07-26 21:22:03 -07:00
John Blum
a2bc65b408 Edit Javadoc. 2020-06-17 20:11:49 -07:00
John Blum
36795103e7 Rename @EnableGemFireGarbageCollector annotation to @EnableGemFireResourceCollector.
Rename all associated and appropriate uses of 'garbage' to 'resources'.

Resolves gh-21.
2020-06-17 20:07:28 -07:00
John Blum
bb63670d65 Format source code.
Edit Javadoc.
2020-06-17 19:19:59 -07:00
John Blum
af6340f8a0 Set the default 'destroyEventTypes' to AfterTestClassEvent.class. 2020-06-17 19:15:55 -07:00
John Blum
15077eb5f4 Rename @EnableGemFireMockObjects.destroyOnEvent annotation attribute to 'destroyOnEvents'.
Add additional test cases for the GemFireMockObjectsConfiguration class testing the ApplicationListener and BeanPostProcessor bean configurations.
2020-06-17 19:09:15 -07:00
John Blum
06aeaa62cf Add Unit Tests for GemFireGarbageCollectorApplicationListener.
Resolves gh-21.
2020-06-17 17:18:58 -07:00
John Blum
ddfbfb3852 Add Unit Tests for GemFireGarbageCollectorConfiguration.
Resolves gh-21.
2020-06-17 17:18:49 -07:00
John Blum
ed9ac261f4 Set default GemFire Gargabe Collector event type to AfterTestClassEvent.class.
Add accessor methods for gemfireGarbageCollectorEventTypes and tryCleanDiskStoreFiles configuration settings.

Resolves gh-21.
2020-06-17 15:11:01 -07:00
John Blum
a4e6892a55 Add isEmpty(:File) method to determine whether a file or a directory is empty.
A file is empty if the file size (length) is 0 bytes.  A directory is empty if it contains no files.
2020-06-17 15:04:56 -07:00
John Blum
140b423f70 Add nullSafeLength(:File) method to safely invoke file.length() protexting against a null File reference. 2020-06-17 15:04:56 -07:00
John Blum
6a6cd7c136 Add new @EnableGemFireGarbageCollector annotation and logic to collect and cleanup after GemFire/Geode, deleting all files and directories in the filesystem left over after a GemFire/Geode process terminates.
Resolves gh-21.
2020-06-17 15:04:56 -07:00
John Blum
56dc4ffec6 Extend SDG's AbstractAnnotationConfigSupport base class. 2020-06-15 16:35:38 -07:00
John Blum
75db4b496a Edit Javadoc. 2020-06-15 16:34:29 -07:00
John Blum
ede0b99e28 Correct Generics signature.
Format source code.
2020-06-15 16:33:55 -07:00
John Blum
96e9b05750 Add Spring TestExecutionListener implementation to destroy all GemFire/Geode Mock Objects when configured TestContextEvents by type are fired during the test execution lifecycle.
Resolves gh-20.
2020-05-21 21:47:02 -07:00
John Blum
4f4cfad6c2 Create enumeration of all Spring TestContext framework, TestContextEvent types.
Resolves gh-20.
2020-05-21 21:45:52 -07:00
John Blum
39f36ce9d0 Add Spring ApplicationListener implementation to destroy all GemFire/Geode Mock Objects when configured ApplicationEvents are fired in a Spring context.
Resolves gh-20.
2020-05-21 21:45:13 -07:00
John Blum
ff49f11a02 Add Unit Tests for GemFireMockObjectsBeanPostProcessor. 2020-05-21 21:43:21 -07:00
John Blum
fbb39b97b9 Add Unit Tests for GemFireMockObjectsApplicationContextInitializer. 2020-05-21 21:42:46 -07:00
John Blum
4761c0ade5 Edit Javadoc. 2020-05-21 21:40:26 -07:00
John Blum
21761a789c Move GemFireMockObjectsBeanPostProcessor to org.springframework.data.gemfire.tests.mock.beans.factory.config. 2020-05-21 21:40:26 -07:00
John Blum
af9237eeb1 Add 'destroyOnEvent' configuration annotation attribute.
The 'destoryOnEvent' EnableGemFireMockObjects annotation attribute configures specific Spring ApplicationEvent types (Class) that will trigger the destruction of all GemFire/Geode Mock Objects.

Add bean definition and declaration for the DestroyGemFireMockObjectsApplicationListener.

Add Unit Tests for the GemFireMockObjectsConfiguration class.

Resolves gh-20.
2020-05-21 21:40:26 -07:00