/**
 * 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 storm.mesos.logviewer;

import org.junit.Test;

import static org.junit.Assert.fail;

public final class SocketUrlDetectionTest {

    @Test
    public void isReachable() {
        fail();
    }

    @Test
    public void getPort() {
        fail();
    }
}
@@ -849,216 +849,1055 @@
 nit.
-Test;%0A%0Aimport static org.junit.Assert.fail;%0A%0Apublic final class SocketUrlDetectionTest %7B%0A%0A    @Test%0A    public void isReachable() %7B%0A        fail();%0A    %7D%0A%0A    @Test%0A    public void getPort() %7B%0A        fail();
+AfterClass;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0Aimport java.net.ServerSocket;%0A%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assert.fail;%0A%0Apublic final class SocketUrlDetectionTest %7B%0A%0A    /**%0A     * Test Target.%0A     */%0A    private SocketUrlDetection target;%0A%0A    /**%0A     * ServerSocket.%0A     */%0A    private static ServerSocket serverSocket;%0A%0A    @BeforeClass%0A    public static void beforeClass() %7B%0A        try %7B%0A            serverSocket = new ServerSocket(0);%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void isReachable() %7B%0A        target = new SocketUrlDetection(serverSocket.getLocalPort());%0A        boolean actual = target.isReachable();%0A        assertTrue(actual);%0A    %7D%0A%0A    @Test%0A    public void getPort() %7B%0A        fail();%0A    %7D%0A%0A    @AfterClass%0A    public static void afeterClass() %7B%0A        try %7B%0A            serverSocket.close();%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D
 %0A   

write test to isReachable method.