001: /*
002: (c) Copyright 2002, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003: [See end of file]
004: $Id: TestCapabilities.java,v 1.9 2008/01/02 12:05:31 andy_seaborne Exp $
005: */
006:
007: package com.hp.hpl.jena.graph.test;
008:
009: import com.hp.hpl.jena.graph.*;
010: import junit.framework.*;
011:
012: /**
013: Test graph capabilities.
014: @author kers
015: */
016: public class TestCapabilities extends GraphTestBase {
017: protected final class AllFalse implements Capabilities {
018: public boolean sizeAccurate() {
019: return false;
020: }
021:
022: public boolean addAllowed() {
023: return false;
024: }
025:
026: public boolean addAllowed(boolean everyTriple) {
027: return false;
028: }
029:
030: public boolean deleteAllowed() {
031: return false;
032: }
033:
034: public boolean deleteAllowed(boolean everyTriple) {
035: return false;
036: }
037:
038: public boolean iteratorRemoveAllowed() {
039: return false;
040: }
041:
042: public boolean canBeEmpty() {
043: return false;
044: }
045:
046: public boolean findContractSafe() {
047: return false;
048: }
049:
050: public boolean handlesLiteralTyping() {
051: return false;
052: }
053: }
054:
055: public TestCapabilities(String name) {
056: super (name);
057: }
058:
059: public static TestSuite suite() {
060: return new TestSuite(TestCapabilities.class);
061: }
062:
063: /**
064: pending on use-cases.
065: */
066: public void testTheyreThere() {
067: Graph g = Factory.createDefaultGraph();
068: g.getCapabilities();
069: }
070:
071: public void testCanConstruct() {
072: Capabilities c = new AllFalse();
073: }
074:
075: public void testCanAccess() {
076: Capabilities c = new AllFalse();
077: boolean b = false;
078: b = c.addAllowed();
079: b = c.addAllowed(true);
080: b = c.canBeEmpty();
081: b = c.deleteAllowed();
082: b = c.deleteAllowed(false);
083: b = c.sizeAccurate();
084: b = c.iteratorRemoveAllowed();
085: b = c.findContractSafe();
086: b = c.handlesLiteralTyping();
087: }
088: }
089:
090: /*
091: (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
092: All rights reserved.
093:
094: Redistribution and use in source and binary forms, with or without
095: modification, are permitted provided that the following conditions
096: are met:
097:
098: 1. Redistributions of source code must retain the above copyright
099: notice, this list of conditions and the following disclaimer.
100:
101: 2. Redistributions in binary form must reproduce the above copyright
102: notice, this list of conditions and the following disclaimer in the
103: documentation and/or other materials provided with the distribution.
104:
105: 3. The name of the author may not be used to endorse or promote products
106: derived from this software without specific prior written permission.
107:
108: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
109: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
110: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
111: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
112: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
113: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
114: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
115: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
116: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
117: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
118: */
|