Removed unused imports under src/java and src/testcases. Other minor fixes.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@888653 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0c3c85a152
commit
2ddd88ed0d
@ -21,12 +21,10 @@ import org.apache.poi.hssf.eventusermodel.dummyrecord.LastCellOfRowDummyRecord;
|
||||
import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingCellDummyRecord;
|
||||
import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingRowDummyRecord;
|
||||
import org.apache.poi.hssf.record.BOFRecord;
|
||||
import org.apache.poi.hssf.record.BlankRecord;
|
||||
import org.apache.poi.hssf.record.CellValueRecordInterface;
|
||||
import org.apache.poi.hssf.record.MulBlankRecord;
|
||||
import org.apache.poi.hssf.record.MulRKRecord;
|
||||
import org.apache.poi.hssf.record.NoteRecord;
|
||||
import org.apache.poi.hssf.record.NumberRecord;
|
||||
import org.apache.poi.hssf.record.Record;
|
||||
import org.apache.poi.hssf.record.RecordFactory;
|
||||
import org.apache.poi.hssf.record.RowRecord;
|
||||
|
@ -17,22 +17,14 @@
|
||||
|
||||
package org.apache.poi.hssf.usermodel;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
||||
import org.apache.poi.ddf.EscherBSERecord;
|
||||
import org.apache.poi.util.POILogFactory;
|
||||
import org.apache.poi.util.POILogger;
|
||||
import org.apache.poi.ss.usermodel.Picture;
|
||||
import org.apache.poi.ss.util.ImageUtils;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageReader;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.*;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import org.apache.poi.util.POILogFactory;
|
||||
import org.apache.poi.util.POILogger;
|
||||
|
||||
/**
|
||||
* Represents a escher picture. Eg. A GIF, JPEG etc...
|
||||
@ -65,8 +57,6 @@ public final class HSSFPicture extends HSSFSimpleShape implements Picture {
|
||||
private int _pictureIndex;
|
||||
HSSFPatriarch _patriarch; // TODO make private
|
||||
|
||||
private static final POILogger log = POILogFactory.getLogger(HSSFPicture.class);
|
||||
|
||||
/**
|
||||
* Constructs a picture object.
|
||||
*/
|
||||
|
@ -18,7 +18,6 @@
|
||||
package org.apache.poi.ss.util;
|
||||
|
||||
import org.apache.poi.ss.SpreadsheetVersion;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -17,15 +17,13 @@
|
||||
|
||||
package org.apache.poi.ddf;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.poi.util.HexRead;
|
||||
import org.apache.poi.util.HexDump;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
|
||||
import org.apache.poi.POIDataSamples;
|
||||
import org.apache.poi.util.HexDump;
|
||||
import org.apache.poi.util.HexRead;
|
||||
|
||||
/**
|
||||
* Tests for {@link EscherContainerRecord}
|
||||
|
@ -29,12 +29,9 @@ import junit.framework.TestCase;
|
||||
|
||||
import org.apache.poi.hpsf.CustomProperties;
|
||||
import org.apache.poi.hpsf.DocumentSummaryInformation;
|
||||
import org.apache.poi.hpsf.MarkUnsupportedException;
|
||||
import org.apache.poi.hpsf.NoPropertySetStreamException;
|
||||
import org.apache.poi.hpsf.PropertySet;
|
||||
import org.apache.poi.hpsf.PropertySetFactory;
|
||||
import org.apache.poi.hpsf.SummaryInformation;
|
||||
import org.apache.poi.hpsf.UnexpectedPropertySetTypeException;
|
||||
import org.apache.poi.hpsf.WritingNotSupportedException;
|
||||
import org.apache.poi.poifs.filesystem.DirectoryEntry;
|
||||
import org.apache.poi.poifs.filesystem.DocumentEntry;
|
||||
@ -605,7 +602,7 @@ public final class TestMetaDataIPI extends TestCase{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Iterative testing of the unicode test
|
||||
*
|
||||
*/
|
||||
|
@ -17,25 +17,21 @@
|
||||
|
||||
package org.apache.poi.hpsf.extractor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.poi.POIDataSamples;
|
||||
import org.apache.poi.hssf.HSSFTestDataSamples;
|
||||
import org.apache.poi.hssf.extractor.ExcelExtractor;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.hssf.HSSFTestDataSamples;
|
||||
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
||||
import org.apache.poi.POIDataSamples;
|
||||
|
||||
public final class TestHPSFPropertiesExtractor extends TestCase {
|
||||
private static final POIDataSamples _samples = POIDataSamples.getHPSFInstance();
|
||||
private static final POIDataSamples _samples = POIDataSamples.getHPSFInstance();
|
||||
|
||||
public void testNormalProperties() throws Exception {
|
||||
POIFSFileSystem fs = new POIFSFileSystem(
|
||||
_samples.openResourceAsStream("TestMickey.doc")
|
||||
);
|
||||
POIFSFileSystem fs = new POIFSFileSystem(_samples.openResourceAsStream("TestMickey.doc"));
|
||||
HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);
|
||||
ext.getText();
|
||||
|
||||
@ -57,9 +53,7 @@ public final class TestHPSFPropertiesExtractor extends TestCase {
|
||||
}
|
||||
|
||||
public void testNormalUnicodeProperties() throws Exception {
|
||||
POIFSFileSystem fs = new POIFSFileSystem(
|
||||
_samples.openResourceAsStream("TestUnicode.xls")
|
||||
);
|
||||
POIFSFileSystem fs = new POIFSFileSystem(_samples.openResourceAsStream("TestUnicode.xls"));
|
||||
HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);
|
||||
ext.getText();
|
||||
|
||||
@ -82,8 +76,8 @@ public final class TestHPSFPropertiesExtractor extends TestCase {
|
||||
|
||||
public void testCustomProperties() throws Exception {
|
||||
POIFSFileSystem fs = new POIFSFileSystem(
|
||||
_samples.openResourceAsStream("TestMickey.doc")
|
||||
);
|
||||
_samples.openResourceAsStream("TestMickey.doc")
|
||||
);
|
||||
HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);
|
||||
|
||||
// Custom properties are part of the document info stream
|
||||
@ -100,9 +94,7 @@ public final class TestHPSFPropertiesExtractor extends TestCase {
|
||||
POIFSFileSystem fs;
|
||||
HSSFWorkbook wb;
|
||||
try {
|
||||
fs = new POIFSFileSystem(
|
||||
_samples.openResourceAsStream("TestUnicode.xls")
|
||||
);
|
||||
fs = new POIFSFileSystem(_samples.openResourceAsStream("TestUnicode.xls"));
|
||||
wb = new HSSFWorkbook(fs);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -17,18 +17,17 @@
|
||||
|
||||
package org.apache.poi.hssf.extractor;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.poi.POIDataSamples;
|
||||
import org.apache.poi.hssf.HSSFTestDataSamples;
|
||||
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.poifs.filesystem.DirectoryNode;
|
||||
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
||||
import org.apache.poi.POIDataSamples;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -243,10 +242,10 @@ public final class TestExcelExtractor extends TestCase {
|
||||
* Excel embeded in excel
|
||||
*/
|
||||
public void testWithEmbededInOwn() throws Exception {
|
||||
POIDataSamples ssSamples = POIDataSamples.getSpreadSheetInstance();
|
||||
POIDataSamples ssSamples = POIDataSamples.getSpreadSheetInstance();
|
||||
POIFSFileSystem fs = new POIFSFileSystem(
|
||||
ssSamples.openResourceAsStream("excel_with_embeded.xls")
|
||||
);
|
||||
ssSamples.openResourceAsStream("excel_with_embeded.xls")
|
||||
);
|
||||
|
||||
DirectoryNode dirA = (DirectoryNode) fs.getRoot().getEntry("MBD0000A3B5");
|
||||
DirectoryNode dirB = (DirectoryNode) fs.getRoot().getEntry("MBD0000A3B4");
|
||||
|
@ -18,19 +18,17 @@
|
||||
package org.apache.poi.hssf.record;
|
||||
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.Arrays;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.poi.util.HexRead;
|
||||
import org.apache.poi.util.HexDump;
|
||||
import org.apache.poi.util.LittleEndianInputStream;
|
||||
import org.apache.poi.util.LittleEndianOutputStream;
|
||||
import org.apache.poi.hssf.record.formula.Ptg;
|
||||
import org.apache.poi.hssf.record.formula.AreaPtg;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.util.HexRead;
|
||||
import org.apache.poi.util.LittleEndianInputStream;
|
||||
import org.apache.poi.util.LittleEndianOutputStream;
|
||||
|
||||
/**
|
||||
* Tests the serialization and deserialization of the LbsDataSubRecord class works correctly.
|
||||
|
@ -22,7 +22,6 @@ import junit.framework.TestCase;
|
||||
|
||||
import org.apache.poi.hssf.record.formula.eval.EvaluationException;
|
||||
import org.apache.poi.hssf.record.formula.eval.NumberEval;
|
||||
import org.apache.poi.hssf.record.formula.eval.ValueEval;
|
||||
import org.apache.poi.hssf.record.formula.functions.Offset.LinearOffsetRange;
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,6 @@ package org.apache.poi.hssf.usermodel;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
@ -29,10 +28,9 @@ import org.apache.poi.hssf.record.DBCellRecord;
|
||||
import org.apache.poi.hssf.record.FormulaRecord;
|
||||
import org.apache.poi.hssf.record.Record;
|
||||
import org.apache.poi.hssf.record.StringRecord;
|
||||
import org.apache.poi.ss.SpreadsheetVersion;
|
||||
import org.apache.poi.ss.usermodel.BaseTestCell;
|
||||
import org.apache.poi.ss.usermodel.ErrorConstants;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.SpreadsheetVersion;
|
||||
|
||||
/**
|
||||
* Tests various functionality having to do with {@link HSSFCell}. For instance support for
|
||||
@ -295,33 +293,32 @@ public final class TestHSSFCell extends BaseTestCell {
|
||||
assertEquals(DBCellRecord.class, dbcr.getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* The maximum length of cell contents (text) is 32,767 characters.
|
||||
*/
|
||||
public void testMaxTextLength(){
|
||||
HSSFSheet sheet = new HSSFWorkbook().createSheet();
|
||||
HSSFCell cell = sheet.createRow(0).createCell(0);
|
||||
/**
|
||||
* The maximum length of cell contents (text) is 32,767 characters.
|
||||
*/
|
||||
public void testMaxTextLength(){
|
||||
HSSFSheet sheet = new HSSFWorkbook().createSheet();
|
||||
HSSFCell cell = sheet.createRow(0).createCell(0);
|
||||
|
||||
int maxlen = SpreadsheetVersion.EXCEL97.getMaxTextLength();
|
||||
assertEquals(32767, maxlen);
|
||||
int maxlen = SpreadsheetVersion.EXCEL97.getMaxTextLength();
|
||||
assertEquals(32767, maxlen);
|
||||
|
||||
StringBuffer b = new StringBuffer() ;
|
||||
StringBuffer b = new StringBuffer() ;
|
||||
|
||||
// 32767 is okay
|
||||
for( int i = 0 ; i < maxlen ; i++ )
|
||||
{
|
||||
b.append( "X" ) ;
|
||||
}
|
||||
cell.setCellValue(b.toString());
|
||||
// 32767 is okay
|
||||
for( int i = 0 ; i < maxlen ; i++ )
|
||||
{
|
||||
b.append( "X" ) ;
|
||||
}
|
||||
cell.setCellValue(b.toString());
|
||||
|
||||
b.append("X");
|
||||
// 32768 produces an invalid XLS file
|
||||
try {
|
||||
cell.setCellValue(b.toString());
|
||||
fail("Expected exception");
|
||||
} catch (IllegalArgumentException e){
|
||||
assertEquals("The maximum length of cell contents (text) is 32,767 characters", e.getMessage());
|
||||
}
|
||||
}
|
||||
b.append("X");
|
||||
// 32768 produces an invalid XLS file
|
||||
try {
|
||||
cell.setCellValue(b.toString());
|
||||
fail("Expected exception");
|
||||
} catch (IllegalArgumentException e){
|
||||
assertEquals("The maximum length of cell contents (text) is 32,767 characters", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,15 +18,13 @@
|
||||
package org.apache.poi.poifs.filesystem;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.poi.hssf.HSSFTestDataSamples;
|
||||
import org.apache.poi.POIDataSamples;
|
||||
import org.apache.poi.hssf.HSSFTestDataSamples;
|
||||
|
||||
/**
|
||||
* Tests for POIFSFileSystem
|
||||
@ -117,7 +115,6 @@ public final class TestPOIFSFileSystem extends TestCase {
|
||||
// expected
|
||||
}
|
||||
assertTrue("input stream was not closed", testIS.isClosed()); // but still should close
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,8 +133,8 @@ public final class TestPOIFSFileSystem extends TestCase {
|
||||
"ShortLastBlock.qwp", "ShortLastBlock.wps"
|
||||
};
|
||||
|
||||
POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
|
||||
for(int i=0; i<files.length; i++) {
|
||||
POIDataSamples _samples = POIDataSamples.getPOIFSInstance();
|
||||
for(int i=0; i<files.length; i++) {
|
||||
|
||||
// Open the file up
|
||||
POIFSFileSystem fs = new POIFSFileSystem(
|
||||
|
Loading…
Reference in New Issue
Block a user