You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2014/11/04 13:13:55 UTC

[1/3] git commit: Add "clearAll" (use with care!)

Repository: jena
Updated Branches:
  refs/heads/master 75087f52e -> 7fa09e8a9


Add "clearAll" (use with care!)

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/f4ee4cae
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/f4ee4cae
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/f4ee4cae

Branch: refs/heads/master
Commit: f4ee4caecbaef6740b97182cbe3e43cbf864e152
Parents: 75087f5
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Nov 4 12:11:29 2014 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Nov 4 12:11:29 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/jena/atlas/lib/FileOps.java | 228 ++++++++++---------
 1 file changed, 120 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/f4ee4cae/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java b/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java
index afae19d..98a8616 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.jena.atlas.lib;
+package org.apache.jena.atlas.lib ;
 
 import java.io.File ;
 import java.io.FileInputStream ;
@@ -28,55 +28,64 @@ import org.apache.jena.atlas.AtlasException ;
 import org.apache.jena.atlas.io.IO ;
 import org.apache.jena.atlas.logging.Log ;
 
-public class FileOps
-{
+/** A library of utility operations on files and the filing system */
+public class FileOps {
+    // Update implementations as standard library functions appear that meet the contract.
     private FileOps() {}
-    
-    /** Delete a file
+
+    /**
+     * Delete a file
      * 
      * @param filename
      */
-    public static void delete(String filename)
-    {
+    public static void delete(String filename) {
         delete(new File(filename), true) ;
     }
-    
+
     /* Delete a file - don't check it worked */
-    
-    public static void deleteSilent(String filename)
-    {
+
+    public static void deleteSilent(String filename) {
         delete(new File(filename), false) ;
     }
-    
-    public static void delete(File f, boolean reportExistsAfter)
-    {
+
+    public static void delete(File f, boolean reportExistsAfter) {
         try {
-            /* Note: On windows, deleting a file which has been memory
-             * mapped does not delete the file.
-             */ 
+            /*
+             * Note: On windows, deleting a file which has been memory mapped
+             * does not delete the file.
+             */
             f.delete() ;
             if ( reportExistsAfter && f.exists() )
-                Log.warn(FileOps.class, "delete: *** File still exists: "+f) ;
-        } catch (SecurityException ex)
-        {
-            Log.warn(FileOps.class, "delete: "+f+": Security exception; "+ex.getMessage()) ;
+                Log.warn(FileOps.class, "delete: *** File still exists: " + f) ;
+        }
+        catch (SecurityException ex) {
+            Log.warn(FileOps.class, "delete: " + f + ": Security exception; " + ex.getMessage()) ;
         }
-            
+
     }
-    
-    public static void clearDirectory(String dir)
-    {
+
+    /** Delete all files in a directory */
+    public static void clearDirectory(String dir) {
         File d = new File(dir) ;
-        for ( File f : d.listFiles())
-        {
+        for ( File f : d.listFiles() ) {
             if ( f.isFile() )
                 delete(f, false) ;
         }
     }
 
-    /** See if there are any files in this directory */ 
-    public static boolean existsAnyFiles(String dir)
-    {
+    /** Delete all files and directories (recursively) in a directory */
+    public static void clearAll(File d) {
+        for ( File f : d.listFiles() ) {
+            if ( ".".equals(f.getName()) || "..".equals(f.getName()) )
+                continue ;
+            if ( f.isDirectory() )
+                clearAll(f) ;
+            f.delete() ;
+        }
+    }
+
+    /** See if there are any files in this directory */
+    public static boolean existsAnyFiles(String dir) {
         File d = new File(dir) ;
         File[] entries = d.listFiles() ;
         if ( entries == null )
@@ -85,135 +94,138 @@ public class FileOps
         return entries.length > 0 ;
     }
 
-    public static boolean exists(String path)
-    {
+    /** Test for existence */
+    public static boolean exists(String path) {
         File f = new File(path) ;
-        return f.exists() ; 
+        return f.exists() ;
     }
-    
-    public static boolean isEmpty(String filename)
-    {
+
+    /** Test for an empty file */
+    public static boolean isEmpty(String filename) {
         File f = new File(filename) ;
-        if ( f.exists() ) return true ;
-        if ( f.isFile() ) return f.length() == 0 ;
+        if ( f.exists() )
+            return true ;
+        if ( f.isFile() )
+            return f.length() == 0 ;
         throw new AtlasException("Not a file") ;
     }
 
-    public static void ensureDir(String dirname)
-    {
+    /** Ensure a directory exists */ 
+    public static void ensureDir(String dirname) {
         File dir = new File(dirname) ;
-        if ( ! dir.exists() )
+        if ( !dir.exists() )
             dir.mkdirs() ;
     }
-    
-    /** Split a file name into path, basename and extension.  Nulls returned if don't make sense. */
-    public static Tuple<String> splitDirBaseExt(String filename)
-    {
+
+    /**
+     * Split a file name into path, basename and extension. Nulls returned if
+     * don't make sense.
+     */
+    public static Tuple<String> splitDirBaseExt(String filename) {
         String path = null ;
         String basename = filename ;
         String ext = null ;
-        
+
         int j = filename.lastIndexOf('/') ;
         if ( j < 0 )
             j = filename.lastIndexOf('\\') ;
 
-        if ( j >= 0 )
-        {
+        if ( j >= 0 ) {
             path = filename.substring(0, j) ;
-            basename = filename.substring(j+1) ;
+            basename = filename.substring(j + 1) ;
         }
-        
+
         int i = basename.lastIndexOf('.') ;
-        
-        if ( i > -1 )
-        {
-            ext = basename.substring(i+1) ;
+
+        if ( i > -1 ) {
+            ext = basename.substring(i + 1) ;
             basename = basename.substring(0, i) ;
         }
-        
+
         return Tuple.createTuple(path, basename, ext) ;
     }
-    
-    /** Split a file name into path and filename.  Nulls returned if don't make sense. */
-    public static Tuple<String> splitDirFile(String filename)
-    {
+
+    /**
+     * Split a file name into path and filename. Nulls returned if don't make
+     * sense.
+     */
+    public static Tuple<String> splitDirFile(String filename) {
         String path = null ;
         String fn = filename ;
-        
+
         int j = filename.lastIndexOf('/') ;
         if ( j < 0 )
             j = filename.lastIndexOf('\\') ;
-        
-        if ( j >= 0 )
-        {
+
+        if ( j >= 0 ) {
             path = filename.substring(0, j) ;
-            fn = filename.substring(j+1) ;
+            fn = filename.substring(j + 1) ;
         }
         return Tuple.createTuple(path, fn) ;
     }
 
     /** Return the basename (no path, no extension) */
-    public static String basename(String filename)
-    {
+    public static String basename(String filename) {
         int j = filename.lastIndexOf('/') ;
         if ( j < 0 )
             j = filename.lastIndexOf('\\') ;
 
-        String fn = ( j >= 0 ) ? filename.substring(j+1) : filename ;
+        String fn = (j >= 0) ? filename.substring(j + 1) : filename ;
         int i = fn.lastIndexOf('.') ;
-        
+
         if ( i > -1 )
             return fn.substring(0, i) ;
         return fn ;
     }
-    
+
     /** Return the extension (or "") */
     public static String extension(String filename) {
-        int iSlash = filename.lastIndexOf( '/' );      
-        int iBack = filename.lastIndexOf( '\\' );
-        int iExt = filename.lastIndexOf( '.' ); 
-        if (iBack > iSlash) iSlash = iBack;
-        return iExt > iSlash ? filename.substring( iExt+1 ).toLowerCase() : "";
-    }
-    
-    public static String fullPath(String filename)
-    {
-        File f = new File(filename);
-        return f.getAbsolutePath();
-    }
-    
-    public static String fullDirectoryPath(String filename)
-    {
-        File f = new File(filename);
-        if (f.isDirectory()) {
-            return f.getAbsolutePath();
-        } else if (f.getParentFile() != null) {
-            return f.getParentFile().getAbsolutePath();
+        int iSlash = filename.lastIndexOf('/') ;
+        int iBack = filename.lastIndexOf('\\') ;
+        int iExt = filename.lastIndexOf('.') ;
+        if ( iBack > iSlash )
+            iSlash = iBack ;
+        return iExt > iSlash ? filename.substring(iExt + 1).toLowerCase() : "" ;
+    }
+
+    public static String fullPath(String filename) {
+        File f = new File(filename) ;
+        return f.getAbsolutePath() ;
+    }
+
+    public static String fullDirectoryPath(String filename) {
+        File f = new File(filename) ;
+        if ( f.isDirectory() ) {
+            return f.getAbsolutePath() ;
+        } else if ( f.getParentFile() != null ) {
+            return f.getParentFile().getAbsolutePath() ;
         } else {
-            return f.getAbsolutePath();
+            return f.getAbsolutePath() ;
         }
     }
-    
+
     /** Copy a file */
     public static void copyFile(File source, File dest) {
         try {
             @SuppressWarnings("resource")
-            FileChannel sourceChannel = new FileInputStream(source).getChannel();
+            FileChannel sourceChannel = new FileInputStream(source).getChannel() ;
             @SuppressWarnings("resource")
-            FileChannel destChannel = new FileOutputStream(dest).getChannel();
-            destChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
-            sourceChannel.close();
-            destChannel.close();
-        } catch (IOException ex) { IO.exception(ex); }
-    }
-
-    
-//    public static String getExt(String filename)
-//    {
-//        int i = filename.lastIndexOf('.') ;
-//        int j = filename.lastIndexOf('/') ;
-//        if ( i > j )
-//            return filename.substring(i+1) ;
-//        return null ;
-//    }
+            FileChannel destChannel = new FileOutputStream(dest).getChannel() ;
+            destChannel.transferFrom(sourceChannel, 0, sourceChannel.size()) ;
+            sourceChannel.close() ;
+            destChannel.close() ;
+        }
+        catch (IOException ex) {
+            IO.exception(ex) ;
+        }
+    }
+
+    // public static String getExt(String filename)
+    // {
+    // int i = filename.lastIndexOf('.') ;
+    // int j = filename.lastIndexOf('/') ;
+    // if ( i > j )
+    // return filename.substring(i+1) ;
+    // return null ;
+    // }
 }


[2/3] git commit: Codec for StoreParams using JSON.

Posted by an...@apache.org.
Codec for StoreParams using JSON.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/e8877500
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/e8877500
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/e8877500

Branch: refs/heads/master
Commit: e8877500066d96c0761f7e1d38fd1270a2798bc9
Parents: f4ee4ca
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Nov 4 12:12:07 2014 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Nov 4 12:12:07 2014 +0000

----------------------------------------------------------------------
 .../hp/hpl/jena/tdb/setup/StoreParamsCodec.java | 138 +++++++++++++++++++
 .../hp/hpl/jena/tdb/setup/TestStoreParams.java  |  65 ++++++++-
 2 files changed, 201 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/e8877500/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/StoreParamsCodec.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/StoreParamsCodec.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/StoreParamsCodec.java
new file mode 100644
index 0000000..a3df300
--- /dev/null
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/StoreParamsCodec.java
@@ -0,0 +1,138 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.hp.hpl.jena.tdb.setup;
+
+import org.apache.jena.atlas.json.JsonArray ;
+import org.apache.jena.atlas.json.JsonBuilder ;
+import org.apache.jena.atlas.json.JsonObject ;
+
+import com.hp.hpl.jena.sparql.util.Utils ;
+import com.hp.hpl.jena.tdb.TDBException ;
+import com.hp.hpl.jena.tdb.base.block.FileMode ;
+
+/** Encode and decode {@linkplain StoreParams} */ 
+public class StoreParamsCodec {
+    
+    public static JsonObject encodeToJson(StoreParams params) {
+        JsonBuilder builder = new JsonBuilder() ;
+        builder.startObject("StoreParams") ;    // "StoreParams" is an internal alignment marker - not in the JSON.
+        
+        encode(builder, "tdb.FileMode",                 params.getFileMode().name()) ;
+        encode(builder, "tdb.BlockSize",                params.getBlockSize()) ;
+        encode(builder, "tdb.BlockReadCacheSize",       params.getBlockReadCacheSize()) ;
+        encode(builder, "tdb.BlockWriteCacheSize",      params.getBlockWriteCacheSize()) ;
+        encode(builder, "tdb.Node2NodeIdCacheSize",     params.getNode2NodeIdCacheSize()) ;
+        encode(builder, "tdb.NodeId2NodeCacheSize",     params.getNodeId2NodeCacheSize()) ;
+        encode(builder, "tdb.NodeMissCacheSize",        params.getNodeMissCacheSize()) ;
+        encode(builder, "tdb.IndexNode2Id",             params.getIndexNode2Id()) ;
+        encode(builder, "tdb.IndexId2Node",             params.getIndexId2Node()) ;
+        encode(builder, "tdb.PrimaryIndexTriples",      params.getPrimaryIndexTriples()) ;
+        encode(builder, "tdb.TripleIndexes",            params.getTripleIndexes()) ;
+        encode(builder, "tdb.PrimaryIndexQuads",        params.getPrimaryIndexQuads()) ;
+        encode(builder, "tdb.QuadIndexes",              params.getQuadIndexes()) ;
+        encode(builder, "tdb.PrimaryIndexPrefix",       params.getPrimaryIndexPrefix()) ;
+        encode(builder, "tdb.PrefixIndexes",            params.getPrefixIndexes()) ;
+        encode(builder, "tdb.IndexPrefix",              params.getIndexPrefix()) ;
+        encode(builder, "tdb.PrefixNode2Id",            params.getPrefixNode2Id()) ;
+        encode(builder, "tdb.PrefixId2Node",            params.getPrefixId2Node()) ;
+        builder.finishObject("StoreParams") ;
+        return (JsonObject)builder.build() ;
+    }
+
+    public static StoreParams decode(JsonObject json) {
+        StoreParamsBuilder builder = StoreParamsBuilder.create() ;
+        
+        for ( String key : json.keys() ) {
+            switch(key) {
+                case "tdb.FileMode" :               builder.fileMode(FileMode.valueOf(getString(json, key))) ; break ;
+                case "tdb.BlockSize":               builder.blockSize(getInt(json, key)) ; break ;
+                case "tdb.BlockReadCacheSize":      builder.blockReadCacheSize(getInt(json, key)) ; break ;
+                case "tdb.BlockWriteCacheSize":     builder.blockWriteCacheSize(getInt(json, key)) ; break ;
+                case "tdb.Node2NodeIdCacheSize":    builder.node2NodeIdCacheSize(getInt(json, key)) ; break ;
+                case "tdb.NodeId2NodeCacheSize":    builder.nodeId2NodeCacheSize(getInt(json, key)) ; break ;
+                case "tdb.NodeMissCacheSize":       builder.nodeMissCacheSize(getInt(json, key)) ; break ;
+                case "tdb.IndexNode2Id":            builder.indexNode2Id(getString(json, key)) ; break ;
+                case "tdb.IndexId2Node":            builder.indexId2Node(getString(json, key)) ; break ;
+                case "tdb.PrimaryIndexTriples":     builder.primaryIndexTriples(getString(json, key)) ; break ;
+                case "tdb.TripleIndexes":           builder.tripleIndexes(getStringArray(json, key)) ; break ;
+                case "tdb.PrimaryIndexQuads":       builder.primaryIndexQuads(getString(json, key)) ; break ;
+                case "tdb.QuadIndexes":             builder.quadIndexes(getStringArray(json, key)) ; break ;
+                case "tdb.PrimaryIndexPrefix":      builder.primaryIndexPrefix(getString(json, key)) ; break ;
+                case "tdb.PrefixIndexes":           builder.prefixIndexes(getStringArray(json, key)) ; break ;
+                case "tdb.IndexPrefix":             builder.indexPrefix(getString(json, key)) ; break ;
+                case "tdb.PrefixNode2Id":           builder.prefixNode2Id(getString(json, key)) ; break ;
+                case "tdb.PrefixId2Node":           builder.prefixId2Node(getString(json, key)) ; break ;
+                default:
+                    throw new TDBException("StoreParams key no recognized: "+key) ;
+            }
+        }
+        return builder.build() ;
+    }
+
+    // "Get or error" operations.
+    
+    private static String getString(JsonObject json, String key) {
+        if ( ! json.hasKey(key) )
+            throw new TDBException("StoreParamsCodec.getString: no such key: "+key) ;
+        String x = json.get(key).getAsString().value() ;
+        return x ;
+    }
+
+    private static Integer getInt(JsonObject json, String key) {
+        if ( ! json.hasKey(key) )
+            throw new TDBException("StoreParamsCodec.getInt: no such key: "+key) ;
+        Integer x = json.get(key).getAsNumber().value().intValue() ;
+        return x ;
+    }
+    
+    private static String[] getStringArray(JsonObject json, String key) {
+        if ( ! json.hasKey(key) )
+            throw new TDBException("StoreParamsCodec.getStringArray: no such key: "+key) ;
+        JsonArray a = json.get(key).getAsArray() ;
+        String[] x = new String[a.size()] ;
+        for ( int i = 0 ; i < a.size() ; i++ ) {
+            x[i] = a.get(i).getAsString().value() ;
+        }
+        return x ;
+    }
+
+    // Encode helper.
+    private static void encode(JsonBuilder builder, String name, Object value) {
+        if ( value instanceof Number ) {
+            long x = ((Number)value).longValue() ;
+            builder.key(name).value(x) ;
+            return ;
+        }
+        if ( value instanceof String ) {
+            builder.key(name).value(value.toString()) ;
+            return ;
+        }
+        if ( value instanceof String[] ) {
+            String[] x = (String[])value ;
+            builder.key(name) ;
+            builder.startArray() ;
+            for ( String s : x ) {
+                builder.value(s) ;
+            }
+            builder.finishArray() ;
+            return ;
+        }
+        throw new TDBException("Class of value not recognized: "+Utils.classShortName(value.getClass())) ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/e8877500/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/setup/TestStoreParams.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/setup/TestStoreParams.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/setup/TestStoreParams.java
index 25b4d57..1be0924 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/setup/TestStoreParams.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/setup/TestStoreParams.java
@@ -20,6 +20,11 @@ package com.hp.hpl.jena.tdb.setup;
 
 import java.util.Objects ;
 
+import com.hp.hpl.jena.tdb.TDBException ;
+import com.hp.hpl.jena.tdb.base.block.FileMode ;
+
+import org.apache.jena.atlas.json.JSON ;
+import org.apache.jena.atlas.json.JsonObject ;
 import org.apache.jena.atlas.junit.BaseTest ;
 import org.apache.jena.atlas.lib.InternalErrorException ;
 import org.junit.Test ;
@@ -34,11 +39,68 @@ public class TestStoreParams extends BaseTest {
         StoreParams sp = StoreParamsBuilder.create().build() ;
         assertEqualsStoreParams(StoreParams.getDftStoreParams(), sp) ; 
     }
+
+    @Test public void store_params_03() {
+        StoreParams params = StoreParamsBuilder.create().build() ;
+        StoreParams params2 = roundTrip(params) ;
+        assertEqualsStoreParams(params,params2) ;
+    }
+    
+    // ----
+    
+    @Test public void store_params_04() {
+        StoreParams params = StoreParamsBuilder.create().fileMode(FileMode.direct).blockSize(1024).build() ;
+        StoreParams params2 = roundTrip(params) ;
+        assertEqualsStoreParams(params,params2) ;
+        assertEquals(params.getFileMode(), params2.getFileMode()) ;
+        assertEquals(params.getBlockSize(), params2.getBlockSize()) ;
+    }
+
+    @Test public void store_params_05() {
+        String xs = "{ \"tdb.BlockSize\": 2048 }" ;
+        JsonObject x = JSON.parse(xs) ;
+        StoreParams paramsExpected = StoreParamsBuilder.create().blockSize(2048).build() ;
+        StoreParams paramsActual = StoreParamsCodec.decode(x) ;
+        assertEqualsStoreParams(paramsExpected,paramsActual) ;
+    }
+
+    @Test public void store_params_06() {
+        String xs = "{ \"tdb.FileMode\": \"direct\" , \"tdb.BlockSize\": 2048 }" ;
+        JsonObject x = JSON.parse(xs) ;
+        StoreParams paramsExpected = StoreParamsBuilder.create().blockSize(2048).fileMode(FileMode.direct).build() ;
+        StoreParams paramsActual = StoreParamsCodec.decode(x) ;
+        assertEqualsStoreParams(paramsExpected,paramsActual) ;
+    }
+
+    @Test public void store_params_07() {
+        String xs = "{ \"tdb.TripleIndexes\" : [ \"POS\" , \"PSO\"] } " ; 
+        JsonObject x = JSON.parse(xs) ;
+        StoreParams params = StoreParamsCodec.decode(x) ;
+        String[] expected =  { "POS" , "PSO" } ;
+        assertArrayEquals(expected, params.getTripleIndexes()) ;
+    }
+
+    @Test(expected=TDBException.class)
+    public void store_params_08() {
+        String xs = "{ \"tdb.TriplesIndexes\" : [ \"POS\" , \"PSO\"] } " ; // Misspelt. 
+        JsonObject x = JSON.parse(xs) ;
+        StoreParams params = StoreParamsCodec.decode(x) ;
+        String[] expected =  { "POS" , "PSO" } ;
+        assertArrayEquals(expected, params.getTripleIndexes()) ;
+    }
+
+    // --------
+    
+    private static StoreParams roundTrip(StoreParams params) {
+        JsonObject obj = StoreParamsCodec.encodeToJson(params) ;
+        StoreParams params2 = StoreParamsCodec.decode(obj) ;
+        return params2 ;
+    }
     
     private static void assertEqualsStoreParams(StoreParams params1, StoreParams params2) {
         assertTrue(same(params1, params2)) ;
     }
-
+    
     private static boolean same(StoreParams params1, StoreParams params2) {
         boolean b0 = same0(params1, params2) ;
         boolean b1 = same1(params1, params2) ;
@@ -54,5 +116,4 @@ public class TestStoreParams extends BaseTest {
     private static boolean same1(StoreParams params1, StoreParams params2) {
         return Objects.equals(params1, params2) ;
     }
-    
 }


[3/3] git commit: Delete stray file

Posted by an...@apache.org.
Delete stray file


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/7fa09e8a
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/7fa09e8a
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/7fa09e8a

Branch: refs/heads/master
Commit: 7fa09e8a966dc8d5d8b3902df02eed204a2fafaa
Parents: e887750
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Nov 4 12:12:39 2014 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Nov 4 12:12:39 2014 +0000

----------------------------------------------------------------------
 jena-text/data.ttl | 20 --------------------
 1 file changed, 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/7fa09e8a/jena-text/data.ttl
----------------------------------------------------------------------
diff --git a/jena-text/data.ttl b/jena-text/data.ttl
deleted file mode 100644
index 0090904..0000000
--- a/jena-text/data.ttl
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-@prefix :        <http://localhost/jena_example/#> .
-@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
-:T1 rdfs:label "X0 X1 X2" .
-:T2 rdfs:label "X10 X11 X12" .