Skip to content

67 move config validation to before lock file is acquired#95

Draft
Lagejohn wants to merge 1 commit into
mainfrom
67-mmtc-can-attempt-to-access-config-key-tablerunhistoryfilepath-before-the-config-is-validated-and-its-confirmed-that-the-key-exists
Draft

67 move config validation to before lock file is acquired#95
Lagejohn wants to merge 1 commit into
mainfrom
67-mmtc-can-attempt-to-access-config-key-tablerunhistoryfilepath-before-the-config-is-validated-and-its-confirmed-that-the-key-exists

Conversation

@Lagejohn
Copy link
Copy Markdown
Collaborator

Draft until E2E test suite can be completed

Manually tested by leaving XML config key table.runHistoryFile.URI (old version of table.runHistoryFile.path) in place and testing before and after.

Previous behavior:

Exception in thread "main" java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:209)
	at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:263)
	at java.base/java.nio.file.Path.of(Path.java:147)
	at java.base/java.nio.file.Paths.get(Paths.java:69)
	at edu.jhuapl.sd.sig.mmtc.cfg.MmtcConfig.getRunHistoryFilePath(MmtcConfig.java:737)
	at edu.jhuapl.sd.sig.mmtc.cfg.MmtcConfig.getLockFileLocation(MmtcConfig.java:995)
	at edu.jhuapl.sd.sig.mmtc.cfg.MmtcConfig.acquireLockFile(MmtcConfig.java:1001)
	at edu.jhuapl.sd.sig.mmtc.app.MmtcCli.main(MmtcCli.java:113)

New behavior:

Exception in thread "main" edu.jhuapl.sd.sig.mmtc.app.MmtcException: MMTC correlation initialization failed.
	at edu.jhuapl.sd.sig.mmtc.app.MmtcCli.main(MmtcCli.java:111)
Caused by: edu.jhuapl.sd.sig.mmtc.app.MmtcException: Failed to validate TimeCorrelationConfigProperties.xml, missing 1 required key(s): [table.runHistoryFile.path]
	at edu.jhuapl.sd.sig.mmtc.cfg.MmtcConfig.validate(MmtcConfig.java:1423)
	at edu.jhuapl.sd.sig.mmtc.app.MmtcCli.main(MmtcCli.java:108)
MMTC correlation initialization failed.

@sonarqubecloud
Copy link
Copy Markdown

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.

MMTC can attempt to access config key "table.runHistoryFile.path" before the config is validated and it's confirmed that the key exists

1 participant