geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [1/3] incubator-geode git commit: Update to use DUnitTestRule
Date Tue, 25 Aug 2015 23:17:46 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-217 921ce90df -> 89c0b4376


Update to use DUnitTestRule


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b932d8b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b932d8b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b932d8b8

Branch: refs/heads/feature/GEODE-217
Commit: b932d8b8d5fcc8ba4822fdac9ceace19b1c06d8d
Parents: 921ce90
Author: Kirk Lund <klund@pivotal.io>
Authored: Tue Aug 25 09:49:28 2015 -0700
Committer: Kirk Lund <klund@pivotal.io>
Committed: Tue Aug 25 09:49:28 2015 -0700

----------------------------------------------------------------------
 .../CatchExceptionExampleDUnitTest.java         | 23 +++++++++++---------
 1 file changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b932d8b8/gemfire-core/src/test/java/com/gemstone/gemfire/test/catchexception/CatchExceptionExampleDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/test/catchexception/CatchExceptionExampleDUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/test/catchexception/CatchExceptionExampleDUnitTest.java
index 845c46d..f85018c 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/test/catchexception/CatchExceptionExampleDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/test/catchexception/CatchExceptionExampleDUnitTest.java
@@ -1,13 +1,15 @@
 package com.gemstone.gemfire.test.catchexception;
 
 import static com.googlecode.catchexception.CatchException.*;
-import static com.googlecode.catchexception.apis.BDDCatchException.when;
-import static org.assertj.core.api.BDDAssertions.*;
+import static org.assertj.core.api.Assertions.*;
 
+import java.io.Serializable;
+
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
+import com.gemstone.gemfire.test.dunit.DUnitTestRule;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.RMIException;
 import com.gemstone.gemfire.test.dunit.SerializableCallable;
@@ -19,26 +21,28 @@ import com.gemstone.gemfire.test.junit.categories.DistributedTest;
  * about root cause of RMIExceptions in DUnit tests.
  */
 @Category(DistributedTest.class)
-public class CatchExceptionExampleDUnitTest extends DistributedTestCase {
-  private static final long serialVersionUID = 1L;
+@SuppressWarnings("serial")
+public class CatchExceptionExampleDUnitTest implements Serializable {
 
   private static final String REMOTE_THROW_EXCEPTION_MESSAGE = "Throwing remoteThrowException";
 
+  @Rule
+  public final DUnitTestRule dunitTestRule = new DUnitTestRule();
+  
   @Test
   public void testRemoteInvocationWithException() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
 
-    when(vm).invoke(new ThrowBasicTestException());
+    catchException(vm).invoke(new ThrowBasicTestException());
 
-    then(caughtException())
+    assertThat(caughtException())
         .isInstanceOf(RMIException.class)
         .hasCause(new BasicTestException(REMOTE_THROW_EXCEPTION_MESSAGE));
   }
   
   protected static class ThrowBasicTestException extends SerializableCallable<Object>
{
-    private static final long serialVersionUID = 1L;
-    
+
     @Override
     public Object call() throws Exception {
       throw new BasicTestException(REMOTE_THROW_EXCEPTION_MESSAGE);
@@ -46,7 +50,6 @@ public class CatchExceptionExampleDUnitTest extends DistributedTestCase
{
   }
   
   protected static class BasicTestException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
 
     public BasicTestException() {
       super();


Mime
View raw message