KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > io > ArchiveFileSystemTest


1 /*
2  * ArchiveFileSystemTest.java
3  * JUnit based test
4  *
5  * Created on 12. Januar 2006, 16:01
6  */

7
8 package de.schlichtherle.io;
9
10 import junit.framework.*;
11
12 /**
13  * @author Christian Schlichtherle
14  */

15 public class ArchiveFileSystemTest extends TestCase {
16     
17     public ArchiveFileSystemTest(String JavaDoc 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     /**
28      * Test of split method, of class de.schlichtherle.io.ArchiveFileSystem.
29      */

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 JavaDoc path, final String JavaDoc parent, final String JavaDoc name) {
42         final String JavaDoc[] split = new String JavaDoc[2];
43         ArchiveFileSystem.split(path, split);
44         assertEquals(split[0], parent);
45         assertEquals(split[1], name);
46     }
47     
48 }
49
Popular Tags