1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs2.provider.http5;
18
19 import static org.junit.jupiter.api.Assertions.assertEquals;
20
21 import org.apache.commons.vfs2.FileObject;
22 import org.apache.commons.vfs2.FileSystemException;
23 import org.apache.commons.vfs2.FileSystemManager;
24 import org.apache.commons.vfs2.VFS;
25 import org.junit.jupiter.api.Test;
26
27
28
29
30 public class Http5FilesCacheTest {
31
32
33
34
35 @Test
36 public void testQueryStringUrls() throws FileSystemException {
37 final String noQueryStringUrl = "http5://commons.apache.org/vfs";
38 final String queryStringUrl = "http5://commons.apache.org/vfs?query=string";
39 final String queryStringUrl2 = "http5://commons.apache.org/vfs?query=string&more=stuff";
40
41 final FileSystemManager fileSystemManager = VFS.getManager();
42
43 final FileObject noQueryFile = fileSystemManager.resolveFile(noQueryStringUrl);
44 assertEquals(noQueryStringUrl, noQueryFile.getURL().toExternalForm());
45
46 final FileObject queryFile = fileSystemManager.resolveFile(queryStringUrl);
47 assertEquals(queryStringUrl, queryFile.getURL().toExternalForm());
48
49 final FileObject queryFile2 = fileSystemManager.resolveFile(queryStringUrl2);
50 assertEquals(queryStringUrl2, queryFile2.getURL().toExternalForm());
51 }
52
53 }