source: josm/trunk/test/unit/org/openstreetmap/josm/tools/StreamUtilsTest.java@ 15732

Last change on this file since 15732 was 15732, checked in by simon04, 5 years ago

see #18503 - Relation editor: compute wayConnection for type=superroute

This basic implementation only considers route segments without a role
(as specified for public_transport:version=2; no forward/backward)
and does not take roundabouts into account.

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4import org.junit.Rule;
5import org.junit.Test;
6import org.openstreetmap.josm.testutils.JOSMTestRules;
7
8import static org.junit.Assert.assertEquals;
9
10import java.util.Arrays;
11import java.util.stream.Collectors;
12
13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
14import net.trajano.commons.testing.UtilityClassTestUtil;
15
16/**
17 * Unit tests of {@link StreamUtils} class.
18 */
19public class StreamUtilsTest {
20
21 /**
22 * Setup rule.
23 */
24 @Rule
25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
26 public JOSMTestRules test = new JOSMTestRules();
27
28 /**
29 * Tests that {@code StreamUtils} satisfies utility class criterias.
30 * @throws ReflectiveOperationException if an error occurs
31 */
32 @Test
33 public void testUtilityClass() throws ReflectiveOperationException {
34 UtilityClassTestUtil.assertUtilityClassWellDefined(StreamUtils.class);
35 }
36
37 /**
38 * Tests {@link StreamUtils#reversedStream(java.util.List)}
39 */
40 @Test
41 public void testReverseStream() {
42 assertEquals("baz/bar/foo",
43 StreamUtils.reversedStream(Arrays.asList("foo", "bar", "baz")).collect(Collectors.joining("/")));
44 }
45}
Note: See TracBrowser for help on using the repository browser.