You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by al...@apache.org on 2022/10/19 09:29:31 UTC
[dubbo-samples] branch master updated: feat: fix generic exception (#535)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push:
new 09dc583a feat: fix generic exception (#535)
09dc583a is described below
commit 09dc583a9c3a7a267b3155448438e41e790b6356
Author: aamingaa <49...@users.noreply.github.com>
AuthorDate: Wed Oct 19 17:29:24 2022 +0800
feat: fix generic exception (#535)
* feat: fix generic exception
* feat: change expect exception
* feat: change expect exception v2
---
.../test/java/org/apache/dubbo/sample/tri/TriGenericTest.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dubbo-samples-triple/src/test/java/org/apache/dubbo/sample/tri/TriGenericTest.java b/dubbo-samples-triple/src/test/java/org/apache/dubbo/sample/tri/TriGenericTest.java
index d6070e0e..71061227 100644
--- a/dubbo-samples-triple/src/test/java/org/apache/dubbo/sample/tri/TriGenericTest.java
+++ b/dubbo-samples-triple/src/test/java/org/apache/dubbo/sample/tri/TriGenericTest.java
@@ -1,5 +1,6 @@
package org.apache.dubbo.sample.tri;
+import com.alibaba.dubbo.rpc.service.GenericException;
import org.apache.dubbo.common.Version;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.config.ApplicationConfig;
@@ -7,7 +8,6 @@ import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.rpc.RpcException;
-import org.apache.dubbo.rpc.service.GenericException;
import org.apache.dubbo.rpc.service.GenericService;
import org.apache.dubbo.sample.tri.api.PojoGreeter;
@@ -71,18 +71,19 @@ public class TriGenericTest {
@Test
public void greetException() {
- boolean isSupportSelfDefineException = Version.getVersion().compareTo("3.2.0") < 0;
+ boolean isSupportSelfDefineException = Version.getVersion().compareTo("3.2.0") >= 0;
try {
generic.$invoke("greetException", new String[]{String.class.getName()},
new Object[]{"exception"});
Assert.fail();
} catch (RpcException e) {
- Assert.assertEquals(isSupportSelfDefineException, true);
- } catch (IllegalStateException e) {
Assert.assertEquals(isSupportSelfDefineException, false);
+ } catch (GenericException e) {
+ Assert.assertEquals(isSupportSelfDefineException, true);
}
}
+
@Test(expected = RpcException.class)
public void notFoundMethod() {
generic.$invoke("greetNotExist", new String[]{String.class.getName()},
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org