1 6 7 package com.hp.hpl.jena.graph.test; 8 9 import com.hp.hpl.jena.graph.*; 10 import junit.framework.*; 11 12 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 name ) 62 { super( name ); } 63 64 public static TestSuite suite() 65 { return new TestSuite( TestCapabilities.class ); } 66 67 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 | Popular Tags |