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 CompactionOptionsFIFOTest { 13 14 static { 15 RocksDB.loadLibrary(); 16 } 17 18 @Test 19 public void maxTableFilesSize() { 20 final long size = 500 * 1024 * 1026; 21 try (final CompactionOptionsFIFO opt = new CompactionOptionsFIFO()) { 22 opt.setMaxTableFilesSize(size); 23 assertThat(opt.maxTableFilesSize()).isEqualTo(size); 24 } 25 } 26 sv2text(SV * sv)27 @Test 28 public void allowCompaction() { 29 final boolean allowCompaction = true; 30 try (final CompactionOptionsFIFO opt = new CompactionOptionsFIFO()) { 31 opt.setAllowCompaction(allowCompaction); 32 assertThat(opt.allowCompaction()).isEqualTo(allowCompaction); 33 } 34 } 35 } 36