Пример #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());
 }