ralf0131 closed pull request #1507: Mirror improvement for test cases in 
dubbo-rpc-api module
URL: https://github.com/apache/incubator-dubbo/pull/1507
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/filter/tps/StatItemTest.java
 
b/dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/filter/tps/StatItemTest.java
index d2b5065cff..c211af12c7 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/filter/tps/StatItemTest.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/filter/tps/StatItemTest.java
@@ -19,8 +19,8 @@
 import org.junit.After;
 import org.junit.Test;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 public class StatItemTest {
 
diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/support/RpcUtilsTest.java
 
b/dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/support/RpcUtilsTest.java
index bc80cf2a89..ec355e7fbe 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/support/RpcUtilsTest.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/support/RpcUtilsTest.java
@@ -21,12 +21,16 @@
 import com.alibaba.dubbo.rpc.Invocation;
 import com.alibaba.dubbo.rpc.RpcInvocation;
 
-import junit.framework.Assert;
 import org.junit.Test;
 
 import java.util.HashMap;
 import java.util.Map;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+
 public class RpcUtilsTest {
 
     /**
@@ -43,9 +47,9 @@ public void testAttachInvocationIdIfAsync_normal() {
         long id1 = RpcUtils.getInvocationId(inv);
         RpcUtils.attachInvocationIdIfAsync(url, inv);
         long id2 = RpcUtils.getInvocationId(inv);
-        Assert.assertTrue(id1 == id2); // verify if it's idempotent
-        Assert.assertTrue(id1 >= 0);
-        Assert.assertEquals("bb", attachments.get("aa"));
+        assertTrue(id1 == id2); // verify if it's idempotent
+        assertTrue(id1 >= 0);
+        assertEquals("bb", attachments.get("aa"));
     }
 
     /**
@@ -57,7 +61,7 @@ public void testAttachInvocationIdIfAsync_sync() {
         URL url = URL.valueOf("dubbo://localhost/");
         Invocation inv = new RpcInvocation("test", new Class[]{}, new 
String[]{});
         RpcUtils.attachInvocationIdIfAsync(url, inv);
-        Assert.assertNull(RpcUtils.getInvocationId(inv));
+        assertNull(RpcUtils.getInvocationId(inv));
     }
 
     /**
@@ -69,7 +73,7 @@ public void testAttachInvocationIdIfAsync_nullAttachments() {
         URL url = URL.valueOf("dubbo://localhost/?test.async=true");
         Invocation inv = new RpcInvocation("test", new Class[]{}, new 
String[]{});
         RpcUtils.attachInvocationIdIfAsync(url, inv);
-        Assert.assertTrue(RpcUtils.getInvocationId(inv) >= 0l);
+        assertTrue(RpcUtils.getInvocationId(inv) >= 0l);
     }
 
     /**
@@ -81,7 +85,7 @@ public void testAttachInvocationIdIfAsync_forceNotAttache() {
         URL url = URL.valueOf("dubbo://localhost/?test.async=true&" + 
Constants.AUTO_ATTACH_INVOCATIONID_KEY + "=false");
         Invocation inv = new RpcInvocation("test", new Class[]{}, new 
String[]{});
         RpcUtils.attachInvocationIdIfAsync(url, inv);
-        Assert.assertNull(RpcUtils.getInvocationId(inv));
+        assertNull(RpcUtils.getInvocationId(inv));
     }
 
     /**
@@ -93,6 +97,6 @@ public void testAttachInvocationIdIfAsync_forceAttache() {
         URL url = URL.valueOf("dubbo://localhost/?" + 
Constants.AUTO_ATTACH_INVOCATIONID_KEY + "=true");
         Invocation inv = new RpcInvocation("test", new Class[]{}, new 
String[]{});
         RpcUtils.attachInvocationIdIfAsync(url, inv);
-        Assert.assertNotNull(RpcUtils.getInvocationId(inv));
+        assertNotNull(RpcUtils.getInvocationId(inv));
     }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to