Return-Path: X-Original-To: apmail-poi-commits-archive@minotaur.apache.org Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 27725186D8 for ; Mon, 15 Feb 2016 19:16:50 +0000 (UTC) Received: (qmail 41373 invoked by uid 500); 15 Feb 2016 19:16:50 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 41333 invoked by uid 500); 15 Feb 2016 19:16:50 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 41324 invoked by uid 99); 15 Feb 2016 19:16:50 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Feb 2016 19:16:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8F77018063F for ; Mon, 15 Feb 2016 19:16:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.471 X-Spam-Level: * X-Spam-Status: No, score=1.471 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id F57KM4XRoilL for ; Mon, 15 Feb 2016 19:16:48 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id 8696C5FB11 for ; Mon, 15 Feb 2016 19:16:47 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 351D9E019D for ; Mon, 15 Feb 2016 19:16:46 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 203383A10A5 for ; Mon, 15 Feb 2016 19:16:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1730598 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java Date: Mon, 15 Feb 2016 19:16:46 -0000 To: commits@poi.apache.org From: centic@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160215191646.203383A10A5@svn01-us-west.apache.org> Author: centic Date: Mon Feb 15 19:16:45 2016 New Revision: 1730598 URL: http://svn.apache.org/viewvc?rev=1730598&view=rev Log: Tried to reproduce bug 55476, but could not, added unit test anyway Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java?rev=1730598&r1=1730597&r2=1730598&view=diff ============================================================================== --- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java (original) +++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFRun.java Mon Feb 15 19:16:45 2016 @@ -16,25 +16,19 @@ ==================================================================== */ package org.apache.poi.xwpf.usermodel; +import junit.framework.TestCase; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.util.Units; +import org.apache.poi.xwpf.XWPFTestDataSamples; +import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy; +import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; + import java.io.ByteArrayInputStream; import java.io.IOException; import java.math.BigInteger; import java.util.Iterator; import java.util.List; -import junit.framework.TestCase; - -import org.apache.poi.xwpf.XWPFTestDataSamples; -import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STBrClear; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STHighlightColor; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STOnOff; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STUnderline; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalAlignRun; - /** * Tests for XWPF Run */ @@ -444,4 +438,26 @@ public class TestXWPFRun extends TestCas } } } + + public void testBug55476() throws IOException, InvalidFormatException { + byte[] image = XWPFTestDataSamples.getImage("abstract1.jpg"); + XWPFDocument document = new XWPFDocument(); + + document.createParagraph().createRun().addPicture( + new ByteArrayInputStream(image), Document.PICTURE_TYPE_JPEG, "test.jpg", Units.toEMU(300), Units.toEMU(100)); + + XWPFDocument docBack = XWPFTestDataSamples.writeOutAndReadBack(document); + List pictures = docBack.getParagraphArray(0).getRuns().get(0).getEmbeddedPictures(); + assertEquals(1, pictures.size()); + docBack.close(); + + /*OutputStream stream = new FileOutputStream("c:\\temp\\55476.docx"); + try { + document.write(stream); + } finally { + stream.close(); + }*/ + + document.close(); + } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org