@@ -0,0 +1,863 @@
+package org.objenesis.instantiator.basic;%0A%0Aimport org.junit.Test;%0A%0Aimport java.io.InputStream;%0Aimport java.util.Arrays;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * @author Henri Tremblay%0A */%0Apublic class ClassDefinitionUtilsTest %7B%0A%0A   @Test%0A   public void testDefineClass() throws Exception %7B%0A      String className = %22org.objenesis.EmptyClass%22;%0A      byte%5B%5D b = readClass();%0A      Class%3C?%3E c = ClassDefinitionUtils.defineClass(className, b, getClass().getClassLoader());%0A      assertEquals(c.getName(), className);%0A   %7D%0A%0A   private byte%5B%5D readClass() throws Exception %7B%0A      byte%5B%5D b = new byte%5B1000%5D;%0A      int length;%0A      InputStream in = getClass().getResourceAsStream(%22/org/objenesis/EmptyClass.class%22);%0A      try %7B%0A         length = in.read(b);%0A      %7D%0A      finally %7B%0A         in.close();%0A      %7D%0A      return Arrays.copyOf(b, length);%0A   %7D%0A%7D%0A

Test ClassDefinitionUtils