(String[] args)
| 11 | private static int DELAY = 24; |
| 12 | |
| 13 | public static void main(String[] args)throws Exception{ |
| 14 | for(int i = 1; i< args.length ; i++){ |
| 15 | if(!args[i].contains(MY_USERNAME)){ |
| 16 | return; |
| 17 | } |
| 18 | } |
| 19 | Socket telnet = new Socket(COFFEE_MACHINE_IP, 23); |
| 20 | PrintWriter out = new PrintWriter(telnet.getOutputStream(), true); |
| 21 | BufferedReader in = new BufferedReader(new InputStreamReader(telnet.getInputStream())); |
| 22 | Thread.sleep(DELAY_BEFORE_BREW*1000); |
| 23 | if(!in.readLine().equals(PASSWORD_PROMPT)){ |
| 24 | return ; |
| 25 | } |
| 26 | out.println(PASSWORD); |
| 27 | out.println("sys brew"); |
| 28 | Thread.sleep(DELAY*1000); |
| 29 | out.println("sys pour"); |
| 30 | out.close(); |
| 31 | in.close(); |
| 32 | telnet.close(); |
| 33 | } |
| 34 | } |
nothing calls this directly
no outgoing calls
no test coverage detected