jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1344892 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/mk/simple/ oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/ oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/
Date Thu, 31 May 2012 20:23:19 GMT
Author: stefan
Date: Thu May 31 20:23:18 2012
New Revision: 1344892

URL: http://svn.apache.org/viewvc?rev=1344892&view=rev
Log:
OAK-77: Consolidate Utilities

[move StringCache and ExceptionFactory utility classes to the oak-core component where they
are referenced]

fix failing test case (expects wrong exception)
fix oak-core build error

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/SimpleKernelImpl.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/SimpleKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/SimpleKernelImpl.java?rev=1344892&r1=1344891&r2=1344892&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/SimpleKernelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/mk/simple/SimpleKernelImpl.java
Thu May 31 20:23:18 2012
@@ -563,17 +563,29 @@ public class SimpleKernelImpl extends Mi
 
     @Override
     public long getLength(String blobId) {
-        return ds.getBlobLength(blobId);
+        try {
+            return ds.getBlobLength(blobId);
+        } catch (Exception e) {
+            throw ExceptionFactory.convert(e);
+        }
     }
 
     @Override
     public int read(String blobId, long pos, byte[] buff, int off, int length) {
-        return ds.readBlob(blobId, pos, buff, off, length);
+        try {
+            return ds.readBlob(blobId, pos, buff, off, length);
+        } catch (Exception e) {
+            throw ExceptionFactory.convert(e);
+        }
     }
 
     @Override
     public String write(InputStream in) {
-        return ds.writeBlob(in);
+        try {
+            return ds.writeBlob(in);
+        } catch (Exception e) {
+            throw ExceptionFactory.convert(e);
+        }
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java?rev=1344892&r1=1344891&r2=1344892&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
Thu May 31 20:23:18 2012
@@ -282,7 +282,7 @@ public abstract class AbstractBlobStore 
 
     protected abstract byte[] readBlockFromBackend(BlockId id) throws Exception;
 
-    public long getBlobLength(String blobId) throws Exception {
+    public long getBlobLength(String blobId) throws IOException {
         if (isMarkEnabled()) {
             mark(blobId);
         }

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java?rev=1344892&r1=1344891&r2=1344892&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java
Thu May 31 20:23:18 2012
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.mk.blobs;
 
 import junit.framework.TestCase;
-import org.apache.jackrabbit.mk.api.MicroKernelException;
 import org.apache.jackrabbit.mk.json.JsopBuilder;
 import org.apache.jackrabbit.mk.json.JsopTokenizer;
 import org.apache.jackrabbit.mk.util.IOUtilsTest;
@@ -130,13 +129,13 @@ public abstract class AbstractBlobStoreT
         try {
             store.readBlob("ff", 0, data, 0, 1);
             fail();
-        } catch (MicroKernelException e) {
+        } catch (Exception e) {
             // expected
         }
         try {
             store.getBlobLength("ff");
             fail();
-        } catch (MicroKernelException e) {
+        } catch (Exception e) {
             // expected
         }
         try {



Mime
View raw message