1 // Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2 //  This source code is licensed under both the GPLv2 (found in the
3 //  COPYING file in the root directory) and Apache 2.0 License
4 //  (found in the LICENSE.Apache file in the root directory).
5 
6 package org.rocksdb;
7 
8 import org.junit.Test;
9 
10 import static org.assertj.core.api.Assertions.assertThat;
11 
12 public class CompactionPriorityTest {
13 
14   @Test(expected = IllegalArgumentException.class)
failIfIllegalByteValueProvided()15   public void failIfIllegalByteValueProvided() {
16     CompactionPriority.getCompactionPriority((byte) -1);
17   }
18 
19   @Test
getCompactionPriority()20   public void getCompactionPriority() {
21     assertThat(CompactionPriority.getCompactionPriority(
22         CompactionPriority.OldestLargestSeqFirst.getValue()))
23             .isEqualTo(CompactionPriority.OldestLargestSeqFirst);
24   }
25 
26   @Test
valueOf()27   public void valueOf() {
28     assertThat(CompactionPriority.valueOf("OldestSmallestSeqFirst")).
29         isEqualTo(CompactionPriority.OldestSmallestSeqFirst);
30   }
31 }
32