Browse Source

feat: KERNEL-10354 bytebuddy / 加解密性能优化 @Harrison

加入部分 bytebuddy 相关的单元测试,帮助理解 advice 相关的功能
feature/x
Harrison 3 years ago
parent
commit
091fc1ee64
  1. 12
      designer-base/src/test/java/com/fr/design/record/analyzer/BytebuddyRedefineTest.java

12
designer-base/src/test/java/com/fr/design/record/analyzer/BytebuddyRedefineTest.java

@ -5,6 +5,7 @@ import com.fr.third.net.bytebuddy.agent.ByteBuddyAgent;
import com.fr.third.net.bytebuddy.asm.Advice;
import com.fr.third.net.bytebuddy.dynamic.loading.ClassReloadingStrategy;
import com.fr.third.net.bytebuddy.matcher.ElementMatchers;
import org.junit.Assert;
import org.junit.Test;
/**
@ -31,7 +32,7 @@ public class BytebuddyRedefineTest {
TestClass testClass = new TestClass();
testClass.testPrint();
} catch (Throwable throwable) {
Assert.assertNotNull("expected throw exception", throwable);
}
}
@ -52,9 +53,9 @@ public class BytebuddyRedefineTest {
TestClass testClass = new TestClass();
String print = testClass.testPrint();
System.out.println(TestTransferValueAdvice.intField);
System.out.println(TestTransferValueAdvice.stringField);
System.out.println(TestTransferValueAdvice.objectField);
Assert.assertEquals(10, TestTransferValueAdvice.intField);
Assert.assertEquals("[test]stringField", TestTransferValueAdvice.stringField);
Assert.assertEquals("[test]objectField", TestTransferValueAdvice.objectField);
}
@ -75,7 +76,8 @@ public class BytebuddyRedefineTest {
TestClass testClass = new TestClass();
String print = testClass.testPrint();
System.out.println(print);
Assert.assertEquals("[test]Modify Return Value", print);
}
}
Loading…
Cancel
Save