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

Issue #211: Conveniently skip validation #212

Merged
merged 1 commit into from
Nov 11, 2022
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 @@ -112,16 +112,43 @@ public void afterTestExecution(ExtensionContext context) throws Exception {
}
}

/**
* Skip validation for the current test run only.
*
* @return the object for chaining.
*/
public ManagedCas skipValidation() {
validator = null;
validator = new Validator.Builder().withoutAutoDetectedChecks().build();
return this;
}

/**
* Skip validation by default. If validation is enabled for a particular run using
* {@link #withValidator(Validator)} it is reset to a no-op validator again after the test is
* complete.
*
* @return the object for chaining.
*/
public ManagedCas withoutDefaultValidator() {
this.defaultValidator = new Validator.Builder().withoutAutoDetectedChecks().build();
return this;
}

/**
* Set a default validator for the all test runs.
*
* @return the object for chaining.
*/
public ManagedCas withDefaultValidator(Validator aValidator) {
this.defaultValidator = aValidator;
return this;
}

/**
* Set a validator for the current test run only.
*
* @return the object for chaining.
*/
public ManagedCas withValidator(Validator aValidator) {
this.validator = aValidator;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,43 @@ public void afterTestExecution(ExtensionContext context) throws Exception {
}
}

/**
* Skip validation for the current test run only.
*
* @return the object for chaining.
*/
public ManagedJCas skipValidation() {
validator = null;
validator = new Validator.Builder().withoutAutoDetectedChecks().build();
return this;
}

/**
* Skip validation by default. If validation is enabled for a particular run using
* {@link #withValidator(Validator)} it is reset to a no-op validator again after the test is
* complete.
*
* @return the object for chaining.
*/
public ManagedJCas withoutDefaultValidator() {
this.defaultValidator = new Validator.Builder().withoutAutoDetectedChecks().build();
return this;
}

/**
* Set a default validator for the all test runs.
*
* @return the object for chaining.
*/
public ManagedJCas withDefaultValidator(Validator aValidator) {
this.defaultValidator = aValidator;
return this;
}

/**
* Set a validator for the current test run only.
*
* @return the object for chaining.
*/
public ManagedJCas withValidator(Validator aValidator) {
this.validator = aValidator;
return this;
Expand Down