KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gui > propertyeditors > PropertyType_Character


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package gui.propertyeditors;
21
22 import org.netbeans.junit.NbTestSuite;
23
24
25 /**
26  * Tests of Character Property Editor.
27  *
28  * @author Marian.Mirilovic@Sun.Com
29  */

30 public class PropertyType_Character extends PropertyEditorsTest {
31
32     public String JavaDoc propertyName_L;
33     public String JavaDoc propertyValue_L;
34     public String JavaDoc propertyValueExpectation_L;
35
36     /** Creates a new instance of PropertyType_Character */
37     public PropertyType_Character(String JavaDoc testName) {
38         super(testName);
39     }
40
41
42     public void setUp(){
43         propertyName_L = "Character";
44         super.setUp();
45     }
46     
47     public static NbTestSuite suite() {
48         NbTestSuite suite = new NbTestSuite();
49         suite.addTest(new PropertyType_Character("testByInPlace"));
50         suite.addTest(new PropertyType_Character("testByInPlaceInvalid"));
51         return suite;
52     }
53     
54     public void testByInPlace(){
55         propertyValue_L = "f";
56         propertyValueExpectation_L = propertyValue_L;
57         setByInPlace(propertyName_L, propertyValue_L, true);
58     }
59     
60     public void testByInPlaceInvalid(){
61         propertyValue_L = "invalid";
62         propertyValueExpectation_L = propertyValue_L.substring(0,1);
63         setByInPlace(propertyName_L, propertyValue_L, true);
64     }
65     
66     public void verifyPropertyValue(boolean expectation) {
67         verifyExpectationValue(propertyName_L,expectation, propertyValueExpectation_L, propertyValue_L, false);
68     }
69     
70     public void setCustomizerValue(){}
71     public void verifyCustomizerLayout(){}
72     
73     /** Test could be executed internaly in Forte without XTest
74      * @param args arguments from command line
75      */

76     public static void main(String JavaDoc[] args) {
77         //junit.textui.TestRunner.run(new NbTestSuite(PropertyType_Character.class));
78
junit.textui.TestRunner.run(suite());
79     }
80     
81     
82 }
83
Popular Tags