1 35 36 package org.codehaus.groovy.wiki; 37 38 import java.io.File ; 39 40 import org.codehaus.groovy.classgen.TestSupport; 41 42 import groovy.util.GroovyTestSuite; 43 import junit.framework.Test; 44 import junit.framework.TestSuite; 45 46 52 public class RunWikiTest extends TestSupport { 53 54 public static Test suite() { 55 TestSuite suite = new TestSuite(); 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(".wiki")) { 62 name = "target/test-classes/wiki/" + name.replaceAll(".wiki", "Test.groovy"); 63 System.setProperty("test", name); 64 suite.addTest(GroovyTestSuite.suite()); 65 } 66 } 67 return suite; 68 } 69 } 70 | Popular Tags |