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 2013/02/15 18:15:43 UTC

svn commit: r1446696 - /jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena395_RemoveAllEvents.java

Author: andy
Date: Fri Feb 15 17:15:43 2013
New Revision: 1446696

URL: http://svn.apache.org/r1446696
Log:
Test case for Jena 395.

Added:
    jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena395_RemoveAllEvents.java

Added: jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena395_RemoveAllEvents.java
URL: http://svn.apache.org/viewvc/jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena395_RemoveAllEvents.java?rev=1446696&view=auto
==============================================================================
--- jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena395_RemoveAllEvents.java (added)
+++ jena/Scratch/AFS/Jena-Dev/trunk/src/dev/Jena395_RemoveAllEvents.java Fri Feb 15 17:15:43 2013
@@ -0,0 +1,59 @@
+/**
+ * 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 dev;
+
+import com.hp.hpl.jena.graph.Triple ;
+import com.hp.hpl.jena.query.Dataset ;
+import com.hp.hpl.jena.rdf.listeners.StatementListener ;
+import com.hp.hpl.jena.rdf.model.Model ;
+import com.hp.hpl.jena.rdf.model.ModelChangedListener ;
+import com.hp.hpl.jena.rdf.model.ModelFactory ;
+import com.hp.hpl.jena.rdf.model.Statement ;
+import com.hp.hpl.jena.sparql.sse.SSE ;
+import com.hp.hpl.jena.tdb.TDBFactory ;
+
+public class Jena395_RemoveAllEvents
+{
+    public static void main(String[] args)
+    {
+        Dataset ds = TDBFactory.createDataset() ;
+        
+        boolean useTDB = false ;
+        
+        Model model = useTDB ? ds.getDefaultModel() : ModelFactory.createDefaultModel() ;
+        
+        Triple t = SSE.parseTriple("(<s> <p> <o>)") ;
+        model.getGraph().add(t) ;
+        
+        ModelChangedListener listener = new StatementListener() {
+            @Override
+            public void addedStatement( Statement s )
+            { System.out.println("Add : "+s) ; }
+            
+            @Override
+            public void removedStatement( Statement s )  
+            { System.out.println("Del : "+s) ; }  
+        }  ;
+        
+        model.register(listener) ;
+        model.removeAll(null,null, null) ; 
+        System.out.println("DONE") ;
+    }
+}
+