This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new af6b4978d4 Added FilePrefixTest to test FilePrefix.fromPrefix (#3155)
af6b4978d4 is described below

commit af6b4978d42e7a1f9102a7ec9605be51c67bb595
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Fri Jan 6 15:09:15 2023 -0500

    Added FilePrefixTest to test FilePrefix.fromPrefix (#3155)
---
 .../apache/accumulo/core/file/FilePrefixTest.java  | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git 
a/core/src/test/java/org/apache/accumulo/core/file/FilePrefixTest.java 
b/core/src/test/java/org/apache/accumulo/core/file/FilePrefixTest.java
new file mode 100644
index 0000000000..7b84fa99cc
--- /dev/null
+++ b/core/src/test/java/org/apache/accumulo/core/file/FilePrefixTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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
+ *
+ *   https://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.accumulo.core.file;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import org.junit.jupiter.api.Test;
+
+public class FilePrefixTest {
+
+  @Test
+  public void testPrefixes() {
+    assertEquals(FilePrefix.BULK_IMPORT, FilePrefix.fromPrefix("I"));
+    assertEquals(FilePrefix.MINOR_COMPACTION, FilePrefix.fromPrefix("F"));
+    assertEquals(FilePrefix.MAJOR_COMPACTION, FilePrefix.fromPrefix("C"));
+    assertEquals(FilePrefix.MAJOR_COMPACTION_ALL_FILES, 
FilePrefix.fromPrefix("A"));
+    assertThrows(IllegalArgumentException.class, () -> {
+      FilePrefix.fromPrefix("B");
+    });
+  }
+
+}

Reply via email to