@Test public void testCalendarLiterals() { Calendar now = Calendar.getInstance(); Literal A = ModelFactory.createDefaultModel().createTypedLiteral(now); Literal B = ResourceFactory.createTypedLiteral(now); assertEquals(A, B); }
@Test public void testInfoStamp() { String versionString = "E3.14159", commentString = "gloopSmurfale"; String resourceString = "_x eye:assumed 'ABC'; _x eye:checked 'DEF'; _x eye:version '%v'; _x eye:comment '%c'" .replaceAll("%v", versionString) .replaceAll("%c", commentString); InfoStamp i = new InfoStamp(resourceInModel(resourceString)); Calendar now = Calendar.getInstance(); Resource root = i.stamp(now); Model stamp = root.getModel(); Literal dateLiteral = ModelFactory.createDefaultModel().createTypedLiteral(now); String dateString = "'" + dateLiteral.getLexicalForm() + "'" + dateLiteral.getDatatypeURI(); String expectedFormat = "[eye:assumed 'ABC' & eye:checked 'DEF' & eye:dated <date>" + " & eye:comment '<comment>' & eye:version '<version>']"; String expectedString = expectedFormat .replaceAll("<date>", dateString) .replaceAll("<version>", versionString) .replaceAll("<comment>", commentString); Model expected = model(expectedString); assertIsoModels(expected, stamp); }