KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gui > propertyeditors > PropertyType_byte


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  * Tests of byte Property Editor.
26  *
27  * @author Marian.Mirilovic@Sun.Com
28  */

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

80     public static void main(String JavaDoc[] args) {
81         //junit.textui.TestRunner.run(new NbTestSuite(PropertyType_Byte.class));
82
junit.textui.TestRunner.run(suite());
83     }
84 }
85
Popular Tags