| 10 | import javax.rmi.ssl.SslRMIServerSocketFactory; |
| 11 | |
| 12 | public class SSLServer implements HelloInterface { |
| 13 | |
| 14 | public SSLServer() {} |
| 15 | |
| 16 | /** START TESTS **/ |
| 17 | // void function |
| 18 | public String restart() { return "Hello from the server!"; } |
| 19 | |
| 20 | // invoke tests |
| 21 | public boolean login(String email, String password) { |
| 22 | if (email.equals("admin@example.com") && password.equals("admin")) { |
| 23 | return true; |
| 24 | } |
| 25 | return false; |
| 26 | } |
| 27 | |
| 28 | public int add(int a, int b) { |
| 29 | return a + b; |
| 30 | } |
| 31 | |
| 32 | public int addList(int[] a) { |
| 33 | int acc = 0; |
| 34 | for (int i = 0; i < a.length; i++) { |
| 35 | acc += a[i]; |
| 36 | } |
| 37 | return acc; |
| 38 | } |
| 39 | |
| 40 | // Single param type tests |
| 41 | public String sayTest1(int name) { return "Hello from the server!"; } |
| 42 | public String sayTest2(byte name) { return "Hello from the server!"; } |
| 43 | public String sayTest3(short name) { return "Hello from the server!"; } |
| 44 | public String sayTest4(long name) { return "Hello from the server!"; } |
| 45 | public String sayTest5(char name) { return "Hello from the server!"; } |
| 46 | public String sayTest6(boolean name) { return "Hello from the server!"; } |
| 47 | public String sayTest7(float name) { return "Hello from the server!"; } |
| 48 | public String sayTest8(double name) { return "Hello from the server!"; } |
| 49 | public String sayTest9(Map name) { return "Hello from the server!"; } |
| 50 | public String sayTest10(HashMap name) { return "Hello from the server!"; } |
| 51 | public String sayTest11(List name) { return "Hello from the server!"; } |
| 52 | public String sayTest12(Object name) { return "Hello from the server!"; } |
| 53 | public String sayTest13(Class name) { return "Hello from the server!"; } |
| 54 | public String sayTest14(int[] name) { return "Hello from the server!"; } |
| 55 | public String sayTest15(Object[] name) { return "Hello from the server!"; } |
| 56 | public String sayTest16(HashMap[] name) { return "Hello from the server!"; } |
| 57 | |
| 58 | // Overload tests |
| 59 | public String sayHello(int name) { |
| 60 | return "Hello #" + name; |
| 61 | } |
| 62 | |
| 63 | public String sayHello(String name) { |
| 64 | return "Hello" + name; |
| 65 | } |
| 66 | |
| 67 | public String sayHello(String name, String from) { |
| 68 | return "Hello" + name + " from " + from; |
| 69 | } |
nothing calls this directly
no outgoing calls
no test coverage detected