/*
  (c) Copyright 2003, Hewlett-Packard Company, all rights reserved.
  [See end of file]
  $Id: TestQueryRDB.java,v 1.1 2003-07-18 14:13:58 chris-dollin Exp $
*/

package com.hp.hpl.jena.db.test;

import com.hp.hpl.jena.graph.query.test.*;
import com.hp.hpl.jena.graph.*;
import com.hp.hpl.jena.db.*;
import com.hp.hpl.jena.shared.*;

import junit.framework.*;

/**
    Apply the abstract query tests to an RDB graph.
 	@author kers
*/
public class TestQueryRDB extends AbstractTestQuery
    {
    public TestQueryRDB( String name )
        { super( name ); }

   public static TestSuite suite()
        { return new TestSuite( TestGraphRDB.class ); }

    private IDBConnection theConnection;
    private int count = 0;
    
    public void setUp()
        {
        theConnection = TestConnection.makeAndCleanTestConnection();
        }
        
    public void tearDown()
        {
        try { theConnection.close(); }
        catch (Exception e) { throw new JenaException( e ); }
        }
        
    public Graph getGraph()
        { 
        return new GraphRDB
            (
            theConnection,
            "testGraph-" + count ++, 
            theConnection.getDefaultModelProperties().getGraph(), 
            GraphRDB.OPTIMIZE_AND_HIDE_ONLY_FULL_REIFICATIONS, 
            true
            );
        }

    }


/*
    (c) Copyright Hewlett-Packard Company 2003
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@@ -117,42 +117,33 @@
 v 1.
-1
+2
  2003-0
-7-18 14:13:58 chris-dollin
+8-11 02:51:10 wkw
  Exp
@@ -183,16 +183,58 @@
 .test;%0A%0A
+import com.hp.hpl.jena.graph.query.Query;%0A
 import c
@@ -570,17 +570,26 @@
        %7B
- 
+%0A        %09
 super( n
@@ -594,23 +594,30 @@
  name );
- %7D%0A
 %0A   
+     %7D%0A%0A%0A%09
 public s
@@ -676,21 +676,21 @@
 te( Test
-Graph
+Query
 RDB.clas
@@ -695,17 +695,31 @@
 ass ); %7D
-%0A
+     %0A%0A        
 %0A    pri
@@ -887,16 +887,120 @@
 tion();%0A
+%09%09Q = new Query();%0A%09%09empty = getGraphWith( %22%22 );%0A%09%09single = getGraphWith( %22spindizzies drive cities%22 );%0A
         
@@ -1494,16 +1494,27 @@
 %0A    %7D%0A%0A
+        %0A%0A%0A
 %0A/*%0A    

add to setUp: initialization for Q, empty, single.