001: /* ====================================================================
002: Licensed to the Apache Software Foundation (ASF) under one or more
003: contributor license agreements. See the NOTICE file distributed with
004: this work for additional information regarding copyright ownership.
005: The ASF licenses this file to You under the Apache License, Version 2.0
006: (the "License"); you may not use this file except in compliance with
007: the License. You may obtain a copy of the License at
008:
009: http://www.apache.org/licenses/LICENSE-2.0
010:
011: Unless required by applicable law or agreed to in writing, software
012: distributed under the License is distributed on an "AS IS" BASIS,
013: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: See the License for the specific language governing permissions and
015: limitations under the License.
016: ==================================================================== */
017:
018: package org.apache.poi.hdf.model;
019:
020: import junit.framework.TestCase;
021:
022: import java.io.FileInputStream;
023: import java.io.IOException;
024:
025: /**
026: * Class to test HDFDocument functionality
027: *
028: * @author Bob Otterberg
029: */
030: public class TestHDFDocument extends TestCase {
031:
032: public TestHDFDocument(String name) {
033: super (name);
034: }
035:
036: public void testStopJUnitComplainintAboutNoTests() throws Exception {
037:
038: }
039:
040: /**
041: * TEST NAME: Test Read Empty <P>
042: * OBJECTIVE: Test that HDF can read an empty document (empty.doc).<P>
043: * SUCCESS: HDF reads the document. Matches values in their particular positions.<P>
044: * FAILURE: HDF does not read the document or excepts. HDF cannot identify values
045: * in the document in their known positions.<P>
046: *
047: */
048: public void fixme_testEmpty() throws IOException {
049:
050: String filename = System.getProperty("HDF.testdata.path");
051:
052: filename = filename + "/empty.doc";
053:
054: FileInputStream stream = new FileInputStream(filename);
055:
056: HDFDocument empty = new HDFDocument(stream);
057:
058: stream.close();
059:
060: }
061:
062: /**
063: * TEST NAME: Test Simple <P>
064: * OBJECTIVE: Test that HDF can read an _very_ simple document (simple.doc).<P>
065: * SUCCESS: HDF reads the document. Matches values in their particular positions.<P>
066: * FAILURE: HDF does not read the document or excepts. HDF cannot identify values
067: * in the document in their known positions.<P>
068: *
069: */
070: public void fixme_testSimple() throws IOException {
071: String filename = System.getProperty("HDF.testdata.path");
072: filename = filename + "/simple.doc";
073: FileInputStream stream = new FileInputStream(filename);
074: HDFDocument empty = new HDFDocument(stream);
075: stream.close();
076: }
077:
078: /**
079: * TEST NAME: Test Read Simple List <P>
080: * OBJECTIVE: Test that HDF can read a document containing a simple list (simple-list.doc).<P>
081: * SUCCESS: HDF reads the document. Matches values in their particular positions.<P>
082: * FAILURE: HDF does not read the document or excepts. HDF cannot identify values
083: * in the document in their known positions.<P>
084: *
085: */
086: public void fixme_testSimpleList() throws IOException {
087: String filename = System.getProperty("HDF.testdata.path");
088:
089: filename = filename + "/simple-list.doc";
090: FileInputStream stream = new FileInputStream(filename);
091: HDFDocument empty = new HDFDocument(stream);
092: stream.close();
093: }
094:
095: /**
096: * TEST NAME: Test Read Simple Table <P>
097: * OBJECTIVE: Test that HDF can read a document containing a simple table (simple-table.doc).<P>
098: * SUCCESS: HDF reads the document. Matches values in their particular positions.<P>
099: * FAILURE: HDF does not read the document or excepts. HDF cannot identify values
100: * in the document in their known positions.<P>
101: *
102: */
103: public void fixme_testSimpleTable() throws IOException {
104: String filename = System.getProperty("HDF.testdata.path");
105:
106: filename = filename + "/simple-table.doc";
107: FileInputStream stream = new FileInputStream(filename);
108: HDFDocument empty = new HDFDocument(stream);
109: stream.close();
110: }
111:
112: public static void main(String[] ignored_args) {
113: String path = System.getProperty("HDF.testdata.path");
114:
115: // assume this is relative to basedir
116: if (path == null) {
117: System.setProperty("HDF.testdata.path",
118: "src/scratchpad/testcases/org/apache/poi/hdf/data");
119: }
120: System.out
121: .println("Testing org.apache.poi.hdf.model.HDFDocument");
122:
123: junit.textui.TestRunner.run(TestHDFDocument.class);
124: }
125: }
|