Package org.apache.hadoop.fs.shell.find

Examples of org.apache.hadoop.fs.shell.find.Not


public class TestNot extends TestExpression {

  @Test
  public void applyPass()  throws IOException {
    Not not = new Not();
   
    PathData pathData = mock(PathData.class);
   
    Expression child = mock(Expression.class);
    when(child.apply(pathData)).thenReturn(Result.PASS);
   
    Deque<Expression> children = new LinkedList<Expression>();
    children.add(child);
    not.addChildren(children);
   
    assertEquals(Result.FAIL, not.apply(pathData));
    verify(child).apply(pathData);
    verifyNoMoreInteractions(child);
  }
View Full Code Here


    verifyNoMoreInteractions(child);
  }

  @Test
  public void applyFail()  throws IOException {
    Not not = new Not();
   
    PathData pathData = mock(PathData.class);
   
    Expression child = mock(Expression.class);
    when(child.apply(pathData)).thenReturn(Result.FAIL);
   
    Deque<Expression> children = new LinkedList<Expression>();
    children.add(child);
    not.addChildren(children);
   
    assertEquals(Result.PASS, not.apply(pathData));
    verify(child).apply(pathData);
    verifyNoMoreInteractions(child);
  }
View Full Code Here

    verify(child).apply(pathData);
    verifyNoMoreInteractions(child);
  }
  @Test
  public void testInit()  throws IOException {
    Not not = new Not();
    Expression child = mock(Expression.class);
   
    Deque<Expression> children = new LinkedList<Expression>();
    children.add(child);
    not.addChildren(children);
   
    FindOptions options = mock(FindOptions.class);
    not.initialise(options);
    verify(child).initialise(options);
    verifyNoMoreInteractions(child);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.shell.find.Not

Copyright © 2018 www.massapicom. 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.