aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf/model
diff options
context:
space:
mode:
authorEvgeniy Berlog <berlog@apache.org>2012-07-01 09:38:08 +0000
committerEvgeniy Berlog <berlog@apache.org>2012-07-01 09:38:08 +0000
commit5f543636b754773ab470a104ae6acd36102c7cb9 (patch)
treec56d66d54fdd78720f2627bdd46c311b92021b88 /src/testcases/org/apache/poi/hssf/model
parentfe51bb989b1e85d48d22a52974d40946eac325eb (diff)
downloadpoi-5f543636b754773ab470a104ae6acd36102c7cb9.tar.gz
poi-5f543636b754773ab470a104ae6acd36102c7cb9.zip
implemented work with existing shape groups and polygons
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/gsoc2012@1355866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/model')
-rw-r--r--src/testcases/org/apache/poi/hssf/model/HSSFTestModelHelper.java5
-rw-r--r--src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java17
2 files changed, 7 insertions, 15 deletions
diff --git a/src/testcases/org/apache/poi/hssf/model/HSSFTestModelHelper.java b/src/testcases/org/apache/poi/hssf/model/HSSFTestModelHelper.java
index 507561e7e4..bc22d17a97 100644
--- a/src/testcases/org/apache/poi/hssf/model/HSSFTestModelHelper.java
+++ b/src/testcases/org/apache/poi/hssf/model/HSSFTestModelHelper.java
@@ -1,6 +1,7 @@
package org.apache.poi.hssf.model;
import org.apache.poi.hssf.usermodel.HSSFComment;
+import org.apache.poi.hssf.usermodel.HSSFPolygon;
import org.apache.poi.hssf.usermodel.HSSFTextbox;
/**
@@ -15,4 +16,8 @@ public class HSSFTestModelHelper {
public static CommentShape createCommentShape(int shapeId, HSSFComment comment){
return new CommentShape(comment, shapeId);
}
+
+ public static PolygonShape createPolygonShape(int shapeId, HSSFPolygon polygon){
+ return new PolygonShape(polygon, shapeId);
+ }
}
diff --git a/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java b/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java
index 18572d6ec1..1f058c06da 100644
--- a/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java
+++ b/src/testcases/org/apache/poi/hssf/model/TestDrawingAggregate.java
@@ -201,7 +201,7 @@ public class TestDrawingAggregate extends TestCase {
HSSFPatriarch drawing = sheet.createDrawingPatriarch();
EscherAggregate agg1 = HSSFTestHelper.getEscherAggregate(drawing);
- callConvertPatriarch(agg1);
+ HSSFTestHelper.callConvertPatriarch(agg1);
agg1.setPatriarch(null);
agg.setPatriarch(null);
@@ -213,20 +213,7 @@ public class TestDrawingAggregate extends TestCase {
assertTrue(Arrays.equals(aggS, agg1S));
}
- private static void callConvertPatriarch(EscherAggregate agg) {
- Method method = null;
- try {
- method = agg.getClass().getDeclaredMethod("convertPatriarch", HSSFPatriarch.class);
- method.setAccessible(true);
- method.invoke(agg, agg.getPatriarch());
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- } catch (InvocationTargetException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
+
/**
* when reading incomplete data ensure that the serialized bytes