|
From: Bryan T. <tho...@us...> - 2007-08-28 16:14:09
|
Update of /cvsroot/cweb/rdf-generic/src/test/org/CognitiveWeb/sesame/sailimpl/generic In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17805/src/test/org/CognitiveWeb/sesame/sailimpl/generic Modified Files: TestUnicodeClean.java Log Message: added test of delete. Index: TestUnicodeClean.java =================================================================== RCS file: /cvsroot/cweb/rdf-generic/src/test/org/CognitiveWeb/sesame/sailimpl/generic/TestUnicodeClean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestUnicodeClean.java 27 Aug 2007 19:39:31 -0000 1.1 --- TestUnicodeClean.java 28 Aug 2007 14:59:09 -0000 1.2 *************** *** 135,180 **** new LiteralImpl(unicode1))); /* ! * Verify literals can be returned from the graph. */ ! StatementIterator itr = r.getStatements(null, null, null); ! try { ! ! int stmt1 = 0, stmt2 = 0, stmt3 = 0; ! while (itr.hasNext()) { ! Statement stmt = itr.next(); ! Literal lit = (Literal) stmt.getObject(); ! if(lit.getLabel().equals("Gozo")) stmt1++; ! if(lit.getLabel().equals("gozo")) stmt2++; ! if(lit.getLabel().equals(unicode1)) stmt3++; ! } ! ! // verify ASCII literal is returned. ! assertEquals("stmt1",1,stmt1); ! ! if(stmt2==0) { ! /* ! * The index does not differentiate between "Gozo" and "gozo" ! * (it is not case sensitive). ! */ ! log.warn("Index does not differentiate case of strings."); } ! ! // verify can return Unicode literal. ! assertEquals("stmt3",1,stmt3); ! ! } finally { ! ! itr.close(); ! } --- 135,252 ---- new LiteralImpl(unicode1))); + { + + /* + * Verify literals can be returned from the graph. + */ + StatementIterator itr = r.getStatements(null, null, null); + + try { + + int stmt1 = 0, stmt2 = 0, stmt3 = 0; + + while (itr.hasNext()) { + + Statement stmt = itr.next(); + + Literal lit = (Literal) stmt.getObject(); + + if (lit.getLabel().equals("Gozo")) + stmt1++; + if (lit.getLabel().equals("gozo")) + stmt2++; + if (lit.getLabel().equals(unicode1)) + stmt3++; + + } + + // verify ASCII literal is returned. + assertEquals("stmt1", 1, stmt1); + + if (stmt2 == 0) { + + /* + * The index does not differentiate between "Gozo" and + * "gozo" (it is not case sensitive). + */ + + log.warn("Index does not differentiate case of strings."); + + } + + // verify can return Unicode literal. + assertEquals("stmt3", 1, stmt3); + + } finally { + + itr.close(); + + } + + } + /* ! * Attempt to remove the unicode label. */ ! { ! ! r.startTransaction(); ! ! assertEquals("#removed", 1, r.removeStatements(null, ! URIImpl.RDFS_LABEL, new LiteralImpl(unicode1))); ! ! r.commitTransaction(); ! ! } ! /* ! * Verify that the unicode label is gone. ! */ ! { ! /* ! * Verify literals can be returned from the graph. ! */ ! StatementIterator itr = r.getStatements(null, null, null); ! ! try { ! int stmt1 = 0, stmt2 = 0, stmt3 = 0; ! ! while (itr.hasNext()) { ! Statement stmt = itr.next(); ! ! Literal lit = (Literal) stmt.getObject(); ! ! if(lit.getLabel().equals("Gozo")) stmt1++; ! if(lit.getLabel().equals("gozo")) stmt2++; ! if(lit.getLabel().equals(unicode1)) stmt3++; ! ! } ! // verify ASCII literal is returned. ! assertEquals("stmt1",1,stmt1); ! if(stmt2==0) { ! ! /* ! * The index does not differentiate between "Gozo" and "gozo" ! * (it is not case sensitive). ! */ ! ! log.warn("Index does not differentiate case of strings."); ! ! } ! // verify will no longer return Unicode literal. ! assertEquals("stmt3",0,stmt3); ! } finally { ! ! itr.close(); } ! } |