@Test
    public void errorCodesMatchCppDefinitions() throws Exception {
        final NamedErrorCodes codes = new NamedErrorCodes();
        enumerateAllDocumentProtocolErrorCodes(codes);

        final String javaGoldenFile = TestFileUtil.getPath("HEAD-java-golden-error-codes.txt");
        final String javaGoldenData = codes.toSortedKeyValueString();
        TestFileUtil.writeToFile(javaGoldenFile, javaGoldenData);

        final String cppGoldenFile = TestFileUtil.getPath("HEAD-cpp-golden-error-codes.txt");
        final String cppGoldenData = new String(TestFileUtil.readFile(cppGoldenFile), Charset.forName("UTF-8"));
        assertEquals(javaGoldenData, cppGoldenData);
    }
Always meant to be run against HEAD.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/ErrorCodesTest.java