<name>com.healthmarketscience.jackcess.bigIndex</name>
<value>${jackcess.bigIndex}</value>
</property>
+ <property>
+ <name>com.healthmarketscience.jackcess.testFormats</name>
+ <value>${jackcess.testFormats}</value>
+ </property>
</systemProperties>
</configuration>
</plugin>
<url>scp://shell.sourceforge.net/home/groups/j/ja/jackcess/htdocs</url>
</site>
</distributionManagement>
+ <properties>
+ <jackcess.bigIndex>true</jackcess.bigIndex>
+ <jackcess.testFormats>V2000,V2003,V2007</jackcess.testFormats>
+ </properties>
</project>
super(name);
}
- public static Database open(Database.FileFormat fileFormat, File file) throws Exception {
+ public static Database open(FileFormat fileFormat, File file)
+ throws Exception
+ {
final Database db = Database.open(file, true, _autoSync);
assertEquals("Wrong JetFormat.", fileFormat.getJetFormat(), db.getFormat());
assertEquals("Wrong FileFormat.", fileFormat, db.getFileFormat());
return open(testDB.getExpectedFileFormat(), testDB.getFile());
}
- public static Database create(Database.FileFormat fileFormat) throws Exception {
+ public static Database create(FileFormat fileFormat) throws Exception {
return create(fileFormat, false);
}
- public static Database create(Database.FileFormat fileFormat, boolean keep) throws Exception {
+ public static Database create(FileFormat fileFormat, boolean keep)
+ throws Exception
+ {
return Database.create(fileFormat, createTempFile(keep), _autoSync);
}
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
+import java.util.EnumSet;
import java.util.List;
+import java.util.Set;
import junit.framework.TestCase;
+import static com.healthmarketscience.jackcess.Database.*;
+
/**
* @author Dan Rollo
* Date: Mar 5, 2010
}
/** Defines currently supported db file formats. */
- final static Database.FileFormat[] SUPPORTED_FILEFORMATS =
- new Database.FileFormat[] {
- Database.FileFormat.V2000,
- Database.FileFormat.V2003,
- Database.FileFormat.V2007,
+ final static FileFormat[] SUPPORTED_FILEFORMATS =
+ new FileFormat[] {
+ FileFormat.V2000,
+ FileFormat.V2003,
+ FileFormat.V2007,
};
/**
public static final class TestDB {
private final File dbFile;
- private final Database.FileFormat expectedFileFormat;
+ private final FileFormat expectedFileFormat;
private TestDB(File databaseFile,
- Database.FileFormat expectedDBFileFormat) {
+ FileFormat expectedDBFileFormat) {
dbFile = databaseFile;
expectedFileFormat = expectedDBFileFormat;
public final File getFile() { return dbFile; }
- public final Database.FileFormat getExpectedFileFormat() {
+ public final FileFormat getExpectedFileFormat() {
return expectedFileFormat;
}
public static List<TestDB> getSupportedForBasename(Basename basename) {
+ String testFormatStr = System.getProperty("com.healthmarketscience.jackcess.testFormats");
+ Set<FileFormat> testFormats = EnumSet.allOf(FileFormat.class);
+ if((testFormatStr != null) && (testFormatStr.length() > 0)) {
+ testFormats = EnumSet.noneOf(FileFormat.class);
+ for(String tmp : testFormatStr.split(",")) {
+ testFormats.add(FileFormat.valueOf(tmp.toUpperCase()));
+ }
+ }
+
List<TestDB> supportedTestDBs = new ArrayList<TestDB>();
- for (Database.FileFormat fileFormat : SUPPORTED_FILEFORMATS) {
+ for (FileFormat fileFormat : SUPPORTED_FILEFORMATS) {
+ if(!testFormats.contains(fileFormat)) {
+ continue;
+ }
supportedTestDBs.add(new TestDB(
getFileForBasename(basename, fileFormat),
fileFormat));
}
private static File getFileForBasename(
- Basename basename, Database.FileFormat fileFormat) {
+ Basename basename, FileFormat fileFormat) {
return new File(DIR_TEST_DATA,
fileFormat.name() + File.separator +