Example #1
0
 public void testMkdirWithTooManyParameter() {
   Operation op = new Operation("mkdir directory1 directory2");
   assertNull(op.getArgs());
   assertEquals(Operation.type.UNKNOWN, op.getCommand());
   assertEquals(
       "too many arguments for mkdir command, this version of the server only allows one directory creation per command",
       op.getError());
 }
Example #2
0
 public void testCdWithInsuficientParameters() {
   Operation op = new Operation("cd");
   assertNull(op.getArgs());
   assertEquals(Operation.type.UNKNOWN, op.getCommand());
   assertEquals("insuficient number of args for cd command", op.getError());
 }
Example #3
0
 public void testCdWithTooManyParameters() {
   Operation op = new Operation("cd directory1 directory2");
   assertNull(op.getArgs());
   assertEquals(Operation.type.UNKNOWN, op.getCommand());
   assertEquals("too many arguments for cd command", op.getError());
 }
Example #4
0
 public void testPwdWithTooManyParameter() {
   Operation op = new Operation("pwd something");
   assertNull(op.getArgs());
   assertEquals(Operation.type.PWD, op.getCommand());
   assertEquals("too many arguments for pwd command", op.getError());
 }
Example #5
0
 public void testLsWithTooManyParameter() {
   Operation op = new Operation("ls -la");
   assertNull(op.getArgs());
   assertEquals(Operation.type.UNKNOWN, op.getCommand());
   assertEquals("too many arguments for ls command", op.getError());
 }