1717package org .apache .dubbo .rpc .protocol .tri ;
1818
1919import org .apache .dubbo .common .URL ;
20+ import org .apache .dubbo .common .extension .ExtensionLoader ;
2021import org .apache .dubbo .common .stream .StreamObserver ;
2122import org .apache .dubbo .common .utils .ClassUtils ;
2223import org .apache .dubbo .common .utils .NetUtils ;
3334import org .apache .dubbo .rpc .protocol .tri .support .IGreeter ;
3435import org .apache .dubbo .rpc .protocol .tri .support .IGreeterImpl ;
3536import org .apache .dubbo .rpc .protocol .tri .support .MockStreamObserver ;
37+ import org .apache .dubbo .rpc .service .EchoService ;
3638
3739import java .util .concurrent .TimeUnit ;
3840
3941import org .junit .jupiter .api .Assertions ;
4042import org .junit .jupiter .api .Test ;
4143
4244import static org .apache .dubbo .rpc .protocol .tri .support .IGreeter .SERVER_MSG ;
45+ import static org .junit .jupiter .api .Assertions .assertEquals ;
4346
4447class TripleProtocolTest {
4548
@@ -65,7 +68,8 @@ void testDemoProtocol() throws Exception {
6568 serviceRepository .registerProvider (providerModel );
6669 providerUrl = providerUrl .setServiceModel (providerModel );
6770
68- Protocol protocol = new TripleProtocol (providerUrl .getOrDefaultFrameworkModel ());
71+ Protocol protocol = ExtensionLoader .getExtensionLoader (Protocol .class ).getExtension ("tri" );
72+
6973 ProxyFactory proxy =
7074 applicationModel .getExtensionLoader (ProxyFactory .class ).getAdaptiveExtension ();
7175 Invoker <IGreeter > invoker = proxy .getInvoker (serviceImpl , IGreeter .class , providerUrl );
@@ -107,6 +111,11 @@ void testDemoProtocol() throws Exception {
107111 Assertions .assertEquals (REQUEST_MSG , serverOutboundMessageSubscriber .getOnNextData ());
108112 Assertions .assertTrue (serverOutboundMessageSubscriber .isOnCompleted ());
109113
114+ EchoService echo = proxy .getProxy (protocol .refer (EchoService .class , consumerUrl ));
115+ assertEquals (echo .$echo ("test" ), "test" );
116+ assertEquals (echo .$echo ("abcdefg" ), "abcdefg" );
117+ assertEquals (echo .$echo (1234 ), 1234 );
118+
110119 export .unexport ();
111120 protocol .destroy ();
112121 // resource recycle.
0 commit comments