Skip to content

Instantly share code, notes, and snippets.

@cwensel
Created July 8, 2011 19:32
Show Gist options
  • Select an option

  • Save cwensel/1072620 to your computer and use it in GitHub Desktop.

Select an option

Save cwensel/1072620 to your computer and use it in GitHub Desktop.
public void testComplexLogic() throws Exception
{
if( !new File( inputFileLhs ).exists() )
fail( "data file not found" );
copyFromLocal( inputFileLhs );
Tap source = new Hfs( new TextDelimited( new Fields( "num", "char" ), " " ), inputFileLhs );
Pipe pipe = new Pipe( "test" );
Filter filter = new Not( new And( new Fields( "num" ), new RegexFilter( "1", true, true ), new Fields( "char" ), new RegexFilter( "a", true, true ) ) );
pipe = new Each( pipe, new Fields( "num", "char" ), filter );
Tap sink = new Hfs( new TextDelimited( Fields.ALL, " " ), outputPath + "/regression/complexlogic", true );
Flow flow = new FlowConnector( getProperties() ).connect( source, sink, pipe );
flow.complete();
validateLength( flow, 1, 2, Pattern.compile( "1\ta" ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment