use of net.bytebuddy.benchmark.specimen.ExampleInterface in project byte-buddy by raphw.
the class ClassByImplementationBenchmarkTest method testJavassistClassCreation.
@Test
public void testJavassistClassCreation() throws Exception {
ExampleInterface instance = classByImplementationBenchmark.benchmarkJavassist();
assertThat(Arrays.asList(instance.getClass().getInterfaces()), hasItem(ClassByImplementationBenchmark.BASE_CLASS));
assertThat(instance.getClass().getSuperclass(), CoreMatchers.<Class<?>>is(Object.class));
assertThat(classByImplementationBenchmark.benchmarkJavassist().getClass(), not(CoreMatchers.<Class<?>>is(instance.getClass())));
assertReturnValues(instance);
}
use of net.bytebuddy.benchmark.specimen.ExampleInterface in project byte-buddy by raphw.
the class ClassByImplementationBenchmarkTest method testBaseline.
@Test
public void testBaseline() throws Exception {
ExampleInterface instance = classByImplementationBenchmark.baseline();
assertThat(Arrays.asList(instance.getClass().getInterfaces()), hasItem(ClassByImplementationBenchmark.BASE_CLASS));
assertThat(instance.getClass().getSuperclass(), CoreMatchers.<Class<?>>is(Object.class));
assertThat(classByImplementationBenchmark.benchmarkByteBuddy().getClass(), not(CoreMatchers.<Class<?>>is(instance.getClass())));
assertReturnValues(instance);
}
use of net.bytebuddy.benchmark.specimen.ExampleInterface in project byte-buddy by raphw.
the class ClassByImplementationBenchmarkTest method testCglibClassCreation.
@Test
public void testCglibClassCreation() throws Exception {
ExampleInterface instance = classByImplementationBenchmark.benchmarkCglib();
assertThat(Arrays.asList(instance.getClass().getInterfaces()), hasItem(ClassByImplementationBenchmark.BASE_CLASS));
assertThat(instance.getClass().getSuperclass(), CoreMatchers.<Class<?>>is(Object.class));
assertThat(classByImplementationBenchmark.benchmarkCglib().getClass(), not(CoreMatchers.<Class<?>>is(instance.getClass())));
assertReturnValues(instance);
}
Aggregations