1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.vfs2.provider.res;
19
20 import java.net.URI;
21 import java.net.URISyntaxException;
22
23 import org.apache.commons.vfs2.FileSystemException;
24 import org.apache.commons.vfs2.VFS;
25 import org.junit.Assert;
26 import org.junit.Test;
27
28 public class ResSchemeTestCase {
29
30 @Test
31 public void test_resolveFile_String() throws FileSystemException {
32 Assert.assertTrue(VFS.getManager().resolveFile("res:test.properties").exists());
33 }
34
35 @Test
36 public void test_resolveFile_String_S() throws FileSystemException {
37 Assert.assertTrue(VFS.getManager().resolveFile("res:/test.properties").exists());
38 }
39
40 @Test
41 public void test_resolveFile_String_SS() throws FileSystemException {
42 Assert.assertTrue(VFS.getManager().resolveFile("res://test.properties").exists());
43 }
44
45 @Test
46 public void test_resolveFile_String_SSS() throws FileSystemException {
47 Assert.assertTrue(VFS.getManager().resolveFile("res://test.properties").exists());
48 }
49
50 @Test(expected = FileSystemException.class)
51 public void test_resolveFile_String_SSSnull() throws FileSystemException {
52
53 Assert.assertTrue(VFS.getManager().resolveFile("res:///").exists());
54 }
55
56 @Test
57 public void test_resolveFile_URI() throws FileSystemException, URISyntaxException {
58 Assert.assertTrue(VFS.getManager().resolveFile(new URI("res:test.properties")).exists());
59 }
60
61 @Test
62 public void test_resolveFile_URI_S() throws FileSystemException, URISyntaxException {
63 Assert.assertTrue(VFS.getManager().resolveFile(new URI("res:/test.properties")).exists());
64 }
65
66 @Test
67 public void test_resolveFile_URI_SS() throws FileSystemException, URISyntaxException {
68 Assert.assertTrue(VFS.getManager().resolveFile(new URI("res://test.properties")).exists());
69 }
70
71 @Test
72 public void test_resolveFile_URI_SSS() throws FileSystemException, URISyntaxException {
73 Assert.assertTrue(VFS.getManager().resolveFile(new URI("res://test.properties")).exists());
74 }
75
76 @Test
77 public void test_resolveURI_String() throws FileSystemException {
78 Assert.assertTrue(VFS.getManager().resolveURI("res:test.properties").isFile());
79 }
80
81 @Test
82 public void test_resolveURI_String_S() throws FileSystemException {
83 Assert.assertTrue(VFS.getManager().resolveURI("res:/test.properties").isFile());
84 }
85
86 @Test
87 public void test_resolveURI_String_SS() throws FileSystemException {
88 Assert.assertTrue(VFS.getManager().resolveURI("res://test.properties").isFile());
89 }
90
91 @Test
92 public void test_resolveURI_String_SSS() throws FileSystemException {
93 Assert.assertTrue(VFS.getManager().resolveURI("res:///test.properties").isFile());
94 }
95
96 @Test(expected = FileSystemException.class)
97 public void test_resolveURI_String_SSSnull() throws FileSystemException {
98
99 Assert.assertTrue(VFS.getManager().resolveURI("res:///").isFile());
100 }
101 }