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