SGF-351 - Optimize the SDG test suite runtime with GemFire 8 now in the mix.
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.data.gemfire;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.After;
|
||||
@@ -36,10 +38,10 @@ import com.gemstone.gemfire.cache.Cache;
|
||||
* Made abstract to avoid multiple caches running at the same time.
|
||||
*
|
||||
* @author Costin Leau
|
||||
* @author John Blum
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations="/org/springframework/data/gemfire/basic-cache.xml",
|
||||
initializers=GemfireTestApplicationContextInitializer.class)
|
||||
@ContextConfiguration(locations = "basic-cache.xml", initializers = GemfireTestApplicationContextInitializer.class)
|
||||
public class CacheIntegrationTest {
|
||||
|
||||
@Autowired ApplicationContext ctx;
|
||||
@@ -54,15 +56,15 @@ public class CacheIntegrationTest {
|
||||
public void testCacheWithProps() throws Exception {
|
||||
cache = ctx.getBean("cache-with-props", Cache.class);
|
||||
// the name property seems to be ignored
|
||||
Assert.assertEquals("cache-with-props", cache.getDistributedSystem().getName());
|
||||
Assert.assertEquals("cache-with-props", cache.getName());
|
||||
assertEquals("cache-with-props", cache.getDistributedSystem().getName());
|
||||
assertEquals("cache-with-props", cache.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNamedCache() throws Exception {
|
||||
cache = ctx.getBean("named-cache", Cache.class);
|
||||
Assert.assertEquals("cache-with-props", cache.getDistributedSystem().getName());
|
||||
Assert.assertEquals("cache-with-props", cache.getName());
|
||||
assertEquals("named-cache", cache.getDistributedSystem().getName());
|
||||
assertEquals("named-cache", cache.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -74,4 +76,4 @@ public class CacheIntegrationTest {
|
||||
public void tearDown() {
|
||||
if (cache!=null) cache.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import com.gemstone.gemfire.cache.Region;
|
||||
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
|
||||
* @since 1.3.3
|
||||
*/
|
||||
@ContextConfiguration("/org/springframework/data/gemfire/colocated-region.xml")
|
||||
@ContextConfiguration("colocated-region.xml")
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ColocatedRegionIntegrationTest {
|
||||
|
||||
@@ -31,16 +31,19 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
*
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations="client-readyforevents-cache.xml",
|
||||
initializers=GemfireTestApplicationContextInitializer.class)
|
||||
@ContextConfiguration(locations = "client-cache-ready-for-events.xml",
|
||||
initializers = GemfireTestApplicationContextInitializer.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ClientReadyForEventsTest {
|
||||
|
||||
@Autowired ApplicationContext ctx;
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
@Test
|
||||
public void testReadyForEvents() throws Exception {
|
||||
ClientCacheFactoryBean cfb = (ClientCacheFactoryBean) ctx.getBean("&gemfireCache");
|
||||
Boolean readyforevents = (Boolean) TestUtils.readField("readyForEvents", cfb);
|
||||
assertTrue( readyforevents );
|
||||
ClientCacheFactoryBean clientCacheFactoryBean = context.getBean("&gemfireCache", ClientCacheFactoryBean.class);
|
||||
Boolean readyForEvents = TestUtils.readField("readyForEvents", clientCacheFactoryBean);
|
||||
assertTrue(readyForEvents);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,9 +58,9 @@ import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
|
||||
* @see com.gemstone.gemfire.cache.Region
|
||||
* @since 1.3.3
|
||||
*/
|
||||
@ContextConfiguration(locations = "/org/springframework/data/gemfire/client/clientcache-with-region-using-cache-loader-writer.xml",
|
||||
initializers = GemfireTestApplicationContextInitializer.class)
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = "clientcache-with-region-using-cache-loader-writer.xml",
|
||||
initializers = GemfireTestApplicationContextInitializer.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class ClientRegionWithCacheLoaderWriterTest {
|
||||
|
||||
|
||||
@@ -46,8 +46,8 @@ import com.gemstone.gemfire.cache.client.ClientCache;
|
||||
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
|
||||
* @since 1.4.0
|
||||
*/
|
||||
@ContextConfiguration("clientcache-with-subregion-config.xml")
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration("clientcache-with-subregion-config.xml")
|
||||
@SuppressWarnings("unused")
|
||||
public class ClientSubRegionTest {
|
||||
|
||||
|
||||
@@ -43,9 +43,8 @@ import com.gemstone.gemfire.pdx.PdxSerializer;
|
||||
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
|
||||
* @since 1.3.3
|
||||
*/
|
||||
@ContextConfiguration(locations = "/org/springframework/data/gemfire/config/cache-using-pdx-ns.xml",
|
||||
initializers = GemfireTestApplicationContextInitializer.class)
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = "cache-using-pdx-ns.xml", initializers = GemfireTestApplicationContextInitializer.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class CacheUsingPdxNamespaceTest {
|
||||
|
||||
|
||||
@@ -32,11 +32,13 @@ import com.gemstone.gemfire.cache.execute.FunctionService;
|
||||
/**
|
||||
* @author Costin Leau
|
||||
* @author David Turanski
|
||||
* @author John Blum
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations="/org/springframework/data/gemfire/config/function-service-ns.xml",
|
||||
initializers=GemfireTestApplicationContextInitializer.class)
|
||||
@ContextConfiguration(locations="function-service-ns.xml", initializers=GemfireTestApplicationContextInitializer.class)
|
||||
@SuppressWarnings("unused")
|
||||
public class FunctionServiceNamespaceTest {
|
||||
|
||||
@Test
|
||||
public void testFunctionsRegistered() throws Exception {
|
||||
assertEquals(2, FunctionService.getRegisteredFunctions().size());
|
||||
@@ -49,8 +51,6 @@ public class FunctionServiceNamespaceTest {
|
||||
|
||||
@Override
|
||||
public void execute(FunctionContext arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,8 +65,6 @@ public class FunctionServiceNamespaceTest {
|
||||
|
||||
@Override
|
||||
public void execute(FunctionContext arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,4 +73,5 @@ public class FunctionServiceNamespaceTest {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ public class DefaultGemfireEntityInformationTest {
|
||||
assertEquals("Algorithms", entityInfo.getRegionName());
|
||||
assertTrue(Algorithm.class.isAssignableFrom(entityInfo.getJavaType()));
|
||||
assertEquals(String.class, entityInfo.getIdType());
|
||||
assertEquals("QuickSort", entityInfo.getId(new QuickSort()));
|
||||
assertEquals("Quick Sort", entityInfo.getId(createAlgorithm("Quick Sort")));
|
||||
}
|
||||
|
||||
@@ -157,4 +158,12 @@ public class DefaultGemfireEntityInformationTest {
|
||||
}
|
||||
}
|
||||
|
||||
protected static class QuickSort implements Algorithm {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,8 +43,8 @@ import com.gemstone.gemfire.cache.Region;
|
||||
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
|
||||
* @since 1.4.0
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration
|
||||
@SuppressWarnings("unused")
|
||||
public class AlgorithmRepositoryTest {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user