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/12/06 13:13:10 UTC
[commons-vfs] branch master updated: Add missing test case.
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 3d68180 Add missing test case.
3d68180 is described below
commit 3d681806ab1ef0276bf71b2ac235738e13011a6d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Dec 6 08:13:07 2021 -0500
Add missing test case.
---
.../commons/vfs2/util/RandomAccessModeTest.java | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/util/RandomAccessModeTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/util/RandomAccessModeTest.java
new file mode 100644
index 0000000..ff5fbc7
--- /dev/null
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/util/RandomAccessModeTest.java
@@ -0,0 +1,35 @@
+package org.apache.commons.vfs2.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+/**
+ * Tests {@link RandomAccessMode}.
+ */
+public class RandomAccessModeTest {
+
+ @Test
+ public void test_getModeStringRead() {
+ assertEquals("r", RandomAccessMode.READ.getModeString());
+ }
+
+ @Test
+ public void test_getModeStringReadWrite() {
+ assertEquals("rw", RandomAccessMode.READWRITE.getModeString());
+ }
+
+ @Test
+ public void test_testRead() {
+ assertTrue(RandomAccessMode.READ.requestRead());
+ assertFalse(RandomAccessMode.READ.requestWrite());
+ }
+
+ @Test
+ public void test_testReadWrite() {
+ assertTrue(RandomAccessMode.READWRITE.requestRead());
+ assertTrue(RandomAccessMode.READWRITE.requestWrite());
+ }
+}