]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/java/src/test/java/org/rocksdb/TimedEnvTest.java
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rocksdb / java / src / test / java / org / rocksdb / TimedEnvTest.java
CommitLineData
494da23a
TL
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
6package org.rocksdb;
7
8import org.junit.ClassRule;
9import org.junit.Rule;
10import org.junit.Test;
11import org.junit.rules.TemporaryFolder;
12
13import static java.nio.charset.StandardCharsets.UTF_8;
14
15public class TimedEnvTest {
16
17 @ClassRule
f67539c2
TL
18 public static final RocksNativeLibraryResource ROCKS_NATIVE_LIBRARY_RESOURCE =
19 new RocksNativeLibraryResource();
494da23a
TL
20
21 @Rule
22 public TemporaryFolder dbFolder = new TemporaryFolder();
23
24 @Test
25 public void construct() throws RocksDBException {
26 try (final Env env = new TimedEnv(Env.getDefault())) {
27 // no-op
28 }
29 }
30
31 @Test
32 public void construct_integration() throws RocksDBException {
33 try (final Env env = new TimedEnv(Env.getDefault());
34 final Options options = new Options()
35 .setCreateIfMissing(true)
36 .setEnv(env);
37 ) {
38 try (final RocksDB db = RocksDB.open(options, dbFolder.getRoot().getPath())) {
39 db.put("key1".getBytes(UTF_8), "value1".getBytes(UTF_8));
40 }
41 }
42 }
43}