Search in sources :

Example 16 with ExampleClass

use of net.bytebuddy.benchmark.specimen.ExampleClass in project byte-buddy by raphw.

the class ClassByExtensionBenchmarkTest method testByteBuddyWithAccessorClassCreationCachedWithTypePool.

@Test
public void testByteBuddyWithAccessorClassCreationCachedWithTypePool() throws Exception {
    ExampleClass instance = classByExtensionBenchmark.benchmarkByteBuddyWithAccessorAndReusedDelegatorWithTypePool();
    assertThat(instance.getClass(), not(CoreMatchers.<Class<?>>is(ClassByExtensionBenchmark.BASE_CLASS)));
    assertThat(instance.getClass().getSuperclass(), CoreMatchers.<Class<?>>is(ClassByExtensionBenchmark.BASE_CLASS));
    assertThat(classByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClass(), not(CoreMatchers.<Class<?>>is(instance.getClass())));
    assertReturnValues(instance);
}
Also used : ExampleClass(net.bytebuddy.benchmark.specimen.ExampleClass) ExampleClass(net.bytebuddy.benchmark.specimen.ExampleClass) Test(org.junit.Test)

Example 17 with ExampleClass

use of net.bytebuddy.benchmark.specimen.ExampleClass in project byte-buddy by raphw.

the class ClassByExtensionBenchmarkTest method testJavassistClassCreation.

@Test
public void testJavassistClassCreation() throws Exception {
    ExampleClass instance = classByExtensionBenchmark.benchmarkJavassist();
    assertThat(instance.getClass(), not(CoreMatchers.<Class<?>>is(ClassByExtensionBenchmark.BASE_CLASS)));
    assertThat(instance.getClass().getSuperclass(), CoreMatchers.<Class<?>>is(ClassByExtensionBenchmark.BASE_CLASS));
    assertThat(classByExtensionBenchmark.benchmarkJavassist().getClass(), not(CoreMatchers.<Class<?>>is(instance.getClass())));
    assertReturnValues(instance);
}
Also used : ExampleClass(net.bytebuddy.benchmark.specimen.ExampleClass) ExampleClass(net.bytebuddy.benchmark.specimen.ExampleClass) Test(org.junit.Test)

Aggregations

ExampleClass (net.bytebuddy.benchmark.specimen.ExampleClass)17 Test (org.junit.Test)16 Method (java.lang.reflect.Method)1 MethodFilter (javassist.util.proxy.MethodFilter)1 MethodHandler (javassist.util.proxy.MethodHandler)1 ProxyFactory (javassist.util.proxy.ProxyFactory)1