source: josm/trunk/test/unit/org/openstreetmap/josm/data/VersionTest.java@ 11479

Last change on this file since 11479 was 10300, checked in by Don-vip, 8 years ago

sonar - Performance - Method passes constant String of length 1 to character overridden method + add unit tests/javadoc

  • Property svn:eol-style set to native
File size: 880 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data;
3
4import static org.junit.Assert.assertTrue;
5
6import org.junit.BeforeClass;
7import org.junit.Test;
8import org.openstreetmap.josm.JOSMFixture;
9
10/**
11 * Unit tests for class {@link Version}.
12 */
13public class VersionTest {
14
15 /**
16 * Setup test.
17 */
18 @BeforeClass
19 public static void setUpBeforeClass() {
20 JOSMFixture.createUnitTestFixture().init();
21 }
22
23 /**
24 * Unit test of {@link Version#getAgentString}
25 */
26 @Test
27 public void testGetAgentString() {
28 String v = Version.getInstance().getAgentString(false);
29 assertTrue(v.startsWith("JOSM/1.5 ("));
30 assertTrue(v.endsWith(" en)"));
31 v = Version.getInstance().getAgentString(true);
32 assertTrue(v.startsWith("JOSM/1.5 ("));
33 assertTrue(v.contains(" en) "));
34 }
35}
Note: See TracBrowser for help on using the repository browser.