KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > db > test > TestQueryRDB


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: TestQueryRDB.java,v 1.6 2005/02/21 12:03:18 andy_seaborne Exp $
5 */

6
7 package com.hp.hpl.jena.db.test;
8
9 import com.hp.hpl.jena.graph.query.test.*;
10 import com.hp.hpl.jena.graph.*;
11 import com.hp.hpl.jena.db.*;
12 import com.hp.hpl.jena.shared.*;
13
14 import junit.framework.*;
15
16 /**
17     Apply the abstract query tests to an RDB graph.
18     @author kers
19 */

20 public class TestQueryRDB extends AbstractTestQuery
21     {
22     public TestQueryRDB( String JavaDoc name )
23         { super( name ); }
24
25     public static TestSuite suite()
26         { return new TestSuite( TestQueryRDB.class ); }
27      
28     private IDBConnection theConnection;
29     private int count = 0;
30     
31     public void setUp()
32         {
33         theConnection = TestConnection.makeAndCleanTestConnection();
34         super.setUp();
35         }
36         
37     public void tearDown()
38         {
39         try { theConnection.close(); }
40         catch (Exception JavaDoc e) { throw new JenaException( e ); }
41         }
42         
43     public Graph getGraph()
44         {
45         return new GraphRDB
46             (
47             theConnection,
48             "testGraph-" + count ++,
49             theConnection.getDefaultModelProperties().getGraph(),
50             GraphRDB.OPTIMIZE_AND_HIDE_ONLY_FULL_REIFICATIONS,
51             true
52             );
53         }
54
55     }
56
57         
58
59
60
61 /*
62     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
63     All rights reserved.
64
65     Redistribution and use in source and binary forms, with or without
66     modification, are permitted provided that the following conditions
67     are met:
68
69     1. Redistributions of source code must retain the above copyright
70        notice, this list of conditions and the following disclaimer.
71
72     2. Redistributions in binary form must reproduce the above copyright
73        notice, this list of conditions and the following disclaimer in the
74        documentation and/or other materials provided with the distribution.
75
76     3. The name of the author may not be used to endorse or promote products
77        derived from this software without specific prior written permission.
78
79     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
80     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
81     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
82     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
83     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
84     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
85     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
86     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
87     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
88     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89 */
Popular Tags