@@ -0,0 +1,1387 @@
+package servidor;%0A%0Aimport java.util.ArrayList;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0A// obtenido de https://andrejserafim.wordpress.com/2010/10/07/testing-threads-with-junit/s%0Apublic class ServidorTest %7B%0A%0A%09@Test%0A%09public void pruebaThreadServidor() throws InterruptedException%7B%0A%09%09 Servidor s = new Servidor() %7B%0A%09%09     @Override %0A%09%09     public void run() %7B%0A%09%09    %09 Assert.fail();%0A%09%09      %7D           %0A%09     %7D;%0A%09%09Thread t1 = new Thread(s);%0A%09%09t1.start();%0A%09%09t1.join();%0A%09%7D%0A%0A%09@Test public void testCase2Threads() throws InterruptedException %7B%0A        final ArrayList%3CInteger%3E threadsCompleted = new ArrayList%3C Integer %3E();%0A        Runnable runnable1 = new Runnable() %7B%0A            @Override %0A            public void run() %7B%0A                Assert.fail();%0A                threadsCompleted.add(1);%0A            %7D%0A        %7D;%0A         %0A        Runnable runnable2 = new Runnable() %7B%0A            @Override %0A            public void run() %7B%0A                Assert.assertTrue( true );%0A                threadsCompleted.add(2);%0A            %7D%0A        %7D;%0A         %0A        Thread t1 = new Thread( runnable1 );%0A        Thread t2 = new Thread( runnable2 );%0A         %0A        t1.start();%0A        t2.start();%0A        t1.join();%0A        t2.join();%0A         %0A        System.out.println( %22Threads completed: %22 + threadsCompleted );%0A        Assert.assertEquals(2, threadsCompleted.size());%0A    %7D%0A%09%0A%09%0A%09%0A%7D%0A

Test Servidor