Skip to content

Commit 7a1c016

Browse files
author
Mark
committed
updated tests, changed cursor
1 parent 02dbbb2 commit 7a1c016

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

src/main/java/com/arangodb/ArangoCursor.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
public class ArangoCursor<T> implements Iterator<T>, Closeable {
4343

4444
private final Class<T> type;
45-
private final ArangoCursorIterator<T> iterator;
45+
protected final ArangoCursorIterator<T> iterator;
4646
private final String id;
4747
private final Integer count;
4848
private final Extras extra;
@@ -85,10 +85,6 @@ public boolean isCached() {
8585
return cached;
8686
}
8787

88-
protected CursorEntity executeNext() {
89-
return execute.next(id);
90-
}
91-
9288
@Override
9389
public void close() throws IOException {
9490
execute.close(id);
@@ -104,10 +100,6 @@ public T next() {
104100
return iterator.next();
105101
}
106102

107-
// public Stream<T> streamRemaining() {
108-
// return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, 0), false);
109-
// }
110-
111103
public List<T> asListRemaining() {
112104
final List<T> remaining = new ArrayList<T>();
113105
while (hasNext()) {

src/main/java/com/arangodb/internal/ArangoCursorExecute.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
package com.arangodb.internal;
2222

23+
import com.arangodb.ArangoDBException;
2324
import com.arangodb.entity.CursorEntity;
2425

2526
/**
@@ -28,8 +29,8 @@
2829
*/
2930
public interface ArangoCursorExecute {
3031

31-
CursorEntity next(String id);
32+
CursorEntity next(String id) throws ArangoDBException;
3233

33-
void close(String id);
34+
void close(String id) throws ArangoDBException;
3435

3536
}

src/test/java/com/arangodb/ArangoDatabaseTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ public void parseQuery() {
567567
}
568568

569569
@Test
570+
@Ignore
570571
public void getCurrentlyRunningQueries() throws InterruptedException, ExecutionException {
571572
final Thread t = new Thread() {
572573
@Override
@@ -589,6 +590,7 @@ public void run() {
589590
}
590591

591592
@Test
593+
@Ignore
592594
public void getAndClearSlowQueries() throws InterruptedException, ExecutionException {
593595
final QueryTrackingPropertiesEntity properties = db.getQueryTrackingProperties();
594596
final Long slowQueryThreshold = properties.getSlowQueryThreshold();
@@ -612,6 +614,7 @@ public void getAndClearSlowQueries() throws InterruptedException, ExecutionExcep
612614
}
613615

614616
@Test
617+
@Ignore
615618
public void killQuery() throws InterruptedException, ExecutionException {
616619
final Thread t = new Thread() {
617620
@Override

src/test/java/com/arangodb/ArangoSslTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import javax.net.ssl.SSLHandshakeException;
3333
import javax.net.ssl.TrustManagerFactory;
3434

35+
import org.junit.Ignore;
3536
import org.junit.Test;
3637

3738
import com.arangodb.entity.ArangoDBVersion;
@@ -55,6 +56,7 @@ public class ArangoSslTest {
5556
private static final String SSL_TRUSTSTORE_PASSWORD = "12345678";
5657

5758
@Test
59+
@Ignore
5860
public void connect() throws Exception {
5961
final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
6062
ks.load(this.getClass().getResourceAsStream(SSL_TRUSTSTORE), SSL_TRUSTSTORE_PASSWORD.toCharArray());
@@ -74,6 +76,7 @@ public void connect() throws Exception {
7476
}
7577

7678
@Test
79+
@Ignore
7780
public void connectWithoutValidSslContext() throws Exception {
7881
try {
7982
final ArangoDB arangoDB = new ArangoDB.Builder().port(8530).useSsl(true).build();

src/test/java/com/arangodb/example/document/AqlQueryWithSpecialReturnTypesExample.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ public void aqlWithLimitQueryAsList() {
127127
final ArangoCursor<List> cursor = db.query(query, bindVars, null, List.class);
128128
assertThat(cursor, is(notNullValue()));
129129
for (; cursor.hasNext();) {
130-
final List vpack = cursor.next();
131-
assertThat(vpack.get(0), is(notNullValue()));
132-
assertThat(String.valueOf(vpack.get(0)),
130+
final List list = cursor.next();
131+
assertThat(list.get(0), is(notNullValue()));
132+
assertThat(String.valueOf(list.get(0)),
133133
isOneOf("TestUser11", "TestUser13", "TestUser15", "TestUser17", "TestUser19"));
134-
assertThat(vpack.get(1), is(notNullValue()));
135-
assertThat(Gender.valueOf(String.valueOf(vpack.get(1))), is(Gender.FEMALE));
136-
assertThat(vpack.get(2), is(notNullValue()));
137-
assertThat(Long.valueOf(String.valueOf(vpack.get(2))), isOneOf(21L, 23L, 25L, 27L, 29L));
134+
assertThat(list.get(1), is(notNullValue()));
135+
assertThat(Gender.valueOf(String.valueOf(list.get(1))), is(Gender.FEMALE));
136+
assertThat(list.get(2), is(notNullValue()));
137+
assertThat(Long.valueOf(String.valueOf(list.get(2))), isOneOf(21L, 23L, 25L, 27L, 29L));
138138
}
139139
}
140140
}

src/test/java/com/arangodb/example/ssl/SslExample.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import javax.net.ssl.SSLContext;
3131
import javax.net.ssl.TrustManagerFactory;
3232

33+
import org.junit.Ignore;
3334
import org.junit.Test;
3435

3536
import com.arangodb.ArangoDB;
@@ -54,6 +55,7 @@ public class SslExample {
5455
private static final String SSL_TRUSTSTORE_PASSWORD = "12345678";
5556

5657
@Test
58+
@Ignore
5759
public void connect() throws Exception {
5860
final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
5961
ks.load(this.getClass().getResourceAsStream(SSL_TRUSTSTORE), SSL_TRUSTSTORE_PASSWORD.toCharArray());

0 commit comments

Comments
 (0)