/
ElasticsarchGraphQueryResultTest.java
52 lines (40 loc) · 1.88 KB
/
ElasticsarchGraphQueryResultTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*******************************************************************************
* Copyright (c) 2019 Eclipse RDF4J contributors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*******************************************************************************/
package org.eclipse.rdf4j.sail.elasticsearchstore.compliance;
import org.assertj.core.util.Files;
import org.eclipse.rdf4j.repository.GraphQueryResultTest;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.elasticsearchstore.SingletonClientProvider;
import org.eclipse.rdf4j.sail.elasticsearchstore.ElasticsearchStore;
import org.eclipse.rdf4j.sail.elasticsearchstore.TestHelpers;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import pl.allegro.tech.embeddedelasticsearch.EmbeddedElastic;
import java.io.File;
import java.io.IOException;
public class ElasticsarchGraphQueryResultTest extends GraphQueryResultTest {
private static EmbeddedElastic embeddedElastic;
private static File installLocation = Files.newTemporaryFolder();
private static SingletonClientProvider clientPool;
@BeforeClass
public static void beforeClass() throws IOException, InterruptedException {
embeddedElastic = TestHelpers.startElasticsearch(installLocation);
clientPool = new SingletonClientProvider("localhost", embeddedElastic.getTransportTcpPort(), "cluster1");
}
@AfterClass
public static void afterClass() throws Exception {
clientPool.close();
TestHelpers.stopElasticsearch(embeddedElastic, installLocation);
}
@Override
protected Repository newRepository() {
return new SailRepository(
new ElasticsearchStore(clientPool, "index1"));
}
}