예제 #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());
 }
예제 #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());
 }
예제 #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());
 }
예제 #4
0
 public void testCdOperation() {
   Operation op = new Operation("cd directory");
   assertEquals(Operation.type.CD, op.getCommand());
   assertEquals("directory", op.getArgs());
 }
예제 #5
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());
 }
예제 #6
0
 public void testPwdOperation() {
   Operation op = new Operation("pwd");
   assertEquals(Operation.type.PWD, op.getCommand());
   assertNull(op.getArgs());
 }
예제 #7
0
 public void testMkdirOperation() {
   Operation op = new Operation("mkdir directory1");
   assertEquals(Operation.type.MKDIR, op.getCommand());
   assertEquals("directory1", op.getArgs());
 }
예제 #8
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());
 }
예제 #9
0
 public void testLsOperation() {
   Operation op = new Operation("ls");
   assertNull(op.getArgs());
   assertEquals(Operation.type.LS, op.getCommand());
 }
예제 #10
0
 public void testEmptyOperation() {
   Operation op = new Operation("");
   assertNull(op.getArgs());
   assertEquals(Operation.type.UNKNOWN, op.getCommand());
 }