@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("\\")); } } }
@Test public void testNoAccessByDefault() { Assert.assertEquals(0, VirtualFileSystem.getInstance().getAccessedFiles().size()); }
@After public void tearDown() { VirtualFileSystem.getInstance().resetSingleton(); }
@Before public void init() { MockFramework.enable(); VirtualFileSystem.getInstance().resetSingleton(); VirtualFileSystem.getInstance().init(); }