예제 #1
0
  public void testSessionExpiration() throws Exception {
    Interpreter interpreter = new Interpreter();
    interpreter.initialize(this.cacheManager);
    interpreter.setSessionTimeout(500);
    interpreter.setSessionReaperWakeupInterval(1000);
    interpreter.start();

    try {
      String sessionId = interpreter.createSessionId(null);
      Thread.sleep(1500);
      Map<String, String> response = interpreter.execute(sessionId, "");
      assert response.containsKey("ERROR");
    } finally {
      interpreter.stop();
    }
  }