コード例 #1
0
  @Test
  public void testTimeFor_FiftyThousand() {
    Choir testChoir = new Choir();

    Address choirAddress = new Address();

    choirAddress.setCity("Omaha");

    choirAddress.setState("NE");

    testChoir.setChoirName("Omaha Children's Choir");

    testChoir.setAddress(choirAddress);

    StopWatch timer = new StopWatch();

    String result = null;

    timer.start();

    for (int i = 0; i < 50000; i++) {

      result = TestUtility.post(timeTestBase + "names", testChoir.toJson(false));
    }

    timer.stop();

    assertNotNull(result);

    say("\n\nTime taken = " + timer.getTime());
    say("Time taken (nano) = " + timer.getNanoTime());
  }
コード例 #2
0
  public void PostChoir(RoutingContext rc) {
    Choir choir = TestUtility.toChoirFromJson(rc.getBodyAsString());

    rc.response().end(choir.toJson(false));
  }