Source Code Cross Referenced for VPFDateTest.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » vpf » io » 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 » GIS » GeoTools 2.4.1 » org.geotools.data.vpf.io 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * File is generated by 'Unit Tests Generator' developed under
003:         * 'Web Test Tools' project at http://sf.net/projects/wttools/
004:         * Copyright (C) 2001 "Artur Hefczyc" <kobit@users.sourceforge.net>
005:         * to all 'Web Test Tools' subprojects.
006:         *
007:         * No rigths to files and no responsibility for code generated
008:         * by this tool are belonged to author of 'unittestsgen' utility.
009:         *
010:         */
011:        package org.geotools.data.vpf.io;
012:
013:        import java.util.Calendar;
014:
015:        import junit.framework.Test;
016:        import junit.framework.TestCase;
017:        import junit.framework.TestSuite;
018:
019:        /**
020:         * File <code>VPFDateTest.java</code> is automaticaly generated by
021:         * 'unittestsgen' application. Code generator is created for java
022:         * sources and for 'junit' package by "Artur Hefczyc"
023:         * <kobit@users.sourceforge.net><br/>
024:         * You should fulfil test methods with proper code for testing
025:         * purpose. All methods where you should put your code are below and
026:         * their names starts with 'test'.<br/>
027:         * You can run unit tests in many ways, however prefered are:
028:         * <ul>
029:         *   <li>Run tests for one class only, for example for this class you
030:         *       can run tests with command:
031:         *     <pre>
032:         *       java -cp "jar/thisjarfile.jar;lib/junit.jar" org.geotools.vpf.VPFDateTest
033:         *     </pre>
034:         *   </li>
035:         *   <li>Run tests for all classes in one command call. Code generator
036:         *       creates also <code>TestAll.class</code> which runs all
037:         *       available tests:
038:         *     <pre>
039:         *       java -cp "jar/thisjarfile.jar;lib/junit.jar" TestAll
040:         *     </pre>
041:         *   </li>
042:         *   <li>But the most prefered way is to run all tests from
043:         *     <em>Ant</em> just after compilation process finished.<br/>
044:         *     To do it. You need:
045:         *     <ol>
046:         *       <li>Ant package from
047:         *         <a href="http://jakarta.apache.org/">Ant</a>
048:         *       </li>
049:         *       <li>JUnit package from
050:         *         <a href="http://www.junit.org/">JUnit</a>
051:         *       </li>
052:         *       <li>Put some code in your <code>build.xml</code> file
053:         *         to tell Ant how to test your package. Sample code for
054:         *         Ant's <code>build.xml</code> you can find in created file:
055:         *         <code>sample-junit-build.xml</code>. And remember to have
056:         *         <code>junit.jar</code> in CLASSPATH <b>before</b> you run Ant.
057:         *         To generate reports by ant you must have <code>xalan.jar</code>
058:         *         in your <code>ANT_HOME/lib/</code> directory.
059:         *       </li>
060:         *     </ol>
061:         *   </li>
062:         * </ul>
063:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/vpf/src/test/java/org/geotools/data/vpf/io/VPFDateTest.java $
064:         */
065:        public class VPFDateTest extends TestCase {
066:            /**
067:             * Instance of tested class.
068:             */
069:            protected VPFDate varVPFDate;
070:
071:            /**
072:             * Public constructor for creating testing class.
073:             */
074:            public VPFDateTest(String name) {
075:                super (name);
076:            } // end of VPFDateTest(String name)
077:
078:            /**
079:             * This main method is used for run tests for this class only
080:             * from command line.
081:             */
082:            public static void main(String[] args) {
083:                junit.textui.TestRunner.run(suite());
084:            } // end of main(Stringp[] args)
085:
086:            protected String date = "20030129161055.00000";
087:
088:            /**
089:             * This method is called every time before particular test execution.
090:             * It creates new instance of tested class and it can perform some more
091:             * actions which are necessary for performs tests.
092:             */
093:            protected void setUp() {
094:                byte[] bytes = new byte[date.length()];
095:                for (int i = 0; i < bytes.length; i++) {
096:                    bytes[i] = (byte) date.charAt(i);
097:                } // end of for (int i = 0; i < bytes.length; i++)
098:                varVPFDate = new VPFDate(bytes);
099:            }
100:
101:            /**
102:             * Returns all tests which should be performed for testing class.
103:             * By default it returns only name of testing class. Instance of this
104:             * is then created with its constructor.
105:             */
106:            public static Test suite() {
107:                return new TestSuite(VPFDateTest.class);
108:            } // end of suite()
109:
110:            /**
111:             * Method for testing original source method:
112:             * java.util.Date getDate()
113:             * from tested class
114:             */
115:            public void testGetDate() {
116:                assertNotNull(
117:                        "Check if it is possible to parse date, corretness is "
118:                                + "checked in getCalendar method", varVPFDate
119:                                .getDate());
120:            } // end of testGetDate()
121:
122:            public void testGetCalendar() {
123:                Calendar cal = varVPFDate.getCalendar();
124:                assertEquals("Checking year", 2003, cal.get(Calendar.YEAR));
125:                assertEquals("Checking month (Calendar numvers months from 0)",
126:                        1, cal.get(Calendar.MONTH) + 1);
127:                assertEquals("Checking day of month", 29, cal
128:                        .get(Calendar.DAY_OF_MONTH));
129:                assertEquals("Checking hour", 16, cal.get(Calendar.HOUR_OF_DAY));
130:                assertEquals("Checking minute", 10, cal.get(Calendar.MINUTE));
131:                assertEquals("Checking second", 55, cal.get(Calendar.SECOND));
132:                assertEquals("Checking zone", 0, cal.get(Calendar.ZONE_OFFSET));
133:            }
134:
135:            /**
136:             * Method for testing original source method:
137:             * java.lang.String toString()
138:             * from tested class
139:             */
140:            public void testToString() {
141:                assertEquals("Conversion to string", varVPFDate.toString(),
142:                        date);
143:            } // end of testToString()
144:
145:        } // end of VPFDateTest
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.