Patch from Josh from bug #44437 - improved unit test for poifs

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@629832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2008-02-21 15:42:06 +00:00
parent 1030ecb726
commit 598e5e1ba8
8 changed files with 335 additions and 0 deletions

View File

@ -0,0 +1,44 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi;
import org.apache.poi.ddf.AllPOIDDFTests;
import org.apache.poi.hpsf.basic.AllPOIHPSFBasicTests;
import org.apache.poi.hssf.HSSFTests;
import org.apache.poi.poifs.AllPOIFSTests;
import org.apache.poi.util.AllPOIUtilTests;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* Root Test Suite for entire POI project. (Includes all sub-packages of org.apache.poi)<br/>
*
* @author Josh Micich
*/
public final class AllPOITests {
public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi");
result.addTestSuite(TestPOIDocumentMain.class);
result.addTest(AllPOIDDFTests.suite());
result.addTest(AllPOIHPSFBasicTests.suite());
result.addTest(HSSFTests.suite());
result.addTest(AllPOIFSTests.suite());
result.addTest(AllPOIUtilTests.suite());
return result;
}
}

View File

@ -0,0 +1,47 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.ddf;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* Tests for org.apache.poi.ddf<br/>
*
* @author Josh Micich
*/
public final class AllPOIDDFTests {
public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi.ddf");
result.addTestSuite(TestEscherBlipWMFRecord.class);
result.addTestSuite(TestEscherBoolProperty.class);
result.addTestSuite(TestEscherBSERecord.class);
result.addTestSuite(TestEscherChildAnchorRecord.class);
result.addTestSuite(TestEscherClientAnchorRecord.class);
result.addTestSuite(TestEscherClientDataRecord.class);
result.addTestSuite(TestEscherContainerRecord.class);
result.addTestSuite(TestEscherDggRecord.class);
result.addTestSuite(TestEscherDgRecord.class);
result.addTestSuite(TestEscherOptRecord.class);
result.addTestSuite(TestEscherPropertyFactory.class);
result.addTestSuite(TestEscherSpgrRecord.class);
result.addTestSuite(TestEscherSplitMenuColorsRecord.class);
result.addTestSuite(TestEscherSpRecord.class);
result.addTestSuite(TestUnknownEscherRecord.class);
return result;
}
}

View File

@ -0,0 +1,39 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hpsf.basic;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* Test suite for org.apache.poi.hpsf.basic
*
* @author Josh Micich
*/
public final class AllPOIHPSFBasicTests {
public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi.hpsf.basic");
result.addTestSuite(TestBasic.class);
result.addTestSuite(TestClassID.class);
result.addTestSuite(TestEmptyProperties.class);
result.addTestSuite(TestMetaDataIPI.class);
result.addTestSuite(TestUnicode.class);
result.addTestSuite(TestWrite.class);
result.addTestSuite(TestWriteWellKnown.class);
return result;
}
}

View File

@ -0,0 +1,41 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.poifs;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.poi.poifs.eventfilesystem.TestPOIFSReaderRegistry;
import org.apache.poi.poifs.filesystem.AllPOIFSFileSystemTests;
import org.apache.poi.poifs.property.AllPOIFSPropertyTests;
import org.apache.poi.poifs.storage.AllPOIFSStorageTests;
/**
* Test suite for all sub-packages of org.apache.poi.poifs
*
* @author Josh Micich
*/
public final class AllPOIFSTests {
public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi.poifs");
result.addTestSuite(TestPOIFSReaderRegistry.class);
result.addTest(AllPOIFSFileSystemTests.suite());
result.addTest(AllPOIFSPropertyTests.suite());
result.addTest(AllPOIFSStorageTests.suite());
return result;
}
}

View File

@ -0,0 +1,44 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.poifs.filesystem;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* Tests for org.apache.poi.poifs.filesystem<br/>
*
* @author Josh Micich
*/
public final class AllPOIFSFileSystemTests {
public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi.poifs.filesystem");
result.addTestSuite(TestDirectoryNode.class);
result.addTestSuite(TestDocument.class);
result.addTestSuite(TestDocumentDescriptor.class);
result.addTestSuite(TestDocumentInputStream.class);
result.addTestSuite(TestDocumentNode.class);
result.addTestSuite(TestDocumentOutputStream.class);
result.addTestSuite(TestEmptyDocument.class);
result.addTestSuite(TestOffice2007XMLException.class);
result.addTestSuite(TestPOIFSDocumentPath.class);
result.addTestSuite(TestPropertySorter.class);
return result;
}
}

View File

@ -0,0 +1,22 @@
package org.apache.poi.poifs.property;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* Tests for org.apache.poi.poifs.property<br/>
*
* @author Josh Micich
*/
public final class AllPOIFSPropertyTests {
public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi.poifs.property");
result.addTestSuite(TestDirectoryProperty.class);
result.addTestSuite(TestDocumentProperty.class);
result.addTestSuite(TestPropertyFactory.class);
result.addTestSuite(TestPropertyTable.class);
result.addTestSuite(TestRootProperty.class);
return result;
}
}

View File

@ -0,0 +1,47 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.poifs.storage;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* Tests for org.apache.poi.poifs.storage<br/>
*
* @author Josh Micich
*/
public final class AllPOIFSStorageTests {
public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi.poifs.storage");
result.addTestSuite(TestBATBlock.class);
result.addTestSuite(TestBlockAllocationTableReader.class);
result.addTestSuite(TestBlockAllocationTableWriter.class);
result.addTestSuite(TestBlockListImpl.class);
result.addTestSuite(TestDocumentBlock.class);
result.addTestSuite(TestHeaderBlockReader.class);
result.addTestSuite(TestHeaderBlockWriter.class);
result.addTestSuite(TestPropertyBlock.class);
result.addTestSuite(TestRawDataBlock.class);
result.addTestSuite(TestRawDataBlockList.class);
result.addTestSuite(TestSmallBlockTableReader.class);
result.addTestSuite(TestSmallBlockTableWriter.class);
result.addTestSuite(TestSmallDocumentBlock.class);
result.addTestSuite(TestSmallDocumentBlockList.class);
return result;
}
}

View File

@ -0,0 +1,51 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.util;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* Test suite for all sub-packages of org.apache.poi.util<br/>
*
* @author Josh Micich
*/
public final class AllPOIUtilTests {
public static Test suite() {
TestSuite result = new TestSuite("Tests for org.apache.poi.util");
result.addTestSuite(TestArrayUtil.class);
result.addTestSuite(TestBinaryTree.class);
result.addTestSuite(TestBitField.class);
result.addTestSuite(TestByteField.class);
result.addTestSuite(TestDoubleList2d.class);
result.addTestSuite(TestHexDump.class);
result.addTestSuite(TestIntegerField.class);
result.addTestSuite(TestIntList.class);
result.addTestSuite(TestIntList2d.class);
result.addTestSuite(TestList2d.class);
result.addTestSuite(TestLittleEndian.class);
result.addTestSuite(TestLongField.class);
result.addTestSuite(TestPOILogFactory.class);
result.addTestSuite(TestPOILogger.class);
result.addTestSuite(TestShortField.class);
result.addTestSuite(TestShortList.class);
result.addTestSuite(TestStringUtil.class);
result.addTestSuite(TestTempFile.class);
return result;
}
}