Search in sources :

Example 6 with DateTimeStruct

use of org.apache.jena.sparql.util.DateTimeStruct in project jena by apache.

the class TestDateTimeParsing method testGDay_2.

@Test
public void testGDay_2() {
    DateTimeStruct dt = DateTimeStruct.parseGDay("---31Z");
    check(dt, null, null, null, "31", "Z");
}
Also used : DateTimeStruct(org.apache.jena.sparql.util.DateTimeStruct) Test(org.junit.Test)

Example 7 with DateTimeStruct

use of org.apache.jena.sparql.util.DateTimeStruct in project jena by apache.

the class TestDateTimeParsing method testDT_11.

@Test
public void testDT_11() {
    DateTimeStruct dt = DateTimeStruct.parseDateTime("2007-08-31T12:34:56Z");
    check(dt, null, "2007", "08", "31", "12", "34", "56", "Z");
}
Also used : DateTimeStruct(org.apache.jena.sparql.util.DateTimeStruct) Test(org.junit.Test)

Example 8 with DateTimeStruct

use of org.apache.jena.sparql.util.DateTimeStruct in project jena by apache.

the class TestDateTimeParsing method testGMonth_1.

@Test
public void testGMonth_1() {
    DateTimeStruct dt = DateTimeStruct.parseGMonth("--10");
    check(dt, null, null, "10", null, null);
}
Also used : DateTimeStruct(org.apache.jena.sparql.util.DateTimeStruct) Test(org.junit.Test)

Example 9 with DateTimeStruct

use of org.apache.jena.sparql.util.DateTimeStruct in project jena by apache.

the class TestDateTimeParsing method testGMonthDay_3.

@Test
public void testGMonthDay_3() {
    DateTimeStruct dt = DateTimeStruct.parseGMonthDay("--10-31-08:00");
    check(dt, null, null, "10", "31", "-08:00");
}
Also used : DateTimeStruct(org.apache.jena.sparql.util.DateTimeStruct) Test(org.junit.Test)

Example 10 with DateTimeStruct

use of org.apache.jena.sparql.util.DateTimeStruct in project jena by apache.

the class TestDateTimeParsing method dateTimeBad.

private static void dateTimeBad(String str) {
    try {
        DateTimeStruct dt = DateTimeStruct.parseDateTime(str);
        fail("No exception; " + str);
    } catch (org.apache.jena.sparql.util.DateTimeStruct.DateTimeParseException ex) {
    }
}
Also used : DateTimeStruct(org.apache.jena.sparql.util.DateTimeStruct)

Aggregations

DateTimeStruct (org.apache.jena.sparql.util.DateTimeStruct)28 Test (org.junit.Test)19 ARQInternalErrorException (org.apache.jena.sparql.ARQInternalErrorException)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)1 Node (org.apache.jena.graph.Node)1