| import java.io.*; |
| |
| File f = new File( basedir, "child/target/child-1-src/test.txt" ); |
| |
| if ( !f.exists() ) |
| { |
| System.out.println( "Filtered file from file-set: " + f + " is missing." ); |
| return false; |
| } |
| |
| StringBuffer sb = new StringBuffer(); |
| |
| FileReader reader = new FileReader( f ); |
| char[] cbuf = new char[16]; |
| int read = -1; |
| while( ( read = reader.read( cbuf ) ) > -1 ) |
| { |
| sb.append( cbuf, 0, read ); |
| } |
| |
| reader.close(); |
| |
| System.out.println( "Contents of test.txt: '" + sb.toString() + "' should contain the windows newline: '\\r\\n'." ); |
| |
| if ( sb.toString().indexOf( "1\r\nchild" ) == -1 ) |
| { |
| System.out.println( "test.txt has wrong line ending" ); |
| return false; |
| } |
| if ( sb.toString().indexOf( "child\r\n" ) > -1 ) |
| { |
| System.out.println( "test.txt has an extra line ending at the end of the file" ); |
| return false; |
| } |
| return true; |