001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: /*
043: * File CreatingPropertiesFileFromExplorer1.java
044: *
045: * This is autometed test for netBeans version 40.
046: *
047: * Created on 16. September 2002
048: *
049: */
050:
051: package org.netbeans.properties.jelly2tests.suites.creating_properties_file;
052:
053: import org.netbeans.jellytools.*;
054: import lib.PropertiesEditorTestCase;
055: import org.netbeans.jellytools.nodes.Node;
056:
057: import org.netbeans.jellytools.nodes.SourcePackagesNode;
058:
059: /**
060: *
061: * @author Petr Felenda - QA Engineer ( petr.felenda@sun.com )
062: */
063: public class CreatingPropertiesFileFromExplorer1 extends
064: PropertiesEditorTestCase {
065:
066: /*
067: * Definition of member variables and objects
068: */
069: final String FILE_NAME = "testFileExplorer1";
070: final String PACKAGE_PATH = "samples";
071:
072: /**
073: * Constructor - creates a new instance of CreatingPropertiesFileFromExplorer1
074: */
075: public CreatingPropertiesFileFromExplorer1() {
076: super ("testCreatingPropertiesFileFromExplorer1");
077: }
078:
079: /**
080: * This method contain body of test
081: * @return void
082: */
083: public void testCreatingPropertiesFileFromExplorer1() {
084:
085: // open project
086: openDefaultProject();
087:
088: /*
089: * 1st step of testcase
090: * In explorer create new properties file. Right click on any directory and
091: * select in appeared context menu New|Other|Properties File.
092: */
093: log(PACKAGE_PATH);
094: SourcePackagesNode spn = new SourcePackagesNode(
095: defaultProjectName);
096: Node node = new Node(spn, PACKAGE_PATH);
097:
098: node.select();
099: node.callPopup().pushMenuNoBlock(
100: "New" + menuSeparator + "Other...", menuSeparator);
101: NewFileWizardOperator newWizard = new NewFileWizardOperator();
102: newWizard.selectCategory(WIZARD_CATEGORY_FILE);
103: newWizard.selectFileType(WIZARD_FILE_TYPE);
104: newWizard.next();
105:
106: /*
107: * 2nd step of testcase
108: * Type name to appeared wizard.
109: */
110: NewFileNameLocationStepOperator nameStepOper = new NewFileNameLocationStepOperator();
111: nameStepOper.setObjectName(FILE_NAME);
112:
113: /*
114: * 3rd step of testcase
115: * Confirm wizard. Press Finish button.
116: */
117: newWizard.finish();
118:
119: /*
120: * Result
121: * Should be created new file in explorer and opened in editor.
122: */
123: if (!existsFileInEditor(FILE_NAME))
124: fail("File " + FILE_NAME + " not found in Editor window");
125: if (!existsFileInExplorer("samples", FILE_NAME))
126: fail("File " + FILE_NAME + " not found in explorer");
127: }
128:
129: public void tearDown() {
130: log("Teardown");
131: closeFiles();
132: }
133:
134: }
|