Last change
on this file since 10945 was 10300, checked in by Don-vip, 9 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.
|
---|
2 | package org.openstreetmap.josm.data;
|
---|
3 |
|
---|
4 | import static org.junit.Assert.assertTrue;
|
---|
5 |
|
---|
6 | import org.junit.BeforeClass;
|
---|
7 | import org.junit.Test;
|
---|
8 | import org.openstreetmap.josm.JOSMFixture;
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * Unit tests for class {@link Version}.
|
---|
12 | */
|
---|
13 | public 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.