mirror of https://github.com/apache/poi.git
Avoid a file-handle leak in tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1907445 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1ca2e638ed
commit
3eae53357d
|
@ -31,13 +31,14 @@ public final class TestXWPFTheme {
|
|||
|
||||
@Test
|
||||
void testRead() throws IOException {
|
||||
XWPFDocument docx = XWPFTestDataSamples.openSampleDocument("sample.docx");
|
||||
XWPFTheme theme = docx.getTheme();
|
||||
assertEquals("Office Theme", theme.getName());
|
||||
assertEquals("Cambria", theme.getMajorFont());
|
||||
assertEquals("Calibri", theme.getMinorFont());
|
||||
CTColor accent1 = theme.getCTColor("accent1");
|
||||
XSLFColor color = new XSLFColor(accent1, null, null, null);
|
||||
assertEquals(new Color(79, 129, 189), color.getColor());
|
||||
try (XWPFDocument docx = XWPFTestDataSamples.openSampleDocument("sample.docx")) {
|
||||
XWPFTheme theme = docx.getTheme();
|
||||
assertEquals("Office Theme", theme.getName());
|
||||
assertEquals("Cambria", theme.getMajorFont());
|
||||
assertEquals("Calibri", theme.getMinorFont());
|
||||
CTColor accent1 = theme.getCTColor("accent1");
|
||||
XSLFColor color = new XSLFColor(accent1, null, null, null);
|
||||
assertEquals(new Color(79, 129, 189), color.getColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue