Add LoggerConfigData unit test (#2077)

This commit is contained in:
Dave Fisher 2024-11-13 13:13:55 -08:00 committed by GitHub
parent 6d32217e7f
commit 99f43db475
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -1092,7 +1092,7 @@ public class NBCLIOptions {
default:
throw new RuntimeException(
NBCLIOptions.LOG_HISTOGRAMS +
" options must be in either 'regex:filename:interval' or 'regex:filename' or 'filename' format"
" options must be in either 'filename:regex:interval' or 'filename:regex' or 'filename' format"
);
}
}

View File

@ -197,6 +197,16 @@ public class TestNBCLIOptions {
//
// }
@Test
public void testLoggerConfigData() {
NBCLIOptions opts = new NBCLIOptions(new String[]{ "--log-histograms", "console.log:.*:30000"}, NBCLIOptions.Mode.ParseAllOptions);
for (final NBCLIOptions.LoggerConfigData histoLogger : opts.getHistoLoggerConfigs()) {
assertThat(histoLogger.pattern).isEqualTo(".*");
assertThat(histoLogger.file).isEqualTo("console.log");
assertThat(histoLogger.millis).isEqualTo(30000L);
}
}
@Test
public void listWorkloads() {
NBCLIOptions opts = new NBCLIOptions(new String[]{ "--list-workloads"}, NBCLIOptions.Mode.ParseAllOptions);