source: josm/trunk/test/unit/org/openstreetmap/josm/tools/FontsManagerTest.java@ 11647

Last change on this file since 11647 was 11202, checked in by Don-vip, 7 years ago

increase test coverage

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4import static org.junit.Assert.fail;
5
6import java.awt.Font;
7import java.awt.GraphicsEnvironment;
8
9import org.junit.Rule;
10import org.junit.Test;
11import org.openstreetmap.josm.testutils.JOSMTestRules;
12
13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
14
15/**
16 * Unit tests of {@link FontsManager} class.
17 */
18public class FontsManagerTest {
19
20 /**
21 * Setup test.
22 */
23 @Rule
24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
25 public JOSMTestRules test = new JOSMTestRules();
26
27 /**
28 * Test method for {@code FontsManager#initialize}
29 */
30 @Test
31 public void testFontsManager() {
32 FontsManager.initialize();
33 boolean found = false;
34 for (Font f : GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts()) {
35 if (f.getName().contains("Droid")) {
36 System.out.println(f);
37 found = true;
38 }
39 }
40 if (!found) {
41 fail("DroidSans font not found");
42 }
43 }
44}
Note: See TracBrowser for help on using the repository browser.