You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MethodExecutorTest.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.uqac.rthoni.java_rmi.server.executors;
  2. import com.uqac.rthoni.java_rmi.server.ServerApplication;
  3. import org.junit.Assert;
  4. import org.junit.Test;
  5. /**
  6. * Created by robin on 9/16/16.
  7. */
  8. public class MethodExecutorTest extends AbstractTest {
  9. @Test
  10. public void test1() throws Exception
  11. {
  12. ServerApplication app = getServer();
  13. String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
  14. "fonction#test#getMyself#java.lang.String:a_value");
  15. Assert.assertEquals("a_value", res);
  16. }
  17. @Test
  18. public void test2() throws Exception
  19. {
  20. ServerApplication app = getServer();
  21. String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
  22. "fonction#test#uselessMethod#int:42,int:24,java.lang.String:a_value");
  23. Assert.assertEquals("NULL", res);
  24. }
  25. @Test
  26. public void test3() throws Exception
  27. {
  28. ServerApplication app = getServer();
  29. String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
  30. "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test2",
  31. "ecriture#test2#privateString#some_value",
  32. "fonction#test#getMyString#com.uqac.rthoni.java_rmi.server.executors.TestDbo:ID(test2)");
  33. Assert.assertEquals("some_value", res);
  34. }
  35. @Test
  36. public void test4() throws Exception
  37. {
  38. ServerApplication app = getServer();
  39. String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
  40. "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test2",
  41. "fonction#test2#setPrivateString#java.lang.String:some_value",
  42. "fonction#test#getMyString#com.uqac.rthoni.java_rmi.server.executors.TestDbo:ID(test2)");
  43. Assert.assertEquals("NULL\nsome_value", res);
  44. }
  45. @Test
  46. public void test5() throws Exception
  47. {
  48. ServerApplication app = getServer();
  49. String res = runCommands(app, "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test",
  50. "creation#com.uqac.rthoni.java_rmi.server.executors.TestDbo#test2",
  51. "fonction#test#setPrivateString#java.lang.String:some_value",
  52. "fonction#test#getPrivateString");
  53. Assert.assertEquals("NULL\nsome_value", res);
  54. }
  55. }