Annotate tests with Spring Test's @DirtiesContext.
This commit is contained in:
@@ -34,6 +34,7 @@ import org.springframework.data.gemfire.config.annotation.EnableCachingDefinedRe
|
|||||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||||
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
|
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
|
||||||
import org.springframework.data.gemfire.util.RegionUtils;
|
import org.springframework.data.gemfire.util.RegionUtils;
|
||||||
|
import org.springframework.test.annotation.DirtiesContext;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
import example.app.books.NonBeanType;
|
import example.app.books.NonBeanType;
|
||||||
@@ -53,9 +54,11 @@ import example.app.books.service.support.CachingBookService;
|
|||||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||||
* @see org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects
|
* @see org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects
|
||||||
* @see org.springframework.geode.boot.autoconfigure.CachingProviderAutoConfiguration
|
* @see org.springframework.geode.boot.autoconfigure.CachingProviderAutoConfiguration
|
||||||
|
* @see org.springframework.test.annotation.DirtiesContext
|
||||||
* @see org.springframework.test.context.junit4.SpringRunner
|
* @see org.springframework.test.context.junit4.SpringRunner
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
@DirtiesContext
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ import example.app.books.model.ISBN;
|
|||||||
* (server(s)) are secure (i.e. when both Authentication and TLS/SSL are enabled).
|
* (server(s)) are secure (i.e. when both Authentication and TLS/SSL are enabled).
|
||||||
*
|
*
|
||||||
* @author John Blum
|
* @author John Blum
|
||||||
|
* @see java.security.KeyStore
|
||||||
* @see org.junit.Test
|
* @see org.junit.Test
|
||||||
* @see org.apache.geode.cache.GemFireCache
|
* @see org.apache.geode.cache.GemFireCache
|
||||||
* @see org.apache.geode.cache.Region
|
* @see org.apache.geode.cache.Region
|
||||||
@@ -86,10 +87,11 @@ import example.app.books.model.ISBN;
|
|||||||
* @see org.springframework.boot.test.context.SpringBootTest
|
* @see org.springframework.boot.test.context.SpringBootTest
|
||||||
* @see org.springframework.context.annotation.Bean
|
* @see org.springframework.context.annotation.Bean
|
||||||
* @see org.springframework.context.annotation.Profile
|
* @see org.springframework.context.annotation.Profile
|
||||||
|
* @see org.springframework.core.env.Environment
|
||||||
|
* @see org.springframework.core.env.Profiles
|
||||||
* @see org.springframework.data.gemfire.GemfireTemplate
|
* @see org.springframework.data.gemfire.GemfireTemplate
|
||||||
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
|
|
||||||
* @see org.springframework.data.gemfire.config.annotation.EnableManager
|
|
||||||
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
|
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
|
||||||
|
* @see org.springframework.geode.config.annotation.ClusterAwareConfiguration
|
||||||
* @see org.springframework.geode.config.annotation.EnableClusterAware
|
* @see org.springframework.geode.config.annotation.EnableClusterAware
|
||||||
* @see org.springframework.geode.security.TestSecurityManager
|
* @see org.springframework.geode.security.TestSecurityManager
|
||||||
* @see org.springframework.test.annotation.DirtiesContext
|
* @see org.springframework.test.annotation.DirtiesContext
|
||||||
@@ -117,9 +119,9 @@ public class SecureClusterAwareConfigurationIntegrationTests extends ForkingClie
|
|||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void startGeodeServer() throws IOException {
|
public static void startGeodeServer() throws IOException {
|
||||||
//startGemFireServer(TestGeodeServerConfiguration.class,
|
startGemFireServer(TestGeodeServerConfiguration.class,
|
||||||
// "-Dspring.profiles.active=cluster-aware-with-secure-server,ssl",
|
"-Dspring.profiles.active=cluster-aware-with-secure-server,ssl",
|
||||||
// "-Dapache-geode.logback.log.level=INFO");
|
"-Dapache-geode.logback.log.level=INFO");
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass @AfterClass
|
@BeforeClass @AfterClass
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedReg
|
|||||||
import org.springframework.data.gemfire.config.annotation.EnableManager;
|
import org.springframework.data.gemfire.config.annotation.EnableManager;
|
||||||
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
|
||||||
import org.springframework.geode.security.TestSecurityManager;
|
import org.springframework.geode.security.TestSecurityManager;
|
||||||
import org.springframework.geode.util.GeodeConstants;
|
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.http.client.ClientHttpRequest;
|
import org.springframework.http.client.ClientHttpRequest;
|
||||||
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||||
@@ -67,18 +66,22 @@ import example.app.books.model.ISBN;
|
|||||||
* server is configured with Security (Authentication).
|
* server is configured with Security (Authentication).
|
||||||
*
|
*
|
||||||
* @author John Blum
|
* @author John Blum
|
||||||
* @see java.io.File
|
|
||||||
* @see java.net.URI
|
* @see java.net.URI
|
||||||
* @see org.junit.Test
|
* @see org.junit.Test
|
||||||
* @see org.apache.geode.cache.GemFireCache
|
* @see org.apache.geode.cache.GemFireCache
|
||||||
* @see org.apache.geode.cache.Region
|
* @see org.apache.geode.cache.Region
|
||||||
|
* @see org.springframework.boot.ApplicationRunner
|
||||||
* @see org.springframework.boot.autoconfigure.SpringBootApplication
|
* @see org.springframework.boot.autoconfigure.SpringBootApplication
|
||||||
* @see org.springframework.boot.builder.SpringApplicationBuilder
|
* @see org.springframework.boot.builder.SpringApplicationBuilder
|
||||||
* @see org.springframework.boot.test.context.SpringBootTest
|
* @see org.springframework.boot.test.context.SpringBootTest
|
||||||
* @see org.springframework.context.annotation.Bean
|
* @see org.springframework.context.annotation.Bean
|
||||||
* @see org.springframework.context.annotation.Profile
|
* @see org.springframework.context.annotation.Profile
|
||||||
|
* @see org.springframework.data.gemfire.GemfireTemplate
|
||||||
* @see org.springframework.data.gemfire.config.annotation.EnableClusterConfiguration
|
* @see org.springframework.data.gemfire.config.annotation.EnableClusterConfiguration
|
||||||
|
* @see org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions
|
||||||
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
|
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
|
||||||
|
* @see org.springframework.geode.security.TestSecurityManager
|
||||||
|
* @see org.springframework.test.annotation.DirtiesContext
|
||||||
* @see org.springframework.test.context.ActiveProfiles
|
* @see org.springframework.test.context.ActiveProfiles
|
||||||
* @see org.springframework.test.context.junit4.SpringRunner
|
* @see org.springframework.test.context.junit4.SpringRunner
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
@@ -180,8 +183,6 @@ public class ClusterConfigurationWithAuthenticationIntegrationTests extends Fork
|
|||||||
@EnableManager(start = true)
|
@EnableManager(start = true)
|
||||||
static class GeodeServerConfiguration {
|
static class GeodeServerConfiguration {
|
||||||
|
|
||||||
private static final String GEODE_HOME_PROPERTY = GeodeConstants.GEMFIRE_PROPERTY_PREFIX + "home";
|
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
|
|
||||||
new SpringApplicationBuilder(GeodeServerConfiguration.class)
|
new SpringApplicationBuilder(GeodeServerConfiguration.class)
|
||||||
|
|||||||
@@ -68,9 +68,6 @@ import example.app.books.model.ISBN;
|
|||||||
* @see org.springframework.context.annotation.Bean
|
* @see org.springframework.context.annotation.Bean
|
||||||
* @see org.springframework.context.annotation.Profile
|
* @see org.springframework.context.annotation.Profile
|
||||||
* @see org.springframework.data.gemfire.GemfireTemplate
|
* @see org.springframework.data.gemfire.GemfireTemplate
|
||||||
* @see org.springframework.data.gemfire.LocalRegionFactoryBean
|
|
||||||
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
|
|
||||||
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
|
|
||||||
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
|
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
|
||||||
* @see org.springframework.geode.boot.autoconfigure.DataImportExportAutoConfiguration
|
* @see org.springframework.geode.boot.autoconfigure.DataImportExportAutoConfiguration
|
||||||
* @see org.springframework.test.annotation.DirtiesContext
|
* @see org.springframework.test.annotation.DirtiesContext
|
||||||
|
|||||||
Reference in New Issue
Block a user