diff options
Diffstat (limited to 'vespajlib/src/test/java/com/yahoo/net/HostNameTest.java')
-rw-r--r-- | vespajlib/src/test/java/com/yahoo/net/HostNameTest.java | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/net/HostNameTest.java b/vespajlib/src/test/java/com/yahoo/net/HostNameTest.java index fa756b31616..2548c3cea60 100644 --- a/vespajlib/src/test/java/com/yahoo/net/HostNameTest.java +++ b/vespajlib/src/test/java/com/yahoo/net/HostNameTest.java @@ -1,39 +1,14 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.net; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; -/** - * @author jonmv - */ public class HostNameTest { @Test - void testNames() { - HostName.of("name-123.0.321-eman"); - HostName.of(("." + "a".repeat(32)).repeat(2).substring(1, 65)); - HostName.of("123"); - - assertThrows(IllegalArgumentException.class, () -> HostName.of("_")); - assertThrows(IllegalArgumentException.class, () -> HostName.of("-")); - assertThrows(IllegalArgumentException.class, () -> HostName.of(".")); - assertThrows(IllegalArgumentException.class, () -> HostName.of("-foo")); - assertThrows(IllegalArgumentException.class, () -> HostName.of("foo-")); - assertThrows(IllegalArgumentException.class, () -> HostName.of(".foo")); - assertThrows(IllegalArgumentException.class, () -> HostName.of("foo.")); - assertThrows(IllegalArgumentException.class, () -> HostName.of("foo..bar")); - assertThrows(IllegalArgumentException.class, () -> HostName.of("foo.-.bar")); - assertThrows(IllegalArgumentException.class, () -> HostName.of("foo/")); - assertThrows(IllegalArgumentException.class, () -> HostName.of("foo%")); - assertThrows(IllegalArgumentException.class, () -> HostName.of(("." + "a".repeat(32)).repeat(2).substring(1, 66))); - assertThrows(IllegalArgumentException.class, () -> HostName.of("a".repeat(64))); - } - - @Test void testHostnameIsFound() { assertFalse(HostName.getLocalhost().isEmpty()); } |