-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. fix dubbo 2.7.3 Generic bug apache/dubbo#4787 2. support implicit parameters. #85
- Loading branch information
Showing
4 changed files
with
129 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/test/java/io/github/ningyu/jmeter/plugin/GenericServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.github.ningyu.jmeter.plugin; | ||
|
||
import io.github.ningyu.jmeter.plugin.util.JsonUtils; | ||
import org.apache.dubbo.config.ApplicationConfig; | ||
import org.apache.dubbo.config.ReferenceConfig; | ||
import org.apache.dubbo.rpc.RpcContext; | ||
import org.apache.dubbo.rpc.service.GenericService; | ||
import org.junit.Test; | ||
|
||
public class GenericServiceTest { | ||
@Test | ||
public void test() { | ||
ApplicationConfig application = new ApplicationConfig(); | ||
application.setName("api-generic-consumer"); | ||
ReferenceConfig<GenericService> reference = new ReferenceConfig<>(); | ||
reference.setUrl("dubbo://192.168.56.1:20880/org.apache.dubbo.samples.basic.api.DemoService"); | ||
// reference.setVersion("1.0.0"); | ||
reference.setTimeout(2000); | ||
// reference.setGroup("test"); | ||
reference.setGeneric(true); | ||
reference.setApplication(application); | ||
reference.setInterface("com.jiuyescm.account.api.IUserService"); | ||
GenericService genericService = reference.get(); | ||
RpcContext.getContext().setAttachment("test.ningyu","this is attachmentValue"); | ||
// Object obj = genericService.$invoke("getUserById", new String[]{Long.class.getName()}, new Long[]{1L}); | ||
Object obj = genericService.$invoke("sayHello", new String[]{String.class.getName()}, new String[]{"ningyu"}); | ||
String json = JsonUtils.toJson(obj); | ||
System.out.println(json); | ||
} | ||
} |