-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Boyi
committed
Aug 16, 2022
1 parent
a695a60
commit 2f2d879
Showing
3 changed files
with
43 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
poi-tl/src/test/java/com/deepoove/poi/tl/issue/Issue810.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.deepoove.poi.tl.issue; | ||
|
||
import java.io.IOException; | ||
import java.util.*; | ||
|
||
import org.apache.poi.xwpf.usermodel.XWPFDocument; | ||
import org.apache.poi.xwpf.usermodel.XWPFParagraph; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import com.deepoove.poi.XWPFTemplate; | ||
|
||
public class Issue810 { | ||
|
||
@Test | ||
public void test810() throws IOException { | ||
Map<String, Object> mainData = new HashMap<>(); | ||
Map<String, Object> rowData = new HashMap<>(); | ||
rowData.put("data1", "data1"); | ||
rowData.put("data2", "data2"); | ||
rowData.put("data3", "data3"); | ||
mainData.put("rows", Collections.singletonList(rowData)); | ||
XWPFTemplate render = XWPFTemplate.compile("src/test/resources/issue/810.docx").render(mainData); | ||
XWPFDocument document = render.getXWPFDocument(); | ||
XWPFParagraph paragraph = document.getParagraphArray(0); | ||
Assertions.assertEquals(paragraph.getText(), "data1\tdata1\tdata1"); | ||
|
||
render.writeToFile("target/out_issue_810.docx"); | ||
} | ||
} |
Binary file not shown.