|
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. */ /* * File AddPropertyToLocaleFileFromExplorer2.java * * Created on 19. brezen 2002, 11:07 * * Description : * * This is autometed test for netBenas34 version. Test has been * writed in Jelly2 ( see testtools.netbeans.org ) * */ package org.netbeans.properties.jelly2tests.suites.customizing_properties_file; import java.io.File; import org.netbeans.jellytools.JellyTestCase; import org.netbeans.jellytools.nodes.FilesystemNode; import org.netbeans.jemmy.EventTool; import org.netbeans.junit.NbTestSuite; import org.netbeans.properties.jelly2tests.operators.PropertiesEditorOperator; /** * * @author Petr Felenda - QA Engineer ( petr.felenda@sun.com ) */ public class AddPropertyToLocaleFileFromExplorer2 extends JellyTestCase { /* * Definition of member variables and objects */ private final String FILE_NAME = "AddPropertyToLocaleFileFromExplorer2"; private final String KEY = "key1"; private final String VALUE = "value1"; private final String COMMENT = "Comment of key1"; /* * Main method for starting test from IDE. * There must be mounted necessary jars in Filesystems ( in Explorer Window ) * - jemmy.jar * - jelly2-nb.jar * both jars have been downloaded from http://jellytools.netbeans.org * @param String[] args - arguments are not processed */ public static void main(String[] args) throws NumberFormatException { NbTestSuite nbTestSuite = new NbTestSuite(); int count = 1; if ( args.length != 0 ) count = Integer.parseInt(args[0]); for ( int ii = 1; ii <= count; ii++ ) nbTestSuite.addTest(new AddPropertyToLocaleFileFromExplorer2()); junit.textui.TestRunner.run(nbTestSuite); } /* * This static constructor have been using for starting this test from JUnit framework */ public static NbTestSuite suite() { NbTestSuite suite = new NbTestSuite(); suite.addTest(new AddPropertyToLocaleFileFromExplorer2()); return suite; } /** * Constructor - Creates new instance of this class */ public AddPropertyToLocaleFileFromExplorer2() { super("testAddPropertyToLocaleFileFromExplorer2"); } /** * This method contains body of test * @return void */ public void testAddPropertyToLocaleFileFromExplorer2() { // Print test description to the Output window System.out.println(); System.out.println("==================================================================================="); System.out.println("= Test : Add property to locale file from Explorer 2 ="); System.out.println("= See testspec of properties module on web : ="); System.out.println("= http://properties.netbeans.org/qa/testspecs/nb34/PropertiesTestSpec.html ="); System.out.println("==================================================================================="); /* * Prepare to test: * Create new properties file and open it in Editor. */ FilesystemNode filesystemNode = new FilesystemNode( System.getProperty( "xtest.workdir") + File.separator + "tmpdir"); PropertiesEditorOperator propertiesEditorOperator = new PropertiesEditorOperator(); propertiesEditorOperator.createNewPropertiesFile(filesystemNode, this.FILE_NAME); try { /* * 1st step of testcase * Open context menu of default locale file. (In explorer right click to 'default' locale file.) */ // joined with step 2 /* * 2nd step of testcase * Select 'Add property' from context menu. */ propertiesEditorOperator.openAddPropertyDialogFromExplorer(filesystemNode, this.FILE_NAME.concat("|Default")); /* * 3th step of testcase * Open help. Use for this action 'Help' button in appeared dialog. * (Dialog 'Add property'.) */ propertiesEditorOperator.newPropertyDialogClickHelpButton(); new EventTool().waitNoEvent(4000); propertiesEditorOperator.closeHelp(); /* * 4th step of testcase * Fill to dialog all values and confirm it. (Click to the 'Ok' button.) */ propertiesEditorOperator.newPropertyDialogFill(this.FILE_NAME, this.KEY, this.VALUE, this.COMMENT); propertiesEditorOperator.newPropertyDialogClickOkButtonNoBlock(); /* * Result * Dialog disappeared and changes will be made correctly in properties file. * Help should diasappeared with dialog 'Add property' at the same time. */ propertiesEditorOperator.checkPropertiesInSheet(this.FILE_NAME, this.KEY, this.VALUE, this.COMMENT,1,1,1); propertiesEditorOperator.openExistedPropetiesFileInClassicEditor(filesystemNode, this.FILE_NAME); propertiesEditorOperator.checkPropertiesFileIntegrityInClassicEditor(this.FILE_NAME); } catch (Exception ex) { fail(ex); } finally { /* * Clean up */ propertiesEditorOperator.deletePropertiesFileFromExplorer(filesystemNode, this.FILE_NAME); } } } |
... 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.