You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Glen Stampoultzis <gs...@iinet.net.au> on 2003/07/28 03:00:56 UTC
[ATTN:Rainer] Re: cvs commit:
jakarta-poi/src/testcases/org/apache/poi/hpsf/data TestCorel.shw
This stuff does not compile. I've been asked to create a build so please
revert or fix this ASAP.
Thanks,
Glen
At 08:01 AM 27/07/2003, you wrote:
>klute 2003/07/26 15:01:37
>
> Modified: src/testcases/org/apache/poi/hpsf/basic Tag: REL_2_BRANCH
> POIFile.java TestBasic.java TestUnicode.java
> Util.java
> Added: src/testcases/org/apache/poi/hpsf/basic Tag: REL_2_BRANCH
> TestEmptyProperties.java
> src/testcases/org/apache/poi/hpsf/data Tag: REL_2_BRANCH
> TestCorel.shw
> Log:
> Bug 21775
>
> Revision Changes Path
> No revision
>
>
> No revision
>
>
> 1.2.2.1 +9
> -8 jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/POIFile.java
>
> Index: POIFile.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/POIFile.java,v
> retrieving revision 1.2
> retrieving revision 1.2.2.1
> diff -u -r1.2 -r1.2.2.1
> --- POIFile.java 30 Apr 2003 04:39:19 -0000 1.2
> +++ POIFile.java 26 Jul 2003 22:01:37 -0000 1.2.2.1
> @@ -53,7 +53,8 @@
> */
>
> package org.apache.poi.hpsf.basic;
> -import org.apache.poi.poifs.filesystem.*;
> +
> +import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
>
>
>
> @@ -73,32 +74,32 @@
>
> public void setName(final String name)
> {
> - this.name = name;
> + this.name = name;
> }
>
> public String getName()
> {
> - return name;
> + return name;
> }
>
> public void setPath(final POIFSDocumentPath path)
> {
> - this.path = path;
> + this.path = path;
> }
>
> public POIFSDocumentPath getPath()
> {
> - return path;
> + return path;
> }
>
> public void setBytes(final byte[] bytes)
> {
> - this.bytes = bytes;
> + this.bytes = bytes;
> }
>
> public byte[] getBytes()
> {
> - return bytes;
> + return bytes;
> }
>
> }
>
>
>
> 1.3.2.1 +101
> -89 jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java
>
> Index: TestBasic.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestBasic.java,v
> retrieving revision 1.3
> retrieving revision 1.3.2.1
> diff -u -r1.3 -r1.3.2.1
> --- TestBasic.java 30 Apr 2003 04:39:19 -0000 1.3
> +++ TestBasic.java 26 Jul 2003 22:01:37 -0000 1.3.2.1
> @@ -54,10 +54,23 @@
>
> package org.apache.poi.hpsf.basic;
>
> -import java.io.*;
> -import java.util.*;
> -import junit.framework.*;
> -import org.apache.poi.hpsf.*;
> +import java.io.ByteArrayInputStream;
> +import java.io.File;
> +import java.io.FileNotFoundException;
> +import java.io.IOException;
> +import java.io.InputStream;
> +
> +import junit.framework.Assert;
> +import junit.framework.TestCase;
> +
> +import org.apache.poi.hpsf.DocumentSummaryInformation;
> +import org.apache.poi.hpsf.HPSFException;
> +import org.apache.poi.hpsf.MarkUnsupportedException;
> +import org.apache.poi.hpsf.NoPropertySetStreamException;
> +import org.apache.poi.hpsf.PropertySet;
> +import org.apache.poi.hpsf.PropertySetFactory;
> +import org.apache.poi.hpsf.SummaryInformation;
> +import org.apache.poi.hpsf.UnexpectedPropertySetTypeException;
>
>
>
> @@ -71,37 +84,37 @@
> public class TestBasic extends TestCase
> {
>
> - final static String POI_FS = "TestGermanWord90.doc";
> - final static String[] POI_FILES = new String[]
> - {
> - "\005SummaryInformation",
> - "\005DocumentSummaryInformation",
> - "WordDocument",
> - "\001CompObj",
> - "1Table"
> - };
> - final static int BYTE_ORDER = 0xfffe;
> - final static int FORMAT = 0x0000;
> - final static int OS_VERSION = 0x00020A04;
> - final static byte[] CLASS_ID =
> - {
> - (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
> - (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
> - (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
> - (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
> - };
> - final static int[] SECTION_COUNT =
> + static final String POI_FS = "TestGermanWord90.doc";
> + static final String[] POI_FILES = new String[]
> + {
> + "\005SummaryInformation",
> + "\005DocumentSummaryInformation",
> + "WordDocument",
> + "\001CompObj",
> + "1Table"
> + };
> + static final int BYTE_ORDER = 0xfffe;
> + static final int FORMAT = 0x0000;
> + static final int OS_VERSION = 0x00020A04;
> + static final byte[] CLASS_ID =
> + {
> + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
> + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
> + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
> + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
> + };
> + static final int[] SECTION_COUNT =
> {1, 2};
> - final static boolean[] IS_SUMMARY_INFORMATION =
> + static final boolean[] IS_SUMMARY_INFORMATION =
> {true, false};
> - final static boolean[] IS_DOCUMENT_SUMMARY_INFORMATION =
> - {false, true};
> + static final boolean[] IS_DOCUMENT_SUMMARY_INFORMATION =
> + {false, true};
>
> POIFile[] poiFiles;
>
>
>
> - public TestBasic(String name)
> + public TestBasic(final String name)
> {
> super(name);
> }
> @@ -113,11 +126,11 @@
> */
> public void setUp() throws FileNotFoundException, IOException
> {
> - final File dataDir =
> - new File(System.getProperty("HPSF.testdata.path"));
> - final File data = new File(dataDir, POI_FS);
> + final File dataDir =
> + new File(System.getProperty("HPSF.testdata.path"));
> + final File data = new File(dataDir, POI_FS);
>
> - poiFiles = Util.readPOIFiles(data);
> + poiFiles = Util.readPOIFiles(data);
> }
>
>
> @@ -128,9 +141,9 @@
> */
> public void testReadFiles() throws IOException
> {
> - String[] expected = POI_FILES;
> - for (int i = 0; i < expected.length; i++)
> - Assert.assertEquals(poiFiles[i].getName(), expected[i]);
> + String[] expected = POI_FILES;
> + for (int i = 0; i < expected.length; i++)
> + Assert.assertEquals(poiFiles[i].getName(), expected[i]);
> }
>
>
> @@ -146,37 +159,37 @@
> */
> public void testCreatePropertySets() throws IOException
> {
> - Class[] expected = new Class[]
> - {
> - SummaryInformation.class,
> - DocumentSummaryInformation.class,
> - NoPropertySetStreamException.class,
> - NoPropertySetStreamException.class,
> - NoPropertySetStreamException.class
> - };
> - for (int i = 0; i < expected.length; i++)
> - {
> - InputStream in = new
> ByteArrayInputStream(poiFiles[i].getBytes());
> - Object o;
> - try
> - {
> - o = PropertySetFactory.create(in);
> - }
> - catch (NoPropertySetStreamException ex)
> - {
> - o = ex;
> - }
> - catch (UnexpectedPropertySetTypeException ex)
> - {
> - o = ex;
> - }
> - catch (MarkUnsupportedException ex)
> - {
> - o = ex;
> - }
> - in.close();
> - Assert.assertEquals(o.getClass(), expected[i]);
> - }
> + Class[] expected = new Class[]
> + {
> + SummaryInformation.class,
> + DocumentSummaryInformation.class,
> + NoPropertySetStreamException.class,
> + NoPropertySetStreamException.class,
> + NoPropertySetStreamException.class
> + };
> + for (int i = 0; i < expected.length; i++)
> + {
> + InputStream in = new
> ByteArrayInputStream(poiFiles[i].getBytes());
> + Object o;
> + try
> + {
> + o = PropertySetFactory.create(in);
> + }
> + catch (NoPropertySetStreamException ex)
> + {
> + o = ex;
> + }
> + catch (UnexpectedPropertySetTypeException ex)
> + {
> + o = ex;
> + }
> + catch (MarkUnsupportedException ex)
> + {
> + o = ex;
> + }
> + in.close();
> + Assert.assertEquals(o.getClass(), expected[i]);
> + }
> }
>
>
> @@ -188,25 +201,24 @@
> */
> public void testPropertySetMethods() throws IOException, HPSFException
> {
> - String[] expected = POI_FILES;
>
> - /* Loop over the two property sets. */
> - for (int i = 0; i < 2; i++)
> - {
> - byte[] b = poiFiles[i].getBytes();
> - PropertySet ps =
> - PropertySetFactory.create(new ByteArrayInputStream(b));
> - Assert.assertEquals(ps.getByteOrder(), BYTE_ORDER);
> - Assert.assertEquals(ps.getFormat(), FORMAT);
> - Assert.assertEquals(ps.getOSVersion(), OS_VERSION);
> - Assert.assertEquals(new String(ps.getClassID().getBytes()),
> - new String(CLASS_ID));
> - Assert.assertEquals(ps.getSectionCount(), SECTION_COUNT[i]);
> - Assert.assertEquals(ps.isSummaryInformation(),
> - IS_SUMMARY_INFORMATION[i]);
> - Assert.assertEquals(ps.isDocumentSummaryInformation(),
> - IS_DOCUMENT_SUMMARY_INFORMATION[i]);
> - }
> + /* Loop over the two property sets. */
> + for (int i = 0; i < 2; i++)
> + {
> + byte[] b = poiFiles[i].getBytes();
> + PropertySet ps =
> + PropertySetFactory.create(new ByteArrayInputStream(b));
> + Assert.assertEquals(ps.getByteOrder(), BYTE_ORDER);
> + Assert.assertEquals(ps.getFormat(), FORMAT);
> + Assert.assertEquals(ps.getOSVersion(), OS_VERSION);
> + Assert.assertEquals(new String(ps.getClassID().getBytes()),
> + new String(CLASS_ID));
> + Assert.assertEquals(ps.getSectionCount(), SECTION_COUNT[i]);
> + Assert.assertEquals(ps.isSummaryInformation(),
> + IS_SUMMARY_INFORMATION[i]);
> + Assert.assertEquals(ps.isDocumentSummaryInformation(),
> + IS_DOCUMENT_SUMMARY_INFORMATION[i]);
> + }
> }
>
>
> @@ -214,11 +226,11 @@
> /**
> * <p>Runs the test cases stand-alone.</p>
> */
> - public static void main(String[] args) throws Throwable
> + public static void main(final String[] args) throws Throwable
> {
> - System.setProperty("HPSF.testdata.path",
> - "./src/testcases/org/apache/poi/hpsf/data");
> - junit.textui.TestRunner.run(TestBasic.class);
> + System.setProperty("HPSF.testdata.path",
> + "./src/testcases/org/apache/poi/hpsf/data");
> + junit.textui.TestRunner.run(TestBasic.class);
> }
>
> }
>
>
>
> 1.2.2.1 +48
> -35 jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java
>
> Index: TestUnicode.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestUnicode.java,v
> retrieving revision 1.2
> retrieving revision 1.2.2.1
> diff -u -r1.2 -r1.2.2.1
> --- TestUnicode.java 30 Apr 2003 04:39:19 -0000 1.2
> +++ TestUnicode.java 26 Jul 2003 22:01:37 -0000 1.2.2.1
> @@ -54,10 +54,18 @@
>
> package org.apache.poi.hpsf.basic;
>
> -import java.io.*;
> -import java.util.*;
> -import junit.framework.*;
> -import org.apache.poi.hpsf.*;
> +import java.io.ByteArrayInputStream;
> +import java.io.File;
> +import java.io.FileNotFoundException;
> +import java.io.IOException;
> +
> +import junit.framework.Assert;
> +import junit.framework.TestCase;
> +
> +import org.apache.poi.hpsf.HPSFException;
> +import org.apache.poi.hpsf.PropertySet;
> +import org.apache.poi.hpsf.PropertySetFactory;
> +import org.apache.poi.hpsf.Section;
>
>
>
> @@ -72,17 +80,22 @@
> public class TestUnicode extends TestCase
> {
>
> - final static String POI_FS = "TestUnicode.xls";
> - final static String[] POI_FILES = new String[]
> - {
> - "\005DocumentSummaryInformation",
> - };
> + static final String POI_FS = "TestUnicode.xls";
> + static final String[] POI_FILES = new String[]
> + {
> + "\005DocumentSummaryInformation",
> + };
> File data;
> POIFile[] poiFiles;
>
>
>
> - public TestUnicode(String name)
> + /**
> + * <p>Constructor</p>
> + *
> + * @param name the test case's name
> + */
> + public TestUnicode(final String name)
> {
> super(name);
> }
> @@ -92,11 +105,11 @@
> /**
> * <p>Read a the test file from the "data" directory.</p>
> */
> - public void setUp() throws FileNotFoundException, IOException
> + protected void setUp() throws FileNotFoundException, IOException
> {
> - final File dataDir =
> - new File(System.getProperty("HPSF.testdata.path"));
> - data = new File(dataDir, POI_FS);
> + final File dataDir =
> + new File(System.getProperty("HPSF.testdata.path"));
> + data = new File(dataDir, POI_FS);
> }
>
>
> @@ -108,23 +121,23 @@
> */
> public void testPropertySetMethods() throws IOException, HPSFException
> {
> - POIFile poiFile = Util.readPOIFiles(data, POI_FILES)[0];
> - byte[] b = poiFile.getBytes();
> - PropertySet ps =
> - PropertySetFactory.create(new ByteArrayInputStream(b));
> - Assert.assertTrue(ps.isDocumentSummaryInformation());
> - Assert.assertEquals(ps.getSectionCount(), 2);
> - Section s = (Section) ps.getSections().get(1);
> - Assert.assertEquals(s.getProperty(1),
> - new Integer(1200));
> - Assert.assertEquals(s.getProperty(2),
> - new Long(4198897018l));
> - Assert.assertEquals(s.getProperty(3),
> - "MCon_Info zu Office bei Schreiner");
> - Assert.assertEquals(s.getProperty(4),
> - "petrovitsch@schreiner-online.de");
> - Assert.assertEquals(s.getProperty(5),
> - "Petrovitsch, Wilhelm");
> + POIFile poiFile = Util.readPOIFiles(data, POI_FILES)[0];
> + byte[] b = poiFile.getBytes();
> + PropertySet ps =
> + PropertySetFactory.create(new ByteArrayInputStream(b));
> + Assert.assertTrue(ps.isDocumentSummaryInformation());
> + Assert.assertEquals(ps.getSectionCount(), 2);
> + Section s = (Section) ps.getSections().get(1);
> + Assert.assertEquals(s.getProperty(1),
> + new Integer(1200));
> + Assert.assertEquals(s.getProperty(2),
> + new Long(4198897018L));
> + Assert.assertEquals(s.getProperty(3),
> + "MCon_Info zu Office bei Schreiner");
> + Assert.assertEquals(s.getProperty(4),
> + "petrovitsch@schreiner-online.de");
> + Assert.assertEquals(s.getProperty(5),
> + "Petrovitsch, Wilhelm");
> }
>
>
> @@ -132,10 +145,10 @@
> /**
> * <p>Runs the test cases stand-alone.</p>
> */
> - public static void main(String[] args)
> + public static void main(final String[] args)
> {
> - System.setProperty("HPSF.testdata.path",
> - "./src/testcases/org/apache/poi/hpsf/data");
> + System.setProperty("HPSF.testdata.path",
> + "./src/testcases/org/apache/poi/hpsf/data");
> junit.textui.TestRunner.run(TestUnicode.class);
> }
>
>
>
>
> 1.3.2.1 +82
> -65 jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/Util.java
>
> Index: Util.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/Util.java,v
> retrieving revision 1.3
> retrieving revision 1.3.2.1
> diff -u -r1.3 -r1.3.2.1
> --- Util.java 30 Apr 2003 04:39:19 -0000 1.3
> +++ Util.java 26 Jul 2003 22:01:37 -0000 1.3.2.1
> @@ -54,9 +54,24 @@
>
> package org.apache.poi.hpsf.basic;
>
> -import java.io.*;
> -import java.util.*;
> -import org.apache.poi.poifs.eventfilesystem.*;
> +import java.io.ByteArrayOutputStream;
> +import java.io.EOFException;
> +import java.io.File;
> +import java.io.FileInputStream;
> +import java.io.FileNotFoundException;
> +import java.io.IOException;
> +import java.io.InputStream;
> +import java.io.OutputStream;
> +import java.util.ArrayList;
> +import java.util.Collections;
> +import java.util.Iterator;
> +import java.util.LinkedList;
> +import java.util.List;
> +import java.util.Properties;
> +
> +import org.apache.poi.poifs.eventfilesystem.POIFSReader;
> +import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
> +import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;
>
>
>
> @@ -73,6 +88,9 @@
> /**
> * <p>Reads bytes from an input stream and writes them to an
> * output stream until end of file is encountered.</p>
> + *
> + * @param in the input stream to read from
> + * @param out the output stream to write to
> */
> public static void copy(final InputStream in, final OutputStream out)
> throws IOException
> @@ -88,8 +106,8 @@
> read = in.read(b, 0, BUF_SIZE);
> if (read > 0)
> out.write(b, 0, read);
> - else
> - eof = true;
> + else
> + eof = true;
> }
> catch (EOFException ex)
> {
> @@ -106,16 +124,16 @@
> * into memory and thus does not cope well with large POI
> * filessystems.</p>
> *
> - * @param file The name of the POI filesystem as seen by the
> + * @param poiFs The name of the POI filesystem as seen by the
> * operating system. (This is the "filename".)
> *
> * @return The POI files. The elements are ordered in the same way
> * as the files in the POI filesystem.
> */
> public static POIFile[] readPOIFiles(final File poiFs)
> - throws FileNotFoundException, IOException
> + throws FileNotFoundException, IOException
> {
> - return readPOIFiles(poiFs, null);
> + return readPOIFiles(poiFs, null);
> }
>
>
> @@ -126,7 +144,7 @@
> * files into memory and thus does not cope well with large POI
> * filessystems.</p>
> *
> - * @param file The name of the POI filesystem as seen by the
> + * @param poiFs The name of the POI filesystem as seen by the
> * operating system. (This is the "filename".)
> *
> * @param poiFiles The names of the POI files to be read.
> @@ -135,50 +153,49 @@
> * as the files in the POI filesystem.
> */
> public static POIFile[] readPOIFiles(final File poiFs,
> - final String[] poiFiles)
> - throws FileNotFoundException, IOException
> + final String[] poiFiles)
> + throws FileNotFoundException, IOException
> {
> - final List files = new ArrayList();
> - POIFSReader r = new POIFSReader();
> - POIFSReaderListener pfl = new POIFSReaderListener()
> - {
> - public void processPOIFSReaderEvent(POIFSReaderEvent event)
> - {
> - try
> - {
> - POIFile f = new POIFile();
> - f.setName(event.getName());
> - f.setPath(event.getPath());
> - InputStream in = event.getStream();
> - ByteArrayOutputStream out =
> - new ByteArrayOutputStream();
> - Util.copy(in, out);
> - out.close();
> - f.setBytes(out.toByteArray());
> - files.add(f);
> - }
> - catch (IOException ex)
> - {
> - ex.printStackTrace();
> - throw new RuntimeException(ex.getMessage());
> - }
> - }
> - };
> - if (poiFiles == null)
> - /* Register the listener for all POI files. */
> - r.registerListener(pfl);
> - else
> - /* Register the listener for the specified POI files
> - * only. */
> - for (int i = 0; i < poiFiles.length; i++)
> - r.registerListener(pfl, poiFiles[i]);
> -
> - /* Read the POI filesystem. */
> - r.read(new FileInputStream(poiFs));
> - POIFile[] result = new POIFile[files.size()];
> - for (int i = 0; i < result.length; i++)
> - result[i] = (POIFile) files.get(i);
> - return result;
> + final List files = new ArrayList();
> + POIFSReader r = new POIFSReader();
> + POIFSReaderListener pfl = new POIFSReaderListener()
> + {
> + public void processPOIFSReaderEvent(final POIFSReaderEvent
> event)
> + {
> + try
> + {
> + POIFile f = new POIFile();
> + f.setName(event.getName());
> + f.setPath(event.getPath());
> + InputStream in = event.getStream();
> + ByteArrayOutputStream out = new
> ByteArrayOutputStream();
> + Util.copy(in, out);
> + out.close();
> + f.setBytes(out.toByteArray());
> + files.add(f);
> + }
> + catch (IOException ex)
> + {
> + ex.printStackTrace();
> + throw new RuntimeException(ex.getMessage());
> + }
> + }
> + };
> + if (poiFiles == null)
> + /* Register the listener for all POI files. */
> + r.registerListener(pfl);
> + else
> + /* Register the listener for the specified POI files
> + * only. */
> + for (int i = 0; i < poiFiles.length; i++)
> + r.registerListener(pfl, poiFiles[i]);
> +
> + /* Read the POI filesystem. */
> + r.read(new FileInputStream(poiFs));
> + POIFile[] result = new POIFile[files.size()];
> + for (int i = 0; i < result.length; i++)
> + result[i] = (POIFile) files.get(i);
> + return result;
> }
>
>
> @@ -188,19 +205,19 @@
> */
> public static void printSystemProperties()
> {
> - Properties p = System.getProperties();
> - List names = new LinkedList();
> - for (Iterator i = p.keySet().iterator(); i.hasNext();)
> - names.add(i.next());
> - Collections.sort(names);
> - for (Iterator i = names.iterator(); i.hasNext();)
> + final Properties p = System.getProperties();
> + final List names = new LinkedList();
> + for (Iterator i = p.keySet().iterator(); i.hasNext();)
> + names.add(i.next());
> + Collections.sort(names);
> + for (final Iterator i = names.iterator(); i.hasNext();)
> {
> - String name = (String) i.next();
> - String value = (String) p.get(name);
> - System.out.println(name + ": " + value);
> - }
> - System.out.println("Current directory: " +
> - System.getProperty("user.dir"));
> + String name = (String) i.next();
> + String value = (String) p.get(name);
> + System.out.println(name + ": " + value);
> + }
> + System.out.println("Current directory: " +
> + System.getProperty("user.dir"));
> }
>
> }
>
>
>
> No revision
>
>
> No revision
>
>
> 1.1.2.1 +7
> -29
> jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java
>
> Index: TestEmptyProperties.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java,v
> retrieving revision 1.1
> retrieving revision 1.1.2.1
> diff -u -r1.1 -r1.1.2.1
> --- TestEmptyProperties.java 26 Jul 2003 21:24:53 -0000 1.1
> +++ TestEmptyProperties.java 26 Jul 2003 22:01:37 -0000 1.1.2.1
> @@ -37,20 +37,13 @@
>
> static final String[] POI_FILES = new String[]
> {
> - "PerfectOffice_MAIN",
> + "SlideShow",
> "\005SummaryInformation",
> - "Main"
> + "PerfectOffice_MAIN"
> };
>
> POIFile[] poiFiles;
>
> -
> -
> - /**
> - * <p>Constructor</p>
> - *
> - * @param name The name of the test case
> - */
> public TestEmptyProperties(final String name)
> {
> super(name);
> @@ -60,10 +53,6 @@
>
> /**
> * <p>Read a the test file from the "data" directory.</p>
> - *
> - * @exception FileNotFoundException if the file containing the
> test data
> - * does not exist
> - * @exception IOException if an I/O exception occurs
> */
> public void setUp() throws FileNotFoundException, IOException
> {
> @@ -79,8 +68,6 @@
> /**
> * <p>Checks the names of the files in the POI filesystem. They
> * are expected to be in a certain order.</p>
> - *
> - * @exception IOException if an I/O exception occurs
> */
> public void testReadFiles() throws IOException
> {
> @@ -99,11 +86,9 @@
> * property sets. In the latter cases a {@link
> * NoPropertySetStreamException} will be thrown when trying to
> * create a {@link PropertySet}.</p>
> - *
> - * @exception IOException if an I/O exception occurs
> */
> public void testCreatePropertySets() throws IOException
> - {
> + {
> Class[] expected = new Class[]
> {
> NoPropertySetStreamException.class,
> @@ -141,13 +126,10 @@
> * <p>Tests the {@link PropertySet} methods. The test file has two
> * property sets: the first one is a {@link SummaryInformation},
> * the second one is a {@link DocumentSummaryInformation}.</p>
> - *
> - * @exception IOException if an I/O exception occurs
> - * @exception HPSFException if an HPSF operation fails
> */
> public void testPropertySetMethods() throws IOException, HPSFException
> {
> - byte[] b = poiFiles[1].getBytes();
> + byte[] b = poiFiles[2].getBytes();
> PropertySet ps =
> PropertySetFactory.create(new ByteArrayInputStream(b));
> SummaryInformation s = (SummaryInformation) ps;
> @@ -163,9 +145,9 @@
> assertNull(s.getLastPrinted());
> assertNull(s.getCreateDateTime());
> assertNull(s.getLastSaveDateTime());
> - assertEquals(s.getPageCount(), 0);
> - assertEquals(s.getWordCount(), 0);
> - assertEquals(s.getCharCount(), 0);
> + assertEquals(s.getPageCount());
> + assertNull(s.getWordCount());
> + assertNull(s.getCharCount());
> assertNull(s.getThumbnail());
> assertNull(s.getApplicationName());
> }
> @@ -174,10 +156,6 @@
>
> /**
> * <p>Runs the test cases stand-alone.</p>
> - *
> - * @param args the command-line arguments (unused)
> - *
> - * @exception Throwable if any exception or error occurs
> */
> public static void main(final String[] args) throws Throwable
> {
>
>
>
> No revision
>
>
> No revision
>
>
> 1.1.2.1 +0
> -0 jakarta-poi/src/testcases/org/apache/poi/hpsf/data/TestCorel.shw
>
> <<Binary file>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: poi-dev-help@jakarta.apache.org
Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/
Re: [ATTN:Rainer] Re: cvs commit: jakarta-poi/src/testcases/org/apache/poi/hpsf/data TestCorel.shw
Posted by ra...@gmx.de.
> I have made the required changes, so the code compiles now, however,
> testEmptyProperties fails as follows.. which also needs fixing, since i
> dont think we should do a release with failing testcases. Maybe it would
> help if you compared the commit mails for your commits to HEAD and
> BRANCH.
Thanks for the hint. I'll iron that out tonight.
Best regards
Rainer Klute
--
RAINER KLUTE IT-CONSULTING GMBH
Dipl.-Inform.
Rainer Klute klute@rainer-klute.de
Körner Grund 24 Telefon: +49 172 2324824
D-44143 Dortmund Telefax: +49 231 5349423
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!
Re: [ATTN:Rainer] Re: cvs
commit: jakarta-poi/src/testcases/org/apache/poi/hpsf/data TestCorel.shw
Posted by Avik Sengupta <av...@apache.org>.
I have made the required changes, so the code compiles now, however,
testEmptyProperties fails as follows.. which also needs fixing, since i
dont think we should do a release with failing testcases. Maybe it would
help if you compared the commit mails for your commits to HEAD and
BRANCH.
single-test:
[junit] Testsuite: org.apache.poi.hpsf.basic.TestEmptyProperties
[junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.252
sec
[junit] Testcase: testReadFiles took 0.116 sec
[junit] FAILED
[junit] expected:<PerfectOffice_MAIN> but was:<SlideShow>
[junit] junit.framework.ComparisonFailure:
expected:<PerfectOffice_MAIN> but was:<SlideShow>
On Mon, 2003-07-28 at 14:43, rainer.klute@gmx.de wrote:
> > Some problem with junit... i am using 3.8.1, so i glen, i think. This is
> > with a clean compile cycle.
>
> Oops, probably something went wrong with my tries to commit the source code
> to the HEAD and the REL_2.0_BRANCH. The three method calls which are in error
> do not represent not the latest working state. I wonder if both attempts
> went wrong or whether its correct in one of the branches.
>
> Since I am behind a firewall during the working day I cannot fix it right
> now. If you are desperately needing compilable code, replace the three faulty
> method calls by the following:
>
> assertEquals(s.getPageCount(), 0);
> assertEquals(s.getWordCount(), 0);
> assertEquals(s.getCharCount(), 0);
>
> Best regards
> Rainer Klute
--
Avik Sengupta <av...@apache.org>
Re: [ATTN:Rainer] Re: cvs commit: jakarta-poi/src/testcases/org/apache/poi/hpsf/data TestCorel.shw
Posted by ra...@gmx.de.
> Some problem with junit... i am using 3.8.1, so i glen, i think. This is
> with a clean compile cycle.
Oops, probably something went wrong with my tries to commit the source code
to the HEAD and the REL_2.0_BRANCH. The three method calls which are in error
do not represent not the latest working state. I wonder if both attempts
went wrong or whether its correct in one of the branches.
Since I am behind a firewall during the working day I cannot fix it right
now. If you are desperately needing compilable code, replace the three faulty
method calls by the following:
assertEquals(s.getPageCount(), 0);
assertEquals(s.getWordCount(), 0);
assertEquals(s.getCharCount(), 0);
Best regards
Rainer Klute
--
RAINER KLUTE IT-CONSULTING GMBH
Dipl.-Inform.
Rainer Klute klute@rainer-klute.de
Körner Grund 24 Telefon: +49 172 2324824
D-44143 Dortmund Telefax: +49 231 5349423
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!
Re: [ATTN:Rainer] Re: cvs commit:
jakarta-poi/src/testcases/org/apache/poi/hpsf/data TestCorel.shw
Posted by Avik Sengupta <av...@apache.org>.
Some problem with junit... i am using 3.8.1, so i glen, i think. This is
with a clean compile cycle.
compile-main:
[javac] Compiling 308 source files to
/home/aviks/projects/jakarta-poi/build/classes
[javac] Compiling 132 source files to
/home/aviks/projects/jakarta-poi/build/test-classes
[javac]
/home/aviks/projects/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java:148: cannot resolve symbol
[javac] symbol : method assertEquals (int)
[javac] location: class
org.apache.poi.hpsf.basic.TestEmptyProperties
[javac] assertEquals(s.getPageCount());
[javac] ^
[javac]
/home/aviks/projects/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java:149: cannot resolve symbol
[javac] symbol : method assertNull (int)
[javac] location: class
org.apache.poi.hpsf.basic.TestEmptyProperties
[javac] assertNull(s.getWordCount());
[javac] ^
[javac]
/home/aviks/projects/jakarta-poi/src/testcases/org/apache/poi/hpsf/basic/TestEmptyProperties.java:150: cannot resolve symbol
[javac] symbol : method assertNull (int)
[javac] location: class
org.apache.poi.hpsf.basic.TestEmptyProperties
[javac] assertNull(s.getCharCount());
[javac] ^
[javac] Note:
/home/aviks/projects/jakarta-poi/src/testcases/org/apache/poi/hssf/record/TestRecordFactory.java uses or overrides a deprecated API.
[javac] Note: Recompile with -deprecation for details.
[javac] 3 errors
On Mon, 2003-07-28 at 13:13, rainer.klute@gmx.de wrote:
> > This stuff does not compile. I've been asked to create a build so please
> > revert or fix this ASAP.
>
> Glen,
>
> it compiles and runs fine for me. Otherwise I wouldn't have committed it.
> Please send the error messages so I can see what went wrong! Thanks!
>
> Best regards
> Rainer Klute
--
Avik Sengupta <av...@apache.org>
Re: [ATTN:Rainer] Re: cvs commit: jakarta-poi/src/testcases/org/apache/poi/hpsf/data TestCorel.shw
Posted by ra...@gmx.de.
> This stuff does not compile. I've been asked to create a build so please
> revert or fix this ASAP.
Glen,
it compiles and runs fine for me. Otherwise I wouldn't have committed it.
Please send the error messages so I can see what went wrong! Thanks!
Best regards
Rainer Klute
--
RAINER KLUTE IT-CONSULTING GMBH
Dipl.-Inform.
Rainer Klute klute@rainer-klute.de
Körner Grund 24 Telefon: +49 172 2324824
D-44143 Dortmund Telefax: +49 231 5349423
+++ GMX - Mail, Messaging & more http://www.gmx.net +++
Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!