From cb1eb57fa9707b1186f0aa10a0853780d7674742 Mon Sep 17 00:00:00 2001 From: jonmv Date: Sat, 9 Apr 2022 14:51:56 +0200 Subject: Revert "Merge pull request #22072 from vespa-engine/jonmv/unify-hostname-classes" This reverts commit 87e5b33c003d07ca585d73e0166857fe22b4c16f, reversing changes made to 80b96d32550ae0df59572a58cd62f507e8068c2c. --- .../src/test/java/com/yahoo/net/HostNameTest.java | 25 ---------------------- 1 file changed, 25 deletions(-) (limited to 'vespajlib/src/test/java') 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,38 +1,13 @@ // 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()); -- cgit v1.2.3