package com.ian;

import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;

public class ServSocketTest {

    // Integration tests that require manual work:
    // Run the following command in the terminal, then un-ignore tests here.
    // $ java -jar ./target/http-server-1.0-SNAPSHOT.jar
    @Test
    @Ignore
    public void testClientSocketGetsHTTP200ResponseWhenRootIsRequested() {
        String expected;
        try { expected = ClientSocketHelper.request("GET / HTTP/1.1");
        } catch ( IOException e ) { expected = e.getMessage(); }
        assertEquals("HTTP/1.1 200 OK", expected);
    }

    @Test
    @Ignore
    public void testClientSocketGetsHTTP200ResponseWhenAnythingOtherThanRootIsRequested() {
        String expected;
        try { expected = ClientSocketHelper.request("GET /a-day-not-night-to-see-till-i-see-thee HTTP/1.1");
        } catch ( IOException e ) { expected = e.getMessage(); }
        assertEquals("HTTP/1.1 404 Not Found", expected);
    }
}
@@ -78,63 +78,11 @@
 nit.
-Before;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;
+*;%0A
 %0Aimp
@@ -146,285 +146,427 @@
     
-// Integration tests that require manual work:%0A    // Run the following command in the terminal, then un-ignore tests here.%0A    // $ java -jar ./target/http-server-1.0-SNAPSHOT.jar%0A    @Test%0A    @Ignore%0A    public void testClientSocketGetsHTTP200ResponseWhenRootIsRequested() %7B
+@BeforeClass%0A    public static void startUp() %7B%0A        class SeparateThread implements Runnable %7B%0A            public void run() %7B%0A                ServSocket.serve(5000);%0A            %7D%0A        %7D%0A        new Thread(new SeparateThread()).start();%0A    %7D%0A%0A    @Test%0A    public void testClientSocketGetsHTTP200ResponseWhenRootIsRequested() %7B%0A        try %7B Thread.sleep(1); %7D catch (InterruptedException e)%7B e.getMessage(); %7D
 %0A   
@@ -795,20 +795,8 @@
 est%0A
-    @Ignore%0A
     
@@ -823,35 +823,35 @@
 ntSocketGetsHTTP
-200
+404
 ResponseWhenAnyt
@@ -875,32 +875,115 @@
 IsRequested() %7B%0A
+        try %7B Thread.sleep(1); %7D catch (InterruptedException e)%7B e.getMessage(); %7D%0A
         String e

automate tests w/ multiple threads & Thread.sleep