コード例 #1
0
 @Test
 public void testAddMultipleUrlsToClasspath() throws Exception {
   String separator = System.getProperty("path.separator");
   String paths = "/blah/blah" + separator + "C" + otherSeperator(separator) + "\\foo\\bar";
   FileUtil.addItemsToClasspath(paths);
   URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
   String classpath = classpathAsString(classLoader);
   assertSubString("/blah/blah", classpath);
   assertMatches("[C" + otherSeperator(separator) + "?foo?bar]", classpath);
 }
コード例 #2
0
 @Test
 public void testBuildPathThreeElements() throws Exception {
   String separator = System.getProperty("file.separator");
   assertEquals(
       "a" + separator + "b" + separator + "c", FileUtil.buildPath(new String[] {"a", "b", "c"}));
 }