459273 - Redundant license notices

+ Adding missing .hasFiles() check in download path.
This commit is contained in:
Joakim Erdfelt 2015-03-13 13:35:04 -07:00
parent afa926d45d
commit 4a41317501
2 changed files with 28 additions and 1 deletions

View File

@ -721,7 +721,7 @@ public class Main
{
for (Module module : args.getAllModules().resolveEnabled())
{
if (!module.acknowledgeLicense())
if (!module.hasFiles(baseHome) && !module.acknowledgeLicense())
{
StartLog.warn(EXITING_LICENSE_NOT_ACKNOWLEDGED);
System.exit(1);

View File

@ -58,6 +58,7 @@ public class LicenseTest
int len = cmds.size();
String args[] = cmds.toArray(new String[len]);
System.err.printf("%n## Exec: %s%n", Main.join(cmds,", "));
Main main = new Main();
StartArgs startArgs = main.processCommandLine(args);
main.start(startArgs);
@ -115,6 +116,32 @@ public class LicenseTest
assertThat("Contents",contents,containsString("--module=spdy"+System.lineSeparator()));
}
@Test
public void testAdd_HttpSpdy_Then_Deploy() throws Exception
{
File basePath = testdir.getEmptyDir();
List<String> cmds = getBaseCommandLine(basePath);
cmds.add("-Dorg.eclipse.jetty.start.ack.license.protonego-impl=true");
cmds.add("--add-to-start=http,spdy");
execMain(cmds);
String contents = assertFileExists(basePath, "start.ini");
assertThat("Contents",contents,containsString("--module=http"+System.lineSeparator()));
assertThat("Contents",contents,containsString("--module=spdy"+System.lineSeparator()));
// now request deploy (no license check should occur)
List<String> cmds2 = getBaseCommandLine(basePath);
cmds2.add("--add-to-start=deploy");
execMain(cmds2);
contents = assertFileExists(basePath, "start.ini");
assertThat("Contents",contents,containsString("--module=deploy"+System.lineSeparator()));
assertThat("Contents",contents,containsString("--module=spdy"+System.lineSeparator()));
}
@Test
public void testCreate_SPDY_Licensed() throws Exception
{