Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Licensed to Aduna under one or more contributor license agreements.  
   * See the NOTICE.txt file distributed with this work for additional 
   * information regarding copyright ownership. 
   * Aduna licenses this file to you under the terms of the Aduna BSD 
   * License (the "License"); you may not use this file except in compliance 
   * with the License. See the LICENSE.txt file distributed with this work 
   * for the full License.
  * Unless required by applicable law or agreed to in writing, software 
  * distributed under the License is distributed on an "AS IS" BASIS, 
  * implied. See the License for the specific language governing permissions
  * and limitations under the License.
 package org.openrdf.sail;
 import static org.junit.Assert.*;
 import org.junit.Test;
A JUnit test for testing Sail implementations that store RDF data. This is purely a test for data storage and retrieval which assumes that no inferencing or whatsoever is performed. This is an abstract class that should be extended for specific Sail implementations.
 public abstract class RDFNotifyingStoreTest extends RDFStoreTest implements SailChangedListener {
 	 * Variables *
 	private int removeEventCount;
 	private int addEventCount;
 	 * Methods *

Gets an instance of the Sail that should be tested. The returned repository should already have been initialized.

an initialized Sail.
org.openrdf.sail.SailException If the initialization of the repository failed.
 	protected abstract NotifyingSail createSail()
 		throws SailException;
 	public void setUp()
 		throws Exception
 		// set self as listener
 		throws Exception
 		// Add some data to the repository
 		// Test removal of statements
 		assertEquals("Repository should contain 4 statements in total", 4, countAllElements());
 		assertEquals("Named context should contain 3 statements", 3, countContext1Elements());
 		assertEquals("Statement (Painting, type, Class) should no longer be in the repository", 0,
 				countQueryResults("select 1 from {ex:Painting} rdf:type {rdfs:Class}"));
 		assertEquals("Repository should contain 1 statement in total", 1, countAllElements());
		assertEquals("Named context should be empty", 0, countContext1Elements());
		assertEquals("Repository should no longer contain any statements", 0, countAllElements());
		// test if event listener works properly.
		assertEquals("There should have been 1 event in which statements were added", 1, );
		assertEquals("There should have been 3 events in which statements were removed", 3, );
	public void sailChanged(SailChangedEvent event) {
		if (event.statementsAdded()) {
		if (event.statementsRemoved()) {
New to GrepCode? Check out our FAQ X