Skip to content

Commit

Permalink
add assertions to test that filename setting works. (couldn't think o…
Browse files Browse the repository at this point in the history
…f any validation to perform, since it's just a string that could theoretically be whatever)
  • Loading branch information
jmartin-sul committed May 31, 2017
1 parent dbc1753 commit 6fbdb3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/edu/stanford/dlss/was/TestWasapiDownloaderSettings.java
Expand Up @@ -45,7 +45,7 @@ public void getHelpAndSettingsMessage_containsUsageAndSettingsInfo() throws Sett
//TODO: if settings validation flags possibly nonsensical/redundant combos like jobId
// and jobIdLowerBound, this test might have to be broken up a bit.
String[] args = { "-h", "--collectionId", "123", "--jobId=456", "--jobIdLowerBound=400",
"--crawlStartAfter", "2014-03-14", "--crawlStartBefore=2017-03-14" };
"--crawlStartAfter", "2014-03-14", "--crawlStartBefore=2017-03-14", "--filename=filename.warc.gz" };
WasapiDownloaderSettings settings = new WasapiDownloaderSettings(WasapiDownloader.SETTINGS_FILE_LOCATION, args);

String helpAndSettingsMsg = settings.getHelpAndSettingsMessage();
Expand All @@ -62,6 +62,7 @@ public void getHelpAndSettingsMessage_containsUsageAndSettingsInfo() throws Sett
assertThat("helpAndSettingsMsg lists help flag", helpAndSettingsMsg, containsString("-h,--help"));
assertThat("helpAndSettingsMsg lists jobId arg", helpAndSettingsMsg, containsString("--jobId <arg>"));
assertThat("helpAndSettingsMsg lists jobIdLowerBound arg", helpAndSettingsMsg, containsString("--jobIdLowerBound <arg>"));
assertThat("helpAndSettingsMsg lists filename arg", helpAndSettingsMsg, containsString("--filename <arg>"));

assertThat("helpAndSettingsMsg hides password value", helpAndSettingsMsg, containsString("password : [password hidden]"));
assertThat("helpAndSettingsMsg lists crawlStartAfter value", helpAndSettingsMsg, containsString("crawlStartAfter : 2014-03-14"));
Expand All @@ -74,6 +75,7 @@ public void getHelpAndSettingsMessage_containsUsageAndSettingsInfo() throws Sett
assertThat("helpAndSettingsMsg lists authurl value", helpAndSettingsMsg, containsString("authurl : https://example.org/login"));
assertThat("helpAndSettingsMsg lists username value", helpAndSettingsMsg, containsString("username : user"));
assertThat("helpAndSettingsMsg lists accountId value", helpAndSettingsMsg, containsString("accountId : 1"));
assertThat("helpAndSettingsMsg lists filename value", helpAndSettingsMsg, containsString("filename : filename.warc.gz"));
}

@Test
Expand Down

0 comments on commit 6fbdb3c

Please sign in to comment.