示例#1
0
  @Test
  public void testSpace() throws Exception {

    String name = " a file with     many spaces.jar";

    File file = new File(name);
    if (!file.exists()) {
      assertTrue(file.createNewFile());
      file.deleteOnExit();
    }

    String pathing = JarPathing.createJarPathing(file.getAbsolutePath());
    String back = JarPathing.extractCPFromPathingJar(pathing);

    assertTrue(back.contains(file.getName()));
  }
示例#2
0
  @Test
  public void testBase() {

    String first = "target" + File.separator + "classes";
    String second = "target" + File.separator + "test-classes";

    String classpath = first + File.pathSeparator + second;

    assertFalse(JarPathing.containsAPathingJar(classpath));

    String pathing = JarPathing.createJarPathing(classpath);
    assertTrue(JarPathing.isPathingJar(pathing));

    String back = JarPathing.extractCPFromPathingJar(pathing);

    assertTrue(back.contains(first));
    assertTrue(back.contains(second));
  }