forked from sofastack/sofa-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
66 changed files
with
322 additions
and
157 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
package com.alipay.sofa.rpc.proxy.javassist; | ||
|
||
import com.alipay.sofa.rpc.core.request.SofaRequest; | ||
import com.alipay.sofa.rpc.log.Logger; | ||
import com.alipay.sofa.rpc.log.LoggerFactory; | ||
import com.alipay.sofa.rpc.proxy.AbstractTestClass; | ||
import com.alipay.sofa.rpc.proxy.TestInterface; | ||
import com.alipay.sofa.rpc.proxy.TestInvoker; | ||
|
@@ -32,14 +34,17 @@ | |
* @author <a href="mailto:[email protected]">GengZhang</a> | ||
*/ | ||
public class JavassistProxyTest { | ||
|
||
private final static Logger LOGGER = LoggerFactory.getLogger(JavassistProxyTest.class); | ||
|
||
@Test | ||
public void getProxy() throws Exception { | ||
JavassistProxy proxy = new JavassistProxy(); | ||
AbstractTestClass testClass = null; | ||
try { | ||
testClass = proxy.getProxy(AbstractTestClass.class, new TestInvoker()); | ||
} catch (Exception e) { | ||
System.out.println(e.getMessage()); | ||
LOGGER.info(e.getMessage()); | ||
} | ||
Assert.assertNull(testClass); | ||
|
||
|
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 |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
package com.alipay.sofa.rpc.proxy.jdk; | ||
|
||
import com.alipay.sofa.rpc.core.request.SofaRequest; | ||
import com.alipay.sofa.rpc.log.Logger; | ||
import com.alipay.sofa.rpc.log.LoggerFactory; | ||
import com.alipay.sofa.rpc.proxy.AbstractTestClass; | ||
import com.alipay.sofa.rpc.proxy.TestInterface; | ||
import com.alipay.sofa.rpc.proxy.TestInvoker; | ||
|
@@ -32,14 +34,17 @@ | |
* @author <a href="mailto:[email protected]">GengZhang</a> | ||
*/ | ||
public class JDKProxyTest { | ||
|
||
private final static Logger LOGGER = LoggerFactory.getLogger(JDKProxyTest.class); | ||
|
||
@Test | ||
public void getProxy() throws Exception { | ||
JDKProxy proxy = new JDKProxy(); | ||
AbstractTestClass testClass = null; | ||
try { | ||
testClass = proxy.getProxy(AbstractTestClass.class, new TestInvoker()); | ||
} catch (Exception e) { | ||
System.out.println(e.getMessage()); | ||
LOGGER.info(e.getMessage()); | ||
} | ||
Assert.assertNull(testClass); | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
@@ -28,6 +30,9 @@ | |
* @author <a href="mailto:[email protected]">GengZhang</a> | ||
*/ | ||
public class CodecUtilsTest { | ||
|
||
private final Logger LOGGER = LoggerFactory.getLogger(CodecUtilsTest.class); | ||
|
||
@Test | ||
public void intToBytes() { | ||
int i = 1000; | ||
|
@@ -236,9 +241,9 @@ public void flatCopyTo() { | |
Assert.assertTrue(header.size() == 15); | ||
|
||
for (Map.Entry<String, String> entry : header.entrySet()) { | ||
System.out.println(entry.getKey() + " : " + entry.getValue()); | ||
LOGGER.info(entry.getKey() + " : " + entry.getValue()); | ||
} | ||
System.out.println(""); | ||
LOGGER.info(""); | ||
|
||
Map<String, Object> newRequestProps = new HashMap<String, Object>(); | ||
|
||
|
@@ -257,7 +262,7 @@ public void flatCopyTo() { | |
newRequestProps.put(rpcRespBaggage, newContext); | ||
|
||
for (Map.Entry<String, Object> entry : newRequestProps.entrySet()) { | ||
System.out.println(entry.getKey() + " : " + entry.getValue()); | ||
LOGGER.info(entry.getKey() + " : " + entry.getValue()); | ||
} | ||
|
||
newRequestProps.putAll(header); | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,19 @@ | |
*/ | ||
package com.alipay.sofa.rpc.common.utils; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* | ||
* | ||
* @author <a href=mailto:[email protected]>GengZhang</a> | ||
*/ | ||
public class TestClass2 { | ||
|
||
private final Logger LOGGER = LoggerFactory.getLogger(CodecUtilsTest.class); | ||
|
||
private TestClass2() { | ||
System.out.println("init TestClass2 "); | ||
LOGGER.info("init TestClass2 "); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -16,17 +16,23 @@ | |
*/ | ||
package com.alipay.sofa.rpc.common.utils; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* | ||
* | ||
* @author <a href=mailto:[email protected]>GengZhang</a> | ||
*/ | ||
public class TestClass3 { | ||
private String name; | ||
private int age; | ||
|
||
private final Logger LOGGER = LoggerFactory.getLogger(TestClass3.class); | ||
|
||
private String name; | ||
private int age; | ||
|
||
private TestClass3(String s, int n) { | ||
System.out.println("init TestClass3 "); | ||
LOGGER.info("init TestClass3 "); | ||
this.name = s; | ||
this.age = n; | ||
} | ||
|
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | ||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"> | ||
|
||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> | ||
<layout class="org.apache.log4j.PatternLayout"> | ||
<param name="ConversionPattern" value="%d %t %5p [%c:%M:%L] - %m%n"/> | ||
</layout> | ||
</appender> | ||
|
||
<root> | ||
<level value="INFO"/> | ||
<appender-ref ref="CONSOLE"/> | ||
</root> | ||
|
||
</log4j:configuration> |
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
Oops, something went wrong.