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.data.vpf.ifc.DataTypesDefinition;
021: import org.geotools.data.vpf.ifc.FileConstants;
022: import org.geotools.test.TestData;
023:
024: // TODO TableInputStream was deprecated in 2.0.x and has been removed
025: // in 2.2.x. This file needs to be updated and tests re-enabled.
026:
027: /**
028: * File <code>TableColumnDefTest.java</code> is automaticaly generated by
029: * 'unittestsgen' application. Code generator is created for java
030: * sources and for 'junit' package by "Artur Hefczyc"
031: * <kobit@users.sourceforge.net><br/>
032: * You should fulfil test methods with proper code for testing
033: * purpose. All methods where you should put your code are below and
034: * their names starts with 'test'.<br/>
035: * You can run unit tests in many ways, however prefered are:
036: * <ul>
037: * <li>Run tests for one class only, for example for this class you
038: * can run tests with command:
039: * <pre>
040: * java -cp "jar/thisjarfile.jar;lib/junit.jar" org.geotools.vpf.TableColumnDefTest
041: * </pre>
042: * </li>
043: * <li>Run tests for all classes in one command call. Code generator
044: * creates also <code>TestAll.class</code> which runs all
045: * available tests:
046: * <pre>
047: * java -cp "jar/thisjarfile.jar;lib/junit.jar" TestAll
048: * </pre>
049: * </li>
050: * <li>But the most prefered way is to run all tests from
051: * <em>Ant</em> just after compilation process finished.<br/>
052: * To do it. You need:
053: * <ol>
054: * <li>Ant package from
055: * <a href="http://jakarta.apache.org/">Ant</a>
056: * </li>
057: * <li>JUnit package from
058: * <a href="http://www.junit.org/">JUnit</a>
059: * </li>
060: * <li>Put some code in your <code>build.xml</code> file
061: * to tell Ant how to test your package. Sample code for
062: * Ant's <code>build.xml</code> you can find in created file:
063: * <code>sample-junit-build.xml</code>. And remember to have
064: * <code>junit.jar</code> in CLASSPATH <b>before</b> you run Ant.
065: * To generate reports by ant you must have <code>xalan.jar</code>
066: * in your <code>ANT_HOME/lib/</code> directory.
067: * </li>
068: * </ol>
069: * </li>
070: * </ul>
071: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/vpf/src/test/java/org/geotools/data/vpf/io/TableColumnDefTest.java $
072: */
073: public class TableColumnDefTest extends TestCase implements
074: DataTypesDefinition, FileConstants {
075: /**
076: * Instance of tested class.
077: */
078: protected TableColumnDef varTableColumnDef;
079:
080: /**
081: * Public constructor for creating testing class.
082: */
083: public TableColumnDefTest(String name) {
084: super (name);
085: } // end of TableColumnDefTest(String name)
086:
087: /**
088: * This main method is used for run tests for this class only
089: * from command line.
090: */
091: public static void main(String[] args) {
092: junit.textui.TestRunner.run(suite());
093: } // end of main(Stringp[] args)
094:
095: /**
096: * This method is called every time before particular test execution.
097: * It creates new instance of tested class and it can perform some more
098: * actions which are necessary for performs tests.
099: */
100: protected void setUp() throws IOException {
101:
102: // File file = TestData.file( this, "dnc13/dht" );
103: // TableInputStream tis = new TableInputStream( file.getPath() );
104: //
105: // TableHeader thead = (TableHeader)tis.getHeader();
106: // varTableColumnDef = (TableColumnDef)thead.getColumnDefs().get(0);
107: // tis.close();
108: } // end of setUp()
109:
110: /**
111: * Returns all tests which should be performed for testing class.
112: * By default it returns only name of testing class. Instance of this
113: * is then created with its constructor.
114: */
115: public static Test suite() {
116: return new TestSuite(TableColumnDefTest.class);
117: } // end of suite()
118:
119: /**
120: * Method for testing original source method:
121: * java.lang.String getColDesc()
122: * from tested class
123: */
124: public void XtestGetColDesc() {
125: assertEquals("Cheking column description.", "Row id",
126: varTableColumnDef.getColDesc());
127: } // end of testGetColDesc()
128:
129: /**
130: * Method for testing original source method:
131: * int getColumnSize()
132: * from tested class
133: */
134: public void XtestGetColumnSize() {
135: assertEquals("Cheking column size.", DATA_LONG_INTEGER_LEN,
136: varTableColumnDef.getColumnSize());
137: } // end of testGetColumnSize()
138:
139: /**
140: * Method for testing original source method:
141: * int getElementsNumber()
142: * from tested class
143: */
144: public void XtestGetElementsNumber() {
145: assertEquals("Cheking column size.", 1, varTableColumnDef
146: .getElementsNumber());
147: } // end of testGetElementsNumber()
148:
149: /**
150: * Method for testing original source method:
151: * char getKeyType()
152: * from tested class
153: */
154: public void XtestGetKeyType() {
155: assertEquals("Cheking key type.", KEY_PRIMARY,
156: varTableColumnDef.getKeyType());
157: } // end of testGetKeyType()
158:
159: /**
160: * Method for testing original source method:
161: * java.lang.String getName()
162: * from tested class
163: */
164: public void XtestGetName() {
165: assertEquals("Cheking column name.", "id", varTableColumnDef
166: .getName());
167: } // end of testGetName()
168:
169: /**
170: * Method for testing original source method:
171: * java.lang.String getNarrTable()
172: * from tested class
173: */
174: public void XtestGetNarrTable() {
175: assertNull("Cheking narrative table name.", varTableColumnDef
176: .getNarrTable());
177: } // end of testGetNarrTable()
178:
179: /**
180: * Method for testing original source method:
181: * java.lang.String getThematicIdx()
182: * from tested class
183: */
184: public void XtestGetThematicIdx() {
185: assertNull("Cheking column name.", varTableColumnDef
186: .getThematicIdx());
187: } // end of testGetThematicIdx()
188:
189: /**
190: * Method for testing original source method:
191: * char getType()
192: * from tested class
193: */
194: public void XtestGetType() {
195: assertEquals("Cheking column type.", DATA_LONG_INTEGER,
196: varTableColumnDef.getType());
197: } // end of testGetType()
198:
199: /**
200: * Method for testing original source method:
201: * java.lang.String getValDescTableName()
202: * from tested class
203: */
204: public void XtestGetValDescTableName() {
205: assertNull("Cheking description table name.", varTableColumnDef
206: .getValDescTableName());
207: } // end of testGetValDescTableName()
208:
209: /**
210: * Method for testing original source method:
211: * boolean isNumeric()
212: * from tested class
213: */
214: public void XtestIsNumeric() {
215: assertTrue("Checking if it is numeric column.",
216: varTableColumnDef.isNumeric());
217: } // end of testIsNumeric()
218:
219: public void testNull() {
220: //TODO delete this when this file has been updated - prevents maven from throwing an exception
221: }
222:
223: } // end of TableColumnDefTest
|