Skip to content

Commit b60bf65

Browse files
authored
fix: build error (#12)
2 parents 6f69d3f + 5655aeb commit b60bf65

File tree

14 files changed

+157
-510
lines changed

14 files changed

+157
-510
lines changed

.circleci/config.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Java Gradle CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-java/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
# specify the version you desire here
10+
- image: circleci/openjdk:8-jdk
11+
12+
# Specify service dependencies here if necessary
13+
# CircleCI maintains a library of pre-built images
14+
# documented at https://circleci.com/docs/2.0/circleci-images/
15+
# - image: circleci/postgres:9.4
16+
17+
working_directory: ~/repo
18+
19+
environment:
20+
# Customize the JVM maximum heap limit
21+
JVM_OPTS: -Xmx3200m
22+
TERM: dumb
23+
24+
steps:
25+
- checkout
26+
27+
- run:
28+
name: Install dockerize
29+
command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
30+
environment:
31+
DOCKERIZE_VERSION: v0.3.0
32+
33+
- run:
34+
name: Install Typesense
35+
command: wget https://dl.typesense.org/releases/0.21.0/typesense-server-$TYPESENSE_VERSION-linux-amd64.tar.gz && sudo tar -C /usr/local/bin -xzvf typesense-server-$TYPESENSE_VERSION-linux-amd64.tar.gz && rm typesense-server-$TYPESENSE_VERSION-linux-amd64.tar.gz
36+
environment:
37+
TYPESENSE_VERSION: 0.21.0
38+
39+
- run:
40+
name: Run Typesense
41+
command: mkdir data && typesense-server --data-dir ./data --api-key=xyz
42+
background: true
43+
44+
# Download and cache dependencies
45+
- restore_cache:
46+
keys:
47+
- v1-dependencies-{{ checksum "build.gradle" }}
48+
# fallback to using the latest cache if no exact match is found
49+
- v1-dependencies-
50+
51+
- run: gradle dependencies
52+
53+
- save_cache:
54+
paths:
55+
- ~/.gradle
56+
key: v1-dependencies-{{ checksum "build.gradle" }}
57+
58+
- run:
59+
name: Wait for Typesense
60+
command: dockerize -wait http://localhost:8108/health -timeout 1m
61+
62+
# run tests!
63+
- run: gradle test
-17 Bytes
Binary file not shown.

.gradle/buildOutputCleanup/cache.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.
-18.8 KB
Binary file not shown.

.gradle/vcs-1/gc.properties

Whitespace-only changes.

src/test/java/org/typesense/api/AliasesTest.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/test/java/org/typesense/api/CollectionsTest.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,45 @@
55
import org.typesense.model.CollectionResponse;
66
import org.typesense.model.CollectionSchema;
77
import org.typesense.model.Field;
8-
import org.typesense.resources.Node;
98

10-
import java.time.Duration;
119
import java.util.ArrayList;
1210

1311

1412
public class CollectionsTest extends TestCase {
1513

1614
public Client client;
15+
private Helper helper;
1716

1817
public void setUp() throws Exception {
1918
super.setUp();
19+
helper = new Helper();
20+
this.client = helper.getClient();
21+
}
2022

21-
ArrayList<Node> nodes = new ArrayList<>();
22-
nodes.add(new Node("http","localhost","3001"));
23-
24-
Configuration configuration = new Configuration(nodes,Duration.ofSeconds(3),"xyz");
25-
26-
this.client = new Client(configuration);
27-
23+
public void tearDown() throws Exception {
24+
super.tearDown();
25+
helper.teardown();
2826
}
2927

28+
3029
@Test
3130
public void testRetrieveAllCollections() {
31+
helper.createTestCollection();
3232
CollectionResponse[] collectionResponses = client.collections().retrieve();
3333
for(CollectionResponse c:collectionResponses)
3434
System.out.println(c);
3535
}
3636

3737
@Test
3838
public void testRetrieveSingleCollection(){
39+
helper.createTestCollection();
3940
System.out.println(client.collections("books").retrieve());
4041
}
4142

4243
@Test
4344
public void testDeleteCollection(){
44-
System.out.println(client.collections("Countries").delete());
45+
helper.createTestCollection();
46+
System.out.println(client.collections("books").delete());
4547
}
4648

4749
@Test

0 commit comments

Comments
 (0)