File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
io/src/test/java/com/itextpdf/io/font Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -80,18 +80,12 @@ public void boldTest() throws IOException {
80
80
public void registerDirectoryOpenTypeTest () {
81
81
FontProgramFactory .clearRegisteredFonts ();
82
82
FontProgramFactory .clearRegisteredFontFamilies ();
83
- int cacheSize = -1 ;
84
- try {
85
- Field f = FontCache .class .getDeclaredField ("fontCache" );
86
- f .setAccessible (true );
87
- Map <FontCacheKey , FontProgram > cachedFonts = ((Map <FontCacheKey , FontProgram >) f .get (null ));
88
- cachedFonts .clear ();
89
- FontProgramFactory .registerFontDirectory ("./src/test/resources/com/itextpdf/io/font/otf/" );
90
- cacheSize = cachedFonts .size ();
91
- } catch (Exception e ) { }
83
+ FontCache .clearSavedFonts ();
84
+ FontProgramFactory .registerFontDirectory ("./src/test/resources/com/itextpdf/io/font/otf/" );
85
+
92
86
Assert .assertEquals (43 , FontProgramFactory .getRegisteredFonts ().size ());
87
+ Assert .assertNull (FontCache .getFont ("./src/test/resources/com/itextpdf/io/font/otf/FreeSansBold.ttf" ));
93
88
Assert .assertTrue (FontProgramFactory .getRegisteredFonts ().contains ("free sans lihavoitu" ));
94
- Assert .assertEquals (0 , cacheSize );
95
89
}
96
90
97
91
@ Test
You can’t perform that action at this time.
0 commit comments