KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > graph > test > TestCapabilities


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

6
7 package com.hp.hpl.jena.graph.test;
8
9 import com.hp.hpl.jena.graph.*;
10 import junit.framework.*;
11
12 /**
13     Test graph capabilities.
14     @author kers
15 */

16 public class TestCapabilities extends GraphTestBase
17     {
18     protected final class AllFalse implements Capabilities
19         {
20         public boolean sizeAccurate()
21             {
22             return false;
23             }
24
25         public boolean addAllowed()
26             {
27             return false;
28             }
29
30         public boolean addAllowed( boolean everyTriple )
31             {
32             return false;
33             }
34
35         public boolean deleteAllowed()
36             {
37             return false;
38             }
39
40         public boolean deleteAllowed( boolean everyTriple )
41             {
42             return false;
43             }
44
45         public boolean iteratorRemoveAllowed()
46             {
47             return false;
48             }
49
50         public boolean canBeEmpty()
51             {
52             return false;
53             }
54
55         public boolean findContractSafe()
56             {
57             return false;
58             }
59         }
60
61     public TestCapabilities( String JavaDoc name )
62         { super( name ); }
63         
64     public static TestSuite suite()
65         { return new TestSuite( TestCapabilities.class ); }
66
67     /**
68         pending on use-cases.
69     */

70     public void testTheyreThere()
71         {
72         Graph g = Factory.createDefaultGraph();
73         g.getCapabilities();
74         }
75     
76     public void testCanConstruct()
77         {
78         Capabilities c = new AllFalse();
79         }
80     
81     public void testCanAccess()
82         {
83         Capabilities c = new AllFalse();
84         boolean b = false;
85         b = c.addAllowed();
86         b = c.addAllowed( true );
87         b = c.canBeEmpty();
88         b = c.deleteAllowed();
89         b = c.deleteAllowed( false );
90         b = c.sizeAccurate();
91         b = c.iteratorRemoveAllowed();
92         b = c.findContractSafe();
93         }
94     }
95
96
97 /*
98     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
99     All rights reserved.
100
101     Redistribution and use in source and binary forms, with or without
102     modification, are permitted provided that the following conditions
103     are met:
104
105     1. Redistributions of source code must retain the above copyright
106        notice, this list of conditions and the following disclaimer.
107
108     2. Redistributions in binary form must reproduce the above copyright
109        notice, this list of conditions and the following disclaimer in the
110        documentation and/or other materials provided with the distribution.
111
112     3. The name of the author may not be used to endorse or promote products
113        derived from this software without specific prior written permission.
114
115     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
116     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
117     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
118     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
119     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
120     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
121     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
122     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
123     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
124     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
125 */
Popular Tags