Package eu.infomas.annotation

Examples of eu.infomas.annotation.FileIterator


public final class FileIteratorTest {

    @Test
    public void testNoFile() throws IOException {
        FileIterator iter = new FileIterator();
        assertEquals(0, countFiles(iter));
    }
View Full Code Here


        assertEquals(0, countFiles(iter));
    }
   
    @Test
    public void testSingleFile() throws IOException {
        FileIterator iter = new FileIterator(
            new File("./src/test/java/eu/infomas/annotation/FileIteratorTest.java"));
        assertEquals(1, countFiles(iter));
    }
View Full Code Here

        assertEquals(1, countFiles(iter));
    }
   
    @Test
    public void testSingleDirectory1() throws IOException {
        FileIterator iter = new FileIterator(
            new File("./src/test/java/eu/infomas/annotation"));
        assertEquals(7, countFiles(iter));
    }
View Full Code Here

        assertEquals(7, countFiles(iter));
    }
   
    @Test
    public void testSingleDirectory4() throws IOException {
        FileIterator iter = new FileIterator(
            new File("./src/test/java/eu/infomas"));
        // 5 in annotation and 2 in util
        assertEquals(8, countFiles(iter));
    }
View Full Code Here

        assertEquals(8, countFiles(iter));
    }
   
    @Test
    public void testMixed() throws IOException {
        FileIterator iter = new FileIterator(
            new File("./src/test/java/eu/infomas/util/TestSupport.java"),
            new File("./src/test/java/eu/infomas/annotation/"));
        assertEquals(8, countFiles(iter));
    }
View Full Code Here

            new File("./src/test/java/eu/infomas/annotation/"));
        assertEquals(8, countFiles(iter));
    }
    @Test
    public void testIsRoot1() throws IOException {
        FileIterator iter = new FileIterator(
            new File("./src/test/java/eu/infomas/util/FileIteratorTest.java"));
        assertNotNull(iter.next());
        assertTrue(iter.isRootFile());
        assertNull(iter.next());
    }
View Full Code Here

        assertNull(iter.next());
    }
   
    @Test
    public void testIsRoot2() throws IOException {
        FileIterator iter = new FileIterator(new File("./src/test/java/eu/infomas/util/"));
        assertNotNull(iter.next());
        assertFalse(iter.isRootFile());
        assertNull(iter.next());
    }
View Full Code Here

        assertNull(iter.next());
    }
   
    @Test
    public void testIsRoot3() throws IOException {
        FileIterator iter = new FileIterator(
            new File("./src/test/java/eu/infomas/util/TestSupport.java"),
            new File("./src/test/java/eu/infomas/annotation/")
            );
        while (iter.next() != null) {
            if ("TestSupport.java".equals(iter.getFile().getName())) {
                assertTrue(iter.isRootFile());
            } else {
                assertFalse(iter.getFile().toString(), iter.isRootFile());
            }
        }
    }
View Full Code Here

        }
    }
   
    @Test
    public void testIsRoot4() throws IOException {
        FileIterator iter = new FileIterator(
            new File("./src/test/java/eu/infomas/annotation/"),
            new File("./src/test/java/eu/infomas/util/TestSupport.java")
            );
        while (iter.next() != null) {
            if ("TestSupport.java".equals(iter.getFile().getName())) {
                assertTrue(iter.isRootFile());
            } else {
                assertFalse(iter.getFile().toString(), iter.isRootFile());
            }
        }
    }
View Full Code Here

TOP

Related Classes of eu.infomas.annotation.FileIterator

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.