KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > graph > compose > test > TestCaseBasic


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: TestCaseBasic.java,v 1.7 2005/02/21 11:52:05 andy_seaborne Exp $
5 */

6
7 package com.hp.hpl.jena.graph.compose.test;
8
9 /**
10     @author kers
11 */

12
13 import java.lang.reflect.*;
14 import com.hp.hpl.jena.graph.*;
15 import com.hp.hpl.jena.graph.test.*;
16 import com.hp.hpl.jena.mem.*;
17 import com.hp.hpl.jena.shared.*;
18
19 /**
20  *
21  * @author bwm
22  * @version $Name: $ $Revision: 1.7 $ $Date: 2005/02/21 11:52:05 $
23  */

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

85
Popular Tags