You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2019/01/10 23:05:21 UTC
[kudu] 05/09: Fix DOS line endings in TestServerInfo.java
This is an automated email from the ASF dual-hosted git repository.
granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 5646a05917230fa3f4156099c29a77559fdd2cea
Author: Will Berkeley <wd...@gmail.org>
AuthorDate: Tue Jan 8 10:32:18 2019 -0800
Fix DOS line endings in TestServerInfo.java
Change-Id: Id0c470ed24238e0461e96bd443f3d649e1e11acb
Reviewed-on: http://gerrit.cloudera.org:8080/12180
Tested-by: Kudu Jenkins
Reviewed-by: Grant Henke <gr...@apache.org>
Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
.../org/apache/kudu/client/TestServerInfo.java | 162 ++++++++++-----------
1 file changed, 81 insertions(+), 81 deletions(-)
diff --git a/java/kudu-client/src/test/java/org/apache/kudu/client/TestServerInfo.java b/java/kudu-client/src/test/java/org/apache/kudu/client/TestServerInfo.java
index 63fd093..8a67cec 100644
--- a/java/kudu-client/src/test/java/org/apache/kudu/client/TestServerInfo.java
+++ b/java/kudu-client/src/test/java/org/apache/kudu/client/TestServerInfo.java
@@ -1,81 +1,81 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.kudu.client;
-
-import java.net.InetAddress;
-
-import org.apache.kudu.test.cluster.FakeDNS;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.net.UnknownHostException;
-
-public class TestServerInfo {
- /**
- * Test for KUDU-2103. Checks if the original hostnames is returned if unknown.
- */
- @Test
- public void testGetAndCanonicalizeUnknownHostname() throws Exception {
- installFakeDNS("master1.example.com", "server123.example.com", "10.1.2.3");
-
- ServerInfo serverInfo = new ServerInfo(
- "nevermind",
- new HostAndPort("master2.example.com", 12345),
- InetAddress.getByName("10.1.2.3"),
- /*location=*/"");
-
- Assert.assertEquals("master2.example.com", serverInfo.getAndCanonicalizeHostname());
- Assert.assertEquals("", serverInfo.getLocation());
- }
-
- /**
- * Test for KUDU-2103. Checks if the canonical hostname is returned instead
- * of the one it's set to.
- */
- @Test
- public void testGetAndCanonicalizeHostname() throws Exception {
- installFakeDNS("master1.example.com", "server123.example.com", "10.1.2.3");
-
- ServerInfo serverInfo = new ServerInfo(
- "abcdef", // uuid
- new HostAndPort("master1.example.com", 12345),
- InetAddress.getByName("10.1.2.3"),
- /* location= */"/foo");
-
- Assert.assertEquals("server123.example.com", serverInfo.getAndCanonicalizeHostname());
- Assert.assertEquals("/foo", serverInfo.getLocation());
- Assert.assertEquals("abcdef(master1.example.com:12345)", serverInfo.toString());
- }
-
- /**
- * Helper method to install FakeDNS with the expected values for the tests
- *
- * @param alias alias to be set for forward resolution
- * @param canonical canonical to be set for reverse resolution
- * @param ip IP both hostnames point to
- * @throws UnknownHostException if the "ip" is an unknown host
- */
- private void installFakeDNS(String alias, String canonical, String ip)
- throws UnknownHostException {
- FakeDNS fakeDNS = FakeDNS.getInstance();
- fakeDNS.install();
- InetAddress inetAddress = InetAddress.getByName(ip);
- fakeDNS.addForwardResolution(alias, inetAddress);
- fakeDNS.addForwardResolution(canonical, inetAddress);
- fakeDNS.addReverseResolution(inetAddress, canonical);
- }
-}
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.kudu.client;
+
+import java.net.InetAddress;
+
+import org.apache.kudu.test.cluster.FakeDNS;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.net.UnknownHostException;
+
+public class TestServerInfo {
+ /**
+ * Test for KUDU-2103. Checks if the original hostnames is returned if unknown.
+ */
+ @Test
+ public void testGetAndCanonicalizeUnknownHostname() throws Exception {
+ installFakeDNS("master1.example.com", "server123.example.com", "10.1.2.3");
+
+ ServerInfo serverInfo = new ServerInfo(
+ "nevermind",
+ new HostAndPort("master2.example.com", 12345),
+ InetAddress.getByName("10.1.2.3"),
+ /*location=*/"");
+
+ Assert.assertEquals("master2.example.com", serverInfo.getAndCanonicalizeHostname());
+ Assert.assertEquals("", serverInfo.getLocation());
+ }
+
+ /**
+ * Test for KUDU-2103. Checks if the canonical hostname is returned instead
+ * of the one it's set to.
+ */
+ @Test
+ public void testGetAndCanonicalizeHostname() throws Exception {
+ installFakeDNS("master1.example.com", "server123.example.com", "10.1.2.3");
+
+ ServerInfo serverInfo = new ServerInfo(
+ "abcdef", // uuid
+ new HostAndPort("master1.example.com", 12345),
+ InetAddress.getByName("10.1.2.3"),
+ /* location= */"/foo");
+
+ Assert.assertEquals("server123.example.com", serverInfo.getAndCanonicalizeHostname());
+ Assert.assertEquals("/foo", serverInfo.getLocation());
+ Assert.assertEquals("abcdef(master1.example.com:12345)", serverInfo.toString());
+ }
+
+ /**
+ * Helper method to install FakeDNS with the expected values for the tests
+ *
+ * @param alias alias to be set for forward resolution
+ * @param canonical canonical to be set for reverse resolution
+ * @param ip IP both hostnames point to
+ * @throws UnknownHostException if the "ip" is an unknown host
+ */
+ private void installFakeDNS(String alias, String canonical, String ip)
+ throws UnknownHostException {
+ FakeDNS fakeDNS = FakeDNS.getInstance();
+ fakeDNS.install();
+ InetAddress inetAddress = InetAddress.getByName(ip);
+ fakeDNS.addForwardResolution(alias, inetAddress);
+ fakeDNS.addForwardResolution(canonical, inetAddress);
+ fakeDNS.addReverseResolution(inetAddress, canonical);
+ }
+}