예제 #1
0
 @Test(timeout = 2000)
 public void testAdd2() {
   ClientMessage cm =
       new ClientMessage()
           .setType(ClientMessage.Type.CREATE)
           .setAuthor("AdnanAziz1968")
           .setSubject("Hello World")
           .setBody("My first posting!");
   ServerMessage result = doTxRx(cm, cm, cm);
   assertEquals(result.getId(), 2);
   score += 5;
 }
예제 #2
0
  @Test(timeout = 5000)
  public void testStress1() {
    List<ClientMessage> cmArray = new ArrayList<ClientMessage>();
    int N = 1000;
    for (int i = 0; i < N; i++) {
      cmArray.add(
          new ClientMessage()
              .setType(ClientMessage.Type.CREATE)
              .setAuthor("AdnanAziz1968")
              .setSubject("Stressing...")
              .setBody("Hello World for the " + i + "-th time"));
    }
    ServerMessage result = doTxRx(cmArray);

    assertEquals(result.getId(), N - 1);
    score += 5;
  }