Search in sources :

Example 11 with ExampleClass

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

the class ClassByExtensionBenchmarkTest method testByteBuddyWithProxiesClassCreationCachedWithTypePool.

@Test
public void testByteBuddyWithProxiesClassCreationCachedWithTypePool() throws Exception {
    ExampleClass instance = classByExtensionBenchmark.benchmarkByteBuddyWithProxyAndReusedDelegatorWithTypePool();
    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 12 with ExampleClass

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

the class ClassByExtensionBenchmarkTest method testByteBuddyWithAccessorClassCreation.

@Test
public void testByteBuddyWithAccessorClassCreation() throws Exception {
    ExampleClass instance = classByExtensionBenchmark.benchmarkByteBuddyWithAccessor();
    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 13 with ExampleClass

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

the class ClassByExtensionBenchmarkTest method testByteBuddyWithAccessorClassCreationCached.

@Test
public void testByteBuddyWithAccessorClassCreationCached() throws Exception {
    ExampleClass instance = classByExtensionBenchmark.benchmarkByteBuddyWithAccessorAndReusedDelegator();
    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 14 with ExampleClass

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

the class ClassByExtensionBenchmarkTest method testByteBuddyWithPrefixClassCreation.

@Test
public void testByteBuddyWithPrefixClassCreation() throws Exception {
    ExampleClass instance = classByExtensionBenchmark.benchmarkByteBuddyWithPrefix();
    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 15 with ExampleClass

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

the class ClassByExtensionBenchmarkTest method testByteBuddyWithAccessorClassCreationWithTypePool.

@Test
public void testByteBuddyWithAccessorClassCreationWithTypePool() throws Exception {
    ExampleClass instance = classByExtensionBenchmark.benchmarkByteBuddyWithAccessorWithTypePool();
    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)

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