1 19 20 package org.netbeans.modules.enode; 21 22 import javax.swing.Action ; 23 24 import junit.textui.TestRunner; 25 26 import org.netbeans.junit.NbTestCase; 27 import org.netbeans.junit.NbTestSuite; 28 29 import org.openide.ErrorManager; 30 import org.openide.modules.ModuleInfo; 31 import org.openide.nodes.Node; 32 import org.openide.util.Lookup; 33 34 import org.netbeans.api.enode.ExtensibleNode; 35 import org.netbeans.api.registry.*; 36 37 42 public class ExtensibleIconsTest extends NbTestCase { 43 44 private Context root; 45 46 public ExtensibleIconsTest(String name) { 47 super(name); 48 } 49 50 51 public static void main(String [] args) { 52 TestRunner.run(new NbTestSuite(ExtensibleIconsTest.class)); 53 } 54 55 59 protected void setUp () throws Exception { 60 Lookup.getDefault().lookup(ModuleInfo.class); 61 String baseFolder = ExtensibleNode.E_NODE_ICONS.substring(1, ExtensibleNode.E_NODE_ICONS.length()-1); 62 root = Context.getDefault().createSubcontext(baseFolder); 63 } 64 65 68 protected void tearDown() throws Exception { 69 } 70 71 73 public void test1() throws Exception { 74 ExtensibleNode en1 = new ExtensibleNode("a/b/c", true); 75 java.lang.reflect.Method getIconManagerMethod = ExtensibleNode.class.getDeclaredMethod("getIconManager", new Class [0]); 76 getIconManagerMethod.setAccessible(true); 77 Object iconMan = getIconManagerMethod.invoke(en1, new Object [0]); 78 79 Context b = root.createSubcontext("a/b"); 80 Context c = root.createSubcontext("a/b/c"); 81 82 84 root.destroySubcontext("a"); 85 } 86 } 87 | Popular Tags |