1 30 package org.objectweb.asm; 31 32 import junit.framework.TestCase; 33 34 39 public class ClassWriterUnitTest extends TestCase { 40 41 public void testNewConst() { 42 ClassWriter cw = new ClassWriter(0); 43 cw.newConst(new Byte ((byte) 0)); 44 cw.newConst(new Character ('0')); 45 cw.newConst(new Short ((short) 0)); 46 cw.newConst(Boolean.FALSE); 47 cw.newField("A", "f", "I"); 48 cw.newMethod("A", "m", "()V", false); 49 } 50 51 public void testIllegalNewConstArgument() { 52 ClassWriter cw = new ClassWriter(0); 53 try { 54 cw.newConst(new Object ()); 55 fail(); 56 } catch (RuntimeException e) { 57 } 58 } 59 60 public void testIllegalGetCommonSuperClassArguments() { 61 ClassWriter cw = new ClassWriter(0); 62 try { 63 cw.getCommonSuperClass("-", "-"); 64 fail(); 65 } catch (RuntimeException e) { 66 } 67 } 68 } 69 | Popular Tags |