From: David S. <ds...@us...> - 2007-07-05 20:58:54
|
Update of /cvsroot/junit/junit-ant-tests/src/net/saff/ant In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3239/src/net/saff/ant Added Files: BuildFile.java FileMatchers.java Log Message: initial check-in --- NEW FILE: BuildFile.java --- package net.saff.ant; import java.io.File; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; public class BuildFile { private final String fileName; public BuildFile(String fileName) { this.fileName = fileName; } public static BuildFile fromFile(String fileName) { return new BuildFile(fileName); } public Project parse() { return initializedProject(new File(fileName)); } protected Project initializedProject(File file) { Project project = new Project(); project.init(); ProjectHelper.configureProject(project, file); return project; } } --- NEW FILE: FileMatchers.java --- package net.saff.ant; import java.io.File; import net.saff.theories.matchers.api.MethodNamedMatcher; import org.hamcrest.Matcher; public class FileMatchers { public static Matcher<String> nameOfExistingFile() { return new MethodNamedMatcher<String>() { public boolean matches(Object item) { return new File((String) item).exists(); } }; } } |