diff --git a/src/test/java/org/springframework/data/gemfire/IndexConflictsIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/IndexConflictsIntegrationTest.java index 8327f1ea..26f1c26f 100644 --- a/src/test/java/org/springframework/data/gemfire/IndexConflictsIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/IndexConflictsIntegrationTest.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire; import static org.assertj.core.api.Assertions.assertThat; @@ -22,14 +21,16 @@ import static org.springframework.data.gemfire.util.CollectionUtils.nullSafeColl import java.util.Properties; import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + import org.apache.geode.cache.GemFireCache; import org.apache.geode.cache.query.Index; import org.apache.geode.cache.query.IndexExistsException; import org.apache.geode.cache.query.IndexNameConflictException; import org.apache.geode.cache.query.QueryService; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; + import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -271,7 +272,7 @@ public class IndexConflictsIntegrationTest { gemfireProperties.setProperty("name", IndexConflictsIntegrationTest.class.getSimpleName()); gemfireProperties.setProperty("mcast-port", "0"); - gemfireProperties.setProperty("log-level", "warning"); + gemfireProperties.setProperty("log-level", "error"); return gemfireProperties; } diff --git a/src/test/java/org/springframework/data/gemfire/support/GemfirePersistenceExceptionTranslationTest.java b/src/test/java/org/springframework/data/gemfire/support/GemfirePersistenceExceptionTranslationTest.java index 0151eb94..8f996deb 100644 --- a/src/test/java/org/springframework/data/gemfire/support/GemfirePersistenceExceptionTranslationTest.java +++ b/src/test/java/org/springframework/data/gemfire/support/GemfirePersistenceExceptionTranslationTest.java @@ -19,54 +19,53 @@ import static org.junit.Assert.fail; import java.util.Map; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.apache.geode.cache.query.FunctionDomainException; import org.apache.geode.cache.query.QueryException; import org.apache.geode.cache.query.QueryInvocationTargetException; -import org.junit.Test; -import org.junit.runner.RunWith; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.context.ApplicationContext; import org.springframework.data.gemfire.GemfireQueryException; import org.springframework.stereotype.Repository; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; -@RunWith(SpringJUnit4ClassRunner.class) +@RunWith(SpringRunner.class) @ContextConfiguration public class GemfirePersistenceExceptionTranslationTest { - @Autowired - GemFireRepo1 gemfireRepo1; + @Autowired ApplicationContext ctx; + @Autowired + GemFireRepo1 gemfireRepo1; + @Test public void test() { + Map bpps = ctx.getBeansOfType(BeanPostProcessor.class); - System.out.println(bpps.size()); - for (BeanPostProcessor bpp: bpps.values()) { - System.out.println(bpp.getClass().getSimpleName()); - } + try { gemfireRepo1.doit(new QueryException()); fail("should throw a query exception"); - } catch (GemfireQueryException e){ - } + catch (GemfireQueryException ignore) { } try { gemfireRepo1.doit(new FunctionDomainException("test")); fail("should throw a query exception"); - } catch (GemfireQueryException e) { - } + catch (GemfireQueryException ignore) { } try { gemfireRepo1.doit(new QueryInvocationTargetException("test")); fail("should throw a query exception"); - } catch (GemfireQueryException e) { - } + catch (GemfireQueryException ignore) { } } /** diff --git a/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTest.java index bbab8d3b..898ee1a8 100644 --- a/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTest.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire.wan; import static org.junit.Assert.assertEquals; @@ -26,15 +25,17 @@ import java.util.List; import javax.annotation.Resource; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.apache.geode.cache.asyncqueue.AsyncEvent; import org.apache.geode.cache.asyncqueue.AsyncEventListener; import org.apache.geode.cache.asyncqueue.AsyncEventQueue; import org.apache.geode.cache.wan.GatewaySender; -import org.junit.Test; -import org.junit.runner.RunWith; + import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -51,7 +52,7 @@ import org.springframework.util.StringUtils; * @see org.apache.geode.cache.asyncqueue.AsyncEventQueue * @since 1.0.0 */ -@RunWith(SpringJUnit4ClassRunner.class) +@RunWith(SpringRunner.class) @ContextConfiguration(value = "asyncEventQueueWithListener.xml", initializers = GemfireTestApplicationContextInitializer.class) @SuppressWarnings("unused") public class AsyncEventQueueWithListenerIntegrationTest { @@ -67,6 +68,7 @@ public class AsyncEventQueueWithListenerIntegrationTest { @Test public void testAsyncEventQueueOneAndListenerConfiguration() { + assertNotNull(queueOne); assertEquals("QueueOne", queueOne.getId()); assertFalse(queueOne.isPersistent()); @@ -78,6 +80,7 @@ public class AsyncEventQueueWithListenerIntegrationTest { } @Test public void testAsyncEventQueueTwoAndListenerConfiguration() { + assertNotNull(queueTwo); assertEquals("QueueTwo", queueTwo.getId()); assertFalse(queueTwo.isPersistent()); @@ -90,6 +93,7 @@ public class AsyncEventQueueWithListenerIntegrationTest { @Test public void testAsyncEventQueueThreeAndListenerConfiguration() { + assertNotNull(queueThree); assertEquals("QueueThree", queueThree.getId()); assertFalse(queueThree.isPersistent()); @@ -161,5 +165,4 @@ public class AsyncEventQueueWithListenerIntegrationTest { } } - }