1 35 36 package org.codehaus.groovy.wiki; 37 38 import java.io.File ; 39 import java.util.ArrayList ; 40 import java.util.List ; 41 42 import groovy.lang.GroovyObject; 43 44 import org.codehaus.groovy.classgen.TestSupport; 45 46 52 public class RunHtml2WikiTest extends TestSupport { 53 54 public void testRun() throws Exception { 55 List list = new ArrayList (); 56 File dir = new File ("xdocs"); 57 File [] files = dir.listFiles(); 58 for (int i = 0; i < files.length; i++) { 59 File file = files[i]; 60 String name = file.getName(); 61 if (name.endsWith(".html")) { 62 list.add("xdocs/" + file.getName()); 63 } 64 } 65 String [] args = new String [list.size()]; 66 list.toArray(args); 67 68 GroovyObject object = compile("src/test/org/codehaus/groovy/wiki/Html2Wiki.groovy"); 69 object.invokeMethod("main", new Object [] { args }); 70 } 71 } 72 | Popular Tags |