ASF Bugzilla – Attachment 34016 Details for
Bug 59806
CTBarChart org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
simplified unit test
bug59806.patch (text/plain), 2.97 KB, created by
Javen O'Neal
on 2016-07-06 10:33:04 UTC
(
hide
)
Description:
simplified unit test
Filename:
MIME Type:
Creator:
Javen O'Neal
Created:
2016-07-06 10:33:04 UTC
Size:
2.97 KB
patch
obsolete
>Index: src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java >=================================================================== >--- src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java (revision 1751647) >+++ src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java (working copy) >@@ -32,6 +32,8 @@ > import java.awt.image.BufferedImage; > import java.io.File; > import java.io.IOException; >+import java.io.InputStream; >+import java.io.OutputStream; > import java.net.URI; > import java.util.Collection; > >@@ -51,6 +53,7 @@ > import org.apache.poi.xslf.usermodel.DrawingTextBody; > import org.apache.poi.xslf.usermodel.XMLSlideShow; > import org.apache.poi.xslf.usermodel.XSLFAutoShape; >+import org.apache.poi.xslf.usermodel.XSLFChart; > import org.apache.poi.xslf.usermodel.XSLFHyperlink; > import org.apache.poi.xslf.usermodel.XSLFPictureData; > import org.apache.poi.xslf.usermodel.XSLFPictureShape; >@@ -479,6 +482,42 @@ > > ppt2.close(); > } >+ >+ @Test >+ public void bug59806() throws IOException { >+ String inputPath = "59806.pptx"; >+ XMLSlideShow pptx = null; >+ try { >+ XSLFChart chart = bug59806_getChartFromTitle(inputPath); >+ // embedded Excel workbook that holds the chart data >+ POIXMLDocumentPart xlsPart = chart.getRelations().get(0); >+ >+ // updated the embedded workbook with the data >+ // This is where the exception is thrown >+ OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream(); >+ >+ } finally { >+ if (pptx != null) pptx.close(); >+ } >+ } >+ >+ private static XSLFChart bug59806_getChartFromTitle(String inputPath) throws IOException { >+ InputStream stream = POIDataSamples.getSlideShowInstance().openResourceAsStream(inputPath); >+ XMLSlideShow pptx = new XMLSlideShow(stream); >+ try { >+ XSLFSlide slide = pptx.getSlides().get(0); >+ // find chart in the slide >+ for (POIXMLDocumentPart part : slide.getRelations()) { >+ if (part instanceof XSLFChart) { >+ return (XSLFChart) part; >+ } >+ } >+ return null; >+ } finally { >+ // This is the source of the Rule M2.4 exception >+ if (pptx != null) pptx.close(); >+ } >+ } > > @Test > public void bug58217() throws IOException { >Index: test-data/slideshow/59806.pptx >=================================================================== >Cannot display: file marked as a binary type. >svn:mime-type = application/octet-stream >Index: test-data/slideshow/59806.pptx >=================================================================== >--- test-data/slideshow/59806.pptx (revision 0) >+++ test-data/slideshow/59806.pptx (working copy) > >Property changes on: test-data/slideshow/59806.pptx >___________________________________________________________________ >Added: svn:mime-type >## -0,0 +1 ## >+application/octet-stream >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 59806
:
34014
|
34015
| 34016