]> source.dussan.org Git - jackcess.git/commitdiff
reindent
authorJames Ahlborn <jtahlborn@yahoo.com>
Wed, 7 Apr 2010 02:35:09 +0000 (02:35 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Wed, 7 Apr 2010 02:35:09 +0000 (02:35 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@458 f203690c-595d-4dc9-a70b-905162fa7fd2

test/src/java/com/healthmarketscience/jackcess/JetFormatTest.java

index c4b9b1f9e31c821896fe8ffd52d928aac732bbff..d386af6259b5bc3a16beb074e89cbe341c2fc840 100644 (file)
@@ -13,154 +13,154 @@ import junit.framework.TestCase;
  *         Date: Mar 5, 2010
  *         Time: 12:44:21 PM
  */
-public final class JetFormatTest extends TestCase {
-
-    private static final File DIR_TEST_DATA = new File("test/data");
-
-    /**
-     * Defines known valid db test file base names.
-     */
-    public static enum Basename {
-
-        BIG_INDEX("bigIndexTest"),
-        COMP_INDEX("compIndexTest"),
-        DEL_COL("delColTest"),
-        DEL("delTest"),
-        FIXED_NUMERIC("fixedNumericTest"),
-        FIXED_TEXT("fixedTextTest"),
-        INDEX_CURSOR("indexCursorTest"),
-        INDEX("indexTest"),
-        OVERFLOW("overflowTest"),
-        QUERY("queryTest"),
-        TEST("test"),
-        TEST2("test2"),
-        INDEX_CODES("testIndexCodes"),
-        INDEX_PROPERTIES("testIndexProperties"),
-        PROMOTION("testPromotion"),
-        ;
-
-        private final String _basename;
-
-        Basename(String fileBasename) {
-          _basename = fileBasename;
-        }
-
-        @Override
-        public String toString() { return _basename; }
+public class JetFormatTest extends TestCase {
+
+  private static final File DIR_TEST_DATA = new File("test/data");
+
+  /**
+   * Defines known valid db test file base names.
+   */
+  public static enum Basename {
+
+    BIG_INDEX("bigIndexTest"),
+      COMP_INDEX("compIndexTest"),
+      DEL_COL("delColTest"),
+      DEL("delTest"),
+      FIXED_NUMERIC("fixedNumericTest"),
+      FIXED_TEXT("fixedTextTest"),
+      INDEX_CURSOR("indexCursorTest"),
+      INDEX("indexTest"),
+      OVERFLOW("overflowTest"),
+      QUERY("queryTest"),
+      TEST("test"),
+      TEST2("test2"),
+      INDEX_CODES("testIndexCodes"),
+      INDEX_PROPERTIES("testIndexProperties"),
+      PROMOTION("testPromotion"),
+      ;
+
+    private final String _basename;
+
+    Basename(String fileBasename) {
+      _basename = fileBasename;
     }
 
-    /** Defines currently supported db file formats. */
-    final static Database.FileFormat[] SUPPORTED_FILEFORMATS = 
-      new Database.FileFormat[] {
-            Database.FileFormat.V2000,
-            Database.FileFormat.V2003,
-            Database.FileFormat.V2007,
-    };
-
-    /**
-     * Defines known valid test database files, and their jet format version.
-     */
-    public static final class TestDB {
-
-        private final File dbFile;
-        private final Database.FileFormat expectedFileFormat;
-
-        private TestDB(File databaseFile, 
-                       Database.FileFormat expectedDBFileFormat) {
-
-            dbFile = databaseFile;
-            expectedFileFormat = expectedDBFileFormat;
-        }
-
-        public final File getFile() { return dbFile; }
-
-        public final Database.FileFormat  getExpectedFileFormat() { 
-          return expectedFileFormat; 
-        }
-
-        public final JetFormat getExpectedFormat() { 
-          return expectedFileFormat.getJetFormat(); 
-        }
-
-        @Override
-        public final String toString() {
-          return "dbFile: " + dbFile.getAbsolutePath()
-            + "; expectedFileFormat: " + expectedFileFormat;
-        }
-
-        public static List<TestDB> getSupportedForBasename(Basename basename) {
-
-          List<TestDB> supportedTestDBs = new ArrayList<TestDB>();
-          for (Database.FileFormat fileFormat : SUPPORTED_FILEFORMATS) {
-            supportedTestDBs.add(new TestDB(
-                                     getFileForBasename(basename, fileFormat),
-                                     fileFormat));
-          }
-          return supportedTestDBs;
-        }
-
-        private static File getFileForBasename(
-            Basename basename, Database.FileFormat fileFormat) {
-
-            return new File(DIR_TEST_DATA, 
-                            fileFormat.name() + File.separator +
-                            basename + fileFormat.name() + 
-                            fileFormat.getFileExtension());
-        }
+    @Override
+    public String toString() { return _basename; }
+  }
+
+  /** Defines currently supported db file formats. */
+  final static Database.FileFormat[] SUPPORTED_FILEFORMATS = 
+    new Database.FileFormat[] {
+    Database.FileFormat.V2000,
+    Database.FileFormat.V2003,
+    Database.FileFormat.V2007,
+  };
+
+  /**
+   * Defines known valid test database files, and their jet format version.
+   */
+  public static final class TestDB {
+
+    private final File dbFile;
+    private final Database.FileFormat expectedFileFormat;
+
+    private TestDB(File databaseFile, 
+                   Database.FileFormat expectedDBFileFormat) {
+
+      dbFile = databaseFile;
+      expectedFileFormat = expectedDBFileFormat;
     }
 
-    private static final File UNSUPPORTED_TEST_V1997 = 
-      new File(DIR_TEST_DATA, "V1997" + File.separator +
-               Basename.TEST + "V1997.mdb");
+    public final File getFile() { return dbFile; }
+
+    public final Database.FileFormat  getExpectedFileFormat() { 
+      return expectedFileFormat; 
+    }
+
+    public final JetFormat getExpectedFormat() { 
+      return expectedFileFormat.getJetFormat(); 
+    }
 
-    static final List<TestDB> SUPPORTED_DBS_TEST = 
-      TestDB.getSupportedForBasename(Basename.TEST);
+    @Override
+    public final String toString() {
+      return "dbFile: " + dbFile.getAbsolutePath()
+        + "; expectedFileFormat: " + expectedFileFormat;
+    }
 
+    public static List<TestDB> getSupportedForBasename(Basename basename) {
 
-    public void testGetFormat() throws Exception {
-        try {
-            JetFormat.getFormat(null);
-            fail("npe");
-        } catch (NullPointerException e) {
-          // success
-        }
+      List<TestDB> supportedTestDBs = new ArrayList<TestDB>();
+      for (Database.FileFormat fileFormat : SUPPORTED_FILEFORMATS) {
+        supportedTestDBs.add(new TestDB(
+                                 getFileForBasename(basename, fileFormat),
+                                 fileFormat));
+      }
+      return supportedTestDBs;
+    }
 
-        checkUnsupportedJetFormat(UNSUPPORTED_TEST_V1997);
+    private static File getFileForBasename(
+        Basename basename, Database.FileFormat fileFormat) {
 
-        for (final TestDB testDB : SUPPORTED_DBS_TEST) {
-          checkJetFormat(testDB);
-        }
+      return new File(DIR_TEST_DATA, 
+                      fileFormat.name() + File.separator +
+                      basename + fileFormat.name() + 
+                      fileFormat.getFileExtension());
     }
+  }
+
+  private static final File UNSUPPORTED_TEST_V1997 = 
+    new File(DIR_TEST_DATA, "V1997" + File.separator +
+             Basename.TEST + "V1997.mdb");
 
-    private static void checkJetFormat(final TestDB testDB)
-            throws IOException {
+  static final List<TestDB> SUPPORTED_DBS_TEST = 
+    TestDB.getSupportedForBasename(Basename.TEST);
 
-        final FileChannel channel = Database.openChannel(testDB.dbFile, false);
-        try {
 
-            JetFormat fmtActual = JetFormat.getFormat(channel);
-            assertEquals("Unexpected JetFormat for dbFile: " + 
-                         testDB.dbFile.getAbsolutePath(),
-                         testDB.expectedFileFormat.getJetFormat(), fmtActual);
+  public void testGetFormat() throws Exception {
+    try {
+      JetFormat.getFormat(null);
+      fail("npe");
+    } catch (NullPointerException e) {
+      // success
+    }
+
+    checkUnsupportedJetFormat(UNSUPPORTED_TEST_V1997);
 
-        } finally {
-            channel.close();
-        }
+    for (final TestDB testDB : SUPPORTED_DBS_TEST) {
+      checkJetFormat(testDB);
     }
+  }
 
-    private static void checkUnsupportedJetFormat(File testDB)
-            throws IOException {
-
-        final FileChannel channel = Database.openChannel(testDB, false);
-        try {
-            JetFormat.getFormat(channel);
-            fail("Unexpected JetFormat for dbFile: " + 
-                 testDB.getAbsolutePath());
-        } catch(IOException ignored) {
-          // success
-        } finally {
-            channel.close();
-        }
+  private static void checkJetFormat(final TestDB testDB)
+    throws IOException {
+
+    final FileChannel channel = Database.openChannel(testDB.dbFile, false);
+    try {
+
+      JetFormat fmtActual = JetFormat.getFormat(channel);
+      assertEquals("Unexpected JetFormat for dbFile: " + 
+                   testDB.dbFile.getAbsolutePath(),
+                   testDB.expectedFileFormat.getJetFormat(), fmtActual);
+
+    } finally {
+      channel.close();
+    }
+  }
+
+  private static void checkUnsupportedJetFormat(File testDB)
+    throws IOException {
+
+    final FileChannel channel = Database.openChannel(testDB, false);
+    try {
+      JetFormat.getFormat(channel);
+      fail("Unexpected JetFormat for dbFile: " + 
+           testDB.getAbsolutePath());
+    } catch(IOException ignored) {
+      // success
+    } finally {
+      channel.close();
     }
+  }
 
 }