clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/7] clerezza-rdf-core git commit: CLEREZZA-982: moved files for new packages
Date Thu, 09 Apr 2015 12:34:04 GMT
Repository: clerezza-rdf-core
Updated Branches:
  refs/heads/master 95dc83759 -> 12b3d66e1


http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleGraph.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleGraph.java b/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleGraph.java
deleted file mode 100644
index 9b60a15..0000000
--- a/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleGraph.java
+++ /dev/null
@@ -1,218 +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.
- */
-package org.apache.commons.rdf.impl.utils.simple;
-
-import org.apache.commons.rdf.impl.utils.AbstractGraph;
-import java.lang.ref.SoftReference;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.ConcurrentModificationException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.ImmutableGraph;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-
-/**
- * For now this is a minimalistic implementation, without any indexes or other
- * optimizations.
- *
- * @author reto
- */
-public class SimpleGraph extends AbstractGraph {
-
-    final Set<Triple> triples;
-
-    private boolean checkConcurrency = false;
-
-    class SimpleIterator implements Iterator<Triple> {
-
-        private Iterator<Triple> listIter;
-        private boolean isValid = true;
-
-        public SimpleIterator(Iterator<Triple> listIter) {
-            this.listIter = listIter;
-        }
-        private Triple currentNext;
-
-        @Override
-        public boolean hasNext() {
-            checkValidity();
-            return listIter.hasNext();
-        }
-
-        @Override
-        public Triple next() {
-            checkValidity();
-            currentNext = listIter.next();
-            return currentNext;
-        }        
-
-        @Override
-        public void remove() {
-            checkValidity();
-            listIter.remove();
-            triples.remove(currentNext);            
-            invalidateIterators(this);            
-        }
-
-        private void checkValidity() throws ConcurrentModificationException {
-            if (checkConcurrency && !isValid) {
-                throw new ConcurrentModificationException();
-            }
-        }
-
-        private void invalidate() {
-            isValid = false;
-        }
-    }    
-    
-    private final Set<SoftReference<SimpleIterator>> iterators =
-            Collections.synchronizedSet(new HashSet<SoftReference<SimpleIterator>>());
-    
-    /**
-     * Creates an empty SimpleGraph
-     */
-    public SimpleGraph() {
-        triples = Collections.synchronizedSet(new HashSet<Triple>());
-    }
-
-    /**
-     * Creates a SimpleGraph using the passed iterator, the iterator 
-     * is consumed before the constructor returns
-     * 
-     * @param iterator
-     */
-    public SimpleGraph(Iterator<Triple> iterator) {
-        triples = new HashSet<Triple>();
-        while (iterator.hasNext()) {
-            Triple triple = iterator.next();
-            triples.add(triple);
-        }
-    }
-
-    /**
-     * Creates a SimpleGraph for the specified set of triples, 
-     * subsequent modification of baseSet do affect the created instance.
-     * 
-     * @param baseSet
-     */
-    public SimpleGraph(Set<Triple> baseSet) {
-        this.triples = baseSet;
-    }
-
-    /**
-     * Creates a SimpleGraph for the specified collection of triples,
-     * subsequent modification of baseSet do not affect the created instance.
-     *
-     * @param baseSet
-     */
-    public SimpleGraph(Collection<Triple> baseCollection) {
-        this.triples = new HashSet<Triple>(baseCollection);
-    }
-
-    @Override
-    public int performSize() {
-        return triples.size();
-    }
-
-    @Override
-    public Iterator<Triple> performFilter(final BlankNodeOrIri subject, final Iri predicate, final RdfTerm object) {
-        final List<Triple> tripleList = new ArrayList<Triple>();
-        synchronized (triples) {
-            Iterator<Triple> baseIter = triples.iterator();
-            while (baseIter.hasNext()) {
-                Triple triple = baseIter.next();
-                if ((subject != null)
-                        && (!triple.getSubject().equals(subject))) {
-                    continue;
-                }
-                if ((predicate != null)
-                        && (!triple.getPredicate().equals(predicate))) {
-                    continue;
-                }
-                if ((object != null)
-                        && (!triple.getObject().equals(object))) {
-                    continue;
-                }
-                tripleList.add(triple);
-            }
-
-            final Iterator<Triple> listIter = tripleList.iterator();
-            SimpleIterator resultIter = new SimpleIterator(listIter);
-            if (checkConcurrency) {
-                iterators.add(new SoftReference<SimpleIterator>(resultIter));
-            }
-            return resultIter;
-        }
-    }
-
-
-    @Override
-    public boolean performAdd(Triple e) {
-        boolean modified = triples.add(e);
-        if (modified) {
-            invalidateIterators(null);
-        }
-        return modified;
-    }
-    
-    private void invalidateIterators(SimpleIterator caller) {
-        if (!checkConcurrency) {
-            return;
-        }
-        Set<SoftReference> oldReferences = new HashSet<SoftReference>();
-        synchronized(iterators) {
-            for (SoftReference<SimpleGraph.SimpleIterator> softReference : iterators) {
-                SimpleIterator simpleIterator = softReference.get();
-                if (simpleIterator == null) {
-                    oldReferences.add(softReference);
-                    continue;
-                }
-                if (simpleIterator != caller) {
-                    simpleIterator.invalidate();
-                }
-            }
-        }
-        iterators.removeAll(oldReferences);
-    }
-
-    /**
-     * Specifies whether or not to throw <code>ConcurrentModificationException</code>s,
-     * if this simple triple collection is modified concurrently. Concurrency
-     * check is set to false by default.
-     *
-     * @param bool Specifies whether or not to check concurrent modifications.
-     */
-    public void setCheckConcurrency(boolean bool) {
-        checkConcurrency = bool;
-    }
-    
-    
-    @Override
-    public ImmutableGraph getImmutableGraph() {
-        return new SimpleImmutableGraph(this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleImmutableGraph.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleImmutableGraph.java b/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleImmutableGraph.java
deleted file mode 100644
index bc50a09..0000000
--- a/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleImmutableGraph.java
+++ /dev/null
@@ -1,79 +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.
- */
-package org.apache.commons.rdf.impl.utils.simple;
-
-import org.apache.commons.rdf.impl.utils.AbstractImmutableGraph;
-import java.util.Iterator;
-
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Iri;
-
-/**
- *
- * @author reto
- */
-public class SimpleImmutableGraph extends AbstractImmutableGraph {
-
-    private Graph graph;
-    
-    /**
-     * Creates a ImmutableGraph with the triples in Graph
-     * 
-     * @param Graph the collection of triples this ImmutableGraph shall consist of
-     */
-    public SimpleImmutableGraph(Graph Graph) {
-        this.graph = new SimpleGraph(Graph.iterator());
-    }
-
-    /**
-     * Creates a ImmutableGraph with the triples in Graph.
-     *
-     * This construction allows to specify if the Graph might change
-     * in future. If GraphWillNeverChange is set to true it will
-     * assume that the collection never changes, in this case the collection
-     * isn't copied making things more efficient.
-     *
-     * @param Graph the collection of triples this ImmutableGraph shall consist of
-     * @param GraphWillNeverChange true if the caller promises Graph will never change
-     */
-    public SimpleImmutableGraph(Graph Graph, boolean GraphWillNeverChange) {
-        if (!GraphWillNeverChange) {
-            this.graph = new SimpleGraph(Graph.iterator());
-        } else {
-            this.graph = Graph;
-        }
-    }
-    
-    public SimpleImmutableGraph(Iterator<Triple> tripleIter) {
-        this.graph = new SimpleGraph(tripleIter);
-    }
-
-    @Override
-    public int performSize() {
-        return graph.size();
-    }
-
-    @Override
-    public Iterator<Triple> performFilter(BlankNodeOrIri subject, Iri predicate, RdfTerm object) {
-        return graph.filter(subject, predicate, object);
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleMGraph.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleMGraph.java b/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleMGraph.java
deleted file mode 100644
index 8d0a5ce..0000000
--- a/impl.utils/src/main/java/org/apache/commons/rdf/impl/utils/simple/SimpleMGraph.java
+++ /dev/null
@@ -1,57 +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.
- */
-package org.apache.commons.rdf.impl.utils.simple;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.commons.rdf.ImmutableGraph;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Triple;
-
-/**
- *
- * @deprecated Use SimpleGraph
- * @author reto
- */
-@Deprecated
-public class SimpleMGraph extends SimpleGraph implements Graph {
-
-    /**
-     * Creates an empty SimpleMGraph
-     */
-    public SimpleMGraph() {
-    }
-
-    public SimpleMGraph(Set<Triple> baseSet) {
-        super(baseSet);
-    }
-
-    public SimpleMGraph(Collection<Triple> baseCollection) {
-        super(baseCollection);
-    }
-
-    public SimpleMGraph(Iterator<Triple> iterator) {
-        super(iterator);
-    }
-
-}
-
-    
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/GraphMatcherTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/GraphMatcherTest.java b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/GraphMatcherTest.java
new file mode 100644
index 0000000..5c43c1b
--- /dev/null
+++ b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/GraphMatcherTest.java
@@ -0,0 +1,211 @@
+/*
+ * 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 org.apache.commons.rdf.impl.utils.graphmatching;
+
+import org.apache.commons.rdf.impl.utils.graphmatching.GraphMatcher;
+import java.util.Map;
+import org.apache.commons.rdf.BlankNode;
+import org.apache.commons.rdf.Graph;
+import org.apache.commons.rdf.BlankNodeOrIri;
+import org.apache.commons.rdf.RdfTerm;
+import org.apache.commons.rdf.Triple;
+import org.apache.commons.rdf.Graph;
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.impl.utils.simple.SimpleMGraph;
+import org.apache.commons.rdf.impl.utils.TripleImpl;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ *
+ * @author reto
+ */
+public class GraphMatcherTest {
+
+    final static Iri u1 = new Iri("http://example.org/u1");
+
+    @Test
+    public void testEmpty() {
+        Graph tc1 = new SimpleMGraph();
+        Graph tc2 = new SimpleMGraph();
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        Assert.assertEquals(0, mapping.size());
+    }
+
+    @Test
+    public void test2() {
+        Graph tc1 = new SimpleMGraph();
+        tc1.add(new TripleImpl(u1, u1, u1));
+        Graph tc2 = new SimpleMGraph();
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNull(mapping);
+    }
+
+    @Test
+    public void test3() {
+        Graph tc1 = new SimpleMGraph();
+        tc1.add(new TripleImpl(u1, u1, u1));
+        Graph tc2 = new SimpleMGraph();
+        tc2.add(new TripleImpl(u1, u1, u1));
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        Assert.assertEquals(0, mapping.size());
+    }
+
+    @Test
+    public void test4() {
+        Graph tc1 = new SimpleMGraph();
+        tc1.add(new TripleImpl(u1, u1, new BlankNode()));
+        Graph tc2 = new SimpleMGraph();
+        tc2.add(new TripleImpl(u1, u1, new BlankNode()));
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        Assert.assertEquals(1, mapping.size());
+    }
+
+    @Test
+    public void test5() {
+        Graph tc1 = new SimpleMGraph();
+        tc1.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
+        Graph tc2 = new SimpleMGraph();
+        tc2.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        Assert.assertEquals(2, mapping.size());
+    }
+
+    @Test
+    public void test6() {
+        Graph tc1 = new SimpleMGraph();
+        final BlankNode b11 = new BlankNode();
+        tc1.add(new TripleImpl(new BlankNode(), u1,b11));
+        tc1.add(new TripleImpl(new BlankNode(), u1,b11));
+        Graph tc2 = new SimpleMGraph();
+        tc2.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNull(mapping);
+    }
+
+    private Graph generateCircle(int size) {
+        return generateCircle(size, new BlankNode());
+    }
+
+    private Graph generateCircle(int size, final BlankNodeOrIri firstNode) {
+        if (size < 1) {
+            throw new IllegalArgumentException();
+        }
+        Graph result = new SimpleMGraph();
+        BlankNodeOrIri lastNode = firstNode;
+        for (int i = 0; i < (size-1); i++) {
+            final BlankNode newNode = new BlankNode();
+            result.add(new TripleImpl(lastNode, u1, newNode));
+            lastNode = newNode;
+        }
+        result.add(new TripleImpl(lastNode, u1, firstNode));
+        return result;
+    }
+
+    @Test
+    public void test7() {
+        Graph tc1 = generateCircle(2);
+        Graph tc2 = generateCircle(2);
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        Assert.assertEquals(2, mapping.size());
+    }
+
+    @Test
+    public void test8() {
+        Graph tc1 = generateCircle(5);
+        Graph tc2 = generateCircle(5);
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        Assert.assertEquals(5, mapping.size());
+    }
+
+    @Test
+    public void test9() {
+        BlankNodeOrIri crossing = new Iri("http://example.org/");
+        Graph tc1 = generateCircle(2,crossing);
+        tc1.addAll(generateCircle(3,crossing));
+        Graph tc2 = generateCircle(2,crossing);
+        tc2.addAll(generateCircle(3,crossing));
+        Assert.assertEquals(5, tc1.size());
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        //a circle of 2 with 1 bnode and one of 2 bnodes
+        Assert.assertEquals(3, mapping.size());
+    }
+
+    @Test
+    public void test10() {
+        BlankNodeOrIri crossing1 = new BlankNode();
+        Graph tc1 = generateCircle(2,crossing1);
+        tc1.addAll(generateCircle(3,crossing1));
+        BlankNodeOrIri crossing2 = new BlankNode();
+        Graph tc2 = generateCircle(2,crossing2);
+        tc2.addAll(generateCircle(3,crossing2));
+        Assert.assertEquals(5, tc1.size());
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        //a circle of 2 and one of 3 with one common node
+        Assert.assertEquals(4, mapping.size());
+    }
+
+    @Test
+    public void test11() {
+        BlankNodeOrIri crossing1 = new BlankNode();
+        Graph tc1 = generateCircle(2,crossing1);
+        tc1.addAll(generateCircle(4,crossing1));
+        BlankNodeOrIri crossing2 = new BlankNode();
+        Graph tc2 = generateCircle(3,crossing2);
+        tc2.addAll(generateCircle(3,crossing2));
+        Assert.assertEquals(6, tc1.size());
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNull(mapping);
+    }
+
+    @Test
+    public void test12() {
+        BlankNodeOrIri start1 = new BlankNode();
+        Graph tc1 = Utils4Testing.generateLine(4,start1);
+        tc1.addAll(Utils4Testing.generateLine(5,start1));
+        BlankNodeOrIri start2 = new BlankNode();
+        Graph tc2 = Utils4Testing.generateLine(5,start2);
+        tc2.addAll(Utils4Testing.generateLine(4,start2));
+        Assert.assertEquals(9, tc1.size());
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNotNull(mapping);
+        Assert.assertEquals(10, mapping.size());
+    }
+
+    @Test
+    public void test13() {
+        BlankNodeOrIri start1 = new BlankNode();
+        Graph tc1 = Utils4Testing.generateLine(4,start1);
+        tc1.addAll(Utils4Testing.generateLine(5,start1));
+        BlankNodeOrIri start2 = new BlankNode();
+        Graph tc2 = Utils4Testing.generateLine(3,start2);
+        tc2.addAll(Utils4Testing.generateLine(3,start2));
+        Assert.assertEquals(9, tc1.size());
+        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
+        Assert.assertNull(mapping);
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/HashMatchingTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/HashMatchingTest.java b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/HashMatchingTest.java
new file mode 100644
index 0000000..baac5b9
--- /dev/null
+++ b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/HashMatchingTest.java
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.commons.rdf.impl.utils.graphmatching;
+
+
+import java.util.Map;
+
+import org.apache.commons.rdf.BlankNode;
+import org.apache.commons.rdf.Graph;
+import org.apache.commons.rdf.BlankNodeOrIri;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ *
+ * @author reto
+ */
+public class HashMatchingTest {
+
+    @Test
+    public void twoLine() throws GraphNotIsomorphicException {
+        BlankNodeOrIri start1 = new BlankNode();
+        Graph tc1 = Utils4Testing.generateLine(4,start1);
+        tc1.addAll(Utils4Testing.generateLine(5,start1));
+        BlankNodeOrIri start2 = new BlankNode();
+        Graph tc2 = Utils4Testing.generateLine(5,start2);
+        tc2.addAll(Utils4Testing.generateLine(4,start2));
+        Assert.assertEquals(9, tc1.size());
+        final Map<BlankNode, BlankNode> mapping = new HashMatching(tc1, tc2).getMatchings();
+        Assert.assertNotNull(mapping);
+        Assert.assertEquals(10, mapping.size());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/PermutationIteratorTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/PermutationIteratorTest.java b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/PermutationIteratorTest.java
new file mode 100644
index 0000000..6616060
--- /dev/null
+++ b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/PermutationIteratorTest.java
@@ -0,0 +1,78 @@
+/*
+ * 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 org.apache.commons.rdf.impl.utils.graphmatching;
+
+import org.apache.commons.rdf.impl.utils.graphmatching.PermutationIterator;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ *
+ * @author reto
+ */
+public class PermutationIteratorTest {
+
+    @Test
+    public void simple() {
+        List<String> list = new ArrayList<String>();
+        PermutationIterator<String> pi = new PermutationIterator<String>(list);
+        Assert.assertFalse(pi.hasNext());
+    }
+
+    @Test
+    public void lessSimple() {
+        List<String> list = new ArrayList<String>();
+        list.add("Hasan");
+        PermutationIterator<String> pi = new PermutationIterator<String>(list);
+        Assert.assertTrue(pi.hasNext());
+    }
+
+    @Test
+    public void regular() {
+        List<String> list = new ArrayList<String>();
+        list.add("Hasan");
+        list.add("Tsuy");
+        PermutationIterator<String> pi = new PermutationIterator<String>(list);
+        Set<List<String>> permutations = new HashSet<List<String>>();
+        while (pi.hasNext()) {
+            permutations.add(pi.next());
+        }
+        Assert.assertEquals(2, permutations.size());
+    }
+
+    @Test
+    public void extended() {
+        List<String> list = new ArrayList<String>();
+        list.add("Hasan");
+        list.add("Tsuy");
+        list.add("Llena");
+        PermutationIterator<String> pi = new PermutationIterator<String>(list);
+        Set<List<String>> permutations = new HashSet<List<String>>();
+        while (pi.hasNext()) {
+            permutations.add(pi.next());
+        }
+        Assert.assertEquals(6, permutations.size());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/Utils4Testing.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/Utils4Testing.java b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/Utils4Testing.java
new file mode 100644
index 0000000..3246575
--- /dev/null
+++ b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/graphmatching/Utils4Testing.java
@@ -0,0 +1,51 @@
+/*
+ * 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 org.apache.commons.rdf.impl.utils.graphmatching;
+
+import org.apache.commons.rdf.BlankNode;
+import org.apache.commons.rdf.Graph;
+import org.apache.commons.rdf.BlankNodeOrIri;
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.impl.utils.simple.SimpleMGraph;
+import org.apache.commons.rdf.impl.utils.TripleImpl;
+
+/**
+ *
+ * @author reto
+ */
+public class Utils4Testing {
+
+    static Graph generateLine(int size, final BlankNodeOrIri firstNode) {
+        if (size < 1) {
+            throw new IllegalArgumentException();
+        }
+        Graph result = new SimpleMGraph();
+        BlankNodeOrIri lastNode = firstNode;
+        for (int i = 0; i < size; i++) {
+            final BlankNode newNode = new BlankNode();
+            result.add(new TripleImpl(lastNode, u1, newNode));
+            lastNode = newNode;
+        }
+        return result;
+    }
+
+    final static Iri u1 = new Iri("http://example.org/u1");
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/PlainLiteralImplTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/PlainLiteralImplTest.java b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/PlainLiteralImplTest.java
new file mode 100644
index 0000000..2782f45
--- /dev/null
+++ b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/PlainLiteralImplTest.java
@@ -0,0 +1,71 @@
+/*
+ * 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 org.apache.commons.rdf.impl.utils.simple;
+
+import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
+import org.junit.Test;
+
+import org.apache.commons.rdf.Language;
+import org.apache.commons.rdf.Literal;
+import org.junit.Assert;
+/**
+ *
+ * @author reto
+ *
+ */
+
+public class PlainLiteralImplTest {
+
+    
+    @Test public void plainLiteralEquality() {
+        String stringValue = "some text";
+        Literal literal1 = new PlainLiteralImpl(stringValue);
+        Literal literal2 = new PlainLiteralImpl(stringValue);        
+        Assert.assertEquals(literal1, literal2);
+        Assert.assertEquals(literal1.hashCode(), literal2.hashCode());
+        Literal literal3 = new PlainLiteralImpl("something else");
+        Assert.assertFalse(literal1.equals(literal3));
+    }
+    
+    @Test public void languageLiteralEquality() {
+        String stringValue = "some text";
+        Language lang = new Language("en-ca");
+        Literal literal1 = new PlainLiteralImpl(stringValue, lang);
+        Literal literal2 = new PlainLiteralImpl(stringValue, lang);        
+        Assert.assertEquals(literal1, literal2);
+        Assert.assertEquals(literal1.hashCode(), literal2.hashCode());
+        Language lang2 = new Language("de");
+        Literal literal3 = new PlainLiteralImpl(stringValue, lang2);
+        Assert.assertFalse(literal1.equals(literal3));
+        Literal literal4 = new PlainLiteralImpl(stringValue, null);
+        Assert.assertFalse(literal3.equals(literal4));
+        Assert.assertFalse(literal4.equals(literal3));
+    }
+
+    /**
+     * hashCode of the lexical form plus the hashCode of the locale
+     */
+    @Test public void checkHashCode() {
+        String stringValue = "some text";
+        Language language = new Language("en");
+        Literal literal = new PlainLiteralImpl(stringValue, language);
+        Assert.assertEquals(literal.getDataType().hashCode() + stringValue.hashCode() + language.hashCode(), literal.hashCode());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/SimpleGraphTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/SimpleGraphTest.java b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/SimpleGraphTest.java
new file mode 100644
index 0000000..a1e8d54
--- /dev/null
+++ b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/SimpleGraphTest.java
@@ -0,0 +1,109 @@
+/*
+ * 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 org.apache.commons.rdf.impl.utils.simple;
+
+import org.apache.commons.rdf.impl.utils.TripleImpl;
+import java.util.ConcurrentModificationException;
+import java.util.Iterator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.commons.rdf.Triple;
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
+
+/**
+ *
+ * @author mir
+ */
+public class SimpleGraphTest {
+
+    private Iri uriRef1 = new Iri("http://example.org/foo");
+    private Iri uriRef2 = new Iri("http://example.org/bar");
+    private Iri uriRef3 = new Iri("http://example.org/test");
+    private Triple triple1 = new TripleImpl(uriRef1, uriRef2, uriRef3);
+    private Triple triple2 = new TripleImpl(uriRef2, uriRef2, uriRef1);
+    private Triple triple3 = new TripleImpl(uriRef3, uriRef1, uriRef3);
+    private Triple triple4 = new TripleImpl(uriRef1, uriRef3, uriRef2);
+    private Triple triple5 = new TripleImpl(uriRef2, uriRef3, uriRef2);
+        
+    @Test
+    public void iteratorRemove() {
+        SimpleGraph stc = new SimpleGraph();
+        stc.add(triple1);
+        stc.add(triple2);
+        stc.add(triple3);
+        stc.add(triple4);
+        stc.add(triple5);
+        Iterator<Triple> iter = stc.iterator();
+        while (iter.hasNext()) {
+            Triple triple = iter.next();
+            iter.remove();
+        }
+        Assert.assertEquals(0, stc.size());
+    }
+
+    @Test
+    public void removeAll() {
+        SimpleGraph stc = new SimpleGraph();
+        stc.add(triple1);
+        stc.add(triple2);
+        stc.add(triple3);
+        stc.add(triple4);
+        stc.add(triple5);
+        SimpleGraph stc2 = new SimpleGraph();
+        stc2.add(triple1);
+        stc2.add(triple3);
+        stc2.add(triple5);
+        stc.removeAll(stc2);
+        Assert.assertEquals(2, stc.size());
+    }
+    
+    @Test
+    public void filterIteratorRemove() {
+        SimpleGraph stc = new SimpleGraph();
+        stc.add(triple1);
+        stc.add(triple2);
+        stc.add(triple3);
+        stc.add(triple4);
+        stc.add(triple5);        
+        Iterator<Triple> iter = stc.filter(uriRef1, null, null);
+        while (iter.hasNext()) {
+            Triple triple = iter.next();
+            iter.remove();
+        }
+        Assert.assertEquals(3, stc.size());
+    }
+
+    @Test(expected=ConcurrentModificationException.class)
+    public void remove() {
+        SimpleGraph stc = new SimpleGraph();
+        stc.setCheckConcurrency(true);
+        stc.add(triple1);
+        stc.add(triple2);
+        stc.add(triple3);
+        stc.add(triple4);
+        stc.add(triple5);
+        Iterator<Triple> iter = stc.filter(uriRef1, null, null);
+        while (iter.hasNext()) {
+            Triple triple = iter.next();
+            stc.remove(triple);
+        }
+        Assert.assertEquals(3, stc.size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/TripleImplTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/TripleImplTest.java b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/TripleImplTest.java
new file mode 100644
index 0000000..dd2f967
--- /dev/null
+++ b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/TripleImplTest.java
@@ -0,0 +1,57 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.commons.rdf.impl.utils.simple;
+/*
+ *
+ * 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.
+ *
+*/
+
+
+import org.junit.Test;
+import junit.framework.Assert;
+
+import org.apache.commons.rdf.BlankNodeOrIri;
+import org.apache.commons.rdf.RdfTerm;
+import org.apache.commons.rdf.Triple;
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
+import org.apache.commons.rdf.impl.utils.TripleImpl;
+/**
+ *
+ * @author reto
+ *
+ */
+
+public class TripleImplTest {
+    
+    
+    @Test public void tripleEquality() {
+        BlankNodeOrIri subject = new Iri("http://example.org/");
+        Iri predicate = new Iri("http://example.org/property");
+        RdfTerm object = new PlainLiteralImpl("property value");
+        Triple triple1 = new TripleImpl(subject, predicate, object);
+        Triple triple2 = new TripleImpl(subject, predicate, object);
+        Assert.assertEquals(triple1.hashCode(), triple2.hashCode());
+        Assert.assertEquals(triple1, triple2);    
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/TypedLiteralImplTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/TypedLiteralImplTest.java b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/TypedLiteralImplTest.java
new file mode 100644
index 0000000..515cf93
--- /dev/null
+++ b/impl.utils/src/test/java/org/apache/clerezza/commons/rdf/impl/utils/simple/TypedLiteralImplTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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 org.apache.commons.rdf.impl.utils.simple;
+
+import org.apache.commons.rdf.impl.utils.TypedLiteralImpl;
+import org.junit.Test;
+import junit.framework.Assert;
+
+import org.apache.commons.rdf.Iri;
+import org.apache.commons.rdf.Literal;
+/**
+ *
+ * @author reto/**
+ *
+ * @author reto/**
+ *
+ * @author reto/**
+ *
+ * @author reto
+ *
+ */
+
+public class TypedLiteralImplTest {
+    
+    
+    @Test public void typedLiteralEquality() {
+        String stringValue = "some text";
+        Iri uriRef = new Iri("http://example.org/datatypes/magic");
+        Literal literal1 = new TypedLiteralImpl(stringValue, uriRef);
+        Literal literal2 = new TypedLiteralImpl(stringValue, uriRef);        
+        Assert.assertEquals(literal1, literal2);
+        Assert.assertEquals(literal1.hashCode(), literal2.hashCode());
+        Literal literal3 = new TypedLiteralImpl("something else", uriRef);
+        Assert.assertFalse(literal1.equals(literal3));
+        Iri uriRef2 = new Iri("http://example.org/datatypes/other");
+        Literal literal4 = new TypedLiteralImpl(stringValue, uriRef2);
+        Assert.assertFalse(literal1.equals(literal4));
+    }
+
+
+    /**
+     * The hascode is equals to the hascode of the lexical form plus the hashcode of the dataTyp
+     */
+    @Test public void checkHashCode() {
+        String stringValue = "some text";
+        Iri uriRef = new Iri("http://example.org/datatypes/magic");
+        Literal literal =  new TypedLiteralImpl(stringValue, uriRef);
+        Assert.assertEquals(stringValue.hashCode() + uriRef.hashCode(), literal.hashCode());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/GraphMatcherTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/GraphMatcherTest.java b/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/GraphMatcherTest.java
deleted file mode 100644
index 5c43c1b..0000000
--- a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/GraphMatcherTest.java
+++ /dev/null
@@ -1,211 +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.
- */
-package org.apache.commons.rdf.impl.utils.graphmatching;
-
-import org.apache.commons.rdf.impl.utils.graphmatching.GraphMatcher;
-import java.util.Map;
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.simple.SimpleMGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author reto
- */
-public class GraphMatcherTest {
-
-    final static Iri u1 = new Iri("http://example.org/u1");
-
-    @Test
-    public void testEmpty() {
-        Graph tc1 = new SimpleMGraph();
-        Graph tc2 = new SimpleMGraph();
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        Assert.assertEquals(0, mapping.size());
-    }
-
-    @Test
-    public void test2() {
-        Graph tc1 = new SimpleMGraph();
-        tc1.add(new TripleImpl(u1, u1, u1));
-        Graph tc2 = new SimpleMGraph();
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNull(mapping);
-    }
-
-    @Test
-    public void test3() {
-        Graph tc1 = new SimpleMGraph();
-        tc1.add(new TripleImpl(u1, u1, u1));
-        Graph tc2 = new SimpleMGraph();
-        tc2.add(new TripleImpl(u1, u1, u1));
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        Assert.assertEquals(0, mapping.size());
-    }
-
-    @Test
-    public void test4() {
-        Graph tc1 = new SimpleMGraph();
-        tc1.add(new TripleImpl(u1, u1, new BlankNode()));
-        Graph tc2 = new SimpleMGraph();
-        tc2.add(new TripleImpl(u1, u1, new BlankNode()));
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        Assert.assertEquals(1, mapping.size());
-    }
-
-    @Test
-    public void test5() {
-        Graph tc1 = new SimpleMGraph();
-        tc1.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
-        Graph tc2 = new SimpleMGraph();
-        tc2.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        Assert.assertEquals(2, mapping.size());
-    }
-
-    @Test
-    public void test6() {
-        Graph tc1 = new SimpleMGraph();
-        final BlankNode b11 = new BlankNode();
-        tc1.add(new TripleImpl(new BlankNode(), u1,b11));
-        tc1.add(new TripleImpl(new BlankNode(), u1,b11));
-        Graph tc2 = new SimpleMGraph();
-        tc2.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNull(mapping);
-    }
-
-    private Graph generateCircle(int size) {
-        return generateCircle(size, new BlankNode());
-    }
-
-    private Graph generateCircle(int size, final BlankNodeOrIri firstNode) {
-        if (size < 1) {
-            throw new IllegalArgumentException();
-        }
-        Graph result = new SimpleMGraph();
-        BlankNodeOrIri lastNode = firstNode;
-        for (int i = 0; i < (size-1); i++) {
-            final BlankNode newNode = new BlankNode();
-            result.add(new TripleImpl(lastNode, u1, newNode));
-            lastNode = newNode;
-        }
-        result.add(new TripleImpl(lastNode, u1, firstNode));
-        return result;
-    }
-
-    @Test
-    public void test7() {
-        Graph tc1 = generateCircle(2);
-        Graph tc2 = generateCircle(2);
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        Assert.assertEquals(2, mapping.size());
-    }
-
-    @Test
-    public void test8() {
-        Graph tc1 = generateCircle(5);
-        Graph tc2 = generateCircle(5);
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        Assert.assertEquals(5, mapping.size());
-    }
-
-    @Test
-    public void test9() {
-        BlankNodeOrIri crossing = new Iri("http://example.org/");
-        Graph tc1 = generateCircle(2,crossing);
-        tc1.addAll(generateCircle(3,crossing));
-        Graph tc2 = generateCircle(2,crossing);
-        tc2.addAll(generateCircle(3,crossing));
-        Assert.assertEquals(5, tc1.size());
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        //a circle of 2 with 1 bnode and one of 2 bnodes
-        Assert.assertEquals(3, mapping.size());
-    }
-
-    @Test
-    public void test10() {
-        BlankNodeOrIri crossing1 = new BlankNode();
-        Graph tc1 = generateCircle(2,crossing1);
-        tc1.addAll(generateCircle(3,crossing1));
-        BlankNodeOrIri crossing2 = new BlankNode();
-        Graph tc2 = generateCircle(2,crossing2);
-        tc2.addAll(generateCircle(3,crossing2));
-        Assert.assertEquals(5, tc1.size());
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        //a circle of 2 and one of 3 with one common node
-        Assert.assertEquals(4, mapping.size());
-    }
-
-    @Test
-    public void test11() {
-        BlankNodeOrIri crossing1 = new BlankNode();
-        Graph tc1 = generateCircle(2,crossing1);
-        tc1.addAll(generateCircle(4,crossing1));
-        BlankNodeOrIri crossing2 = new BlankNode();
-        Graph tc2 = generateCircle(3,crossing2);
-        tc2.addAll(generateCircle(3,crossing2));
-        Assert.assertEquals(6, tc1.size());
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNull(mapping);
-    }
-
-    @Test
-    public void test12() {
-        BlankNodeOrIri start1 = new BlankNode();
-        Graph tc1 = Utils4Testing.generateLine(4,start1);
-        tc1.addAll(Utils4Testing.generateLine(5,start1));
-        BlankNodeOrIri start2 = new BlankNode();
-        Graph tc2 = Utils4Testing.generateLine(5,start2);
-        tc2.addAll(Utils4Testing.generateLine(4,start2));
-        Assert.assertEquals(9, tc1.size());
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNotNull(mapping);
-        Assert.assertEquals(10, mapping.size());
-    }
-
-    @Test
-    public void test13() {
-        BlankNodeOrIri start1 = new BlankNode();
-        Graph tc1 = Utils4Testing.generateLine(4,start1);
-        tc1.addAll(Utils4Testing.generateLine(5,start1));
-        BlankNodeOrIri start2 = new BlankNode();
-        Graph tc2 = Utils4Testing.generateLine(3,start2);
-        tc2.addAll(Utils4Testing.generateLine(3,start2));
-        Assert.assertEquals(9, tc1.size());
-        final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
-        Assert.assertNull(mapping);
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/HashMatchingTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/HashMatchingTest.java b/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/HashMatchingTest.java
deleted file mode 100644
index baac5b9..0000000
--- a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/HashMatchingTest.java
+++ /dev/null
@@ -1,51 +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.
- */
-
-package org.apache.commons.rdf.impl.utils.graphmatching;
-
-
-import java.util.Map;
-
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author reto
- */
-public class HashMatchingTest {
-
-    @Test
-    public void twoLine() throws GraphNotIsomorphicException {
-        BlankNodeOrIri start1 = new BlankNode();
-        Graph tc1 = Utils4Testing.generateLine(4,start1);
-        tc1.addAll(Utils4Testing.generateLine(5,start1));
-        BlankNodeOrIri start2 = new BlankNode();
-        Graph tc2 = Utils4Testing.generateLine(5,start2);
-        tc2.addAll(Utils4Testing.generateLine(4,start2));
-        Assert.assertEquals(9, tc1.size());
-        final Map<BlankNode, BlankNode> mapping = new HashMatching(tc1, tc2).getMatchings();
-        Assert.assertNotNull(mapping);
-        Assert.assertEquals(10, mapping.size());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/PermutationIteratorTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/PermutationIteratorTest.java b/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/PermutationIteratorTest.java
deleted file mode 100644
index 6616060..0000000
--- a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/PermutationIteratorTest.java
+++ /dev/null
@@ -1,78 +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.
- */
-
-package org.apache.commons.rdf.impl.utils.graphmatching;
-
-import org.apache.commons.rdf.impl.utils.graphmatching.PermutationIterator;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author reto
- */
-public class PermutationIteratorTest {
-
-    @Test
-    public void simple() {
-        List<String> list = new ArrayList<String>();
-        PermutationIterator<String> pi = new PermutationIterator<String>(list);
-        Assert.assertFalse(pi.hasNext());
-    }
-
-    @Test
-    public void lessSimple() {
-        List<String> list = new ArrayList<String>();
-        list.add("Hasan");
-        PermutationIterator<String> pi = new PermutationIterator<String>(list);
-        Assert.assertTrue(pi.hasNext());
-    }
-
-    @Test
-    public void regular() {
-        List<String> list = new ArrayList<String>();
-        list.add("Hasan");
-        list.add("Tsuy");
-        PermutationIterator<String> pi = new PermutationIterator<String>(list);
-        Set<List<String>> permutations = new HashSet<List<String>>();
-        while (pi.hasNext()) {
-            permutations.add(pi.next());
-        }
-        Assert.assertEquals(2, permutations.size());
-    }
-
-    @Test
-    public void extended() {
-        List<String> list = new ArrayList<String>();
-        list.add("Hasan");
-        list.add("Tsuy");
-        list.add("Llena");
-        PermutationIterator<String> pi = new PermutationIterator<String>(list);
-        Set<List<String>> permutations = new HashSet<List<String>>();
-        while (pi.hasNext()) {
-            permutations.add(pi.next());
-        }
-        Assert.assertEquals(6, permutations.size());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/Utils4Testing.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/Utils4Testing.java b/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/Utils4Testing.java
deleted file mode 100644
index 3246575..0000000
--- a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/graphmatching/Utils4Testing.java
+++ /dev/null
@@ -1,51 +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.
- */
-
-package org.apache.commons.rdf.impl.utils.graphmatching;
-
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.simple.SimpleMGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-
-/**
- *
- * @author reto
- */
-public class Utils4Testing {
-
-    static Graph generateLine(int size, final BlankNodeOrIri firstNode) {
-        if (size < 1) {
-            throw new IllegalArgumentException();
-        }
-        Graph result = new SimpleMGraph();
-        BlankNodeOrIri lastNode = firstNode;
-        for (int i = 0; i < size; i++) {
-            final BlankNode newNode = new BlankNode();
-            result.add(new TripleImpl(lastNode, u1, newNode));
-            lastNode = newNode;
-        }
-        return result;
-    }
-
-    final static Iri u1 = new Iri("http://example.org/u1");
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/PlainLiteralImplTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/PlainLiteralImplTest.java b/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/PlainLiteralImplTest.java
deleted file mode 100644
index 2782f45..0000000
--- a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/PlainLiteralImplTest.java
+++ /dev/null
@@ -1,71 +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.
- */
-package org.apache.commons.rdf.impl.utils.simple;
-
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
-import org.junit.Test;
-
-import org.apache.commons.rdf.Language;
-import org.apache.commons.rdf.Literal;
-import org.junit.Assert;
-/**
- *
- * @author reto
- *
- */
-
-public class PlainLiteralImplTest {
-
-    
-    @Test public void plainLiteralEquality() {
-        String stringValue = "some text";
-        Literal literal1 = new PlainLiteralImpl(stringValue);
-        Literal literal2 = new PlainLiteralImpl(stringValue);        
-        Assert.assertEquals(literal1, literal2);
-        Assert.assertEquals(literal1.hashCode(), literal2.hashCode());
-        Literal literal3 = new PlainLiteralImpl("something else");
-        Assert.assertFalse(literal1.equals(literal3));
-    }
-    
-    @Test public void languageLiteralEquality() {
-        String stringValue = "some text";
-        Language lang = new Language("en-ca");
-        Literal literal1 = new PlainLiteralImpl(stringValue, lang);
-        Literal literal2 = new PlainLiteralImpl(stringValue, lang);        
-        Assert.assertEquals(literal1, literal2);
-        Assert.assertEquals(literal1.hashCode(), literal2.hashCode());
-        Language lang2 = new Language("de");
-        Literal literal3 = new PlainLiteralImpl(stringValue, lang2);
-        Assert.assertFalse(literal1.equals(literal3));
-        Literal literal4 = new PlainLiteralImpl(stringValue, null);
-        Assert.assertFalse(literal3.equals(literal4));
-        Assert.assertFalse(literal4.equals(literal3));
-    }
-
-    /**
-     * hashCode of the lexical form plus the hashCode of the locale
-     */
-    @Test public void checkHashCode() {
-        String stringValue = "some text";
-        Language language = new Language("en");
-        Literal literal = new PlainLiteralImpl(stringValue, language);
-        Assert.assertEquals(literal.getDataType().hashCode() + stringValue.hashCode() + language.hashCode(), literal.hashCode());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/SimpleGraphTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/SimpleGraphTest.java b/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/SimpleGraphTest.java
deleted file mode 100644
index a1e8d54..0000000
--- a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/SimpleGraphTest.java
+++ /dev/null
@@ -1,109 +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.
- */
-package org.apache.commons.rdf.impl.utils.simple;
-
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import org.junit.Assert;
-import org.junit.Test;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-
-/**
- *
- * @author mir
- */
-public class SimpleGraphTest {
-
-    private Iri uriRef1 = new Iri("http://example.org/foo");
-    private Iri uriRef2 = new Iri("http://example.org/bar");
-    private Iri uriRef3 = new Iri("http://example.org/test");
-    private Triple triple1 = new TripleImpl(uriRef1, uriRef2, uriRef3);
-    private Triple triple2 = new TripleImpl(uriRef2, uriRef2, uriRef1);
-    private Triple triple3 = new TripleImpl(uriRef3, uriRef1, uriRef3);
-    private Triple triple4 = new TripleImpl(uriRef1, uriRef3, uriRef2);
-    private Triple triple5 = new TripleImpl(uriRef2, uriRef3, uriRef2);
-        
-    @Test
-    public void iteratorRemove() {
-        SimpleGraph stc = new SimpleGraph();
-        stc.add(triple1);
-        stc.add(triple2);
-        stc.add(triple3);
-        stc.add(triple4);
-        stc.add(triple5);
-        Iterator<Triple> iter = stc.iterator();
-        while (iter.hasNext()) {
-            Triple triple = iter.next();
-            iter.remove();
-        }
-        Assert.assertEquals(0, stc.size());
-    }
-
-    @Test
-    public void removeAll() {
-        SimpleGraph stc = new SimpleGraph();
-        stc.add(triple1);
-        stc.add(triple2);
-        stc.add(triple3);
-        stc.add(triple4);
-        stc.add(triple5);
-        SimpleGraph stc2 = new SimpleGraph();
-        stc2.add(triple1);
-        stc2.add(triple3);
-        stc2.add(triple5);
-        stc.removeAll(stc2);
-        Assert.assertEquals(2, stc.size());
-    }
-    
-    @Test
-    public void filterIteratorRemove() {
-        SimpleGraph stc = new SimpleGraph();
-        stc.add(triple1);
-        stc.add(triple2);
-        stc.add(triple3);
-        stc.add(triple4);
-        stc.add(triple5);        
-        Iterator<Triple> iter = stc.filter(uriRef1, null, null);
-        while (iter.hasNext()) {
-            Triple triple = iter.next();
-            iter.remove();
-        }
-        Assert.assertEquals(3, stc.size());
-    }
-
-    @Test(expected=ConcurrentModificationException.class)
-    public void remove() {
-        SimpleGraph stc = new SimpleGraph();
-        stc.setCheckConcurrency(true);
-        stc.add(triple1);
-        stc.add(triple2);
-        stc.add(triple3);
-        stc.add(triple4);
-        stc.add(triple5);
-        Iterator<Triple> iter = stc.filter(uriRef1, null, null);
-        while (iter.hasNext()) {
-            Triple triple = iter.next();
-            stc.remove(triple);
-        }
-        Assert.assertEquals(3, stc.size());
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/TripleImplTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/TripleImplTest.java b/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/TripleImplTest.java
deleted file mode 100644
index dd2f967..0000000
--- a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/TripleImplTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.apache.commons.rdf.impl.utils.simple;
-/*
- *
- * 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.
- *
-*/
-
-
-import org.junit.Test;
-import junit.framework.Assert;
-
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-/**
- *
- * @author reto
- *
- */
-
-public class TripleImplTest {
-    
-    
-    @Test public void tripleEquality() {
-        BlankNodeOrIri subject = new Iri("http://example.org/");
-        Iri predicate = new Iri("http://example.org/property");
-        RdfTerm object = new PlainLiteralImpl("property value");
-        Triple triple1 = new TripleImpl(subject, predicate, object);
-        Triple triple2 = new TripleImpl(subject, predicate, object);
-        Assert.assertEquals(triple1.hashCode(), triple2.hashCode());
-        Assert.assertEquals(triple1, triple2);    
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza-rdf-core/blob/816dc11f/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/TypedLiteralImplTest.java
----------------------------------------------------------------------
diff --git a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/TypedLiteralImplTest.java b/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/TypedLiteralImplTest.java
deleted file mode 100644
index 515cf93..0000000
--- a/impl.utils/src/test/java/org/apache/commons/rdf/impl/utils/simple/TypedLiteralImplTest.java
+++ /dev/null
@@ -1,67 +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.
- */
-package org.apache.commons.rdf.impl.utils.simple;
-
-import org.apache.commons.rdf.impl.utils.TypedLiteralImpl;
-import org.junit.Test;
-import junit.framework.Assert;
-
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.Literal;
-/**
- *
- * @author reto/**
- *
- * @author reto/**
- *
- * @author reto/**
- *
- * @author reto
- *
- */
-
-public class TypedLiteralImplTest {
-    
-    
-    @Test public void typedLiteralEquality() {
-        String stringValue = "some text";
-        Iri uriRef = new Iri("http://example.org/datatypes/magic");
-        Literal literal1 = new TypedLiteralImpl(stringValue, uriRef);
-        Literal literal2 = new TypedLiteralImpl(stringValue, uriRef);        
-        Assert.assertEquals(literal1, literal2);
-        Assert.assertEquals(literal1.hashCode(), literal2.hashCode());
-        Literal literal3 = new TypedLiteralImpl("something else", uriRef);
-        Assert.assertFalse(literal1.equals(literal3));
-        Iri uriRef2 = new Iri("http://example.org/datatypes/other");
-        Literal literal4 = new TypedLiteralImpl(stringValue, uriRef2);
-        Assert.assertFalse(literal1.equals(literal4));
-    }
-
-
-    /**
-     * The hascode is equals to the hascode of the lexical form plus the hashcode of the dataTyp
-     */
-    @Test public void checkHashCode() {
-        String stringValue = "some text";
-        Iri uriRef = new Iri("http://example.org/datatypes/magic");
-        Literal literal =  new TypedLiteralImpl(stringValue, uriRef);
-        Assert.assertEquals(stringValue.hashCode() + uriRef.hashCode(), literal.hashCode());
-    }
-
-}


Mime
View raw message