1 19 package org.netbeans.jmi.javamodel.getters; 20 21 import java.util.LinkedList ; 22 import junit.textui.TestRunner; 23 import org.netbeans.jmi.javamodel.codegen.Utility; 24 import org.netbeans.junit.NbTestCase; 25 import org.netbeans.jmi.javamodel.JavaClass; 26 import org.netbeans.jmi.javamodel.JavaModelPackage; 27 import org.netbeans.jmi.javamodel.Method; 28 import org.netbeans.junit.NbTestSuite; 29 import org.netbeans.modules.javacore.internalapi.JavaMetamodel; 30 31 32 35 public class SuperClassTest extends NbTestCase { 36 37 JavaClass clazz; 38 JavaModelPackage pkg; 39 JavaMetamodel model; 40 41 public SuperClassTest() { 42 super("SuperClassTest"); 43 } 44 45 public static NbTestSuite suite() { 46 NbTestSuite suite = new NbTestSuite(SuperClassTest.class); 47 return suite; 48 } 49 50 protected void setUp() { 51 clazz = (JavaClass) Utility.findClass("org.netbeans.test.getters.SecondClass"); 52 pkg = (JavaModelPackage) clazz.refImmediatePackage(); 53 model = JavaMetamodel.getManager(); 54 } 55 56 public void test() { 57 boolean fail = true; 58 Utility.beginTrans(false); 59 try { 60 assertEquals("org.netbeans.test.getters.FirstClass", clazz.getSuperClass().getName()); 61 fail = false; 62 } 63 finally { 64 Utility.endTrans(fail); 65 } 66 } 67 68 69 public static void main(java.lang.String [] args) { 70 TestRunner.run(suite()); 71 } 72 } 73 | Popular Tags |