|
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 complete.common;
import java.io.*;
import junit.framework.*;
import org.netbeans.junit.*;
import org.netbeans.jemmy.JemmyProperties;
import org.netbeans.jemmy.util.PNGEncoder;
import org.openide.util.Utilities;
import org.netbeans.jellytools.*;
import org.netbeans.jellytools.nodes.Node;
import org.netbeans.jellytools.actions.*;
import org.netbeans.jellytools.properties.*;
import org.netbeans.jellytools.modules.vcsgeneric.wizard.*;
/** XTest / JUnit test class performing check of all settings of filesystems mounted
* using Generic VCS module.
* @author Jiri Kovalsky
* @version 1.0
*/
public class FilesystemSettings extends JellyTestCase {
public static String VERSIONING_MENU = "Versioning";
public static String MOUNT_MENU = VERSIONING_MENU + "|Mount Version Control|Generic VCS";
public static String UNMOUNT_MENU = "File|Unmount Filesystem";
/** Constructor required by JUnit.
* @param testName Method name to be used as testcase.
*/
public FilesystemSettings(String testName) {
super(testName);
}
/** Method used for explicit test suite definition. This suite contains following test cases:
* testUnmount, testPopupMenu, testRuntimeTab and testFindService.
* @return GenericVCSAvailabilityTest test suite.
*/
public static junit.framework.Test suite() {
TestSuite suite = new NbTestSuite();
suite.addTest(new FilesystemSettings("testAnnotationPattern"));
suite.addTest(new FilesystemSettings("testCommandNotification"));
suite.addTest(new FilesystemSettings("testProcessAllFiles"));
suite.addTest(new FilesystemSettings("testIgnoredFiles"));
suite.addTest(new FilesystemSettings("testBackupProperties"));
suite.addTest(new FilesystemSettings("testRefreshTime"));
suite.addTest(new FilesystemSettings("testHideShadowFiles"));
return suite;
}
/** Use for internal test execution inside IDE.
* @param args Command line arguments.
*/
public static void main(java.lang.String[] args) {
junit.textui.TestRunner.run(suite());
}
/** Mounts new filesystem using given profile.
* @param profile Profile that should be used in wizard.
* @throws Any unexpected exception thrown during test.
*/
private void mountFilesystem(String profile, String workingDirectory) throws Exception {
new ActionNoBlock(MOUNT_MENU, null).perform();
VCSWizardProfile wizard = new VCSWizardProfile();
wizard.setWorkingDirectory(workingDirectory);
// wizard.checkOnlyCompatibleProfiles(false);
wizard.setProfile(profile);
Thread.sleep(1000);
wizard.finish();
}
/** Creates new file or directory at given place.
* @param name Name of directory or file to create.
* @param isFile Should file be created or directory ?
* @throws Any unexpected exception thrown during test.
*/
public void createFile(String name, boolean isFile) throws Exception {
if (isFile) {
BufferedWriter writer = new BufferedWriter(new FileWriter(name));
writer.write("/** This is testing file.\n */\n\n public class Testing_File {\n }\n");
writer.flush();
writer.close();
}
else new File(name).mkdirs();
}
/** Returns all of node's children as one String devided with commas.
* @param node The node whose children should be returned in one String.
* @return Collection of all children of given node.
*/
private String getChildren(Node node) {
String[] children = node.getChildren();
String output = " [";
int count = children.length;
for(int i=0; i |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 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.