1 7 8 package de.schlichtherle.io; 9 10 import junit.framework.*; 11 12 15 public class ArchiveFileSystemTest extends TestCase { 16 17 public ArchiveFileSystemTest(String testName) { 18 super(testName); 19 } 20 21 public static Test suite() { 22 TestSuite suite = new TestSuite(ArchiveFileSystemTest.class); 23 24 return suite; 25 } 26 27 30 public void testSplitEntryName() { 31 testSplitEntryName("a/b/", "a/", "b"); 32 testSplitEntryName("a/b", "a/", "b"); 33 testSplitEntryName("a/", "/", "a"); 34 testSplitEntryName("a", "/", "a"); 35 testSplitEntryName("/a/", "/", "a"); 36 testSplitEntryName("/a", "/", "a"); 37 testSplitEntryName("/", null, ""); 38 testSplitEntryName("", null, ""); 39 } 40 41 public void testSplitEntryName(final String path, final String parent, final String name) { 42 final String [] split = new String [2]; 43 ArchiveFileSystem.split(path, split); 44 assertEquals(split[0], parent); 45 assertEquals(split[1], name); 46 } 47 48 } 49 | Popular Tags |