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

ValidateVariants exception message improvement #6076

Merged
merged 4 commits into from
Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public static class FailsStrictValidation extends UserException {
public final ValidateVariants.ValidationType type;

public FailsStrictValidation(String f, ValidateVariants.ValidationType type, String message) {
super(String.format("Input %s fails strict validation: %s of type:", f, message, type));
super(String.format("Input %s fails strict validation of type %s: %s", f, type, message));
this.type = type;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public String baseTestStringWithoutReference(boolean sharedFile, String file, bo
}

private static String excludeValidationTypesButString(ValidateVariants.ValidationType type) {
if (type.equals(ALL)) {
if (type == null || type.equals(ALL)) {
return "";
}
final StringBuilder sbuilder = new StringBuilder();
Expand Down Expand Up @@ -153,13 +153,22 @@ public void testBadRefBase2() throws IOException {

@Test
public void testBadChrCount1() throws IOException {
IntegrationTestSpec spec = new IntegrationTestSpec(
final IntegrationTestSpec spec = new IntegrationTestSpec(
baseTestString(false, "validationExampleBad.vcf", false, CHR_COUNTS),
0,
UserException.FailsStrictValidation.class
);

spec.executeTest("test bad chr counts #1", this);

//test with no reference and no validations specified
final IntegrationTestSpec spec2 = new IntegrationTestSpec(
baseTestStringWithoutReference(false, "validationExampleBad.vcf", false, null),
0,
UserException.FailsStrictValidation.class
);

spec2.executeTest("test bad chr counts with no ref and no validations specified", this);
}

@Test
Expand Down