1 19 20 25 26 package org.netbeans.test.java.generating.SourceElem; 27 28 import org.netbeans.test.java.Common; 29 import java.lang.reflect.Modifier ; 30 import org.netbeans.api.java.source.JavaSource; 31 import org.netbeans.junit.*; 32 import org.openide.filesystems.FileObject; 33 34 55 56 57 public class SourceElem extends org.netbeans.test.java.XRunner { 58 59 public static void main(java.lang.String [] args) { 60 junit.textui.TestRunner.run(suite()); 61 } 62 63 public SourceElem() { 64 super(""); 65 } 66 67 public SourceElem(java.lang.String testName) { 68 super(testName); 69 } 70 71 public static NbTest suite() { 72 return new NbTestSuite(SourceElem.class); 73 } 74 75 82 public boolean go(Object o, java.io.PrintWriter log) throws Exception { 83 84 boolean passed = true; 86 FileObject fo = (FileObject) o; 87 JavaSource js = JavaSource.forFileObject(fo); 88 Common.addImport(js, "java.awt.image.RGBImageFilter", false); 89 Common.addImport(js, "javax.swing.event.HyperlinkEvent", false); 90 Common.addImport(js, "java.awt.Color.BLACK", true); 91 Common.setPackage(js, "newpack"); 92 Common.addTopLevelClass(js); 93 return passed; 94 } 95 96 98 protected void setUp() { 99 super.setUp(); 100 name = "JavaTestSourceSourceElem"; 101 packageName = "org.netbeans.test.java.testsources"; 102 } 103 104 } 105 | Popular Tags |