From 7f78f5386631c005327018f46d52c898d49891e0 Mon Sep 17 00:00:00 2001 From: "Andrew C. Oliver" Date: Fri, 11 Apr 2003 02:39:21 +0000 Subject: [PATCH] test cases...we can't run them yet, but I'll leave this to glen http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17208 PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353055 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hdf/data/empty.doc | Bin 0 -> 19456 bytes .../org/apache/poi/hdf/data/simple-list.doc | Bin 0 -> 19456 bytes .../org/apache/poi/hdf/data/simple-table.doc | Bin 0 -> 19456 bytes .../org/apache/poi/hdf/data/simple.doc | Bin 0 -> 19456 bytes .../apache/poi/hdf/model/TestHDFDocument.java | 183 ++++++++++++++++++ 5 files changed, 183 insertions(+) create mode 100644 src/scratchpad/testcases/org/apache/poi/hdf/data/empty.doc create mode 100644 src/scratchpad/testcases/org/apache/poi/hdf/data/simple-list.doc create mode 100644 src/scratchpad/testcases/org/apache/poi/hdf/data/simple-table.doc create mode 100644 src/scratchpad/testcases/org/apache/poi/hdf/data/simple.doc create mode 100644 src/scratchpad/testcases/org/apache/poi/hdf/model/TestHDFDocument.java diff --git a/src/scratchpad/testcases/org/apache/poi/hdf/data/empty.doc b/src/scratchpad/testcases/org/apache/poi/hdf/data/empty.doc new file mode 100644 index 0000000000000000000000000000000000000000..1b4ac2d922b9b461325b854b640dbb760dd98da8 GIT binary patch literal 19456 zcmeHPO>9(E6h3b{Gi`xDDKKC`c$E4RE43BSVvtPRvCu?XA{a~rp+8gF+A?MOh<`EZ z#^8bl{v^5}Q4-OGXsQxdCL+3U;SVOF!BtI+ap6Y7LKg7+zB_Yg>T9P=Nij5@Gdb^^ zd+xpG-21&ZKj*%8=lu7J$4`D#^{WJEtCYw!zg(gd><;v`wp<~y4mxeueBYI*q6}Hy}Ux?JW%U1 zv)#UTq_qvq2o7F(%9O%VQZdL69i60&z7FSa>%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^|crCXr9n z6$=x2G<@peA?{bGLENApUylvs`V2*0)}qxJ7`?iF%3=zt!xUU}0_m;lEkL0YXI1n@ z^=#_o*ZC5#xXz{9FnI|-hhKjf+u2zw4{i|qR@{Ydv?Y7u#>3Wno{$-z?nM1WoO8F> z{;R5U^%wShYVB!2{kreP){nCyxuYnStV0iZqGk(@q3mYLlxQ~U=XV&tvx=>s73i9> zwK}->9!@B6E+m*-G*w~cZnFOCaj#|3#*552S^X24A$I0FHy^?4OSf?MgLtU3*M;BR toTmkQ(pvog52AhtY}&^E8G&g%IOf>RL+J6CoKLOdhp``!- literal 0 HcmV?d00001 diff --git a/src/scratchpad/testcases/org/apache/poi/hdf/data/simple.doc b/src/scratchpad/testcases/org/apache/poi/hdf/data/simple.doc new file mode 100644 index 0000000000000000000000000000000000000000..11262f996ed8b66722c5924bb5265f4eefe70622 GIT binary patch literal 19456 zcmeHPO>9(E6h3b{Gi`xjsW50kctBMYJ4`{O7{s;=#hO3~V2BZe)Ap5_I%Ue6NANdx zq0t2kR1#f~C<(Zcn5x8uF%i+FKXt)E;{p?7T)2V2f&>`9@4a`Y!)vF^urN^WY0o?7 z{+@fkckfKk{pr{*bIu+6yy;H~&<3fIYlV7=mc$#-m#A=q$TH}RyH+R^7;S=~YPyXO z`1izjvR~@Mcy*26;sL^&1tBH@o-MtDy@SpQXN4Pk-J?DnlSQ*cVjYIdiR)4)1`36{ zijn1XmEn0;dCw10mglg`vS=~Y&YvAMSZF2Q!-eu3M;9~1trsC;9xz$ zF!7m;K0)Mc@F`!aa^<9IkE)OD*?_XDT~J+8>A`wbdbLv3r|kcZ3OJ4uPri1g>7O%( z8c#}ILD~$kDhKrzpq=SV-o$Up%x8v%vz9rK!K2T%QjXPc9?Uptb63vpH`lFg*|B|9 zoE^|Koe=Op=ciMbbYCh)z);`wS1T@}Gfoo(`2Aaa|I?&Tx*OFYU@Vlyqhl-0(Q{8M z8Lg{b3SM^j<4803{?Y2H(z!JP8iCslfkwFtUWp;kLDE|#!3%9aUkFiR{b#G>#FimR zNfu$|3Cqw^?ur5QQd%z^?H3BiWIZBdk`zk@Q0f56IbzB-=r(w-`y7@u;<`}xKBNYT zD+x88JLRq@@vACq77COem8>=Rf59Suan%A*MLj|tv>Y45jhd0ci&UNXR97=5x(TR-ymNugav3|Wa9$fNTgHVhz2y_7-? zeuzy6*GaqEN!c7bjDCee(V9p&5~>Nm{fe7$q|VRpuB}1e>6*6C1QRdCl7o=j(Ez@h zeMnz}dO{M37$KuJ8j5)RQ_DGCT_Y4b1Bw?4XXxhLK5>AQ8Z;=wO}qi=B>33DKsei%&W;6pI|w=pn1??1rwx-WvG zU}mN_It!9ctqEBV*#=3cf;*zzSbPDJJE&Pd{1PO0g5QMX$$>+V4Uk75?}j`IN&A1n z=psmZ+|})8N`mE34ZPS)o;vMy=6cN@$Fb~Q%ib$ltC$DzL479jZ_U|5scgJI=ZHO3 z9c*i>cy+M-TQYriE}t84ye-zYctW!6h?lPKmr=CyF);WmcavTHWXmP$#F}lUBn71x ztDhPHjetf#BcKt`2xtT}0vZ90fJQ(gpb;2Hpq&3tUo~|0r?W@n3mV@40RI0Ymp@A) zE)s~Nuf7~iznwm58cbh(7|b<*Ltw4}907CP;3#-L_&Aup^GPs$dY<;CPy7v-r^kN) zb4}n!Fzc>G<)ywp^KR_!+(_3s+iz}3*)Lj7-t&doj>&xF)_HZVO(d6_h_FrmZ+<(Sp#U2yKGa>c((8wF9RaI zfJQ(gpb^jrXaqC@8Uc-fMnEHQXCOcyls+f@Wo)CnK0BRP?$`7GI&hz!{wRHQ`r*{M zM@}D~>GbKjhfjZeE|@pf>A%y*XZpR6P2dIKh2Z8&GMc)2G&nk literal 0 HcmV?d00001 diff --git a/src/scratchpad/testcases/org/apache/poi/hdf/model/TestHDFDocument.java b/src/scratchpad/testcases/org/apache/poi/hdf/model/TestHDFDocument.java new file mode 100644 index 0000000000..175d039f01 --- /dev/null +++ b/src/scratchpad/testcases/org/apache/poi/hdf/model/TestHDFDocument.java @@ -0,0 +1,183 @@ + +/* ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation" and + * "Apache POI" must not be used to endorse or promote products + * derived from this software without prior written permission. For + * written permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * "Apache POI", nor may "Apache" appear in their name, without + * prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + +package org.apache.poi.hdf.model; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Iterator; + +import junit.framework.TestCase; + +import org.apache.poi.poifs.filesystem.POIFSFileSystem; +import org.apache.poi.hdf.model.HDFDocument; + +/** + * Class to test HDFDocument functionality + * + * @author Bob Otterberg + */ + +public class TestHDFDocument + extends TestCase +{ + /** + * Constructor TestHDFDocument + * + * @param name + */ + + public TestHDFDocument(String name) + { + super(name); + } + + /** + * TEST NAME: Test Read Empty

+ * OBJECTIVE: Test that HDF can read an empty document (empty.doc).

+ * SUCCESS: HDF reads the document. Matches values in their particular positions.

+ * FAILURE: HDF does not read the document or excepts. HDF cannot identify values + * in the document in their known positions.

+ * + */ + + public void testEmpty() + throws IOException + { + String filename = System.getProperty("HDF.testdata.path"); + + filename = filename + "/empty.doc"; + FileInputStream stream = new FileInputStream(filename); + HDFDocument empty = new HDFDocument(stream); + stream.close(); + } + + /** + * TEST NAME: Test Simple

+ * OBJECTIVE: Test that HDF can read an _very_ simple document (simple.doc).

+ * SUCCESS: HDF reads the document. Matches values in their particular positions.

+ * FAILURE: HDF does not read the document or excepts. HDF cannot identify values + * in the document in their known positions.

+ * + */ + + public void testSimple() + throws IOException + { + String filename = System.getProperty("HDF.testdata.path"); + + filename = filename + "/simple.doc"; + FileInputStream stream = new FileInputStream(filename); + HDFDocument empty = new HDFDocument(stream); + stream.close(); + } + + /** + * TEST NAME: Test Read Simple List

+ * OBJECTIVE: Test that HDF can read a document containing a simple list (simple-list.doc).

+ * SUCCESS: HDF reads the document. Matches values in their particular positions.

+ * FAILURE: HDF does not read the document or excepts. HDF cannot identify values + * in the document in their known positions.

+ * + */ + + public void testSimpleList() + throws IOException + { + String filename = System.getProperty("HDF.testdata.path"); + + filename = filename + "/simple-list.doc"; + FileInputStream stream = new FileInputStream(filename); + HDFDocument empty = new HDFDocument(stream); + stream.close(); + } + + /** + * TEST NAME: Test Read Simple Table

+ * OBJECTIVE: Test that HDF can read a document containing a simple table (simple-table.doc).

+ * SUCCESS: HDF reads the document. Matches values in their particular positions.

+ * FAILURE: HDF does not read the document or excepts. HDF cannot identify values + * in the document in their known positions.

+ * + */ + + public void testSimpleTable() + throws IOException + { + String filename = System.getProperty("HDF.testdata.path"); + + filename = filename + "/simple-table.doc"; + FileInputStream stream = new FileInputStream(filename); + HDFDocument empty = new HDFDocument(stream); + stream.close(); + } + + public static void main(String [] ignored_args) + { + String path = System.getProperty("HDF.testdata.path"); + + // assume this is relative to basedir + if (path == null) + { + System.setProperty( + "HDF.testdata.path", + "src/scratchpad/testcases/org/apache/poi/hdf/data"); + } + System.out.println("Testing org.apache.poi.hdf.model.HDFDocument"); + junit.textui.TestRunner.run(TestHDFDocument.class); + } +} -- 2.39.5