@Test
    public void requireThatTooLongPreNamespaceSpecificThrowsWhileParsing() {
        StringBuilder builder = new StringBuilder("id:");
        for (int i = 0; i < 0xff00; i++) {
            builder.append('n');
        }
        builder.append(":type::namespacespecificpart_01");
        try {
            IdString.createIdString(builder.toString());
            fail();
        } catch (IllegalArgumentException e) {
            assertEquals("Document id prior to the namespace specific part, 65289, is longer than 65280", e.getMessage().substring(0, 77));
        }
    }
Created with IntelliJ IDEA.
User: magnarn
Date: 10/16/12
Time: 9:10 AM
document/src/test/java/com/yahoo/document/IdIdStringTest.java