Package com.sleepycat.util

Examples of com.sleepycat.util.RuntimeExceptionWrapper


   public void objectToEntry(InternalCacheEntry object, DatabaseEntry entry) {
      byte[] b;
      try {
         b = m.objectToByteBuffer(object);
      } catch (IOException e) {
         throw new RuntimeExceptionWrapper(e);
      }
      entry.setData(b);
   }
View Full Code Here


        FastOutputStream fo = getFastOutputStream();
        try {
            SerialOutput jos = new SerialOutput(fo, classCatalog);
            jos.writeObject(object);
        } catch (IOException e) {
            throw new RuntimeExceptionWrapper(e);
        }

        byte[] hdr = SerialOutput.getStreamHeader();
        entry.setData(fo.getBufferBytes(), hdr.length,
                     fo.getBufferLength() - hdr.length);
View Full Code Here

   }

   public  void testApplyModificationsThrowsOriginalDatabaseException() throws Exception {
      start();
      DatabaseException ex = new DatabaseException("Dummy"){};
      doThrow(new RuntimeExceptionWrapper(ex)).when(runner).run(isA(TransactionWorker.class));
      cs.start();
      try {
         cs.applyModifications(Collections.singletonList(new Store(TestInternalCacheEntryFactory.create("k", "v"))));
         assert false : "should have gotten an exception";
      } catch (CacheLoaderException e) {
View Full Code Here

      start();
      DatabaseException ex = new DatabaseException("Dummy"){};
      com.sleepycat.je.Transaction txn = mock(com.sleepycat.je.Transaction.class);
      when(currentTransaction.beginTransaction(null)).thenReturn(txn);
      runner.prepare(isA(TransactionWorker.class));
      doThrow(new RuntimeExceptionWrapper(ex)).when(txn).commit();
      cs.start();
      try {
         txn = currentTransaction.beginTransaction(null);
         GlobalTransaction t = gtf.newGlobalTransaction(null, false);
         cs.prepare(Collections.singletonList(new Store(TestInternalCacheEntryFactory.create("k", "v"))), t, false);
View Full Code Here

   }

   public void testPrepareThrowsOriginalDatabaseException() throws Exception {
      start();
      DatabaseException ex = new DatabaseException("Dummy"){};
      doThrow(new RuntimeExceptionWrapper(ex)).when(runner).prepare(isA(TransactionWorker.class));
      cs.start();
      try {
         GlobalTransaction tx = gtf.newGlobalTransaction(null, false);
         cs.prepare(Collections.singletonList(new Store(TestInternalCacheEntryFactory.create("k", "v"))), tx, false);
         assert false : "should have gotten an exception";
View Full Code Here

TOP

Related Classes of com.sleepycat.util.RuntimeExceptionWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.