Package com.bj58.spat.gaea.server.performance.commandhelper

Examples of com.bj58.spat.gaea.server.performance.commandhelper.Count.createCommand()


public class CountTest {

  @Test
  public void testCreateCommand() {
    Count count = new Count();
    Command command1 = count.createCommand("count");
    Assert.assertEquals(CommandType.Count, command1.getCommandType());
    Assert.assertEquals("#all#", command1.getMethod());
    Assert.assertEquals(1, command1.getSecond());
   
   
View Full Code Here


    Assert.assertEquals(CommandType.Count, command1.getCommandType());
    Assert.assertEquals("#all#", command1.getMethod());
    Assert.assertEquals(1, command1.getSecond());
   
   
    Command command2 = count.createCommand("count|second 2|method getInfo");
    Assert.assertEquals(CommandType.Count, command2.getCommandType());
    Assert.assertEquals("getInfo", command2.getMethod());
    Assert.assertEquals(2, command2.getSecond());
  }
}
View Full Code Here

public class ExecTest {

  @Test
  public void testCreateCommand() {
    Exec exec = new Exec();
    Command command1 = exec.createCommand("exec|netstat -na");
    assertEquals(CommandType.Exec, command1.getCommandType());
    assertEquals("netstat -na", command1.getCommand());
   
    Command command2 = exec.createCommand("exec|killall java");
    assertEquals(CommandType.Illegal, command2.getCommandType());
View Full Code Here

    Exec exec = new Exec();
    Command command1 = exec.createCommand("exec|netstat -na");
    assertEquals(CommandType.Exec, command1.getCommandType());
    assertEquals("netstat -na", command1.getCommand());
   
    Command command2 = exec.createCommand("exec|killall java");
    assertEquals(CommandType.Illegal, command2.getCommandType());
  }

}
View Full Code Here

public class TimeTest {

  @Test
  public void testCreateCommand() {
    Time time = new Time();
    Command command1 = time.createCommand("time|grep abc|group 10|column -kd");
    assertEquals(CommandType.Time, command1.getCommandType());
    assertEquals("abc", command1.getGrep().get(0));
    assertEquals(ShowColumn.Key, command1.getColumnList().get(0));
    assertEquals(ShowColumn.Description, command1.getColumnList().get(1));
    assertEquals(2, command1.getColumnList().size());
View Full Code Here

    assertEquals(ShowColumn.Description, command1.getColumnList().get(1));
    assertEquals(2, command1.getColumnList().size());
    assertEquals(10, command1.getGroup());
   
   
    Command command2 = time.createCommand("time|grep 123");
    assertEquals(CommandType.Time, command2.getCommandType());
    assertEquals("123", command2.getGrep().get(0));
    assertEquals(ShowColumn.All, command2.getColumnList().get(0));
    assertEquals(1, command2.getColumnList().size());
    assertEquals(0, command2.getGroup());
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.