source: josm/trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/DNSNameTest.java@ 12156

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

sonar - squid:S3578 - Test methods should comply with a naming convention

  • 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.io.remotecontrol;
3
4import static org.junit.Assert.assertEquals;
5
6import java.io.IOException;
7
8import org.junit.Test;
9
10import nl.jqno.equalsverifier.EqualsVerifier;
11import nl.jqno.equalsverifier.Warning;
12
13/**
14 * Unit tests of {@link DNSName} class.
15 */
16public class DNSNameTest {
17
18 /**
19 * Unit test of {@link DNSName#DNSName} - null check.
20 * @throws IOException always (expected with null name)
21 */
22 @Test(expected = IOException.class)
23 public void testDNSNameNull() throws IOException {
24 new DNSName(null);
25 }
26
27 /**
28 * Unit test of {@link DNSName#DNSName} - nominal cases.
29 * @throws IOException never
30 */
31 @Test
32 public void testDNSNameNominal() throws IOException {
33 assertEquals("localhost", new DNSName("localhost").getName());
34 assertEquals("127.0.0.1", new DNSName("127.0.0.1").getName());
35 }
36
37 /**
38 * Unit test of methods {@link DNSName#equals} and {@link DNSName#hashCode}.
39 */
40 @Test
41 public void testEqualsContract() {
42 EqualsVerifier.forClass(DNSName.class).suppress(Warning.NULL_FIELDS).verify();
43 }
44}
Note: See TracBrowser for help on using the repository browser.