/** * Unit test for {@link ValueFactory#createLiteral(String, URI)} when the * datatype URI is <code>null</code>. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/226 */ public void test_create_literal_datatypeIsNull() { final BigdataLiteral l1 = vf.createLiteral("12", (URI) null); assertEquals(null, l1.getDatatype()); assertEquals(12, l1.intValue()); }
public void test_create_literal_xsdInt() { final BigdataLiteral l1 = vf.createLiteral("12", XSD.INT); assertEquals(XSD.INT, l1.getDatatype()); assertEquals(12, l1.intValue()); }
public void test_create_literal_xsdInt() { final BigdataLiteral l1 = vf.createLiteral("12", XSD.INT); assertEquals(XSD.INT, l1.getDatatype()); assertEquals(12, l1.intValue()); }
/** * Unit test for {@link ValueFactory#createLiteral(String, URI)} when the * datatype URI is <code>null</code>. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/226 */ public void test_create_literal_datatypeIsNull() { final BigdataLiteral l1 = vf.createLiteral("12", (URI) null); assertEquals(null, l1.getDatatype()); assertEquals(12, l1.intValue()); }
/** * Unit test for {@link ValueFactory#createLiteral(XMLGregorianCalendar)}. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/117 */ public void test_gregorian() throws DatatypeConfigurationException { final XMLGregorianCalendar cal = DatatypeFactory.newInstance().newXMLGregorianCalendarDate( 2010,// year 1, // month, 13, // day, 0// timezone ); assertEquals(// "http://www.w3.org/2001/XMLSchema#date",// vf.createLiteral(cal).getDatatype().stringValue()// ); }
/** * Unit test for {@link ValueFactory#createLiteral(XMLGregorianCalendar)}. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/117 */ public void test_gregorian() throws DatatypeConfigurationException { final XMLGregorianCalendar cal = DatatypeFactory.newInstance().newXMLGregorianCalendarDate( 2010,// year 1, // month, 13, // day, 0// timezone ); assertEquals(// "http://www.w3.org/2001/XMLSchema#date",// vf.createLiteral(cal).getDatatype().stringValue()// ); }
public void test_create_literal_xsdInt() { final BigdataLiteral l1 = vf.createLiteral("12", XSD.INT); assertEquals(XSD.INT, l1.getDatatype()); assertEquals(12, l1.intValue()); }
/** * Unit test for {@link ValueFactory#createLiteral(String, URI)} when the * datatype URI is <code>null</code>. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/226 */ public void test_create_literal_datatypeIsNull() { final BigdataLiteral l1 = vf.createLiteral("12", (URI) null); assertEquals(null, l1.getDatatype()); assertEquals(12, l1.intValue()); }
/** * 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 for {@link ValueFactory#createLiteral(XMLGregorianCalendar)}. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/117 */ public void test_gregorian() throws DatatypeConfigurationException { final XMLGregorianCalendar cal = DatatypeFactory.newInstance().newXMLGregorianCalendarDate( 2010,// year 1, // month, 13, // day, 0// timezone ); assertEquals(// "http://www.w3.org/2001/XMLSchema#date",// vf.createLiteral(cal).getDatatype().stringValue()// ); }
/** * 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); }