You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/08/27 21:04:04 UTC
[commons-vfs] branch master updated: [VFS-444] corrected
ResourceFileProvider uri/path processing. #71.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git
The following commit(s) were added to refs/heads/master by this push:
new 8d1787f [VFS-444] corrected ResourceFileProvider uri/path processing. #71.
8d1787f is described below
commit 8d1787fabe3829c069aead27e910fc4ac91acc90
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Aug 27 17:03:58 2019 -0400
[VFS-444] corrected ResourceFileProvider uri/path processing. #71.
Test current behavior.
---
.../vfs2/provider/res/test/ResSchemeTestCase.java | 41 ++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/res/test/ResSchemeTestCase.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/res/test/ResSchemeTestCase.java
new file mode 100644
index 0000000..dfdf323
--- /dev/null
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/res/test/ResSchemeTestCase.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.vfs2.provider.res.test;
+
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.commons.vfs2.VFS;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ResSchemeTestCase {
+
+ @Test
+ public void test() throws FileSystemException {
+ Assert.assertTrue(VFS.getManager().resolveFile("res:test.properties").exists());
+ }
+
+ @Test(expected = FileSystemException.class)
+ public void testStartingSlash() throws FileSystemException {
+ Assert.assertTrue(VFS.getManager().resolveFile("res:/test.properties").exists());
+ }
+
+ @Test(expected = FileSystemException.class)
+ public void testStartingSlashSlash() throws FileSystemException {
+ Assert.assertTrue(VFS.getManager().resolveFile("res://test.properties").exists());
+ }
+}