Ignore:
Timestamp:
12/16/05 14:43:23 (19 years ago)
Author:
boris
Message:
  • fixed bug 1, the problem with disabled finish button in new class wizard on warnings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.test/src/org/modelica/mdt/test/TestNewClassWizard.java

    r235 r237  
    22 * This file is part of Modelica Development Tooling.
    33 *
    4  * Copyright (c) 2005, Linkpings universitet, Department of
     4 * Copyright (c) 2005, Link�pings universitet, Department of
    55 * Computer and Information Science, PELAB
    66 *
     
    2323 *   distribution.
    2424 *
    25  * * Neither the name of Linkpings universitet nor the names of its
     25 * * Neither the name of Link�pings universitet nor the names of its
    2626 *   contributors may be used to endorse or promote products derived from
    2727 *   this software without specific prior written permission.
     
    6969    private static final String PROJECT_NAME_1 =
    7070            TestNewClassWizard.class.getName() + "1";
     71   
     72    /* a project name that is garanteed to be nonexistent */
     73    private static final String NON_EXSITING_PROJECT_NAME =
     74        TestNewClassWizard.class.getName() + "non_existing_project";
     75
    7176    private StructuredSelection fileDestination;
    7277   
     
    172177   
    173178    /**
     179     * This test makes wizard to display a warning  and error messages
     180     * by entering invalid data into the fields.
     181     *
     182     * The test checks that the state of finish button is right,
     183     * it should be enabled for warnings and disabled for errors.
     184     *
     185     * Test for BUG #1, se bugs database
     186     */
     187    public void testFinishButtonState()
     188    {
     189        /*
     190         * open dialog and set a legal source folder and an illegal class name,
     191         * which should display a warning
     192         */
     193        openWizardAndFetchWidgets();
     194       
     195        ttester.actionEnterText(sourceFolder, PROJECT_NAME_1);
     196        ttester.actionEnterText(className, "#¤%&");
     197        assertTrue("Finish button should not be disabled for a warning",
     198                finish.getEnabled());
     199       
     200        /*
     201         * set legal class name and non-existing source folder,
     202         * which should display an error
     203         */
     204        ttester.actionEnterText(className, "legal_class_name");
     205        ttester.actionEnterText(sourceFolder, NON_EXSITING_PROJECT_NAME);       
     206        assertFalse("Finish button should not be enabled for an error",
     207                finish.getEnabled());
     208       
     209        /* close the dialog */
     210        btester.actionClick(cancel);       
     211    }
     212   
     213    /**
    174214     * check if the wizard 'remebers' it's class type selection
    175215     * between different invocations
Note: See TracChangeset for help on using the changeset viewer.