aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2009-03-29 16:10:40 +0000
committerYegor Kozlov <yegor@apache.org>2009-03-29 16:10:40 +0000
commite47dd63c80d7807381f77ee0d8879332737368cf (patch)
tree84873becffceb445145100a219b89959a7ee3b5b /src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java
parent9adb9cc6d3da755b57e1c205d634fb4127fa072c (diff)
downloadpoi-e47dd63c80d7807381f77ee0d8879332737368cf.tar.gz
poi-e47dd63c80d7807381f77ee0d8879332737368cf.zip
more refactoring of common ss tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@759714 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java')
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java
index d1a6719e32..81c8990769 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java
@@ -19,33 +19,23 @@ package org.apache.poi.hssf.usermodel;
import junit.framework.TestCase;
import org.apache.poi.hssf.HSSFTestDataSamples;
+import org.apache.poi.hssf.HSSFITestDataProvider;
+import org.apache.poi.ss.usermodel.BaseTestPicture;
/**
* Test <code>HSSFPicture</code>.
*
* @author Yegor Kozlov (yegor at apache.org)
*/
-public final class TestHSSFPicture extends TestCase{
+public final class TestHSSFPicture extends BaseTestPicture {
- public void testResize() {
- HSSFWorkbook wb = new HSSFWorkbook();
- HSSFSheet sh1 = wb.createSheet();
- HSSFPatriarch p1 = sh1.createDrawingPatriarch();
-
- byte[] pictureData = HSSFTestDataSamples.getTestDataFileContent("logoKarmokar4.png");
- int idx1 = wb.addPicture( pictureData, HSSFWorkbook.PICTURE_TYPE_PNG );
- HSSFPicture picture1 = p1.createPicture(new HSSFClientAnchor(), idx1);
- HSSFClientAnchor anchor1 = picture1.getPreferredSize();
+ @Override
+ protected HSSFITestDataProvider getTestDataProvider(){
+ return HSSFITestDataProvider.getInstance();
+ }
- //assert against what would BiffViewer print if we insert the image in xls and dump the file
- assertEquals(0, anchor1.getCol1());
- assertEquals(0, anchor1.getRow1());
- assertEquals(1, anchor1.getCol2());
- assertEquals(9, anchor1.getRow2());
- assertEquals(0, anchor1.getDx1());
- assertEquals(0, anchor1.getDy1());
- assertEquals(848, anchor1.getDx2());
- assertEquals(240, anchor1.getDy2());
+ public void testResize() {
+ baseTestResize(new HSSFClientAnchor(0, 0, 848, 240, (short)0, 0, (short)1, 9));
}
/**