import static org.junit.Assert.assertFalse;
public class HSSFFileHandler extends SpreadsheetHandler {
- private POIFSFileHandler delegate = new POIFSFileHandler();
+ private final POIFSFileHandler delegate = new POIFSFileHandler();
@Override
public void handleFile(InputStream stream) throws Exception {
HSSFWorkbook wb = new HSSFWorkbook(stream);
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;\r
\r
public class TestThemesTable {\r
- private String testFileSimple = "Themes.xlsx";\r
- private String testFileComplex = "Themes2.xlsx";\r
+ private final String testFileSimple = "Themes.xlsx";\r
+ private final String testFileComplex = "Themes2.xlsx";\r
// TODO .xls version available too, add HSSF support then check \r
\r
// What colours they should show up as\r
public final class TestXSSFChartAxis extends TestCase {
private static final double EPSILON = 1E-7;
- private XSSFChartAxis axis;
+ private final XSSFChartAxis axis;
public TestXSSFChartAxis() {
super();
public abstract class StreamTest extends TestCase {
public static class TestPointer extends Pointer {
- private boolean compressed;
+ private final boolean compressed;
protected boolean hasPointers = false;
public TestPointer(boolean compressed, int offset, int length, int type, short format) {
this.compressed = compressed;
public final class TestStreamComplex extends StreamTest {
private byte[] contents;
- private int trailerPointerAt = 0x24;
- private int trailerDataAt = 0x8a94;
+ private final int trailerPointerAt = 0x24;
+ private final int trailerDataAt = 0x8a94;
private ChunkFactory chunkFactory;
private PointerFactory ptrFactory;
*/
public final class TestReWriteSanity extends TestCase {
// HSLFSlideShow primed on the test data
- private HSLFSlideShowImpl ss;
+ private final HSLFSlideShowImpl ss;
// POIFS primed on the test data
- private POIFSFileSystem pfs;
+ private final POIFSFileSystem pfs;
public TestReWriteSanity() throws Exception {
POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
*/
public final class TestRecordCounts extends TestCase {
// HSLFSlideShow primed on the test data
- private HSLFSlideShowImpl ss;
+ private final HSLFSlideShowImpl ss;
public TestRecordCounts() throws Exception {
POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
*/
public final class TestCruddyExtractor extends TestCase {
// Extractor primed on the test data
- private QuickButCruddyTextExtractor te;
+ private final QuickButCruddyTextExtractor te;
// All the text to be found in the file
String[] allTheText = new String[] {
"This is a test title",
00 00 00
</AnimationInfoAtom>
*/
- private byte[] data = new byte[] {
+ private final byte[] data = new byte[] {
0x01, 0x00, (byte)0xF1, 0x0F, 0x1C, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
*/
public final class TestCString extends TestCase {
// From a real file
- private byte[] data_a = new byte[] { 0, 0, 0xBA-256, 0x0f, 0x10, 0, 0, 0,
+ private final byte[] data_a = new byte[] { 0, 0, 0xBA-256, 0x0f, 0x10, 0, 0, 0,
0x48, 00, 0x6F, 00, 0x67, 00, 0x77, 00,
0x61, 00, 0x72, 00, 0x74, 00, 0x73, 00 };
- private byte[] data_b = new byte[] { 0x10, 0, 0xBA-256, 0x0f, 0x10, 0, 0, 0,
+ private final byte[] data_b = new byte[] { 0x10, 0, 0xBA-256, 0x0f, 0x10, 0, 0, 0,
0x43, 00, 0x6F, 00, 0x6D, 00, 0x6D, 00,
0x65, 00, 0x6E, 00, 0x74, 00, 0x73, 00 };
*/
public final class TestColorSchemeAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] { 60, 0, 0xF0-256, 0x07, 0x20, 0, 0, 0,
+ private final byte[] data_a = new byte[] { 60, 0, 0xF0-256, 0x07, 0x20, 0, 0, 0,
0xFF-256, 0xFF-256, 0xFF-256, 00, 00, 00, 00, 00,
0x80-256, 0x80-256, 0x80-256, 00, 00, 00, 00, 00,
0xBB-256, 0xE0-256, 0xE3-256, 00, 0x33, 0x33, 0x99-256, 00,
*/
public final class TestComment2000 {
// From a real file
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
0x0F, 00, 0xE0-256, 0x2E, 0x9C-256, 00, 00, 00,
00, 00, 0xBA-256, 0x0F, 0x14, 00, 00, 00,
0x44, 00, 0x75, 00, 0x6D, 00, 0x62, 00,
0x0F, 00, 0xCD-256, 00, 0x92-256, 00,
00, 00, 0x92-256, 00, 00, 00
};
- private byte[] data_b = new byte[] {
+ private final byte[] data_b = new byte[] {
0x0F, 00, 0xE0-256, 0x2E, 0xAC-256, 00, 00, 00,
00, 00, 0xBA-256, 0x0F, 0x10, 00, 00, 00,
0x48, 00, 0x6F, 00, 0x67, 00, 0x77, 00,
*/
public final class TestComment2000Atom {
// From a real file
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
00, 00, 0xE1-256, 0x2E, 0x1C, 00, 00, 00,
01, 00, 00, 00, 0xD6-256, 07, 01, 00,
02, 00, 0x18, 00, 0x0A, 00, 0x1A, 00,
0x0F, 00, 0xCD-256, 00, 0x92-256, 00,
00, 00, 0x92-256, 00, 00, 00
};
- private byte[] data_b = new byte[] {
+ private final byte[] data_b = new byte[] {
00, 00, 0xE1-256, 0x2E, 0x1C, 00, 00, 00,
05, 00, 00, 00, 0xD6-256, 0x07, 01, 00,
02, 00, 0x18, 00, 0x15, 00, 0x19, 00, 03,
*/
public final class TestDocument extends TestCase {
// HSLFSlideShow primed on the test data
- private HSLFSlideShowImpl ss;
+ private final HSLFSlideShowImpl ss;
// POIFS primed on the test data
- private POIFSFileSystem pfs;
+ private final POIFSFileSystem pfs;
public TestDocument() throws Exception {
POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
*/
public final class TestDocumentAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] { 1, 0, 0xE9-256, 3, 0x28, 0, 0, 0,
+ private final byte[] data_a = new byte[] { 1, 0, 0xE9-256, 3, 0x28, 0, 0, 0,
0x80-256, 0x16, 0, 0, 0xE0-256, 0x10, 0, 0,
0xE0-256, 0x10, 0, 0, 0x80-256, 0x16, 0, 0,
0x05, 0, 0, 0, 0x0A, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
*/
public final class TestDocumentEncryptionAtom {
// From a real file
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
0x0F, 00, 0x14, 0x2F, 0xBE-256, 00, 00, 00,
02, 00, 02, 00, 0x0C, 00, 00, 00,
0x76, 00, 00, 00, 0x0C, 00, 00, 00,
0xB2-256, 0x8E-256, 0x67, 0x54, 0x07, 0x04, 0x00
};
- private byte[] data_b = new byte[] {
+ private final byte[] data_b = new byte[] {
15, 0, 20, 47, -66, 0, 0, 0,
2, 0, 2, 0, 4,
0, 0, 0, 118, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0,
</CString>
</ExControl>
*/
- private byte[] data = new byte[] {
+ private final byte[] data = new byte[] {
0x0F, 0x00, (byte)0xEE, 0x0F, (byte)0xDA, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0xFB, 0x0F, 0x04, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x01, 0x00, (byte)0xC3, 0x0F, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, (byte)0x96, 0x13, 0x00,
*/
public final class TestExHyperlink extends TestCase {
// From a real file
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
0x0F, 00, 0xD7-256, 0x0F, 0xA8-256, 00, 00, 00,
00, 00, 0xD3-256, 0x0F, 04, 00, 00, 00,
*/
public class TestExHyperlinkAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
00, 00, 0xD3-256, 0x0F, 04, 00, 00, 00,
01, 00, 00, 00
};
- private byte[] data_b = new byte[] {
+ private final byte[] data_b = new byte[] {
00, 00, 0xD3-256, 0x0F, 04, 00, 00, 00,
04, 00, 00, 00
};
*/
public class TestExObjListAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
00, 00, 0x0A, 0x04, 04, 00, 00, 00,
01, 00, 00, 00
};
- private byte[] data_b = new byte[] {
+ private final byte[] data_b = new byte[] {
00, 00, 0x0A, 0x04, 04, 00, 00, 00,
04, 00, 00, 00
};
*/
public final class TestExOleObjAtom extends TestCase {
// From a real file (embedded SWF control)
- private byte[] data = {
+ private final byte[] data = {
0x01, 0x00, (byte)0xC3, 0x0F, 0x18, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, (byte)0x96, 0x13, 0x00 };
88 97 08 35 91 83 81 07 EC 27 10 BF 18 E8 9B E1 0F 00 BD 65 3D D4
</ExOleObjStg>
*/
- private byte[] data = new byte[] {
+ private final byte[] data = new byte[] {
0x10, 0x00, 0x11, 0x10, 0x5B, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x78, (byte)0x9C, (byte)0xBB, 0x70,
0x5E, (byte)0xF0, (byte)0xC1, (byte)0xC2, (byte)0x8D, 0x52, 0x0F, 0x19, (byte)0xD0, (byte)0x80, 0x1D, 0x03,
0x33, (byte)0xC3, (byte)0xBF, (byte)0xFF, (byte)0x9C, 0x0C, 0x6C, 0x48, 0x62, (byte)0x8C, 0x40, (byte)0xCC,
public final class TestExVideoContainer extends TestCase {
// From a real file
- private byte[] data = new byte[]{
+ private final byte[] data = new byte[]{
0x0F, 0x00, 0x05, 0x10, (byte) 0x9E, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x10, 0x08, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
*/
public final class TestFontCollection extends TestCase {
// From a real file
- private byte[] data = new byte[] {
+ private final byte[] data = new byte[] {
0x0F, 0x00, 0xD5-256, 0x07, 0x4C, 0x00, 0x00, 0x00,
0x00, 0x00, 0xB7-256, 0x0F, 0x44, 0x00, 0x00, 0x00,
0x54, 0x00, 0x69, 0x00, 0x6D, 0x00, 0x65, 0x00, 0x73, 0x00,
*/
public final class TestHeadersFootersAtom extends TestCase {
// From a real file
- private byte[] data = new byte[] {
+ private final byte[] data = new byte[] {
0x00, 0x00, (byte)0xDA, 0x0F, 0x04, 0x00, 0x00, 00,
0x00, 0x00, 0x23, 0x00 };
*/
public final class TestHeadersFootersContainer extends TestCase {
// SlideHeadersFootersContainer
- private byte[] slideData = new byte[] {
+ private final byte[] slideData = new byte[] {
0x3F, 0x00, (byte)0xD9, 0x0F, 0x2E, 0x00, 0x00, 0x00,
0x00, 0x00, (byte)0xDA, 0x0F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00,
0x20, 0x00, (byte)0xBA, 0x0F, 0x1A, 0x00, 0x00, 0x00,
};
// NotesHeadersFootersContainer
- private byte[] notesData = new byte[] {
+ private final byte[] notesData = new byte[] {
0x4F, 0x00, (byte)0xD9, 0x0F, 0x48, 0x00, 0x00, 0x00,
0x00, 0x00, (byte)0xDA, 0x0F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x00,
0x10, 0x00, (byte)0xBA, 0x0F, 0x16, 0x00, 0x00, 0x00,
*/
public class TestInteractiveInfo extends TestCase {
// From a real file
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
0x0F, 00, 0xF2-256, 0x0F, 0x18, 00, 00, 00,
00, 00, 0xF3-256, 0x0F, 0x10, 00, 00, 00,
00, 00, 00, 00, 01, 00, 00, 00,
*/
public class TestInteractiveInfoAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
00, 00, 0xF3-256, 0x0F, 0x10, 00, 00, 00,
00, 00, 00, 00, 01, 00, 00, 00,
04, 00, 00, 00, 8, 00, 00, 00
};
- private byte[] data_b = new byte[] {
+ private final byte[] data_b = new byte[] {
00, 00, 0xF3-256, 0x0F, 0x10, 00, 00, 00,
00, 00, 00, 00, 04, 00, 00, 00,
04, 00, 00, 00, 8, 00, 00, 00
*/
public final class TestNotesAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] { 1, 0, 0xF1-256, 3, 8, 0, 0, 0,
+ private final byte[] data_a = new byte[] { 1, 0, 0xF1-256, 3, 8, 0, 0, 0,
0, 0, 0, 0x80-256, 0, 0, 0x0D, 0x30 };
public void testRecordType() {
*/
public final class TestSlideAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] { 1, 0, 0xEF-256, 3, 0x18, 0, 0, 0,
+ private final byte[] data_a = new byte[] { 1, 0, 0xEF-256, 3, 0x18, 0, 0, 0,
0, 0, 0, 0, 0x0F, 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80-256,
0, 1, 0, 0, 7, 0, 0x0C, 0x30 };
*/
public final class TestSlidePersistAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] { 0, 0, 0xF3-256, 3, 0x14, 0, 0, 0,
+ private final byte[] data_a = new byte[] { 0, 0, 0xF3-256, 3, 0x14, 0, 0, 0,
4, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0 };
28, 0, 1, 0, 0, 0, 0, 0,
3, 0, 1, 0, 24, 0
};
- private int data_c_text_len = 123-1;
+ private final int data_c_text_len = 123-1;
/**
* From a real file supplied for Bug 40143 by tales@great.ufc.br
*/
public final class TestTextBytesAtom extends TestCase {
// From a real file
- private byte[] data = new byte[] { 0, 0, 0xA8-256, 0x0f, 0x1c, 0, 0, 0,
+ private final byte[] data = new byte[] { 0, 0, 0xA8-256, 0x0f, 0x1c, 0, 0, 0,
0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68,
0x65, 0x20, 0x74, 0x69, 0x74, 0x6C, 0x65, 0x20, 0x6F, 0x6E,
0x20, 0x70, 0x61, 0x67, 0x65, 0x20, 0x32 };
- private String data_text = "This is the title on page 2";
- private byte[] alt_data = new byte[] { 0, 0, 0xA8-256, 0x0F, 0x14, 0, 0, 0,
+ private final String data_text = "This is the title on page 2";
+ private final byte[] alt_data = new byte[] { 0, 0, 0xA8-256, 0x0F, 0x14, 0, 0, 0,
0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,
0x74, 0x65, 0x73, 0x74, 0x20, 0x74, 0x69, 0x74, 0x6C, 0x65 };
- private String alt_text = "This is a test title";
+ private final String alt_text = "This is a test title";
public void testRecordType() {
TextBytesAtom tba = new TextBytesAtom(data,0,data.length);
*/
public final class TestTextCharsAtom extends TestCase {
// From a real file
- private byte[] data = new byte[] { 0, 0, 0xA0-256, 0x0f, 0x08, 0, 0, 0,
+ private final byte[] data = new byte[] { 0, 0, 0xA0-256, 0x0f, 0x08, 0, 0, 0,
0x54, 0x00, 0x68, 0x00, 0x69, 0x00, 0x73, 0x00 };
- private String data_text = "This";
- private byte[] alt_data = new byte[] { 0, 0, 0xA0-256, 0x0F, 0x0a, 0, 0, 0,
+ private final String data_text = "This";
+ private final byte[] alt_data = new byte[] { 0, 0, 0xA0-256, 0x0F, 0x0a, 0, 0, 0,
0x54, 0x00, 0x68, 0x00, 0x69, 0x00, 0x73, 0x00, 0xa3-256, 0x01 };
- private String alt_text = "This\u01A3";
+ private final String alt_text = "This\u01A3";
public void testRecordType() {
TextCharsAtom tca = new TextCharsAtom(data,0,data.length);
*/
public final class TestTextHeaderAtom extends TestCase {
// From a real file
- private byte[] notes_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 2, 0, 0, 0};
- private byte[] title_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 0, 0, 0, 0 };
- private byte[] body_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 1, 0, 0, 0 };
+ private final byte[] notes_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 2, 0, 0, 0};
+ private final byte[] title_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 0, 0, 0, 0 };
+ private final byte[] body_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 1, 0, 0, 0 };
public void testRecordType() {
TextHeaderAtom tha = new TextHeaderAtom(notes_data,0,12);
public final class TestTextRulerAtom extends TestCase {
//from a real file
- private byte[] data_1 = new byte[] {
+ private final byte[] data_1 = new byte[] {
0x00, 0x00, (byte)0xA6, 0x0F, 0x18, 0x00, 0x00, 0x00,
(byte)0xF8, 0x1F, 0x00, 0x00, 0x75, 0x00, (byte)0xE2, 0x00, 0x59,
0x01, (byte)0xC3, 0x01, 0x1A, 0x03, (byte)0x87, 0x03, (byte)0xF8,
0x03, 0x69, 0x04, (byte)0xF6, 0x05, (byte)0xF6, 0x05
};
- private byte[] data_2 = new byte[] {
+ private final byte[] data_2 = new byte[] {
0x00, 0x00, (byte)0xA6, 0x0F, 0x0A, 0x00, 0x00, 0x00,
0x10, 0x03, 0x00, 0x00, (byte)0xF9, 0x00, 0x41, 0x01, 0x41, 0x01
};
public final class TestTextSpecInfoAtom extends TestCase {
//from a real file
- private byte[] data_1 = new byte[] {
+ private final byte[] data_1 = new byte[] {
0x00, 0x00, (byte)0xAA, 0x0F, 0x2C, 0x00, 0x00, 0x00,
0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00,
*/
public final class TestTxInteractiveInfoAtom extends TestCase {
// From WithLinks.ppt
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
00, 00, (byte)0xDF, 0x0F, 0x08, 00, 00, 00,
0x19, 00, 00, 00, 0x38, 00, 00, 00
};
- private byte[] data_b = new byte[] {
+ private final byte[] data_b = new byte[] {
00, 00, (byte)0xDF, 0x0F, 0x08, 00, 00, 00,
0x39, 00, 00, 00, 0x4E, 00, 00, 00
};
*/
public final class TestUserEditAtom extends TestCase {
// From a real file
- private byte[] data_a = new byte[] { 0, 0, 0xF5-256, 0x0F, 0x1C, 0, 0, 0,
+ private final byte[] data_a = new byte[] { 0, 0, 0xF5-256, 0x0F, 0x1C, 0, 0, 0,
00, 01, 00, 00, 0xD9-256, 18, 00, 03,
00, 00, 00, 00, 00, 0x18, 00, 00, 01, 00, 00, 00,
05, 00, 00, 00, 01, 00, 0xF6-256, 77 };
*/
public final class TestCounts extends TestCase {
// SlideShow primed on the test data
- private HSLFSlideShow ss;
+ private final HSLFSlideShow ss;
public TestCounts() throws Exception {
POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
*/
public final class TestMostRecentRecords extends TestCase {
// HSLFSlideShow primed on the test data
- private HSLFSlideShowImpl hss;
+ private final HSLFSlideShowImpl hss;
// SlideShow primed on the test data
- private HSLFSlideShow ss;
+ private final HSLFSlideShow ss;
public TestMostRecentRecords() throws Exception {
POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
*/
public final class TestNotesText extends TestCase {
// SlideShow primed on the test data
- private HSLFSlideShow ss;
+ private final HSLFSlideShow ss;
public TestNotesText() throws Exception {
POIDataSamples slTests = POIDataSamples.getSlideShowInstance();
*/
public final class TestSystemTimeUtils {
// From real files
- private byte[] data_a = new byte[] {
+ private final byte[] data_a = new byte[] {
0xD6-256, 07, 01, 00,
02, 00, 0x18, 00, 0x0A, 00, 0x1A, 00,
0x0F, 00, 0xCD-256, 00
};
- private byte[] data_b = new byte[] {
+ private final byte[] data_b = new byte[] {
00, 00, 0xE1-256, 0x2E, 0x1C, 00, 00, 00,
01, 00, 00, 00, 0xD6-256, 0x07, 01, 00,
02, 00, 0x18, 00, 0x15, 00, 0x19, 00, 03,
* a range of files
*/
public final class TestBasics extends TestCase {
- private MAPIMessage simple;
- private MAPIMessage quick;
- private MAPIMessage outlook30;
- private MAPIMessage attachments;
- private MAPIMessage noRecipientAddress;
- private MAPIMessage unicode;
- private MAPIMessage cyrillic;
- private MAPIMessage chinese;
+ private final MAPIMessage simple;
+ private final MAPIMessage quick;
+ private final MAPIMessage outlook30;
+ private final MAPIMessage attachments;
+ private final MAPIMessage noRecipientAddress;
+ private final MAPIMessage unicode;
+ private final MAPIMessage cyrillic;
+ private final MAPIMessage chinese;
/**
* Initialize this test, load up the blank.msg mapi message.
* Tests to verify that the library can read blank msg files.
*/
public final class TestBlankFileRead extends TestCase {
- private MAPIMessage mapiMessage;
+ private final MAPIMessage mapiMessage;
/**
* Initialize this test, load up the blank.msg mapi message.
* @author Nicolas Bureau
*/
public class TestFileWithAttachmentsRead extends TestCase {
- private MAPIMessage twoSimpleAttachments;
- private MAPIMessage pdfMsgAttachments;
+ private final MAPIMessage twoSimpleAttachments;
+ private final MAPIMessage pdfMsgAttachments;
/**
* Initialize this test, load up the attachment_test_msg.msg mapi message.
\r
public final class TestMessageSubmissionChunk extends TestCase {\r
\r
- private MAPIMessage mapiMessageExtraHyphenSubmissionChunk;\r
- private MAPIMessage mapiMessageNormalSubmissionChunk;\r
+ private final MAPIMessage mapiMessageExtraHyphenSubmissionChunk;\r
+ private final MAPIMessage mapiMessageNormalSubmissionChunk;\r
\r
/**\r
* Initialise this test, load up the test messages.\r
\r
public final class TestMessageSubmissionChunkY2KRead extends TestCase {\r
\r
- private MAPIMessage mapiMessage1979;\r
- private MAPIMessage mapiMessage1980;\r
- private MAPIMessage mapiMessage1981;\r
+ private final MAPIMessage mapiMessage1979;\r
+ private final MAPIMessage mapiMessage1980;\r
+ private final MAPIMessage mapiMessage1981;\r
\r
/**\r
* Initialise this test, load up the three test messages.\r
* Tests to verify that we can still work on the newer Outlook 3.0 files.
*/
public final class TestOutlook30FileRead extends TestCase {
- private MAPIMessage mapiMessage;
+ private final MAPIMessage mapiMessage;
/**
* Initialize this test, load up the blank.msg mapi message.
* format with no attachments or extra recipents.
*/
public final class TestSimpleFileRead extends TestCase {
- private MAPIMessage mapiMessage;
+ private final MAPIMessage mapiMessage;
/**
* Initialize this test, load up the blank.msg mapi message.
* Tests to verify that the text extractor works
*/
public final class TestOutlookTextExtractor {
- private POIDataSamples samples = POIDataSamples.getHSMFInstance();
+ private final POIDataSamples samples = POIDataSamples.getHSMFInstance();
private static TimeZone userTZ;
* Tests to verify that the chunk parser works properly
*/
public final class TestPOIFSChunkParser {
- private POIDataSamples samples = POIDataSamples.getHSMFInstance();
+ private final POIDataSamples samples = POIDataSamples.getHSMFInstance();
@Test
public void testFindsCore() throws Exception {
public byte[] _tableStream;
public byte[] _mainStream;
public FileInformationBlock _fib;
- private String _testFile;
+ private final String _testFile;
public HWPFDocFixture(Object obj, String testFile)
{
private CHPBinTable _cHPBinTable = null;
private HWPFDocFixture _hWPFDocFixture;
- private TextPieceTable fakeTPT = new TextPieceTable() {
+ private final TextPieceTable fakeTPT = new TextPieceTable() {
@Override
public boolean isIndexInTable(int bytePos) {
return true;
{
/** The expected entries in the test document. */
- private List expected = Arrays.asList(new Object[] {
+ private final List expected = Arrays.asList(new Object[] {
new SavedByEntry("cic22", "C:\\DOCUME~1\\phamill\\LOCALS~1\\Temp\\AutoRecovery save of Iraq - security.asd"),
new SavedByEntry("cic22", "C:\\DOCUME~1\\phamill\\LOCALS~1\\Temp\\AutoRecovery save of Iraq - security.asd"),
new SavedByEntry("cic22", "C:\\DOCUME~1\\phamill\\LOCALS~1\\Temp\\AutoRecovery save of Iraq - security.asd"),
// These are the values the are expected to be read when the file
// is checked.
- private int section1LeftMargin = 1440;
- private int section1RightMargin = 1440;
- private int section1TopMargin = 1440;
- private int section1BottomMargin = 1440;
- private int section1NumColumns = 1;
+ private final int section1LeftMargin = 1440;
+ private final int section1RightMargin = 1440;
+ private final int section1TopMargin = 1440;
+ private final int section1BottomMargin = 1440;
+ private final int section1NumColumns = 1;
private int section2LeftMargin = 1440;
private int section2RightMargin = 1440;
private int section2TopMargin = 1440;
private int section2BottomMargin = 1440;
- private int section2NumColumns = 3;
+ private final int section2NumColumns = 3;
public void testHWPFSections() {
HWPFDocument document = null;
public final class TestRangeDelete extends TestCase {
// u201c and u201d are "smart-quotes"
- private String introText =
+ private final String introText =
"Introduction\r";
- private String fillerText =
+ private final String fillerText =
"${delete} This is an MS-Word 97 formatted document created using NeoOffice v. 2.2.4 Patch 0 (OpenOffice.org v. 2.2.1).\r";
- private String originalText =
+ private final String originalText =
"It is used to confirm that text delete works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present. Everybody should be thankful to the ${organization} ${delete} and all the POI contributors for their assistance in this matter.\r";
- private String lastText =
+ private final String lastText =
"Thank you, ${organization} ${delete}!\r";
- private String searchText = "${delete}";
- private String expectedText1 = " This is an MS-Word 97 formatted document created using NeoOffice v. 2.2.4 Patch 0 (OpenOffice.org v. 2.2.1).\r";
- private String expectedText2 =
+ private final String searchText = "${delete}";
+ private final String expectedText1 = " This is an MS-Word 97 formatted document created using NeoOffice v. 2.2.4 Patch 0 (OpenOffice.org v. 2.2.1).\r";
+ private final String expectedText2 =
"It is used to confirm that text delete works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present. Everybody should be thankful to the ${organization} and all the POI contributors for their assistance in this matter.\r";
- private String expectedText3 = "Thank you, ${organization} !\r";
+ private final String expectedText3 = "Thank you, ${organization} !\r";
private String illustrativeDocFile;
public final class TestRangeInsertion extends TestCase {
// u201c and u201d are "smart-quotes"
- private String originalText =
+ private final String originalText =
"It is used to confirm that text insertion works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present.\r";
- private String textToInsert = "Look at me! I'm cool! ";
- private int insertionPoint = 122;
+ private final String textToInsert = "Look at me! I'm cool! ";
+ private final int insertionPoint = 122;
private String illustrativeDocFile;
public final class TestRangeReplacement extends TestCase {
// u201c and u201d are "smart-quotes"
- private String originalText =
+ private final String originalText =
"It is used to confirm that text replacement works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present. Everybody should be thankful to the ${organization} and all the POI contributors for their assistance in this matter.\r";
- private String searchText = "${organization}";
- private String replacementText = "Apache Software Foundation";
- private String expectedText2 =
+ private final String searchText = "${organization}";
+ private final String replacementText = "Apache Software Foundation";
+ private final String expectedText2 =
"It is used to confirm that text replacement works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present. Everybody should be thankful to the Apache Software Foundation and all the POI contributors for their assistance in this matter.\r";
- private String expectedText3 = "Thank you, Apache Software Foundation!\r";
+ private final String expectedText3 = "Thank you, Apache Software Foundation!\r";
- private String illustrativeDocFile = "testRangeReplacement.doc";
+ private final String illustrativeDocFile = "testRangeReplacement.doc";
/**
* Test just opening the files
/** <code>true</code> if standard system propery is not set,\r
* but the data is available on the test runtime classpath */\r
private boolean _sampleDataIsAvaliableOnClassPath;\r
- private String _moduleDir;\r
+ private final String _moduleDir;\r
\r
/**\r
*\r
}
private static final class AbortableCountingListener extends AbortableHSSFListener {
- private int abortAfterIndex;
+ private final int abortAfterIndex;
public int countSeen;
public Record lastRecordSeen;
final int[] recCnt = { 0 };
final int[] offset = { 0 };
ERFListener listener = new ERFListener() {
- private String[] expectedRecordTypes = {
+ private final String[] expectedRecordTypes = {
UnknownRecord.class.getName(),
ContinueRecord.class.getName(),
ContinueRecord.class.getName()
private static final class MockHSSFListener implements HSSFListener {
public MockHSSFListener() {}
private final List<Record> _records = new ArrayList<Record>();
- private boolean logToStdOut = false;
+ private final boolean logToStdOut = false;
@Override
public void processRecord(Record record) {
* @author Yegor Kozlov
*/
public final class TestAutoFilterInfoRecord extends TestCase {
- private byte[] data = new byte[] {
+ private final byte[] data = new byte[] {
0x05, 0x00
};
* @author Yegor Kozlov
*/
public final class TestFtCblsSubRecord extends TestCase {
- private byte[] data = new byte[] {
+ private final byte[] data = new byte[] {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00,
0x01, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00
};
* @author Yegor Kozlov
*/
public final class TestNoteRecord extends TestCase {
- private byte[] testData = HexRead.readFromString(
+ private final byte[] testData = HexRead.readFromString(
"06 00 01 00 02 00 02 04 " +
"1A 00 00 " +
"41 70 61 63 68 65 20 53 6F 66 74 77 61 72 65 20 46 6F 75 6E 64 61 74 69 6F 6E " +
* @author Yegor Kozlov
*/
public final class TestNoteStructureSubRecord extends TestCase {
- private byte[] data = new byte[] {
+ private final byte[] data = new byte[] {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0x80, 0x00, 0x00, 0x00,
0x00, 0x00, (byte)0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0x81, 0x01,
(byte)0xCC, (byte)0xEC
private static final class CIRCollector implements RecordVisitor {
- private List<Record> _list = new ArrayList<Record>();
+ private final List<Record> _list = new ArrayList<Record>();
@Override
public void visitRecord(Record r) {
public static final class RecordCollector implements RecordVisitor {
- private List<Record> _list;
+ private final List<Record> _list;
public RecordCollector() {
_list = new ArrayList<Record>(128);
{
Class<? extends RecordBase> record;
char occurance; // 1 = one time, M = 1..many times, * = 0..many, 0 = optional
- private boolean together;
+ private final boolean together;
public CheckRecord( Class<? extends RecordBase> record, char occurance )
{
private static class CellFormatBugExample extends Thread {
- private String fileName;
+ private final String fileName;
private Throwable exception = null;
public CellFormatBugExample(String fileName) {
* the more usual, Workbook)
*/
public final class TestNonStandardWorkbookStreamNames extends TestCase {
- private String xlsA = "WORKBOOK_in_capitals.xls";
- private String xlsB = "BOOK_in_capitals.xls";
+ private final String xlsA = "WORKBOOK_in_capitals.xls";
+ private final String xlsB = "BOOK_in_capitals.xls";
/**
* Test that we can open a file with WORKBOOK
private static final String LAST_NAME_VALUE = "Bush";
private static final String FIRST_NAME_VALUE = "George";
private static final String SSN_VALUE = "555555555";
- private SanityChecker sanityChecker = new SanityChecker();
+ private final SanityChecker sanityChecker = new SanityChecker();
private static HSSFWorkbook openSample(String sampleFileName) {
* @author Marc Johnson
*/
public final class TestPOIFSReaderRegistry extends TestCase {
- private POIFSReaderListener[] listeners =
+ private final POIFSReaderListener[] listeners =
{
new Listener(), new Listener(), new Listener(), new Listener()
};
- private POIFSDocumentPath[] paths =
+ private final POIFSDocumentPath[] paths =
{
new POIFSDocumentPath(), new POIFSDocumentPath(new String[]
{
"c"
})
};
- private String[] names =
+ private final String[] names =
{
"a0", "a1", "a2", "a3"
};
public class ReaderWriter
implements POIFSReaderListener, POIFSWriterListener
{
- private POIFSFileSystem filesystem;
- private DirectoryEntry root;
+ private final POIFSFileSystem filesystem;
+ private final DirectoryEntry root;
// keys are DocumentDescriptors, values are byte[]s
- private Map<DocumentDescriptor, byte[]> dataMap;
+ private final Map<DocumentDescriptor, byte[]> dataMap;
/**
* Constructor ReaderWriter
*/
public class SlowInputStream extends FilterInputStream
{
- private Random r = new Random(0);
+ private final Random r = new Random(0);
public SlowInputStream(InputStream in) {
super(in);
import junit.framework.TestCase;
public class TestEntryUtils extends TestCase {
- private byte[] dataSmallA = new byte[] { 12, 42, 11, -12, -121 };
- private byte[] dataSmallB = new byte[] { 11, 73, 21, -92, -103 };
+ private final byte[] dataSmallA = new byte[] { 12, 42, 11, -12, -121 };
+ private final byte[] dataSmallB = new byte[] { 11, 73, 21, -92, -103 };
public void testCopyRecursively() throws Exception {
POIFSFileSystem fsD = new POIFSFileSystem();
* Tests for the older OPOIFS-based POIFSFileSystem
*/
public final class TestPOIFSFileSystem extends TestCase {
- private POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
+ private final POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
/**
* Mock exception used to ensure correct error handling
* @author Marc Johnson(mjohnson at apache dot org)
*/
public final class LocalRawDataBlockList extends RawDataBlockList {
- private List<RawDataBlock> _list;
+ private final List<RawDataBlock> _list;
private RawDataBlock[] _array;
public LocalRawDataBlockList()
* not to have any data
*/
public static class SlowInputStream extends InputStream {
- private Random rnd = new Random();
- private byte[] data;
- private int chunkSize;
+ private final Random rnd = new Random();
+ private final byte[] data;
+ private final int chunkSize;
private int pos = 0;
public SlowInputStream(byte[] data, int chunkSize) {
private final List<String> _logList;
private final HSSFWorkbook _book;
- private Map<ICacheEntry,EvaluationCell> _formulaCellsByCacheEntry;
- private Map<ICacheEntry,Loc> _plainCellLocsByCacheEntry;
+ private final Map<ICacheEntry,EvaluationCell> _formulaCellsByCacheEntry;
+ private final Map<ICacheEntry,Loc> _plainCellLocsByCacheEntry;
public EvalListener(HSSFWorkbook wb) {
_book = wb;
protected Workbook wbH;
protected Workbook wbU;
- private String _file1, _file2;
+ private final String _file1, _file2;
/**
* @param testDataProvider an object that provides test data in HSSF / specific way
{null, null, "str"}
};
- private CountCellHandler countCellHandler = new CountCellHandler();
+ private final CountCellHandler countCellHandler = new CountCellHandler();
public void testNotTraverseEmptyCells() {
Workbook wb = new HSSFWorkbook();