1 6 7 package com.hp.hpl.jena.graph.test; 8 9 import com.hp.hpl.jena.graph.*; 10 import com.hp.hpl.jena.graph.impl.*; 11 import com.hp.hpl.jena.util.iterator.*; 12 13 import junit.framework.*; 14 15 18 public class TestGraphUtils extends GraphTestBase 19 { 20 public TestGraphUtils(String name) 21 { super(name); } 22 23 public static TestSuite suite() 24 { return new TestSuite( TestGraphUtils.class ); } 25 26 private static class Bool 27 { 28 boolean value; 29 Bool( boolean value ) { this.value = value; } 30 } 31 32 public void testFindAll() 33 { 34 final Bool foundAll = new Bool( false ); 35 Graph mock = new GraphBase() 36 { 37 public ExtendedIterator graphBaseFind( TripleMatch m ) 38 { 39 Triple t = m.asTriple(); 40 assertEquals( Node.ANY, t.getSubject() ); 41 assertEquals( Node.ANY, t.getPredicate() ); 42 assertEquals( Node.ANY, t.getObject() ); 43 foundAll.value = true; 44 return null; 45 } 46 }; 47 GraphUtil.findAll( mock ); 48 assertTrue( "find(ANY, ANY, ANY) called", foundAll.value ); 49 } 50 } 51 52 53 | Popular Tags |