@Test(timeout = 100) public void run() { String actual = runCaptureSysOut(Assignment2::run, sock, frames); Assert.assertEquals("I am ready!\n" + expected, actual); }
public static void run(GRNVS_RAW_Mock sock, int frames) { byte[] recbuffer = new byte[1514]; int length; Timeout timeout = new Timeout(10000); mymac = sock.getMac(); System.out.format("I am ready!\n"); for (; true; ) { length = sock.read(recbuffer, timeout); if (length == 0) { System.err.format("Timed out, this means there was nothing to receive. Do you have a sender set up?\n"); break; } } }
Assignment2 { public static void run(GRNVS_RAW_Mock sock, int frames) { byte[] recbuffer = new byte[1514]; int length; Timeout timeout = new Timeout(10000); mymac = sock.getMac(); System.out.format("I am ready!\n"); for (; true; ) { length = sock.read(recbuffer, timeout); if (length == 0) { System.err.format("Timed out, this means there was nothing to receive. Do you have a sender set up?\n"); break; } } } }
Assignment2 { public static void run(GRNVS_RAW_Mock sock, int frames) { byte[] recbuffer = new byte[1514]; int length; Timeout timeout = new Timeout(10000); mymac = sock.getMac(); System.out.format("I am ready!\n"); for (; true; ) { length = sock.read(recbuffer, timeout); if (length == 0) { System.err.format("Timed out, this means there was nothing to receive. Do you have a sender set up?\n"); break; } } }  }
Assignment2 { public static void run(GRNVS_RAW_Mock sock, int frames) { byte[] recbuffer = new byte[1514]; int length; Timeout timeout = new Timeout(10000); mymac = sock.getMac(); System.out.format("I am ready!\n"); for (; true; ) { length = sock.read(recbuffer, timeout); if (length == 0) { System.err.format("Timed out, this means there was nothing to receive. Do you have a sender set up?\n"); break; } } }  static void run(GRNVS_RAW_Mock sock, int frames); static void main(String[] argv); }
Assignment2 { public static void run(GRNVS_RAW_Mock sock, int frames) { byte[] recbuffer = new byte[1514]; int length; Timeout timeout = new Timeout(10000); mymac = sock.getMac(); System.out.format("I am ready!\n"); for (; true; ) { length = sock.read(recbuffer, timeout); if (length == 0) { System.err.format("Timed out, this means there was nothing to receive. Do you have a sender set up?\n"); break; } } }  static void run(GRNVS_RAW_Mock sock, int frames); static void main(String[] argv);  }