|
| 1 | +/******************************************************************************* |
| 2 | + * Copyright (c) 2025 Eclipse RDF4J contributors. |
| 3 | + * |
| 4 | + * All rights reserved. This program and the accompanying materials |
| 5 | + * are made available under the terms of the Eclipse Distribution License v1.0 |
| 6 | + * which accompanies this distribution, and is available at |
| 7 | + * http://www.eclipse.org/org/documents/edl-v10.php. |
| 8 | + * |
| 9 | + * SPDX-License-Identifier: BSD-3-Clause |
| 10 | + *******************************************************************************/ |
| 11 | +package org.eclipse.rdf4j.sail.lmdb; |
| 12 | + |
| 13 | +import static org.junit.Assert.*; |
| 14 | + |
| 15 | +import java.io.File; |
| 16 | + |
| 17 | +import org.eclipse.rdf4j.sail.lmdb.config.LmdbStoreConfig; |
| 18 | +import org.junit.jupiter.api.BeforeEach; |
| 19 | +import org.junit.jupiter.api.Test; |
| 20 | +import org.junit.jupiter.api.io.TempDir; |
| 21 | + |
| 22 | +/** |
| 23 | + * Test ensuring {@link TripleStore} can handle up to 6 indexes. |
| 24 | + */ |
| 25 | +public class TripleStoreManyIndexesTest { |
| 26 | + private File dataDir; |
| 27 | + |
| 28 | + @BeforeEach |
| 29 | + public void before(@TempDir File dataDir) throws Exception { |
| 30 | + this.dataDir = dataDir; |
| 31 | + } |
| 32 | + |
| 33 | + @Test |
| 34 | + public void testSixIndexes() throws Exception { |
| 35 | + TripleStore tripleStore = new TripleStore(dataDir, |
| 36 | + new LmdbStoreConfig("spoc,posc,ospc,cspo,cpos,cosp")); |
| 37 | + tripleStore.startTransaction(); |
| 38 | + tripleStore.storeTriple(1, 2, 3, 1, true); |
| 39 | + tripleStore.commit(); |
| 40 | + |
| 41 | + try (TxnManager.Txn txn = tripleStore.getTxnManager().createReadTxn()) { |
| 42 | + var it = tripleStore.getTriples(txn, 1, 2, 3, 1, true); |
| 43 | + assertNotNull("Store should have a stored statement", it.next()); |
| 44 | + } |
| 45 | + } |
| 46 | +} |
0 commit comments