@Test public void literalSameValueDifferentType() throws Exception { final Literal l1 = new Literal("1", JsonLdConsts.XSD_INTEGER, null); final Literal l2 = new Literal("1", JsonLdConsts.XSD_STRING, null); assertNotEquals(l1, l2); assertNotEquals(0, l1.compareTo(l2)); }
@Test public void literalSameValueLangNull() throws Exception { final Literal l1 = new Literal("Same", JsonLdConsts.RDF_LANGSTRING, "en"); final Literal l2 = new Literal("Same", JsonLdConsts.RDF_LANGSTRING, null); assertNotEquals(l1, l2); assertNotEquals(0, l1.compareTo(l2)); assertNotEquals(0, l2.compareTo(l1)); }
@Test public void literalDifferentValueSameLang() throws Exception { final Literal l1 = new Literal("Same", JsonLdConsts.RDF_LANGSTRING, "en"); final Literal l2 = new Literal("Different", JsonLdConsts.RDF_LANGSTRING, "en"); assertNotEquals(l1, l2); assertNotEquals(0, l1.compareTo(l2)); }
@Test public void literalSameValue() throws Exception { final Literal l1 = new Literal("Same", null, null); final Literal l2 = new Literal("Same", null, null); assertEquals(l1, l2); assertEquals(0, l1.compareTo(l2)); }
@Test public void literalSameValueSameTypeNull() throws Exception { final Literal l1 = new Literal("1", JsonLdConsts.XSD_STRING, null); final Literal l2 = new Literal("1", null, null); assertEquals(l1, l2); assertEquals(0, l1.compareTo(l2)); }
@Test public void literalSameValueSameType() throws Exception { final Literal l1 = new Literal("1", JsonLdConsts.XSD_INTEGER, null); final Literal l2 = new Literal("1", JsonLdConsts.XSD_INTEGER, null); assertEquals(l1, l2); assertEquals(0, l1.compareTo(l2)); }
@Test public void literalSameValueDifferentLang() throws Exception { final Literal l1 = new Literal("Same", JsonLdConsts.RDF_LANGSTRING, "en"); final Literal l2 = new Literal("Same", JsonLdConsts.RDF_LANGSTRING, "no"); assertNotEquals(l1, l2); assertNotEquals(0, l1.compareTo(l2)); }
@Test public void literalDifferentValue() throws Exception { final Literal l1 = new Literal("Same", null, null); final Literal l2 = new Literal("Different", null, null); assertNotEquals(l1, l2); assertNotEquals(0, l1.compareTo(l2)); }
@Test public void literalSameValueSameLang() throws Exception { final Literal l1 = new Literal("Same", JsonLdConsts.RDF_LANGSTRING, "en"); final Literal l2 = new Literal("Same", JsonLdConsts.RDF_LANGSTRING, "en"); assertEquals(l1, l2); assertEquals(0, l1.compareTo(l2)); }