aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2023-06-16 19:05:58 +0000
committerPJ Fanning <fanningpj@apache.org>2023-06-16 19:05:58 +0000
commit3bf427611731a1f2be73e4b77d60800645023185 (patch)
tree32d630a4a34a6844f9f01de2248e886cbcce4958
parent5cafcdc83e5bc955109dd89fdca3b4831c77a6f4 (diff)
downloadpoi-3bf427611731a1f2be73e4b77d60800645023185.tar.gz
poi-3bf427611731a1f2be73e4b77d60800645023185.zip
xddf test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1910459 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java30
-rw-r--r--src/resources/ooxml-lite-report.clazz2
-rw-r--r--src/resources/ooxml-lite-report.xsb1
3 files changed, 33 insertions, 0 deletions
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java b/poi-ooxml/src/test/java/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java
index 45ff5d7747..ba2eeba153 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/xddf/usermodel/chart/TestXDDFChart.java
@@ -48,6 +48,36 @@ class TestXDDFChart {
}
@Test
+ void testSetMajorUnit() {
+ // minimal test to cause ooxml-lite to include all the classes in poi-ooxml-lite
+ XDDFChart xddfChart = newXDDFChart();
+
+ XDDFValueAxis xAxis = xddfChart.createValueAxis(AxisPosition.BOTTOM);
+ XDDFValueAxis yAxis = xddfChart.createValueAxis(AxisPosition.LEFT);
+ assertNotNull(xAxis);
+ assertNotNull(yAxis);
+
+ xAxis.setTitle("Seconds Into Run");
+ final double xAxisMajorUnits = 300.0;
+ xAxis.setMajorUnit(xAxisMajorUnits);
+ assertEquals(xAxisMajorUnits, xAxis.getMajorUnit());
+ final double yAxisMajorUnits = 100.0;
+ yAxis.setMinorUnit(yAxisMajorUnits);
+ assertEquals(yAxisMajorUnits, yAxis.getMinorUnit());
+
+ xAxis.setOrientation(AxisOrientation.MAX_MIN);
+ assertEquals(AxisOrientation.MAX_MIN, xAxis.getOrientation());
+ yAxis.setOrientation(AxisOrientation.MIN_MAX);
+ assertEquals(AxisOrientation.MIN_MAX, yAxis.getOrientation());
+
+ xAxis.setCrosses(AxisCrosses.AUTO_ZERO);
+ assertEquals(AxisCrosses.AUTO_ZERO, xAxis.getCrosses());
+
+ yAxis.setCrossBetween(AxisCrossBetween.BETWEEN);
+ assertEquals(AxisCrossBetween.BETWEEN, yAxis.getCrosses());
+ }
+
+ @Test
void testSetExternalId() {
XDDFChart xddfChart = newXDDFChart();
CTChartSpace ctChartSpace = xddfChart.getCTChartSpace();
diff --git a/src/resources/ooxml-lite-report.clazz b/src/resources/ooxml-lite-report.clazz
index 9321d71703..16c5c9d4b2 100644
--- a/src/resources/ooxml-lite-report.clazz
+++ b/src/resources/ooxml-lite-report.clazz
@@ -2523,3 +2523,5 @@ org/openxmlformats/schemas/wordprocessingml/x2006/main/impl/CTSdtContentRowImpl
org/openxmlformats/schemas/wordprocessingml/x2006/main/CTSdtContentRow
org/openxmlformats/schemas/drawingml/x2006/main/CTComplementTransform
org/openxmlformats/schemas/drawingml/x2006/main/CTPositiveFixedAngle
+org/openxmlformats/schemas/drawingml/x2006/chart/impl/STAxisUnitImpl
+org/openxmlformats/schemas/drawingml/x2006/chart/STAxisUnit
diff --git a/src/resources/ooxml-lite-report.xsb b/src/resources/ooxml-lite-report.xsb
index 352d650408..8ae244c32c 100644
--- a/src/resources/ooxml-lite-report.xsb
+++ b/src/resources/ooxml-lite-report.xsb
@@ -1173,3 +1173,4 @@ ctbubblechart3ff4type
ctbubblesere172type
ctdlblpos9ce4type
stdlblpos1cf4type
+staxisunit6cc7type