Package net.grinder

Examples of net.grinder.AgentDaemon.run()


  @Test
  public void testConnection() throws InterruptedException {
    // Try to connect any port
    AgentDaemon agent = new AgentDaemon(agentConfig1);
    agent.run(getFreePort());
    sleep(1000);
  }

  Condition condition = new Condition();
View Full Code Here


  @Test(timeout = 3000)
  public void testIfAgentDeadWellWhenConsoleIsShutdown() {
    // After connecting agent daemon,
    AgentDaemon agent = new AgentDaemon(agentConfig1);
    agent.run(console1.getConsolePort());
    agent.addListener(new AgentShutDownSynchronizeListener(condition));
    // Shutdown console
    console1.shutdown();
    waitOnCondition(condition, 2100);
  }
View Full Code Here

  @Test
  public void testAgentReconnect() {
    // After connecting agent daemon,
    AgentDaemon agent = new AgentDaemon(agentConfig1);
    agent.run(console1.getConsolePort());
    agent.addListener(new AgentShutDownSynchronizeListener(condition));
    // Shutdown console
    sleep(3000);
    assertThat(console1.getAllAttachedAgentsCount(), is(1));
View Full Code Here

    agent.shutdown();
    sleep(5000);
    assertThat(console1.getAllAttachedAgentsCount(), is(0));

    // Even shutdown twice, agent is well connected into console.
    agent.run(console1.getConsolePort());
    sleep(2000);

    assertThat(console1.getAllAttachedAgentsCount(), is(1));

  }
View Full Code Here

    AgentConfig agentConfig1 = Mockito.spy(agentConfig);
    AgentDaemon agent = new AgentDaemon(agentConfig1);
    URL scriptUrl = this.getClass().getResource("/grinder.properties");
    File scriptFile = new File(scriptUrl.getFile());
    GrinderProperties properties = new GrinderProperties(scriptFile);
    agent.run(properties);
    ThreadUtils.sleep(10000);
  }

  public int getFreePort() {
    ServerSocket socket = null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.