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 tests by preventing validate internal error #826

Merged
merged 2 commits into from
Nov 6, 2024
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
13 changes: 2 additions & 11 deletions model-lddtool/src/test/java/cucumber/ValidateStepDefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ public class ValidateStepDefs {
private static final Logger LOG = LoggerFactory.getLogger(ValidateStepDefs.class);
private static final String DEFAULT_REPORT_FILENAME = "report_{testDir}.json";
private static final String DEFAULT_VALIDATE_ARGS =
"--disable-context-mismatch-warnings --report-style json --skip-content-validation --report-file {reportDir}/"
"--disable-context-mismatch-warnings --report-style json --skip-content-validation --skip-context-validation --report-file {reportDir}/"
+ DEFAULT_REPORT_FILENAME + " ";
private static final String VALIDATE_UPDATE_CONTEXT_ARG = "--update-context-products";
private static final String VALIDATE_CONFIG_FILE = "registered_context_products.json";
private static final String DEFAULT_CORE_ARGS = "-p";
private static final String DEFAULT_LDDTOOL_ARGS = "-lp";
Expand Down Expand Up @@ -77,8 +76,7 @@ void setUp() throws Exception {
FileUtils.forceMkdir(this.outputData); // Create directory if one does not already exist.
System.setProperty("resources.home", TestConstants.TEST_OUT_DIR);
this.launcher = new ValidateLauncher();
initContextProductsJson(TestConstants.TEST_OUT_DIR, this.launcher);
System.setProperty("resources.home", TestConstants.TEST_OUT_DIR);
System.setProperty("resources.home", TestConstants.RESOURCES_DIR + File.pathSeparator + VALIDATE_CONFIG_FILE);
this.refOutputValue = DEFAULT_REPORT_FILENAME;
this.reportDir = TestConstants.TEST_OUT_DIR;
this.resourceDir = TestConstants.TEST_DATA_DIR;
Expand All @@ -98,13 +96,6 @@ void tearDown() throws Exception {
CrossLabelFileAreaReferenceChecker.reset();
}

void initContextProductsJson(String basedir, ValidateLauncher launcher) throws Exception {
LOG.info("Initializing context products config file for Validate");
if (!(new File(basedir + File.separator + VALIDATE_CONFIG_FILE).isFile())) {
launcher.processMain(new String[] {VALIDATE_UPDATE_CONTEXT_ARG});
}
}

private int getMessageCountBasedOnProblemType(String problemEnum, JsonObject reportJson) {
// Given an output report, retrieve the 'count' field based on the problemEnum
// value.
Expand Down
Loading
Loading