Source Code Cross Referenced for JSpinnerTest.java in  » Testing » jacareto » jacareto » test » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jacareto » jacareto.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Jacareto Copyright (c) 2002-2005
003:         * Applied Computer Science Research Group, Darmstadt University of
004:         * Technology, Institute of Mathematics & Computer Science,
005:         * Ludwigsburg University of Education, and Computer Based
006:         * Learning Research Group, Aachen University. All rights reserved.
007:         *
008:         * Jacareto is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU General Public
010:         * License as published by the Free Software Foundation; either
011:         * version 2 of the License, or (at your option) any later version.
012:         *
013:         * Jacareto is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
016:         * General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU General Public
019:         * License along with Jacareto; if not, write to the Free
020:         * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
021:         *
022:         */
023:
024:        package jacareto.test;
025:
026:        import jacareto.comp.Components;
027:        import jacareto.system.Environment;
028:
029:        import java.awt.Component;
030:
031:        //import javax.swing.JSpinner;
032:
033:        /**
034:         * A JSpinner test.
035:         *
036:         * @author <a href="mailto:cspannagel@web.de">Uwe A. Kraemer</a>
037:         * @version 1.0
038:         */
039:        public class JSpinnerTest extends JComponentTest {
040:            Object spinnerValue;
041:
042:            /**
043:             * DOCUMENT ME!
044:             *
045:             * @param env
046:             * @param componentName
047:             * @param isIgnoring
048:             * @param isCorrecting
049:             * @param hasFocus DOCUMENT ME!
050:             * @param isEnabled DOCUMENT ME!
051:             * @param value DOCUMENT ME!
052:             */
053:            public JSpinnerTest(Environment env, String componentName,
054:                    boolean isIgnoring, boolean isCorrecting, boolean hasFocus,
055:                    boolean isEnabled, Object value) {
056:                super (env, componentName, isIgnoring, isCorrecting, hasFocus,
057:                        isEnabled);
058:                setSpinnerValue(value);
059:            }
060:
061:            /**
062:             * DOCUMENT ME!
063:             *
064:             * @param env
065:             * @param components
066:             * @param component
067:             */
068:            public JSpinnerTest(Environment env, Components components,
069:                    Component component) {
070:                super (env, components, component);
071:            }
072:
073:            /**
074:             *
075:             */
076:            public JSpinnerTest() {
077:                this (null, "", false, false, false, false, null);
078:            }
079:
080:            /**
081:             * Evaluates the test. Should return <code>false</code> if the test fails, otherwise
082:             * <code>true</code>. If the test has failed, the error message can be retrieved. by calling
083:             * the method {@link #getEvaluationMessage()}. If {@link #isCorrecting()} returns
084:             * <code>true</code>, after the test the fields (or whatever) of the component will be set to
085:             * the right values in case of a failure. If {@link #isIgnoring()} returns <code>true</code>,
086:             * the behavior of this method is exactly the same as in the opposite case, except it always
087:             * returns <code>true</code>.
088:             *
089:             * @param components the components instance
090:             *
091:             * @return <code>true</code> if all is ok, otherwise <code>false</code>
092:             */
093:            public boolean evaluate(Components components) {
094:                boolean result = true;
095:
096:                //Since JSpinner is new to Java in JDK 1.4, this class is commented
097:
098:                /*        JSpinner spinner = null;
099:
100:                        //get the JSpinner object
101:                        Component component = components.getComponent (getComponentName());
102:                        if (component == null) {
103:                           setEvaluationMessage (language.getString ("Test.Failure.NoComponent"));
104:                           return false;
105:                        }
106:                        if (! (component instanceof JSpinner)) {
107:                           setEvaluationMessage (language.getString ("Test.Failure.WrongComponentType"));
108:                           return false;
109:                        }
110:                        spinner = (JSpinner) component;
111:
112:                        //Let's check if the spinner's value is correct
113:                        if (! (spinner.getValue().equals(getSpinnerValue())))
114:                        {
115:                            result = false;
116:                        }
117:                        setEvaluationMessage (language.getString ("JSpinnerTest.Failure.WrongValue"));
118:
119:                        //If the isCorrecting flag is set, let's set the correct values
120:                        if (isCorrecting()) {
121:                            spinner.setValue(getSpinnerValue());
122:                        }
123:                 */
124:                return result;
125:            }
126:
127:            /**
128:             * Returns a String which describes the content of the recordable shortly.
129:             *
130:             * @return a string with a short description of the recordable
131:             */
132:            public String toShortString() {
133:                return getElementName();
134:            }
135:
136:            /**
137:             * Returns the name of the recordable.
138:             *
139:             * @return the name
140:             */
141:            public String getElementName() {
142:                return language.getString("Tests.JSliderTest.Name");
143:            }
144:
145:            /**
146:             * Returns a description of the recordable.
147:             *
148:             * @return the description
149:             */
150:            public String getElementDescription() {
151:                return language.getString("Tests.JSliderTest.Description");
152:            }
153:
154:            /**
155:             * DOCUMENT ME!
156:             *
157:             * @return Object
158:             */
159:            public Object getSpinnerValue() {
160:                return spinnerValue;
161:            }
162:
163:            /**
164:             * DOCUMENT ME!
165:             *
166:             * @param object
167:             */
168:            public void setSpinnerValue(Object object) {
169:                spinnerValue = object;
170:            }
171:
172:            protected void setEvaluationMessage(String evaluationMessage) {
173:                super .setEvaluationMessage(getComponentName() + ": "
174:                        + evaluationMessage);
175:            }
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.