Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (29 sloc) 0.926 kb
import java.io.*;
import java.util.jar.JarFile;
JarFile getFile() {
File file = new File(basedir, "target/out.jar" );
if ( !file.isFile() ) {
throw new FileNotFoundException( "Could not find generated JAR: " + file );
}
return new JarFile(file);
}
mustNotExist(JarFile file, String path) {
if (file.getEntry(path) != null)
throw new RuntimeException(path + " should not be in "+file.getName());
}
mustExist(JarFile file, String path) {
if (file.getEntry(path) == null)
throw new RuntimeException(path + " should be in "+file.getName());
}
verifyNoEmptyDir() {
mustNotExist(getFile(), "test/empty/");
}
verifyDirWithFilesIsPresent() {
mustExist(getFile(), "test/has_file/");
}
testDirectoriesCreatedByRulesAreIncluded() {
mustExist(getFile(), "com/test/junit/");
}
verifyNoEmptyDir();
verifyDirWithFilesIsPresent();
testDirectoriesCreatedByRulesAreIncluded();
Jump to Line
Something went wrong with that request. Please try again.