/** * Unit test verifies that a new {@link BigdataValue} instance is returned * when {@link BigdataValueFactory#asValue(org.openrdf.model.Value)} is * invoked with a {@link BigdataValue} whose {@link IV} is a "dummmy" IV * (aka a "mock" IV). A "dummy" or "mock" {@link IV} is an {@link IV} which * stands in for a "null" and is used to hold the place for an RDF * {@link Value} which is not known to the database. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/348 */ public void test_asValue_mockIV() { final BigdataValue v1 = vf.createURI("http://www.bigdata.com"); final BigdataValue v2 = vf.asValue(v1); v1.setIV(TermId.mockIV(VTE.URI)); final BigdataValue v3 = vf.asValue(v1); // same BigdataValue assertTrue(v2 == v1); // distinct BigdataValue assertTrue(v3 != v1); }
/** * Unit test verifies that a new {@link BigdataValue} instance is returned * when {@link BigdataValueFactory#asValue(org.openrdf.model.Value)} is * invoked with a {@link BigdataValue} whose {@link IV} is a "dummmy" IV * (aka a "mock" IV). A "dummy" or "mock" {@link IV} is an {@link IV} which * stands in for a "null" and is used to hold the place for an RDF * {@link Value} which is not known to the database. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/348 */ public void test_asValue_mockIV() { final BigdataValue v1 = vf.createURI("http://www.bigdata.com"); final BigdataValue v2 = vf.asValue(v1); v1.setIV(TermId.mockIV(VTE.URI)); final BigdataValue v3 = vf.asValue(v1); // same BigdataValue assertTrue(v2 == v1); // distinct BigdataValue assertTrue(v3 != v1); }
/** * Unit test verifies that the created URIs are canonical for well-known * XSD URIs. */ public void test_create_xsdInt_canonical() { final BigdataURI v1 = vf.createURI(XSD.INT.stringValue()); final BigdataURI v2 = vf.createURI(XSD.INT.stringValue()); // verify the URI. assertEquals(v1.stringValue(),XSD.INT.stringValue()); // verify the same reference (canonical). assertTrue(v1 == v2); }
/** * Unit test verifies that the created URIs are canonical for well-known * XSD URIs. */ public void test_create_xsdInt_canonical() { final BigdataURI v1 = vf.createURI(XSD.INT.stringValue()); final BigdataURI v2 = vf.createURI(XSD.INT.stringValue()); // verify the URI. assertEquals(v1.stringValue(),XSD.INT.stringValue()); // verify the same reference (canonical). assertTrue(v1 == v2); }
/** * Unit test verifies that a new {@link BigdataValue} instance is returned * when {@link BigdataValueFactory#asValue(org.openrdf.model.Value)} is * invoked with a {@link BigdataValue} whose {@link IV} is a "dummmy" IV * (aka a "mock" IV). A "dummy" or "mock" {@link IV} is an {@link IV} which * stands in for a "null" and is used to hold the place for an RDF * {@link Value} which is not known to the database. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/348 */ public void test_asValue_mockIV() { final BigdataValue v1 = vf.createURI("http://www.bigdata.com"); final BigdataValue v2 = vf.asValue(v1); v1.setIV(TermId.mockIV(VTE.URI)); final BigdataValue v3 = vf.asValue(v1); // same BigdataValue assertTrue(v2 == v1); // distinct BigdataValue assertTrue(v3 != v1); }
/** * Unit test verifies that the created URIs are canonical for well-known * XSD URIs. */ public void test_create_xsdInt_canonical() { final BigdataURI v1 = vf.createURI(XSD.INT.stringValue()); final BigdataURI v2 = vf.createURI(XSD.INT.stringValue()); // verify the URI. assertEquals(v1.stringValue(),XSD.INT.stringValue()); // verify the same reference (canonical). assertTrue(v1 == v2); }