1 10 package com.hp.hpl.jena.rdf.model.test; 11 12 import com.hp.hpl.jena.rdf.model.AnonId; 13 import com.hp.hpl.jena.shared.impl.JenaParameters; 14 15 import junit.framework.TestCase; 16 import junit.framework.TestSuite; 17 18 25 public class TestAnonID extends TestCase { 26 27 30 public TestAnonID( String name ) { 31 super( name ); 32 } 33 34 38 public static TestSuite suite() { 39 return new TestSuite( TestAnonID.class ); 40 } 41 42 45 public void testAnonID() { 46 boolean prior = JenaParameters.disableBNodeUIDGeneration; 47 try 48 { 49 JenaParameters.disableBNodeUIDGeneration = false; 50 doTestAnonID(); 51 JenaParameters.disableBNodeUIDGeneration = true; 52 doTestAnonID(); 53 } 54 finally 55 { JenaParameters.disableBNodeUIDGeneration = prior; } 56 } 57 58 61 public void doTestAnonID() { 62 AnonId id1 = new AnonId(); 63 AnonId id2 = new AnonId(); 64 AnonId id3 = new AnonId(); 65 AnonId id4 = new AnonId(); 66 67 assertNotSame(id1, id2); 68 assertNotSame(id1, id3); 69 assertNotSame(id1, id4); 70 assertNotSame(id2, id3); 71 assertNotSame(id2, id4); 72 } 73 74 } 75 76 77 106 | Popular Tags |