1 package net.firstpartners.nounit.utility.test; 2 3 26 27 import java.util.HashSet ; 28 import java.util.Iterator ; 29 30 import junit.framework.Test; 31 import junit.framework.TestCase; 32 import junit.framework.TestSuite; 33 import net.firstpartners.nounit.test.TestData; 34 import net.firstpartners.nounit.utility.DirectoryWalker; 35 36 import org.apache.log4j.Logger; 37 38 41 public class TestDirectoryWalker extends TestCase{ 42 43 static Logger log = Logger.getLogger(TestDirectoryWalker.class); 45 46 50 public TestDirectoryWalker(String name) { 51 super(name); 52 } 53 54 57 protected void setUp() 58 { 59 61 } 62 63 67 public static void main(String [] args) { 68 junit.textui.TestRunner.run (suite()); 69 } 70 71 75 public static Test suite() { 76 return new TestSuite(TestDirectoryWalker.class); 77 } 78 79 public void testSeeFiles() throws Exception { 80 81 HashSet myResults = 82 DirectoryWalker.getFiles( TestData.SAMPLE_CLASS_SOURCE,".class" ); 83 Iterator myList = myResults.iterator(); 84 StringBuffer addList = new StringBuffer (); 85 86 while (myList.hasNext()) { 88 addList.append(myList.next()); 89 addList.append("\n"); 90 91 } 92 String searchString = addList.toString(); 93 94 99 } 100 101 public void testSeeDirs() throws Exception { 102 103 HashSet myResults = DirectoryWalker.getDirs(TestData.SAMPLE_CLASS_SOURCE); 104 Iterator myList = myResults.iterator(); 105 StringBuffer addList = new StringBuffer (); 106 107 while (myList.hasNext()) { 109 addList.append(myList.next()); 110 addList.append("\n"); 111 112 } 113 String searchString = addList.toString(); 114 115 log.debug(searchString); 116 117 120 } 121 122 123 } 124 | Popular Tags |