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 2021/11/29 18:32:22 UTC
[commons-vfs] branch master updated: Add missing test.
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 1f8dd7a Add missing test.
1f8dd7a is described below
commit 1f8dd7a9de73485fd3fbaa3d9af31f085eaa44fd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Nov 29 13:31:11 2021 -0500
Add missing test.
---
.../org/apache/commons/vfs2/FileSystemOptionsTest.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/FileSystemOptionsTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/FileSystemOptionsTest.java
index 47ed535..43bf82d 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/FileSystemOptionsTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/FileSystemOptionsTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.commons.vfs2;
+import static org.junit.Assert.assertEquals;
+
import org.junit.Assert;
import org.junit.Test;
@@ -51,6 +53,15 @@ public class FileSystemOptionsTest {
}
@Test
+ public void testClone() throws CloneNotSupportedException {
+ final FileSystemOptions fileSystemOptions = new FileSystemOptions();
+ assertEquals(fileSystemOptions.getClass(), fileSystemOptions.clone().getClass());
+ fileSystemOptions.setOption(FileSystem.class, "key", "value");
+ final FileSystemOptions clone = (FileSystemOptions) fileSystemOptions.clone();
+ assertEquals("value", clone.getOption(FileSystem.class, "key"));
+ }
+
+ @Test
public void testEqualsHashCodeAndCompareTo() {
final JUnitConfigBuilder builder = JUnitConfigBuilder.getInstance();
final FileSystemOptions expected = new FileSystemOptions();
@@ -63,13 +74,13 @@ public class FileSystemOptionsTest {
Assert.assertEquals(0, actual.compareTo(expected));
Assert.assertEquals(expected.hashCode(), actual.hashCode());
- builder.setNames(expected, new String[] { "A", "B", "C" });
+ builder.setNames(expected, new String[] {"A", "B", "C"});
Assert.assertNotEquals(expected, actual);
Assert.assertEquals(-1, actual.compareTo(expected));
Assert.assertNotEquals(expected.hashCode(), actual.hashCode());
- builder.setNames(actual, new String[] { "A", "B", "C" });
+ builder.setNames(actual, new String[] {"A", "B", "C"});
Assert.assertEquals(expected, actual);
Assert.assertEquals(0, actual.compareTo(expected));