1 19 20 package org.openide.filesystems; 21 22 import java.util.logging.Level ; 23 import org.netbeans.junit.Log; 24 import org.netbeans.junit.NbTestCase; 25 26 30 public class NoAWTTest extends NbTestCase { 31 32 public NoAWTTest(String testName) { 33 super(testName); 34 } 35 36 protected void setUp() throws Exception { 37 } 38 39 protected void tearDown() throws Exception { 40 } 41 42 protected Level logLevel() { 43 return Level.ALL; 44 } 45 46 public void testInitializeFileUtil() throws Exception { 47 CharSequence awt = Log.enable("", Level.ALL); 48 49 Class <?> fu = FileUtil.class; 50 Class.forName(fu.getName(), true, getClass().getClassLoader()); 51 52 if (awt.toString().toLowerCase().indexOf("awt") >= 0) { 53 fail("Do not even try to access AWT when initializing anything in filesystems:\n" + awt); 54 } 55 } 56 } 57 | Popular Tags |