예제 #1
0
 @Test
 public void testTokenizeOnWindows() {
   String[] paths =
       new String[] {
         "C:\\foo\\single",
         "C:\\\\foo\\\\double",
         "C:\\foo\\\\mixed",
         "D:\\foo\\onD",
         "D:\\foo\\trail\\",
         "D:\\foo\\doubleTrail\\\\",
         "D:\\\\\\\\foo\\eight"
       };
   for (String path : paths) {
     String[] tokens = VirtualFileSystem.tokenize(path, '\\');
     Assert.assertEquals(Arrays.toString(tokens), 3, tokens.length);
     for (String token : tokens) {
       Assert.assertTrue(token, !token.contains("\\"));
     }
   }
 }
예제 #2
0
 @Test
 public void testNoAccessByDefault() {
   Assert.assertEquals(0, VirtualFileSystem.getInstance().getAccessedFiles().size());
 }
예제 #3
0
 @After
 public void tearDown() {
   VirtualFileSystem.getInstance().resetSingleton();
 }
예제 #4
0
 @Before
 public void init() {
   MockFramework.enable();
   VirtualFileSystem.getInstance().resetSingleton();
   VirtualFileSystem.getInstance().init();
 }