Fix classpath index so entries match those expected by the launcher

This reverts commit ad164269e9 and adds
some additional tests.

Fixes gh-24192
This commit is contained in:
Andy Wilkinson
2021-01-08 14:42:43 +00:00
parent 826d79be3e
commit 5ad4d627fd
13 changed files with 153 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -78,11 +78,11 @@ class ClassPathIndexFileTests {
ClassPathIndexFile indexFile = copyAndLoadTestIndexFile();
List<URL> urls = indexFile.getUrls();
List<File> expected = new ArrayList<>();
expected.add(new File(this.temp, "a.jar"));
expected.add(new File(this.temp, "b.jar"));
expected.add(new File(this.temp, "c.jar"));
expected.add(new File(this.temp, "d.jar"));
expected.add(new File(this.temp, "e.jar"));
expected.add(new File(this.temp, "BOOT-INF/layers/one/lib/a.jar"));
expected.add(new File(this.temp, "BOOT-INF/layers/one/lib/b.jar"));
expected.add(new File(this.temp, "BOOT-INF/layers/one/lib/c.jar"));
expected.add(new File(this.temp, "BOOT-INF/layers/two/lib/d.jar"));
expected.add(new File(this.temp, "BOOT-INF/layers/two/lib/e.jar"));
assertThat(urls).containsExactly(expected.stream().map(this::toUrl).toArray(URL[]::new));
}

View File

@@ -1,5 +1,5 @@
- "a.jar"
- "b.jar"
- "c.jar"
- "d.jar"
- "e.jar"
- "BOOT-INF/layers/one/lib/a.jar"
- "BOOT-INF/layers/one/lib/b.jar"
- "BOOT-INF/layers/one/lib/c.jar"
- "BOOT-INF/layers/two/lib/d.jar"
- "BOOT-INF/layers/two/lib/e.jar"