ThriftUtils { public static String generateMethodArgsClassName( String serviceName, String methodName ) { int index = serviceName.lastIndexOf( "." ); if ( index > 0 ) { return new StringBuilder( 32 ) .append( serviceName.substring( 0, index + 1 ) ) .append( "$__" ) .append( serviceName.substring( index + 1 ) ) .append( "Stub$" ) .append( methodName ) .append( "_args" ) .toString(); } else { return new StringBuffer( 32 ) .append( "$__" ) .append( serviceName ) .append( "Stub$" ) .append( methodName ) .append( "_args" ) .toString(); } }  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 testGenerateMethodArgsClassName() { Assert.assertEquals( $__DemoStub.echoString_args.class.getName(), ThriftUtils.generateMethodArgsClassName( com.alibaba.dubbo.rpc.gen.dubbo.Demo.class.getName(), "echoString" ) ); Assert.assertEquals( $__DemoStub.echoString_args.class.getName(), ExtensionLoader.getExtensionLoader(ClassNameGenerator.class) .getExtension( DubboClassNameGenerator.NAME ).generateArgsClassName( com.alibaba.dubbo.rpc.gen.dubbo.Demo.class.getName(), "echoString" ) ); }