|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Nokia. Portions Copyright 2003 Nokia. * All Rights Reserved. */ package org.netbeans.modules.enode; import javax.swing.Action; import junit.textui.TestRunner; import org.netbeans.junit.NbTestCase; import org.netbeans.junit.NbTestSuite; import org.openide.ErrorManager; import org.openide.filesystems.FileObject; import org.openide.filesystems.Repository; import org.openide.filesystems.FileSystem; import org.openide.modules.ModuleInfo; import org.openide.nodes.Node; import org.openide.util.Lookup; import org.netbeans.api.enode.ExtensibleNode; /** * This class should test the setting icons in the * ExtensibleNode. * @author David Strupl */ public class ExtensibleIconsTest extends NbTestCase { /** root folder FileObject */ private FileObject root; public ExtensibleIconsTest(String name) { super(name); } public static void main(String[] args) { TestRunner.run(new NbTestSuite(ExtensibleIconsTest.class)); } /** * Sets up the testing environment by creating testing folders * on the system file system. */ protected void setUp () throws Exception { Lookup.getDefault().lookup(ModuleInfo.class); FileSystem dfs = Repository.getDefault().getDefaultFileSystem(); String baseFolder = ExtensibleNode.E_NODE_ICONS.substring(1, ExtensibleNode.E_NODE_ICONS.length()-1); root = dfs.findResource(baseFolder); if (root == null) { String s1 = baseFolder.substring(0, baseFolder.lastIndexOf('/')); FileObject f1 = dfs.findResource(s1); if (f1 == null) { f1 = dfs.getRoot().createFolder(s1); } root = f1.createFolder(baseFolder.substring(baseFolder.lastIndexOf('/')+1)); } } /** * Deletes the folders created in method setUp(). */ protected void tearDown() throws Exception { root.getParent().delete(); } /** * This test verifies that the code in ExtensibleNode calls method * |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.