ThriftUtils { public static String generateMethodResultClassNameThrift( String serviceName, String methodName ) { int index = serviceName.indexOf( "$" ); if ( index > 0 ) { return new StringBuilder( 32 ) .append( serviceName.substring( 0, index + 1 ) ) .append( methodName ) .append( "_result" ) .toString(); } return null; }  static String generateMethodArgsClassName( String serviceName, String methodName ); static String generateMethodResultClassName( String serviceName, String method ); static String generateSetMethodName( String fieldName ); static String generateGetMethodName( String fieldName ); static String generateMethodArgsClassNameThrift( String serviceName, String methodName ); static String generateMethodResultClassNameThrift( String serviceName, String methodName );  }
@Test public void testGenerateMethodResultClassNameThrift() { Assert.assertEquals( com.alibaba.dubbo.rpc.gen.thrift.Demo.echoString_result.class.getName(), ThriftUtils.generateMethodResultClassNameThrift( com.alibaba.dubbo.rpc.gen.thrift.Demo.Iface.class.getName(), "echoString" ) ); Assert.assertEquals( com.alibaba.dubbo.rpc.gen.thrift.Demo.echoString_result.class.getName(), ExtensionLoader.getExtensionLoader( ClassNameGenerator.class ) .getExtension( ThriftClassNameGenerator.NAME ).generateResultClassName( com.alibaba.dubbo.rpc.gen.thrift.Demo.Iface.class.getName(), "echoString" ) ); }