1 29 30 package com.hp.hpl.jena.mem.test; 31 32 import com.hp.hpl.jena.vocabulary.*; 33 import com.hp.hpl.jena.mem.ModelMem; 34 import com.hp.hpl.jena.rdf.model.*; 35 36 41 public class TestCaseBugs 42 extends TestCaseBasic { 43 44 Model model = null; 45 46 public TestCaseBugs(String name) { 47 super(name); 48 } 49 50 public void setUp() { 51 model = new ModelMem(); 52 } 53 54 public void bug36() { 55 try { 56 Resource r = model.createResource(); 57 Object oc = RDFS.Class; 58 Object op = RDF.Property; 59 60 Statement s = model.createStatement(r, RDF.type, oc); 61 assertTrue(s.getObject() instanceof Resource); 62 63 s.changeObject(op); 64 assertTrue(s.getObject() instanceof Resource); 65 66 model.add(r, RDF.type, oc); 67 RDFNode n = model.listStatements() 68 .nextStatement() 69 .getObject(); 70 assertTrue(n instanceof Resource); 71 72 assertTrue(model.listSubjectsWithProperty(RDF.type, oc).hasNext()); 73 74 assertTrue(model.contains(r, RDF.type, oc)); 75 } catch (Exception e) { 76 System.out.println(e); 77 assertTrue(false); 78 } 79 } 80 } 81 | Popular Tags |