use of org.codehaus.plexus.util.cli.StreamConsumer in project maven-scm by apache.
the class FileConsumerTest method testConsumeUpdate.
@Test
public void testConsumeUpdate() {
List<File> extractedFiles = new ArrayList<File>();
StreamConsumer consumer = new FileConsumer(extractedFiles, FileConsumer.UPDATE_PATTERN);
consumer.consumeLine("Content (1 K) of \"readme.txt\" - ok");
consumer.consumeLine("Creating dir \"src/main/java/org\" .");
consumer.consumeLine("Updating (creating) dir /./src/test/java");
consumer.consumeLine("Updating element \\.\\src\\main\\java\\Application.java");
assertThat(extractedFiles.size(), is(2));
assertThat(extractedFiles, hasItem(new File("readme.txt")));
assertThat(extractedFiles, hasItem(new File("src\\main\\java\\Application.java")));
}
use of org.codehaus.plexus.util.cli.StreamConsumer in project maven-scm by apache.
the class FileConsumerTest method testConsumeAdd.
@Test
public void testConsumeAdd() {
List<File> extractedFiles = new ArrayList<File>();
StreamConsumer consumer = new FileConsumer(extractedFiles, FileConsumer.ADD_PATTERN);
consumer.consumeLine("Added and kept element /./src/main/java/Application.java");
consumer.consumeLine("Added and kept element \\.\\src\\main\\java\\Windows.java");
assertThat(extractedFiles.size(), is(2));
assertThat(extractedFiles, hasItem(new File("src/main/java/Application.java")));
assertThat(extractedFiles, hasItem(new File("src\\main\\java\\Windows.java")));
}
Aggregations