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.io.File;
014: import java.io.IOException;
015:
016: import junit.framework.Test;
017: import junit.framework.TestCase;
018: import junit.framework.TestSuite;
019:
020: import org.geotools.test.TestData;
021:
022: //TODO TableInputStream was deprecated in 2.0.x and has been removed
023: //in 2.2.x. This file needs to be updated and tests re-enabled.
024:
025: /**
026: * File <code>TableHeaderTest.java</code> is automaticaly generated by
027: * 'unittestsgen' application. Code generator is created for java
028: * sources and for 'junit' package by "Artur Hefczyc"
029: * <kobit@users.sourceforge.net><br/>
030: * You should fulfil test methods with proper code for testing
031: * purpose. All methods where you should put your code are below and
032: * their names starts with 'test'.<br/>
033: * You can run unit tests in many ways, however prefered are:
034: * <ul>
035: * <li>Run tests for one class only, for example for this class you
036: * can run tests with command:
037: * <pre>
038: * java -cp "jar/thisjarfile.jar;lib/junit.jar" org.geotools.vpf.TableHeaderTest
039: * </pre>
040: * </li>
041: * <li>Run tests for all classes in one command call. Code generator
042: * creates also <code>TestAll.class</code> which runs all
043: * available tests:
044: * <pre>
045: * java -cp "jar/thisjarfile.jar;lib/junit.jar" TestAll
046: * </pre>
047: * </li>
048: * <li>But the most prefered way is to run all tests from
049: * <em>Ant</em> just after compilation process finished.<br/>
050: * To do it. You need:
051: * <ol>
052: * <li>Ant package from
053: * <a href="http://jakarta.apache.org/">Ant</a>
054: * </li>
055: * <li>JUnit package from
056: * <a href="http://www.junit.org/">JUnit</a>
057: * </li>
058: * <li>Put some code in your <code>build.xml</code> file
059: * to tell Ant how to test your package. Sample code for
060: * Ant's <code>build.xml</code> you can find in created file:
061: * <code>sample-junit-build.xml</code>. And remember to have
062: * <code>junit.jar</code> in CLASSPATH <b>before</b> you run Ant.
063: * To generate reports by ant you must have <code>xalan.jar</code>
064: * in your <code>ANT_HOME/lib/</code> directory.
065: * </li>
066: * </ol>
067: * </li>
068: * </ul>
069: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/vpf/src/test/java/org/geotools/data/vpf/io/TableHeaderTest.java $
070: */
071: public class TableHeaderTest extends TestCase {
072: /**
073: * Instance of tested class.
074: */
075: protected TableHeader varTableHeader;
076:
077: /**
078: * Public constructor for creating testing class.
079: */
080: public TableHeaderTest(String name) {
081: super (name);
082: } // end of TableHeaderTest(String name)
083:
084: /**
085: * This main method is used for run tests for this class only
086: * from command line.
087: */
088: public static void main(String[] args) {
089: junit.textui.TestRunner.run(suite());
090: } // end of main(Stringp[] args)
091:
092: /**
093: * This method is called every time before particular test execution.
094: * It creates new instance of tested class and it can perform some more
095: * actions which are necessary for performs tests.
096: */
097: protected void setUp() throws IOException {
098: // File dht = TestData.file( this, "dnc13/dht" );
099: // TableInputStream tis = new TableInputStream( dht.getPath() );
100: // varTableHeader = (TableHeader)tis.getHeader();
101: // tis.close();
102: } // end of setUp()
103:
104: /**
105: * Returns all tests which should be performed for testing class.
106: * By default it returns only name of testing class. Instance of this
107: * is then created with its constructor.
108: */
109: public static Test suite() {
110: return new TestSuite(TableHeaderTest.class);
111: } // end of suite()
112:
113: /**
114: * Method for testing original source method:
115: * char getByteOrder()
116: * from tested class
117: */
118: public void XtestGetByteOrder() {
119: assertEquals("Checking byte order detection.", 'L',
120: varTableHeader.getByteOrder());
121: } // end of testGetByteOrder()
122:
123: /**
124: * Method for testing original source method:
125: * java.util.List getColumnDefs()
126: * from tested class
127: */
128: public void XtestGetColumnDefs() {
129: assertEquals("Checking number of detected column definitions.",
130: 20, varTableHeader.getColumnDefs().size());
131: } // end of testGetColumnDefs()
132:
133: /**
134: * Method for testing original source method:
135: * java.lang.String getDescription()
136: * from tested class
137: */
138: public void XtestGetDescription() {
139: assertEquals("Cheking description detection.",
140: "Database Header Table", varTableHeader
141: .getDescription());
142: } // end of testGetDescription()
143:
144: /**
145: * Method for testing original source method:
146: * int getLength()
147: * from tested class
148: */
149: public void XtestGetLength() {
150: assertEquals("Cheking header length detection.", 1261,
151: varTableHeader.getLength());
152: } // end of testGetLength()
153:
154: /**
155: * Method for testing original source method:
156: * java.lang.String getNarrativeTable()
157: * from tested class
158: */
159: public void XtestGetNarrativeTable() {
160: assertNull("Cheking narrative table name detection.",
161: varTableHeader.getNarrativeTable());
162: } // end of testGetNarrativeTable()
163:
164: public void testNull() {
165: //TODO delete this when this file has been updated - prevents maven from throwing an exception
166: }
167:
168: } // end of TableHeaderTest
|