Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of validation case errors #116

Merged
merged 5 commits into from
Dec 1, 2016

Conversation

cxcorp
Copy link
Contributor

@cxcorp cxcorp commented Nov 29, 2016

Currently, responses with validation error information cause an exception in SubmissionResultParser during deserialization (see #109). This happens because ValidationResultImpl stores them in a Map<File, List<ValidationError>>, but the Gson JSON parser cannot resolve JSON strings into File instances. This is fixed by 3809cf8.

Fixing this bug reveals another one: the validation errors cannot be deserialized into ValidationError instances because ValidationError is an abstract class. This is fixed by 7a94b20.

@nygrenh
Copy link
Member

nygrenh commented Nov 30, 2016

SubmissionResultParserTest

    @Test
    public void parsesTestResultsWithFailedCheckstyle() throws IOException {
        String json = TestUtils.readJsonFile(this.getClass(), "checkstyleFailed.json");
        SubmissionResult result = parser.parseFromJson(json);
        assertThat(result.getValidations().getValidationErrors().size() > 0);
    }

@nygrenh
Copy link
Member

nygrenh commented Dec 1, 2016

👍

@nygrenh nygrenh merged commit 4265d51 into testmycode:master Dec 1, 2016
@cxcorp cxcorp deleted the fix-validation-parsing branch December 1, 2016 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants