private void createClasspathJar(String classPath, final List<String> cmd) { if (this.processArgs.useClasspathJar()) { try { cmd.add("-classpath"); cmd.add( ManifestUtils.createClasspathJarFile(classPath).getAbsolutePath()); } catch (Exception e) { throw new RuntimeException("Unable to create jar to contain classpath", e); } } }
@Test public void shouldParseTheManifestsItCreates() throws IOException { File actual = ManifestUtils.createClasspathJarFile("/some/path/foo.jar:/some/path/"); assertThat(ManifestUtils.readClasspathManifest(actual)) .containsExactly(new File("/some/path/foo.jar"), new File("/some/path/")); }