aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/testcases/org/apache/poi/xwpf
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2014-02-01 22:26:18 +0000
committerAndreas Beeker <kiwiwings@apache.org>2014-02-01 22:26:18 +0000
commit6a864cce7ba1bcfb01125de426b2038ff415a940 (patch)
tree856d7471b9232520fef70943fb367d1ceaa6387b /src/ooxml/testcases/org/apache/poi/xwpf
parent40ceccdcbd5f9b03537e3e78c9090082f010c79e (diff)
downloadpoi-6a864cce7ba1bcfb01125de426b2038ff415a940.tar.gz
poi-6a864cce7ba1bcfb01125de426b2038ff415a940.zip
Bug 55802 - Special Letters not exported correct
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1563496 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/xwpf')
-rw-r--r--src/ooxml/testcases/org/apache/poi/xwpf/AllXWPFTests.java1
-rw-r--r--src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java51
2 files changed, 52 insertions, 0 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/AllXWPFTests.java b/src/ooxml/testcases/org/apache/poi/xwpf/AllXWPFTests.java
index 20a4898e0d..f7ed6df7c7 100644
--- a/src/ooxml/testcases/org/apache/poi/xwpf/AllXWPFTests.java
+++ b/src/ooxml/testcases/org/apache/poi/xwpf/AllXWPFTests.java
@@ -37,6 +37,7 @@ import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({
TestXWPFBugs.class,
+ org.apache.poi.xwpf.usermodel.TestXWPFBugs.class,
TestXWPFDocument.class,
TestXWPFWordExtractor.class,
TestXWPFHeaderFooterPolicy.class,
diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java
new file mode 100644
index 0000000000..a40910df60
--- /dev/null
+++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFBugs.java
@@ -0,0 +1,51 @@
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+package org.apache.poi.xwpf.usermodel;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.poi.xwpf.usermodel.XWPFRun.FontCharRange;
+import org.junit.Test;
+
+public class TestXWPFBugs {
+ @Test
+ public void bug55802() throws Exception {
+ String blabla =
+ "Bir, iki, \u00fc\u00e7, d\u00f6rt, be\u015f,\n"+
+ "\nalt\u0131, yedi, sekiz, dokuz, on.\n"+
+ "\nK\u0131rm\u0131z\u0131 don,\n"+
+ "\ngel bizim bah\u00e7eye kon,\n"+
+ "\nsar\u0131 limon";
+ XWPFDocument doc = new XWPFDocument();
+ XWPFRun run = doc.createParagraph().createRun();
+
+ for (String str : blabla.split("\n")) {
+ run.setText(str);
+ run.addBreak();
+ }
+
+ run.setFontFamily("Times New Roman");
+ run.setFontSize(20);
+ assertEquals(run.getFontFamily(), "Times New Roman");
+ assertEquals(run.getFontFamily(FontCharRange.cs), "Times New Roman");
+ assertEquals(run.getFontFamily(FontCharRange.eastAsia), "Times New Roman");
+ assertEquals(run.getFontFamily(FontCharRange.hAnsi), "Times New Roman");
+ run.setFontFamily("Arial", FontCharRange.hAnsi);
+ assertEquals(run.getFontFamily(FontCharRange.hAnsi), "Arial");
+ }
+
+}