SGF-408 - Provide support in the SDG XML namespace to load a pre-defined data set using GemFire Snapshot Service for development and testing purposes.
Repackaged all GemFire Snapshot Service support classes in Spring Data GemFire under org.springframework.data.gemfire.snapshot. Moved snapshot application events to ..snapshot.event. Moved the ComposableSnapshotFilter class to ..snapshot.filter. (cherry picked from commit 5bf3e8e8132c9cff0c3da33b271bfa4e049968c0) Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire;
|
||||
package org.springframework.data.gemfire.snapshot;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
@@ -35,6 +35,9 @@ import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.data.gemfire.repository.sample.Person;
|
||||
import org.springframework.data.gemfire.snapshot.event.ExportSnapshotApplicationEvent;
|
||||
import org.springframework.data.gemfire.snapshot.event.ImportSnapshotApplicationEvent;
|
||||
import org.springframework.data.gemfire.snapshot.event.SnapshotApplicationEvent;
|
||||
import org.springframework.data.gemfire.test.support.FileSystemUtils;
|
||||
import org.springframework.data.gemfire.test.support.ThreadUtils;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
@@ -56,9 +59,10 @@ import com.gemstone.gemfire.management.internal.cli.util.spring.StringUtils;
|
||||
* @see org.junit.runner.RunWith
|
||||
* @see org.springframework.test.context.ContextConfiguration
|
||||
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
|
||||
* @see org.springframework.data.gemfire.ExportSnapshotApplicationEvent
|
||||
* @see org.springframework.data.gemfire.ImportSnapshotApplicationEvent
|
||||
* @see org.springframework.data.gemfire.SnapshotServiceFactoryBean
|
||||
* @see org.springframework.data.gemfire.snapshot.event.ExportSnapshotApplicationEvent
|
||||
* @see org.springframework.data.gemfire.snapshot.event.ImportSnapshotApplicationEvent
|
||||
* @see org.springframework.data.gemfire.snapshot.event.SnapshotApplicationEvent
|
||||
* @see org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean
|
||||
* @see org.springframework.data.gemfire.repository.sample.Person
|
||||
* @see com.gemstone.gemfire.cache.Region
|
||||
* @since 1.7.0
|
||||
@@ -103,7 +107,6 @@ public class SnapshotApplicationEventTriggeredImportsExportsIntegrationTest {
|
||||
@AfterClass
|
||||
public static void tearDownAfterClass() {
|
||||
FileSystemUtils.deleteRecursive(snapshotsDirectory.getParentFile());
|
||||
snapshotsDirectory = null;
|
||||
}
|
||||
|
||||
protected void assertPeople(Region<Long, Person> targetRegion, Person... people) {
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire;
|
||||
package org.springframework.data.gemfire.snapshot;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.springframework.data.gemfire.SnapshotServiceFactoryBean.SnapshotServiceAdapterSupport;
|
||||
import static org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.SnapshotServiceAdapterSupport;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
@@ -37,7 +37,7 @@ import org.springframework.data.gemfire.test.support.FileSystemUtils;
|
||||
*
|
||||
* @author John Blum
|
||||
* @see org.junit.Test
|
||||
* @see org.springframework.data.gemfire.SnapshotServiceFactoryBean.SnapshotServiceAdapterSupport
|
||||
* @see org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.SnapshotServiceAdapterSupport
|
||||
* @since 1.7.0
|
||||
*/
|
||||
public class SnapshotServiceFactoryBeanIntegrationTest {
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire;
|
||||
package org.springframework.data.gemfire.snapshot;
|
||||
|
||||
import static com.gemstone.gemfire.cache.snapshot.SnapshotOptions.SnapshotFormat;
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
@@ -36,12 +36,12 @@ import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.data.gemfire.SnapshotServiceFactoryBean.ArchiveFileFilter;
|
||||
import static org.springframework.data.gemfire.SnapshotServiceFactoryBean.CacheSnapshotServiceAdapter;
|
||||
import static org.springframework.data.gemfire.SnapshotServiceFactoryBean.RegionSnapshotServiceAdapter;
|
||||
import static org.springframework.data.gemfire.SnapshotServiceFactoryBean.SnapshotMetadata;
|
||||
import static org.springframework.data.gemfire.SnapshotServiceFactoryBean.SnapshotServiceAdapter;
|
||||
import static org.springframework.data.gemfire.SnapshotServiceFactoryBean.SnapshotServiceAdapterSupport;
|
||||
import static org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.ArchiveFileFilter;
|
||||
import static org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.CacheSnapshotServiceAdapter;
|
||||
import static org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.RegionSnapshotServiceAdapter;
|
||||
import static org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.SnapshotMetadata;
|
||||
import static org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.SnapshotServiceAdapter;
|
||||
import static org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.SnapshotServiceAdapterSupport;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
@@ -56,6 +56,9 @@ import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.mockito.Matchers;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.data.gemfire.snapshot.event.ExportSnapshotApplicationEvent;
|
||||
import org.springframework.data.gemfire.snapshot.event.ImportSnapshotApplicationEvent;
|
||||
import org.springframework.data.gemfire.snapshot.event.SnapshotApplicationEvent;
|
||||
import org.springframework.data.gemfire.test.support.FileSystemUtils;
|
||||
|
||||
import com.gemstone.gemfire.cache.Cache;
|
||||
@@ -73,7 +76,7 @@ import com.gemstone.gemfire.cache.snapshot.SnapshotOptions;
|
||||
* @see org.junit.Rule
|
||||
* @see org.junit.Test
|
||||
* @see org.mockito.Mockito
|
||||
* @see org.springframework.data.gemfire.SnapshotServiceFactoryBean
|
||||
* @see org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean
|
||||
* @see com.gemstone.gemfire.cache.snapshot.CacheSnapshotService
|
||||
* @see com.gemstone.gemfire.cache.snapshot.RegionSnapshotService
|
||||
* @since 1.7.0
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire;
|
||||
package org.springframework.data.gemfire.snapshot;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
@@ -47,7 +47,7 @@ import com.gemstone.gemfire.cache.Region;
|
||||
* @see org.junit.Test
|
||||
* @see org.springframework.context.ConfigurableApplicationContext
|
||||
* @see org.springframework.context.support.ClassPathXmlApplicationContext
|
||||
* @see org.springframework.data.gemfire.SnapshotServiceFactoryBean
|
||||
* @see org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean
|
||||
* @see org.springframework.data.gemfire.repository.sample.Person
|
||||
* @see com.gemstone.gemfire.cache.Region
|
||||
* @since 1.7.0
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire;
|
||||
package org.springframework.data.gemfire.snapshot.event;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
@@ -26,7 +26,7 @@ import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.data.gemfire.SnapshotServiceFactoryBean.SnapshotMetadata;
|
||||
import static org.springframework.data.gemfire.snapshot.SnapshotServiceFactoryBean.SnapshotMetadata;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -47,7 +47,7 @@ import com.gemstone.gemfire.cache.snapshot.SnapshotOptions;
|
||||
* @see org.mockito.Mock
|
||||
* @see org.mockito.Mockito
|
||||
* @see org.mockito.runners.MockitoJUnitRunner
|
||||
* @see org.springframework.data.gemfire.SnapshotApplicationEvent
|
||||
* @see org.springframework.data.gemfire.snapshot.event.SnapshotApplicationEvent
|
||||
* @since 1.7.0
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire;
|
||||
package org.springframework.data.gemfire.snapshot.filter;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
@@ -26,12 +26,13 @@ import static org.junit.Assert.assertThat;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.data.gemfire.ComposableSnapshotFilter.Operator;
|
||||
import static org.springframework.data.gemfire.snapshot.filter.ComposableSnapshotFilter.Operator;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.gemfire.TestUtils;
|
||||
|
||||
import com.gemstone.gemfire.cache.snapshot.SnapshotFilter;
|
||||
|
||||
@@ -41,8 +42,9 @@ import com.gemstone.gemfire.cache.snapshot.SnapshotFilter;
|
||||
*
|
||||
* @author John Blum
|
||||
* @see org.junit.Test
|
||||
* @see org.springframework.data.gemfire.ComposableSnapshotFilter
|
||||
* @see org.springframework.data.gemfire.ComposableSnapshotFilter.Operator
|
||||
* @see org.mockito.Mockito
|
||||
* @see org.springframework.data.gemfire.snapshot.filter.ComposableSnapshotFilter
|
||||
* @see org.springframework.data.gemfire.snapshot.filter.ComposableSnapshotFilter.Operator
|
||||
* @see com.gemstone.gemfire.cache.snapshot.SnapshotFilter
|
||||
* @since 1.7.0
|
||||
*/
|
||||
Reference in New Issue
Block a user