KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hdf > model > TestHDFDocument


1
2 /* ====================================================================
3    Copyright 2002-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16 ==================================================================== */

17         
18
19
20 package org.apache.poi.hdf.model;
21
22
23 import junit.framework.TestCase;
24
25 import java.io.FileInputStream JavaDoc;
26 import java.io.IOException JavaDoc;
27
28
29 /**
30  * Class to test HDFDocument functionality
31  *
32  * @author Bob Otterberg
33  */

34 public class TestHDFDocument
35         extends TestCase
36 {
37
38     public TestHDFDocument( String JavaDoc name )
39     {
40         super( name );
41     }
42
43     public void testStopJUnitComplainintAboutNoTests()
44             throws Exception JavaDoc
45     {
46
47     }
48
49     /**
50      * TEST NAME: Test Read Empty <P>
51      * OBJECTIVE: Test that HDF can read an empty document (empty.doc).<P>
52      * SUCCESS: HDF reads the document. Matches values in their particular positions.<P>
53      * FAILURE: HDF does not read the document or excepts. HDF cannot identify values
54      * in the document in their known positions.<P>
55      *
56      */

57     public void fixme_testEmpty()
58             throws IOException JavaDoc
59     {
60
61         String JavaDoc filename = System.getProperty( "HDF.testdata.path" );
62
63
64         filename = filename + "/empty.doc";
65
66         FileInputStream JavaDoc stream = new FileInputStream JavaDoc( filename );
67
68         HDFDocument empty = new HDFDocument( stream );
69
70         stream.close();
71
72     }
73
74
75     /**
76      * TEST NAME: Test Simple <P>
77      * OBJECTIVE: Test that HDF can read an _very_ simple document (simple.doc).<P>
78      * SUCCESS: HDF reads the document. Matches values in their particular positions.<P>
79      * FAILURE: HDF does not read the document or excepts. HDF cannot identify values
80      * in the document in their known positions.<P>
81      *
82      */

83     public void fixme_testSimple()
84             throws IOException JavaDoc
85     {
86         String JavaDoc filename = System.getProperty( "HDF.testdata.path" );
87         filename = filename + "/simple.doc";
88         FileInputStream JavaDoc stream = new FileInputStream JavaDoc( filename );
89         HDFDocument empty = new HDFDocument( stream );
90         stream.close();
91     }
92
93     /**
94      * TEST NAME: Test Read Simple List <P>
95      * OBJECTIVE: Test that HDF can read a document containing a simple list (simple-list.doc).<P>
96      * SUCCESS: HDF reads the document. Matches values in their particular positions.<P>
97      * FAILURE: HDF does not read the document or excepts. HDF cannot identify values
98      * in the document in their known positions.<P>
99      *
100      */

101     public void fixme_testSimpleList()
102             throws IOException JavaDoc
103     {
104         String JavaDoc filename = System.getProperty( "HDF.testdata.path" );
105
106         filename = filename + "/simple-list.doc";
107         FileInputStream JavaDoc stream = new FileInputStream JavaDoc( filename );
108         HDFDocument empty = new HDFDocument( stream );
109         stream.close();
110     }
111
112     /**
113      * TEST NAME: Test Read Simple Table <P>
114      * OBJECTIVE: Test that HDF can read a document containing a simple table (simple-table.doc).<P>
115      * SUCCESS: HDF reads the document. Matches values in their particular positions.<P>
116      * FAILURE: HDF does not read the document or excepts. HDF cannot identify values
117      * in the document in their known positions.<P>
118      *
119      */

120     public void fixme_testSimpleTable()
121             throws IOException JavaDoc
122     {
123         String JavaDoc filename = System.getProperty( "HDF.testdata.path" );
124
125         filename = filename + "/simple-table.doc";
126         FileInputStream JavaDoc stream = new FileInputStream JavaDoc( filename );
127         HDFDocument empty = new HDFDocument( stream );
128         stream.close();
129     }
130
131     public static void main( String JavaDoc[] ignored_args )
132     {
133         String JavaDoc path = System.getProperty( "HDF.testdata.path" );
134
135         // assume this is relative to basedir
136
if ( path == null )
137         {
138             System.setProperty(
139                     "HDF.testdata.path",
140                     "src/scratchpad/testcases/org/apache/poi/hdf/data" );
141         }
142         System.out.println( "Testing org.apache.poi.hdf.model.HDFDocument" );
143
144         junit.textui.TestRunner.run( TestHDFDocument.class );
145     }
146 }
147
148
149
Popular Tags