コード例 #1
0
  @Test
  public void test_getLogs() throws Exception {
    startLogManagerAgent();

    story
        .record()
        .startTester("gui-agent")
        .sendMessage(
            Performative.QUERY,
            RequestProtocol.QUERY,
            new Aid("bebel"),
            AdministrationOntology.GET_LOG_FILES_ACTION)
        .then()
        .receiveMessage()
        .assertReceivedMessage(
            matchContent(
                "<list>\n"
                    + "  <string>server.log</string>\n"
                    + "  <string>mad.log</string>\n"
                    + "</list>"));

    story.record().addAssert(AgentAssert.log(log, "getLogFiles()"));

    story.execute();
  }
コード例 #2
0
  @Test
  public void test_readLog() throws Exception {
    startLogManagerAgent();

    story
        .record()
        .startTester("gui-agent")
        .sendMessage(
            Performative.REQUEST,
            RequestProtocol.REQUEST,
            new Aid("bebel"),
            AdministrationOntology.READ_LOG_ACTION + " server.log")
        .then()
        .receiveMessage()
        .assertReceivedMessage(
            and(
                matchPerformative(Performative.INFORM),
                matchContent("<string>Content of server.log</string>")));

    story.record().addAssert(AgentAssert.log(log, "readLog(server.log)"));

    story.execute();
  }