@@ -0,0 +1,2072 @@
+package com.cloudera.crunch.io;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.fs.FileSystem;%0Aimport org.apache.hadoop.fs.LocalFileSystem;%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.junit.Test;%0A%0Aimport com.cloudera.crunch.io.text.TextFileReaderFactory;%0Aimport com.cloudera.crunch.test.FileHelper;%0Aimport com.cloudera.crunch.types.writable.Writables;%0Aimport com.google.common.collect.Lists;%0Aimport com.google.common.io.Files;%0A%0A%0Apublic class CompositePathIterableTest %7B%0A%0A  %0A  @Test%0A  public void testCreate_FilePresent() throws IOException%7B%0A    String inputFilePath = FileHelper.createTempCopyOf(%22set1.txt%22);%0A    Configuration conf = new Configuration();%0A    LocalFileSystem local = FileSystem.getLocal(conf);%0A    %0A    Iterable%3CString%3E iterable = CompositePathIterable.create(local, new Path(inputFilePath), new TextFileReaderFactory%3CString%3E(Writables.strings(), conf));%0A    %0A    assertEquals(Lists.newArrayList(%22b%22, %22c%22, %22a%22, %22e%22), Lists.newArrayList(iterable));%0A    %0A  %7D%0A  %0A  @Test%0A  public void testCreate_DirectoryPresentButNoFiles() throws IOException%7B%0A    String inputFilePath = Files.createTempDir().getAbsolutePath();%0A %0A    Configuration conf = new Configuration();%0A    LocalFileSystem local = FileSystem.getLocal(conf);%0A    %0A    Iterable%3CString%3E iterable = CompositePathIterable.create(local, new Path(inputFilePath), new TextFileReaderFactory%3CString%3E(Writables.strings(), conf));%0A    %0A    assertTrue(Lists.newArrayList(iterable).isEmpty());%0A  %7D%0A  %0A  @Test(expected=IOException.class)%0A  public void testCreate_DirectoryNotPresent() throws IOException%7B%0A    File inputFileDir = Files.createTempDir();%0A    inputFileDir.delete();%0A    %0A    // Sanity check%0A    assertFalse(inputFileDir.exists());%0A    %0A    Configuration conf = new Configuration();%0A    LocalFileSystem local = FileSystem.getLocal(conf);%0A    %0A    CompositePathIterable.create(local, new Path(inputFileDir.getAbsolutePath()), new TextFileReaderFactory%3CString%3E(Writables.strings(), conf));%0A  %7D%0A%0A%7D%0A

Add tests for creation of CompositePathIterable