Source Code Cross Referenced for TestField.java in  » Code-Analyzer » javapathfinder » gov » nasa » jpf » jvm » 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 » Code Analyzer » javapathfinder » gov.nasa.jpf.jvm 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //
002:        // Copyright (C) 2005 United States Government as represented by the
003:        // Administrator of the National Aeronautics and Space Administration
004:        // (NASA).  All Rights Reserved.
005:        // 
006:        // This software is distributed under the NASA Open Source Agreement
007:        // (NOSA), version 1.3.  The NOSA has been approved by the Open Source
008:        // Initiative.  See the file NOSA-1.3-JPF at the top of the distribution
009:        // directory tree for the complete NOSA document.
010:        // 
011:        // THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY
012:        // KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
013:        // LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO
014:        // SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
015:        // A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT
016:        // THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT
017:        // DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE.
018:        //
019:        package gov.nasa.jpf.jvm;
020:
021:        /**
022:         * field access test
023:         */
024:        class TestFieldBase {
025:            static boolean s_base_Z = true;
026:            static byte s_base_B = 16;
027:            static char s_base_C = 'A';
028:            static short s_base_S = 2048;
029:            static int s_base_I = 0x8000;
030:            static long s_base_J = 0x800000;
031:            static float s_base_F = 1.23f;
032:            static double s_base_D = 3.45;
033:            static Object s_base_o = new String("a static string");
034:            boolean base_Z = true;
035:            byte base_B = 16;
036:            char base_C = 'A';
037:            short base_S = 2048;
038:            int base_I = 0x8000;
039:            long base_J = 0x800000;
040:            float base_F = 1.23f;
041:            double base_D = 3.45;
042:            Object base_o = new String("a instance string");
043:        }
044:
045:        /**
046:         * DOCUMENT ME!
047:         */
048:        public class TestField extends TestFieldBase {
049:            boolean s_Z = s_base_Z;
050:            byte s_B = s_base_B;
051:            char s_C = s_base_C;
052:            short s_S = s_base_S;
053:            int s_I = s_base_I;
054:            long s_J = s_base_J;
055:            float s_F = s_base_F;
056:            double s_D = s_base_D;
057:            Object s_o = s_base_o;
058:            boolean _Z = base_Z;
059:            byte _B = base_B;
060:            char _C = base_C;
061:            short _S = base_S;
062:            int _I = base_I;
063:            long _J = base_J;
064:            float _F = base_F;
065:            double _D = base_D;
066:            Object _o = base_o;
067:
068:            public static void main(String[] args) {
069:                TestField t = new TestField();
070:
071:                if (args.length > 0) {
072:                    // just run the specified tests
073:                    for (int i = 0; i < args.length; i++) {
074:                        String func = args[i];
075:
076:                        // note that we don't use reflection here because this would
077:                        // blow up execution/test scope under JPF
078:                        if ("testReadInstance".equals(func)) {
079:                            t.testReadInstance();
080:                        } else if ("testWriteInstance".equals(func)) {
081:                            t.testWriteInstance();
082:                        } else if ("testReadStatic".equals(func)) {
083:                            t.testReadStatic();
084:                        } else if ("testWriteStatic".equals(func)) {
085:                            t.testWriteStatic();
086:                        } else {
087:                            throw new IllegalArgumentException(
088:                                    "unknown test function");
089:                        }
090:                    }
091:                } else {
092:                    // that's mainly for our standalone test verification
093:                    t.testReadInstance();
094:                    t.testWriteInstance();
095:                    t.testReadStatic();
096:                    t.testWriteStatic();
097:                }
098:            }
099:
100:            public void testReadInstance() {
101:                assert _Z == base_Z;
102:                assert _Z == true;
103:
104:                assert _B == base_B;
105:                assert _B == 16;
106:
107:                assert _C == base_C;
108:                assert _C == 'A';
109:
110:                assert _I == base_I;
111:                assert _I == 0x8000;
112:
113:                assert _J == base_J;
114:                assert _J == 0x800000;
115:
116:                assert _F == base_F;
117:                assert _F == 1.23f;
118:
119:                assert _D == base_D;
120:                assert _D == 3.45;
121:
122:                assert _o.equals(base_o);
123:                assert _o.equals("a instance string");
124:            }
125:
126:            public void testReadStatic() {
127:                assert s_Z == s_base_Z;
128:                assert s_Z == true;
129:
130:                assert s_B == s_base_B;
131:                assert s_B == 16;
132:
133:                assert s_C == s_base_C;
134:                assert s_C == 'A';
135:
136:                assert s_I == s_base_I;
137:                assert s_I == 0x8000;
138:
139:                assert s_J == s_base_J;
140:                assert s_J == 0x800000;
141:
142:                assert s_F == s_base_F;
143:                assert s_F == 1.23f;
144:
145:                assert s_D == s_base_D;
146:                assert s_D == 3.45;
147:
148:                assert s_o.equals(s_base_o);
149:                assert s_o.equals("a static string");
150:            }
151:
152:            public void testWriteInstance() {
153:                _Z = false;
154:                assert _Z == false;
155:                base_Z = _Z;
156:                assert base_Z == _Z;
157:
158:                _B = 17;
159:                assert _B == 17;
160:                base_B = _B;
161:                assert base_B == _B;
162:
163:                _C = 'B';
164:                assert _C == 'B';
165:                base_C = _C;
166:                assert base_C == _C;
167:
168:                _I = 12345;
169:                assert _I == 12345;
170:                base_I = _I;
171:                assert base_I == _I;
172:
173:                _J = 12345678;
174:                assert _J == 12345678;
175:                base_J = _J;
176:                assert base_J == _J;
177:
178:                _F = 7.65f;
179:                assert _F == 7.65f;
180:                base_F = _F;
181:                assert base_F == _F;
182:
183:                _D = 6.54;
184:                assert _D == 6.54;
185:                base_D = _D;
186:                assert base_D == _D;
187:
188:                _o = new Integer(42);
189:                assert _o.equals(new Integer(42));
190:                base_o = _o;
191:                assert base_o.equals(_o);
192:            }
193:
194:            public void testWriteStatic() {
195:                s_Z = false;
196:                assert s_Z == false;
197:                s_base_Z = s_Z;
198:                assert s_base_Z == s_Z;
199:
200:                s_B = 17;
201:                assert s_B == 17;
202:                s_base_B = s_B;
203:                assert s_base_B == s_B;
204:
205:                s_C = 'B';
206:                assert s_C == 'B';
207:                s_base_C = s_C;
208:                assert s_base_C == s_C;
209:
210:                s_I = 12345;
211:                assert s_I == 12345;
212:                s_base_I = s_I;
213:                assert s_base_I == s_I;
214:
215:                s_J = 12345678;
216:                assert s_J == 12345678;
217:                s_base_J = s_J;
218:                assert s_base_J == s_J;
219:
220:                s_F = 7.65f;
221:                assert s_F == 7.65f;
222:                s_base_F = s_F;
223:                assert s_base_F == s_F;
224:
225:                s_D = 6.54;
226:                assert s_D == 6.54;
227:                s_base_D = s_D;
228:                assert s_base_D == s_D;
229:
230:                s_o = new Integer(42);
231:                assert s_o.equals(new Integer(42));
232:                s_base_o = s_o;
233:                assert s_base_o.equals(s_o);
234:            }
235:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.