1 19 package org.netbeans.jmi.javamodel.getters; 20 21 import junit.textui.TestRunner; 22 import org.netbeans.jmi.javamodel.codegen.Utility; 23 import org.netbeans.junit.NbTestCase; 24 import org.netbeans.junit.NbTestSuite; 25 import org.netbeans.jmi.javamodel.*; 26 27 31 public class AnnTypeRetentionTest extends NbTestCase { 32 33 AnnotationType clazz; 34 JavaModelPackage pkg; 35 Attribute[] attribute; 36 37 38 public AnnTypeRetentionTest() { 39 super("AnnTypeRetentionTest"); 40 } 41 42 public static NbTestSuite suite() { 43 NbTestSuite suite = new NbTestSuite(AnnTypeRetentionTest.class); 44 return suite; 45 } 46 47 protected void setUp() { 48 clazz = (AnnotationType) Utility.findClass("java.lang.annotation.Retention"); 49 pkg = (JavaModelPackage) clazz.refImmediatePackage(); 50 } 51 52 public void testGetContents() { 53 Attribute attr = (Attribute) clazz.getContents().iterator().next(); 54 assertEquals("Retention annotation was not correctly created in model", "value", attr.getName()); 55 } 56 57 60 public static void main(String [] args) { 61 TestRunner.run(suite()); 62 } 63 64 } 65 66 67 | Popular Tags |