private static void assertError(String expressionString, DocumentOperation op, String expectedError) {
        try {
            evaluate(expressionString, op);
            fail("The evaluation of '" + expressionString + "' should throw an exception.");
        } catch (ParseException e) {
            fail("The expression '" + expressionString + "' should assertEquals ok.");
        } catch (RuntimeException e) {
            assertTrue(e.getMessage().length() >= expectedError.length());
            assertEquals(expectedError, e.getMessage().substring(0, expectedError.length()));
        }
    }
@author Simon Thoresen Hult
@author bratseth
document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java