mirror of https://github.com/apache/poi.git
Eclipse automated refactor/cleanup: add final modifier to private fields to unit tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765739 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7520fcd4fb
commit
db63b9cf69
|
@ -30,7 +30,7 @@ import java.util.Set;
|
|||
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);
|
||||
|
|
|
@ -41,8 +41,8 @@ import org.junit.Test;
|
|||
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
|
||||
|
||||
public class TestThemesTable {
|
||||
private String testFileSimple = "Themes.xlsx";
|
||||
private String testFileComplex = "Themes2.xlsx";
|
||||
private final String testFileSimple = "Themes.xlsx";
|
||||
private final String testFileComplex = "Themes2.xlsx";
|
||||
// TODO .xls version available too, add HSSF support then check
|
||||
|
||||
// What colours they should show up as
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.apache.poi.xssf.usermodel.*;
|
|||
public final class TestXSSFChartAxis extends TestCase {
|
||||
|
||||
private static final double EPSILON = 1E-7;
|
||||
private XSSFChartAxis axis;
|
||||
private final XSSFChartAxis axis;
|
||||
|
||||
public TestXSSFChartAxis() {
|
||||
super();
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.framework.TestCase;
|
|||
|
||||
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;
|
||||
|
|
|
@ -29,8 +29,8 @@ import org.apache.poi.POIDataSamples;
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ import org.apache.poi.POIDataSamples;
|
|||
*/
|
||||
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();
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.poi.POIDataSamples;
|
|||
*/
|
||||
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();
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.poi.util.StringUtil;
|
|||
*/
|
||||
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",
|
||||
|
|
|
@ -37,7 +37,7 @@ public final class TestAnimationInfoAtom extends TestCase {
|
|||
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
|
||||
|
|
|
@ -28,10 +28,10 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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 };
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.junit.Test;
|
|||
*/
|
||||
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,
|
||||
|
@ -64,7 +64,7 @@ public final class TestComment2000 {
|
|||
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,
|
||||
|
|
|
@ -36,14 +36,14 @@ import org.junit.Test;
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -30,9 +30,9 @@ import org.apache.poi.POIDataSamples;
|
|||
*/
|
||||
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();
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.Test;
|
|||
*/
|
||||
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,
|
||||
|
@ -67,7 +67,7 @@ public final class TestDocumentEncryptionAtom {
|
|||
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,
|
||||
|
|
|
@ -55,7 +55,7 @@ public final class TestExControl extends TestCase {
|
|||
</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,
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.apache.poi.POIDataSamples;
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -28,11 +28,11 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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
|
||||
};
|
||||
|
|
|
@ -28,11 +28,11 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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
|
||||
};
|
||||
|
|
|
@ -30,7 +30,7 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
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 };
|
||||
|
|
|
@ -55,7 +55,7 @@ public final class TestExOleObjStg extends TestCase {
|
|||
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,
|
||||
|
|
|
@ -32,7 +32,7 @@ import junit.framework.TestCase;
|
|||
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,
|
||||
|
|
|
@ -30,7 +30,7 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -31,7 +31,7 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
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 };
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
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,
|
||||
|
@ -41,7 +41,7 @@ public final class TestHeadersFootersContainer extends TestCase {
|
|||
};
|
||||
|
||||
// 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,
|
||||
|
|
|
@ -32,7 +32,7 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -28,12 +28,12 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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() {
|
||||
|
|
|
@ -32,7 +32,7 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
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 };
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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 };
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ public final class TestStyleTextPropAtom {
|
|||
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
|
||||
|
|
|
@ -28,15 +28,15 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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);
|
||||
|
|
|
@ -28,12 +28,12 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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);
|
||||
|
|
|
@ -28,9 +28,9 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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);
|
||||
|
|
|
@ -31,14 +31,14 @@ import junit.framework.TestCase;
|
|||
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
|
||||
};
|
||||
|
|
|
@ -31,7 +31,7 @@ import junit.framework.TestCase;
|
|||
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,
|
||||
|
|
|
@ -28,12 +28,12 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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
|
||||
};
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream;
|
|||
*/
|
||||
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 };
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.apache.poi.POIDataSamples;
|
|||
*/
|
||||
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();
|
||||
|
|
|
@ -30,9 +30,9 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
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();
|
||||
|
|
|
@ -29,7 +29,7 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
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();
|
||||
|
|
|
@ -35,12 +35,12 @@ import org.junit.Test;
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -29,14 +29,14 @@ import org.apache.poi.hsmf.exceptions.ChunkNotFoundException;
|
|||
* 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.
|
||||
|
|
|
@ -30,7 +30,7 @@ import junit.framework.TestCase;
|
|||
* 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.
|
||||
|
|
|
@ -31,8 +31,8 @@ import org.apache.poi.hsmf.exceptions.ChunkNotFoundException;
|
|||
* @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.
|
||||
|
|
|
@ -29,8 +29,8 @@ import junit.framework.TestCase;
|
|||
|
||||
public final class TestMessageSubmissionChunk extends TestCase {
|
||||
|
||||
private MAPIMessage mapiMessageExtraHyphenSubmissionChunk;
|
||||
private MAPIMessage mapiMessageNormalSubmissionChunk;
|
||||
private final MAPIMessage mapiMessageExtraHyphenSubmissionChunk;
|
||||
private final MAPIMessage mapiMessageNormalSubmissionChunk;
|
||||
|
||||
/**
|
||||
* Initialise this test, load up the test messages.
|
||||
|
|
|
@ -29,9 +29,9 @@ import junit.framework.TestCase;
|
|||
|
||||
public final class TestMessageSubmissionChunkY2KRead extends TestCase {
|
||||
|
||||
private MAPIMessage mapiMessage1979;
|
||||
private MAPIMessage mapiMessage1980;
|
||||
private MAPIMessage mapiMessage1981;
|
||||
private final MAPIMessage mapiMessage1979;
|
||||
private final MAPIMessage mapiMessage1980;
|
||||
private final MAPIMessage mapiMessage1981;
|
||||
|
||||
/**
|
||||
* Initialise this test, load up the three test messages.
|
||||
|
|
|
@ -29,7 +29,7 @@ import junit.framework.TestCase;
|
|||
* 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.
|
||||
|
|
|
@ -30,7 +30,7 @@ import junit.framework.TestCase;
|
|||
* 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.
|
||||
|
|
|
@ -39,7 +39,7 @@ import org.junit.Test;
|
|||
* 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;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.junit.Test;
|
|||
* 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 {
|
||||
|
|
|
@ -32,7 +32,7 @@ public final class HWPFDocFixture
|
|||
public byte[] _tableStream;
|
||||
public byte[] _mainStream;
|
||||
public FileInformationBlock _fib;
|
||||
private String _testFile;
|
||||
private final String _testFile;
|
||||
|
||||
public HWPFDocFixture(Object obj, String testFile)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ public final class TestCHPBinTable
|
|||
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;
|
||||
|
|
|
@ -36,7 +36,7 @@ public final class TestSavedByTable
|
|||
{
|
||||
|
||||
/** 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"),
|
||||
|
|
|
@ -811,16 +811,16 @@ public class TestBugs extends TestCase
|
|||
|
||||
// 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;
|
||||
|
|
|
@ -30,19 +30,19 @@ import junit.framework.TestCase;
|
|||
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;
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@ import org.apache.poi.hwpf.HWPFTestDataSamples;
|
|||
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;
|
||||
|
||||
|
|
|
@ -31,15 +31,15 @@ import org.apache.poi.hwpf.HWPFTestDataSamples;
|
|||
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
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class POIDataSamples {
|
|||
/** <code>true</code> if standard system propery is not set,
|
||||
* but the data is available on the test runtime classpath */
|
||||
private boolean _sampleDataIsAvaliableOnClassPath;
|
||||
private String _moduleDir;
|
||||
private final String _moduleDir;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -86,7 +86,7 @@ public final class TestAbortableListener extends TestCase {
|
|||
}
|
||||
|
||||
private static final class AbortableCountingListener extends AbortableHSSFListener {
|
||||
private int abortAfterIndex;
|
||||
private final int abortAfterIndex;
|
||||
public int countSeen;
|
||||
public Record lastRecordSeen;
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ public final class TestEventRecordFactory extends TestCase {
|
|||
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()
|
||||
|
|
|
@ -365,7 +365,7 @@ public final class TestMissingRecordAwareHSSFListener extends TestCase {
|
|||
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) {
|
||||
|
|
|
@ -26,7 +26,7 @@ import junit.framework.TestCase;
|
|||
* @author Yegor Kozlov
|
||||
*/
|
||||
public final class TestAutoFilterInfoRecord extends TestCase {
|
||||
private byte[] data = new byte[] {
|
||||
private final byte[] data = new byte[] {
|
||||
0x05, 0x00
|
||||
};
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import junit.framework.TestCase;
|
|||
* @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
|
||||
};
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.apache.poi.util.HexRead;
|
|||
* @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 " +
|
||||
|
|
|
@ -29,7 +29,7 @@ import junit.framework.TestCase;
|
|||
* @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
|
||||
|
|
|
@ -64,7 +64,7 @@ public final class TestColumnInfoRecordsAggregate {
|
|||
|
||||
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) {
|
||||
|
|
|
@ -36,7 +36,7 @@ public final class RecordInspector {
|
|||
|
||||
public static final class RecordCollector implements RecordVisitor {
|
||||
|
||||
private List<Record> _list;
|
||||
private final List<Record> _list;
|
||||
|
||||
public RecordCollector() {
|
||||
_list = new ArrayList<Record>(128);
|
||||
|
|
|
@ -85,7 +85,7 @@ public class SanityChecker {
|
|||
{
|
||||
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 )
|
||||
{
|
||||
|
|
|
@ -417,7 +417,7 @@ public final class TestCellStyle extends TestCase {
|
|||
|
||||
|
||||
private static class CellFormatBugExample extends Thread {
|
||||
private String fileName;
|
||||
private final String fileName;
|
||||
private Throwable exception = null;
|
||||
|
||||
public CellFormatBugExample(String fileName) {
|
||||
|
|
|
@ -33,8 +33,8 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
|||
* 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
|
||||
|
|
|
@ -51,7 +51,7 @@ public final class TestWorkbook {
|
|||
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) {
|
||||
|
|
|
@ -31,11 +31,11 @@ import org.apache.poi.poifs.filesystem.POIFSDocumentPath;
|
|||
* @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[]
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ public final class TestPOIFSReaderRegistry extends TestCase {
|
|||
"c"
|
||||
})
|
||||
};
|
||||
private String[] names =
|
||||
private final String[] names =
|
||||
{
|
||||
"a0", "a1", "a2", "a3"
|
||||
};
|
||||
|
|
|
@ -40,11 +40,11 @@ import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;
|
|||
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
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.Random;
|
|||
*/
|
||||
public class SlowInputStream extends FilterInputStream
|
||||
{
|
||||
private Random r = new Random(0);
|
||||
private final Random r = new Random(0);
|
||||
|
||||
public SlowInputStream(InputStream in) {
|
||||
super(in);
|
||||
|
|
|
@ -26,8 +26,8 @@ import java.util.List;
|
|||
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();
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.apache.poi.poifs.storage.RawDataBlockList;
|
|||
* 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
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.poi.util.LittleEndianConsts;
|
|||
* @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()
|
||||
|
|
|
@ -190,9 +190,9 @@ public final class TestRawDataBlock extends TestCase {
|
|||
* 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) {
|
||||
|
|
|
@ -91,8 +91,8 @@ public class TestEvaluationCache extends TestCase {
|
|||
|
||||
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;
|
||||
|
|
|
@ -35,7 +35,7 @@ public abstract class BaseTestSheetHiding {
|
|||
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
|
||||
|
|
|
@ -35,7 +35,7 @@ public class TestCellWalk extends TestCase {
|
|||
{null, null, "str"}
|
||||
};
|
||||
|
||||
private CountCellHandler countCellHandler = new CountCellHandler();
|
||||
private final CountCellHandler countCellHandler = new CountCellHandler();
|
||||
|
||||
public void testNotTraverseEmptyCells() {
|
||||
Workbook wb = new HSSFWorkbook();
|
||||
|
|
Loading…
Reference in New Issue