1 19 20 package org.netbeans.core; 21 22 import java.util.logging.Level ; 23 import javax.swing.text.Keymap ; 24 import org.netbeans.core.startup.Main; 25 import org.netbeans.junit.Log; 26 import org.netbeans.junit.NbTestCase; 27 import org.openide.filesystems.FileObject; 28 import org.openide.filesystems.FileSystem; 29 import org.openide.filesystems.FileUtil; 30 import org.openide.filesystems.Repository; 31 import org.openide.util.Lookup; 32 33 public class ShortcutsFolder66845Test extends NbTestCase { 34 35 public ShortcutsFolder66845Test(String s) { 36 super(s); 37 } 38 39 private Keymap keymap; 40 private CharSequence logs; 41 42 protected void setUp() throws Exception { 43 Main.initializeURLFactory (); 44 keymap = Lookup.getDefault().lookup(Keymap .class); 45 assertNotNull("There is a keymap", keymap); 46 assertEquals("of correct type", NbKeymap.class, keymap.getClass()); 47 ShortcutsFolder.initShortcuts (); 48 logs = Log.enable(ShortcutsFolder.class.getName(), Level.WARNING); 49 } 50 51 public void testLogging() throws Exception { 52 final FileSystem fs = Repository.getDefault ().getDefaultFileSystem (); 53 final FileObject shortcuts = FileUtil.createData(fs.getRoot(), "Keymaps/NetBeans/org-nb-Neznam.instance"); 54 55 ShortcutsFolder.waitFinished (); 56 57 assertTrue("got message in " + logs, logs.toString().contains("Neznam")); 58 } 59 60 } 61 | Popular Tags |