From: PJ Fanning Date: Fri, 16 Jun 2023 19:05:58 +0000 (+0000) Subject: xddf test X-Git-Tag: REL_5_2_4~133 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3bf427611731a1f2be73e4b77d60800645023185;p=poi.git xddf test git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1910459 13f79535-47bb-0310-9956-ffa450edef68 --- 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 @@ -47,6 +47,36 @@ class TestXDDFChart { assertNotNull(xddfChart.getCTPlotArea()); } + @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(); 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