[infinispan-commits] Infinispan SVN: r1476 - trunk/cachestore/bdbje/src/test/java/org/infinispan/loaders/bdbje.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Tue Feb 9 08:38:59 EST 2010


Author: manik.surtani at jboss.com
Date: 2010-02-09 08:38:59 -0500 (Tue, 09 Feb 2010)
New Revision: 1476

Modified:
   trunk/cachestore/bdbje/src/test/java/org/infinispan/loaders/bdbje/BdbjeCacheStoreTest.java
Log:
Fixed failing test

Modified: trunk/cachestore/bdbje/src/test/java/org/infinispan/loaders/bdbje/BdbjeCacheStoreTest.java
===================================================================
--- trunk/cachestore/bdbje/src/test/java/org/infinispan/loaders/bdbje/BdbjeCacheStoreTest.java	2010-02-09 13:38:25 UTC (rev 1475)
+++ trunk/cachestore/bdbje/src/test/java/org/infinispan/loaders/bdbje/BdbjeCacheStoreTest.java	2010-02-09 13:38:59 UTC (rev 1476)
@@ -35,7 +35,7 @@
  * @author Adrian Cole
  * @since 4.0
  */
- at Test(groups = "unit", enabled = true, testName = "loaders.bdbje.BdbjeCacheStoreTest")
+ at Test(groups = "unit", testName = "loaders.bdbje.BdbjeCacheStoreTest")
 public class BdbjeCacheStoreTest {
    private BdbjeCacheStore cs;
    private BdbjeCacheStoreConfig cfg;
@@ -116,6 +116,7 @@
       cacheMap = createMock(StoredMap.class);
       expiryMap = createMock(StoredSortedMap.class);
       currentTransaction = createMock(CurrentTransaction.class);
+      gtf = new GlobalTransactionFactory();
       WeakReference<Environment> envRef = new WeakReference<Environment>(env);
       ReflectionUtil.setValue(currentTransaction, "envRef", envRef);
       ThreadLocal localTrans = new ThreadLocal();
@@ -136,6 +137,7 @@
       cache = null;
       cfg = null;
       cs = null;
+      gtf = null;
    }
 
    void start() throws DatabaseException, CacheLoaderException {
@@ -144,7 +146,6 @@
       expect(cache.getConfiguration()).andReturn(null).anyTimes();
    }
 
-   @Test
    public void testGetConfigurationClass() throws Exception {
       replayAll();
       assert cs.getConfigurationClass().equals(BdbjeCacheStoreConfig.class);
@@ -176,7 +177,6 @@
       verify(cache);
    }
 
-   @Test
    public void testInitNoMock() throws Exception {
       replayAll();
       cs.init(cfg, cache, null);
@@ -186,8 +186,7 @@
       verifyAll();
    }
 
-   @Test
-   void testExceptionClosingCacheDatabaseDoesntPreventEnvironmentFromClosing() throws Exception {
+   public void testExceptionClosingCacheDatabaseDoesntPreventEnvironmentFromClosing() throws Exception {
       start();
       cacheDb.close();
       expiryDb.close();
@@ -201,8 +200,7 @@
       verifyAll();
    }
 
-   @Test
-   void testExceptionClosingCatalogDoesntPreventEnvironmentFromClosing() throws Exception {
+   public void testExceptionClosingCatalogDoesntPreventEnvironmentFromClosing() throws Exception {
       start();
       cacheDb.close();
       expiryDb.close();
@@ -216,7 +214,7 @@
    }
 
    @Test(expectedExceptions = CacheLoaderException.class)
-   void testExceptionClosingEnvironment() throws Exception {
+   public void testExceptionClosingEnvironment() throws Exception {
       start();
       cacheDb.close();
       expiryDb.close();
@@ -231,7 +229,7 @@
 
 
    @Test(expectedExceptions = CacheLoaderException.class)
-   void testThrowsCorrectExceptionOnStartForDatabaseException() throws Exception {
+   public void testThrowsCorrectExceptionOnStartForDatabaseException() throws Exception {
       factory = new MockBdbjeResourceFactory(cfg) {
          @Override
          public StoredClassCatalog createStoredClassCatalog(Database catalogDb) throws DatabaseException {
@@ -245,7 +243,7 @@
    }
 
    @Test(expectedExceptions = CacheLoaderException.class)
-   void testEnvironmentDirectoryExistsButNotAFile() throws Exception {
+   public void testEnvironmentDirectoryExistsButNotAFile() throws Exception {
       File file = createMock(File.class);
       expect(file.exists()).andReturn(true);
       expect(file.isDirectory()).andReturn(false);
@@ -254,7 +252,7 @@
    }
 
    @Test(expectedExceptions = CacheLoaderException.class)
-   void testCantCreateEnvironmentDirectory() throws Exception {
+   public void testCantCreateEnvironmentDirectory() throws Exception {
       File file = createMock(File.class);
       expect(file.exists()).andReturn(false);
       expect(file.mkdirs()).andReturn(false);
@@ -262,8 +260,7 @@
       cs.verifyOrCreateEnvironmentDirectory(file);
    }
 
-   @Test
-   void testCanCreateEnvironmentDirectory() throws Exception {
+   public void testCanCreateEnvironmentDirectory() throws Exception {
       File file = createMock(File.class);
       expect(file.exists()).andReturn(false);
       expect(file.mkdirs()).andReturn(true);
@@ -272,10 +269,8 @@
       assert file.equals(cs.verifyOrCreateEnvironmentDirectory(file));
    }
 
-   @Test
    public void testNoExceptionOnRollback() throws Exception {
       start();
-      gtf = new GlobalTransactionFactory();
       GlobalTransaction tx = gtf.newGlobalTransaction(null, false);
       replayAll();
       cs.start();
@@ -283,8 +278,7 @@
       verifyAll();
    }
 
-   @Test
-   protected void testApplyModificationsThrowsOriginalDatabaseException() throws Exception {
+   public  void testApplyModificationsThrowsOriginalDatabaseException() throws Exception {
       start();
       DatabaseException ex = new DatabaseException();
       runner.run(isA(TransactionWorker.class));
@@ -303,8 +297,7 @@
 
    }
 
-   @Test
-   protected void testCommitThrowsOriginalDatabaseException() throws Exception {
+   public void testCommitThrowsOriginalDatabaseException() throws Exception {
       start();
       DatabaseException ex = new DatabaseException();
       com.sleepycat.je.Transaction txn = createMock(com.sleepycat.je.Transaction.class);
@@ -330,8 +323,7 @@
 
    }
 
-   @Test
-   protected void testPrepareThrowsOriginalDatabaseException() throws Exception {
+   public void testPrepareThrowsOriginalDatabaseException() throws Exception {
       start();
       DatabaseException ex = new DatabaseException();
       runner.prepare(isA(TransactionWorker.class));
@@ -351,8 +343,7 @@
 
    }
 
-   @Test
-   void testClearOnAbortFromStream() throws Exception {
+   public void testClearOnAbortFromStream() throws Exception {
       start();
       InternalCacheEntry entry = InternalEntryFactory.create("key", "value");
       expect(cacheMap.put(entry.getKey(), entry)).andReturn(null);



More information about the infinispan-commits mailing list