1 19 20 package org.netbeans.modules.java.source.parsing; 21 import com.sun.source.tree.CompilationUnitTree; 22 import com.sun.tools.javac.util.Context; 23 import java.io.File ; 24 import java.lang.ref.WeakReference ; 25 import java.net.URL ; 26 import java.util.Collections ; 27 import org.netbeans.api.java.classpath.ClassPath; 28 import org.netbeans.insane.scanner.ScannerUtils; 29 import org.netbeans.insane.scanner.SimpleXmlVisitor; 30 import org.netbeans.insane.scanner.Visitor; 31 import org.netbeans.junit.NbTestCase; 32 import org.netbeans.modules.java.source.TestUtil; 33 import org.netbeans.spi.java.classpath.support.ClassPathSupport; 34 import org.openide.filesystems.FileUtil; 35 39 public class PerfJavacIntefaceGCTest extends NbTestCase { 40 41 private File workDir; 42 private File rtJar; 43 private ClassPath bootPath; 44 private ClassPath classPath; 45 private final String SOURCE = 46 "package some;" + 47 "import javax.swing.JTable;" + 48 "import javax.swing.JLabel;" + 49 "public class MemoryFile<K,V> extends JTable {" + 50 " public java.util.Map.Entry<K,V> entry;" + 51 " public JLabel label;" + 52 " public JTable table = new JTable();" + 53 " public MemoryFile() {}" + 54 "}"; 55 56 public PerfJavacIntefaceGCTest(String testName) { 57 super(testName); 58 } 59 60 protected void setUp() throws Exception { 61 workDir = TestUtil.createWorkFolder(); 62 TestUtil.copyFiles( workDir, TestUtil.RT_JAR, "jdk/JTable.java" ); 63 rtJar = new File ( workDir, TestUtil.RT_JAR ); 64 URL url = FileUtil.getArchiveRoot (rtJar.toURI().toURL()); 65 this.bootPath = ClassPathSupport.createClassPath (new URL [] {url}); 66 this.classPath = ClassPathSupport.createClassPath(new URL [0]); 67 } 68 69 protected void tearDown() throws Exception { 70 TestUtil.removeWorkFolder( workDir ); 71 } 72 73 133 } 134 | Popular Tags |