// TODO improve the error message - the pointer should be at the
// property name, not value
public void testWrongName() {
        try {
            construct("--- !!org.yaml.snakeyaml.constructor.TestBean\nwrongName: No one\nage: 24\nborn: 1982-05-03\n");
            fail("IntrospectionException expected.");
        } catch (Exception e) {
            // TODO improve the error message - the pointer should be at the
            // property name, not value
            assertEquals(
                    "Cannot create property=wrongName for JavaBean=#<org.jvyaml.TestBean name=\"null\" age=0 born=\"null\">\n" +
                            " in 'string', line 1, column 5:\n" +
                            "    --- !!org.yaml.snakeyaml.constructor ... \n" +
                            "        ^\n" +
                            "Unable to find property 'wrongName' on class: org.yaml.snakeyaml.constructor.TestBean\n" +
                            " in 'string', line 2, column 12:\n" +
                            "    wrongName: No one\n" +
                            "               ^\n",
                    e.getMessage());
        }
    }
fail("IntrospectionException expected.");
} catch (Exception e) {
// TODO improve the error message - the pointer should be at the
// property name, not value
assertEquals(
"Cannot create property=wrongName for JavaBean=#<org.jvyaml.TestBean name=\"null\" age=0 born=\"null\">\n" +
public void testWrongName() {
try {
construct("--- !!org.yaml.snakeyaml.constructor.TestBean\nwrongName: No one\nage: 24\nborn: 1982-05-03\n");
fail("IntrospectionException expected.");
} catch (Exception e) {
// TODO improve the error message - the pointer should be at the
// property name, not value
assertEquals(
"Cannot create property=wrongName for JavaBean=#<org.jvyaml.TestBean name=\"null\" age=0 born=\"null\">\n" +
" in 'string', line 1, column 5:\n" +
" --- !!org.yaml.snakeyaml.constructor ... \n" +
" ^\n" +
"Unable to find property 'wrongName' on class: org.yaml.snakeyaml.constructor.TestBean\n" +
" in 'string', line 2, column 12:\n" +
" wrongName: No one\n" +
" ^\n",
e.getMessage());
public void testWrongName() {
try {
construct("--- !!org.yaml.snakeyaml.constructor.TestBean\nwrongName: No one\nage: 24\nborn: 1982-05-03\n");
fail("IntrospectionException expected.");
} catch (Exception e) {
// TODO improve the error message - the pointer should be at the
// property name, not value
assertEquals(
"Cannot create property=wrongName for JavaBean=#<org.jvyaml.TestBean name=\"null\" age=0 born=\"null\">\n" +
" in 'string', line 1, column 5:\n" +
" --- !!org.yaml.snakeyaml.constructor ... \n" +
" ^\n" +
"Unable to find property 'wrongName' on class: org.yaml.snakeyaml.constructor.TestBean\n" +
" in 'string', line 2, column 12:\n" +
" wrongName: No one\n" +
" ^\n",
e.getMessage());
}
}