# # Copyright (c) 2003 by Benja Fallenstein # # This file is part of Fenfire. # # Fenfire is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Fenfire is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General # Public License for more details. # # You should have received a copy of the GNU Lesser General # Public License along with Fenfire; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # import gzz from com.hp.hpl.mesa.rdf import jena def setUp(): global model,p,q,r,s model = jena.mem.ModelMem() p = model.createProperty("http://fenfire.org/2003/02/test#", "p") q = model.createProperty("http://fenfire.org/2003/02/test#", "q") r = model.createResource("http://fenfire.org/2003/02/test#r") s = model.createResource("http://fenfire.org/2003/02/test#s") def testSimple(): so = gzz.loom.SimpleOrder.subjOrder oo = gzz.loom.SimpleOrder.objOrder S = model.createStatement assert so.compare(S(r,p,s), S(r,p,s)) == 0 assert so.compare(S(r,p,r), S(r,p,s)) == 0 assert so.compare(S(r,p,s), S(s,p,s)) < 0 assert so.compare(S(s,p,s), S(r,p,s)) > 0 assert so.compare(S(r,q,s), S(r,p,s)) > 0 assert so.compare(S(r,q,s), S(s,p,s)) > 0 assert so.compare(S(r,p,s), S(r,q,s)) < 0 assert so.compare(S(s,p,s), S(r,q,s)) < 0 assert oo.compare(S(r,p,s), S(r,p,s)) == 0 assert oo.compare(S(r,p,s), S(s,p,s)) == 0 assert oo.compare(S(r,p,r), S(r,p,s)) < 0 assert oo.compare(S(r,p,s), S(r,p,r)) > 0 assert oo.compare(S(r,q,s), S(r,p,s)) > 0 assert oo.compare(S(r,q,r), S(r,p,s)) > 0 assert oo.compare(S(r,p,s), S(r,q,s)) < 0 assert oo.compare(S(r,p,s), S(r,q,r)) < 0