Test case fixed.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353266 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Rainer Klute 2003-07-28 16:45:39 +00:00
parent 4d9102eee3
commit 4d6ffc7b93

View File

@ -37,13 +37,20 @@ public class TestEmptyProperties extends TestCase
static final String[] POI_FILES = new String[] static final String[] POI_FILES = new String[]
{ {
"SlideShow", "PerfectOffice_MAIN",
"\005SummaryInformation", "\005SummaryInformation",
"PerfectOffice_MAIN" "Main"
}; };
POIFile[] poiFiles; POIFile[] poiFiles;
/**
* <p>Constructor</p>
*
* @param name The name of the test case
*/
public TestEmptyProperties(final String name) public TestEmptyProperties(final String name)
{ {
super(name); super(name);
@ -53,6 +60,10 @@ public class TestEmptyProperties extends TestCase
/** /**
* <p>Read a the test file from the "data" directory.</p> * <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 public void setUp() throws FileNotFoundException, IOException
{ {
@ -68,6 +79,8 @@ public class TestEmptyProperties extends TestCase
/** /**
* <p>Checks the names of the files in the POI filesystem. They * <p>Checks the names of the files in the POI filesystem. They
* are expected to be in a certain order.</p> * are expected to be in a certain order.</p>
*
* @exception IOException if an I/O exception occurs
*/ */
public void testReadFiles() throws IOException public void testReadFiles() throws IOException
{ {
@ -86,6 +99,8 @@ public class TestEmptyProperties extends TestCase
* property sets. In the latter cases a {@link * property sets. In the latter cases a {@link
* NoPropertySetStreamException} will be thrown when trying to * NoPropertySetStreamException} will be thrown when trying to
* create a {@link PropertySet}.</p> * create a {@link PropertySet}.</p>
*
* @exception IOException if an I/O exception occurs
*/ */
public void testCreatePropertySets() throws IOException public void testCreatePropertySets() throws IOException
{ {
@ -126,10 +141,13 @@ public class TestEmptyProperties extends TestCase
* <p>Tests the {@link PropertySet} methods. The test file has two * <p>Tests the {@link PropertySet} methods. The test file has two
* property sets: the first one is a {@link SummaryInformation}, * property sets: the first one is a {@link SummaryInformation},
* the second one is a {@link DocumentSummaryInformation}.</p> * 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 public void testPropertySetMethods() throws IOException, HPSFException
{ {
byte[] b = poiFiles[2].getBytes(); byte[] b = poiFiles[1].getBytes();
PropertySet ps = PropertySet ps =
PropertySetFactory.create(new ByteArrayInputStream(b)); PropertySetFactory.create(new ByteArrayInputStream(b));
SummaryInformation s = (SummaryInformation) ps; SummaryInformation s = (SummaryInformation) ps;
@ -156,6 +174,10 @@ public class TestEmptyProperties extends TestCase
/** /**
* <p>Runs the test cases stand-alone.</p> * <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 public static void main(final String[] args) throws Throwable
{ {