@Test
    public void testThatVisitingReportsCorrectResult() throws ParseException {
        assertVisitWithValidNowWorks("music.expire > now()");
        assertVisitWithValidNowWorks("music.expire > now() and video.expire > now()");
        assertVisitWithValidNowWorks("music.expire > now() or video");
        assertVisitWithValidNowWorks("music.expire > now() or video.date < 300");
        assertVisitWithValidNowWorks("video.date < 300 or music.expire > now()");
        assertVisitWithValidNowWorks("video.date < 300 and music.expire > now()");
        assertVisitWithValidNowWorks("music.insertdate > now() - 300 and video.expire > now() - 3600");

        assertVisitWithoutNowWorks("test.structarrmap{$x}[$y].key == 15 AND test.structarrmap{$x}[$y].value == \"structval1\"");
        assertVisitWithoutNowWorks("music.artist.lowercase() == \"chang\"");

        assertVisitWithInvalidNowFails("music.expire > now() + 300", "Arithmetic operator '+' is not supported");
        assertVisitWithInvalidNowFails("music.expire < now()", "Comparison operator '<' is not supported");
        assertVisitWithInvalidNowFails("music.expire >= now()", "Comparison operator '>=' is not supported");
        assertVisitWithInvalidNowFails("now() > now()", "Left hand side of comparison must be a document field");
        assertVisitWithInvalidNowFails("music.name.hash() > now()", "Only attribute items are supported");
    }
@author Simon Thoresen Hult
@author bratseth
document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java