@Test
    public void testInvalidLogic() throws ParseException {
        DocumentPut put = new DocumentPut(manager.getDocumentType("test"), new DocumentId("id:ns:test::"));
        DocumentUpdate upd = new DocumentUpdate(manager.getDocumentType("test"), new DocumentId("id:ns:test::"));

        assertEquals(Result.FALSE, evaluate("test.content", put)); // BROKEN
        assertEquals(Result.INVALID, evaluate("test.content", upd));

        assertEquals(Result.FALSE, evaluate("test.content = 1", put)); // BROKEN
        assertEquals(Result.INVALID, evaluate("test.content = 1", upd));

        assertEquals(Result.FALSE, evaluate("test.content = 1 and true", put)); // BROKEN
        assertEquals(Result.INVALID, evaluate("test.content = 1 and true", upd));

        assertEquals(Result.TRUE, evaluate("test.content = 1 or true", put));
        assertEquals(Result.TRUE, evaluate("test.content = 1 or true", upd));

        assertEquals(Result.FALSE, evaluate("test.content = 1 and false",  put));
        assertEquals(Result.FALSE, evaluate("test.content = 1 and false",  upd));

        assertEquals(Result.FALSE, evaluate("test.content = 1 or false", put)); // BROKEN
        assertEquals(Result.INVALID, evaluate("test.content = 1 or false", upd));

        assertEquals(Result.FALSE, evaluate("true and test.content = 1",  put)); // BROKEN
        assertEquals(Result.INVALID, evaluate("true and test.content = 1",  upd));

        assertEquals(Result.TRUE, evaluate("true or test.content = 1", put));
        assertEquals(Result.TRUE, evaluate("true or test.content = 1", upd));

        assertEquals(Result.FALSE, evaluate("false and test.content = 1",  put));
        assertEquals(Result.FALSE, evaluate("false and test.content = 1",  upd));

        assertEquals(Result.FALSE, evaluate("false or test.content = 1",  put)); // BROKEN
        assertEquals(Result.INVALID, evaluate("false or test.content = 1",  upd));
    }
@author Simon Thoresen Hult
@author bratseth
document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java