|
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 Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.test.debugger.basic; import org.openide.TopManager; import org.openide.filesystems.FileObject; import org.openide.filesystems.Repository; import org.openide.loaders.DataObject; import org.openide.loaders.DataFolder; /** * Tests on presence of actions. * * @author Jan Stola */ public class ActionsPresenceTestCase extends org.netbeans.junit.NbTestCase { private static final String FOLDER_PROJECT="Project"; private static final String ACTION_DEBUG_PROJECT="org-netbeans-modules-projects-actions-DebugProjectAction"; private static final String FOLDER_DEBUG="Debug"; private static final String ACTION_ADD_BREAKPOINT="org-netbeans-modules-debugger-support-actions-AddBreakpointAction"; private static final String ACTION_ATTACH="org-netbeans-modules-debugger-support-actions-ConnectAction"; private static final String ACTION_DEBUGGER_WINDOW="org-netbeans-modules-debugger-support-actions-DebuggerWindowAction"; private static final String ACTION_PAUSE="org-netbeans-modules-debugger-support-actions-PauseAction"; private static final String ACTION_ADD_WATCH="org-netbeans-modules-debugger-support-actions-AddWatchAction"; private static final String ACTION_FINISH="org-netbeans-modules-debugger-support-actions-FinishAction"; private static final String ACTION_CONTINUE="org-netbeans-modules-debugger-support-actions-ContinueAction"; private static final String ACTION_RUN_TO_CURSOR="org-netbeans-modules-debugger-support-actions-RunToCursorAction"; private static final String ACTION_START="org-netbeans-modules-debugger-support-actions-StartAction"; private static final String ACTION_STEP_OUT="org-netbeans-modules-debugger-support-actions-StepOutAction"; private static final String ACTION_TOGGLE_BREAKPOINT="org-netbeans-modules-debugger-support-actions-ToggleBreakpointAction"; private static final String ACTION_STEP_INTO="org-netbeans-modules-debugger-support-actions-StepIntoAction"; private static final String ACTION_STEP_OVER="org-netbeans-modules-debugger-support-actions-StepOverAction"; private static final String ACTION_GO_TO_CALLED="org-netbeans-modules-debugger-support-actions-GoToCalledMethodAction"; private static final String ACTION_GO_TO_CALLING="org-netbeans-modules-debugger-support-actions-GoToCallingMethodAction"; public ActionsPresenceTestCase(String name) { super(name); } public void testProjectFolder() { getFolder(FOLDER_PROJECT); } public void testDebugProject() { getAction(getFolder(FOLDER_PROJECT), ACTION_DEBUG_PROJECT); } public void testDebugFolder() { getFolder(FOLDER_DEBUG); } public void testAddBreakpoint() { getAction(getFolder(FOLDER_DEBUG), ACTION_ADD_BREAKPOINT); } public void testAttach() { getAction(getFolder(FOLDER_DEBUG), ACTION_ATTACH); } public void testDebuggerWindow() { getAction(getFolder(FOLDER_DEBUG), ACTION_DEBUGGER_WINDOW); } public void testPause() { getAction(getFolder(FOLDER_DEBUG), ACTION_PAUSE); } public void testAddWatch() { getAction(getFolder(FOLDER_DEBUG), ACTION_ADD_WATCH); } public void testFinish() { getAction(getFolder(FOLDER_DEBUG), ACTION_FINISH); } public void testContinue() { getAction(getFolder(FOLDER_DEBUG), ACTION_CONTINUE); } public void testRunToCursor() { getAction(getFolder(FOLDER_DEBUG), ACTION_RUN_TO_CURSOR); } public void testStart() { getAction(getFolder(FOLDER_DEBUG), ACTION_START); } public void testStepOut() { getAction(getFolder(FOLDER_DEBUG), ACTION_STEP_OUT); } public void testToggleBreakpoint() { getAction(getFolder(FOLDER_DEBUG), ACTION_TOGGLE_BREAKPOINT); } public void testStepInto() { getAction(getFolder(FOLDER_DEBUG), ACTION_STEP_INTO); } public void testStepOver() { getAction(getFolder(FOLDER_DEBUG), ACTION_STEP_OVER); } public void testGoToCalled() { getAction(getFolder(FOLDER_DEBUG), ACTION_GO_TO_CALLED); } public void testGoToCalling() { getAction(getFolder(FOLDER_DEBUG), ACTION_GO_TO_CALLING); } public FileObject getFolder(String folder) { int i; FileObject actionsFolder = Repository.getDefault().findResource("Actions"); FileObject[] actionsSubFolders = actionsFolder.getChildren(); for (i = 0; i < actionsSubFolders.length; i++) { if (folder.equals(actionsSubFolders[i].getName())) return actionsSubFolders[i]; } assertTrue(folder+" folder cannot be found.", false); return null; } public FileObject getAction(FileObject folder, String action) { int i; FileObject[] actionsList=folder.getChildren(); for (i=0; i |
... 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.