コード例 #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();
 }