|
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.java.gui.copypaste; import java.util.ArrayList; import java.util.Arrays; import junit.textui.TestRunner; import org.netbeans.jellytools.Bundle; import org.netbeans.jellytools.NbDialogOperator; import org.netbeans.jellytools.nodes.FolderNode; import org.netbeans.jemmy.EventTool; import org.netbeans.junit.NbTestSuite; public class PackageNodeTest extends CopyTestCase { private static String[] CHILDREN = { "goldenfiles", "Test", "Test2", }; /** Need to be defined because of JUnit */ public PackageNodeTest(String name) { super(name); } public static NbTestSuite suite() { NbTestSuite suite = new NbTestSuite(); suite.addTest(new PackageNodeTest("testCopyPaste")); return suite; } /** Use for execution inside IDE */ public static void main(java.lang.String[] args) { TestRunner.run(suite()); } public void testCopyPaste() { FolderNode srcNode = new FolderNode(testFSName + "|" + DATA_PACKAGE.replace('.', '|')); srcNode.copy(); FolderNode dstNode = new FolderNode(testFSName + "|" + SRC_PACKAGE.replace('.', '|')); dstNode.select(); dstNode.pasteCopy(); waitFilesParsed(); new EventTool().waitNoEvent(3*DELAY); new FolderNode(testFSName + "|" + SRC_PACKAGE.replace('.', '|') + "|data|goldenfiles"); FolderNode todel = new FolderNode(testFSName + "|" + SRC_PACKAGE.replace('.', '|') + "|data"); String[] result = todel.getChildren(); assertTrue("Expected " + Arrays.asList(CHILDREN).toString() + " , but found " + Arrays.asList(removeBackupFiles(result)).toString(), Arrays.equals(removeBackupFiles(result), CHILDREN)); todel.delete(); new NbDialogOperator(Bundle.getString("org.openide.explorer.Bundle", "MSG_ConfirmDeleteObjectTitle")).yes(); } private Object[] removeBackupFiles(String[] s) { ArrayList result = new ArrayList(); for (int 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.