Skip to content

Commit a52f4e2

Browse files
author
mpv1989
committed
Fix tests for cluster
1 parent 2049e0b commit a52f4e2

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

src/test/java/com/arangodb/ArangoCollectionTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,9 @@ public void createHashIndex() throws InterruptedException, ExecutionException {
756756
assertThat(indexResult.getId(), startsWith(COLLECTION_NAME));
757757
assertThat(indexResult.getIsNewlyCreated(), is(true));
758758
assertThat(indexResult.getMinLength(), is(nullValue()));
759-
assertThat(indexResult.getSelectivityEstimate(), is(1));
759+
if (arangoDB.getRole().get() == ServerRole.SINGLE) {
760+
assertThat(indexResult.getSelectivityEstimate(), is(1));
761+
}
760762
assertThat(indexResult.getSparse(), is(false));
761763
assertThat(indexResult.getType(), is(IndexType.hash));
762764
assertThat(indexResult.getUnique(), is(false));

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.junit.Test;
4545

4646
import com.arangodb.entity.AqlExecutionExplainEntity;
47-
import com.arangodb.entity.AqlExecutionExplainEntity.ExecutionNode;
4847
import com.arangodb.entity.AqlExecutionExplainEntity.ExecutionPlan;
4948
import com.arangodb.entity.AqlFunctionEntity;
5049
import com.arangodb.entity.AqlParseEntity;
@@ -535,6 +534,9 @@ public void changeQueryCache() throws InterruptedException, ExecutionException {
535534

536535
@Test
537536
public void queryWithCache() throws InterruptedException, ArangoDBException, ExecutionException {
537+
if (arangoDB.getRole().get() != ServerRole.SINGLE) {
538+
return;
539+
}
538540
try {
539541
db.createCollection(COLLECTION_NAME, null).get();
540542
for (int i = 0; i < 10; i++) {
@@ -689,20 +691,7 @@ public void explainQuery() throws InterruptedException, ExecutionException {
689691
assertThat(plan.getEstimatedNrItems(), greaterThan(0));
690692
assertThat(plan.getVariables().size(), is(1));
691693
assertThat(plan.getVariables().iterator().next().getName(), is("i"));
692-
assertThat(plan.getNodes().size(), is(3));
693-
final Iterator<ExecutionNode> iterator = plan.getNodes().iterator();
694-
final ExecutionNode singletonNode = iterator.next();
695-
assertThat(singletonNode.getType(), is("SingletonNode"));
696-
final ExecutionNode collectionNode = iterator.next();
697-
assertThat(collectionNode.getType(), is("EnumerateCollectionNode"));
698-
assertThat(collectionNode.getDatabase(), is("_system"));
699-
assertThat(collectionNode.getCollection(), is("_apps"));
700-
assertThat(collectionNode.getOutVariable(), is(notNullValue()));
701-
assertThat(collectionNode.getOutVariable().getName(), is("i"));
702-
final ExecutionNode returnNode = iterator.next();
703-
assertThat(returnNode.getType(), is("ReturnNode"));
704-
assertThat(returnNode.getInVariable(), is(notNullValue()));
705-
assertThat(returnNode.getInVariable().getName(), is("i"));
694+
assertThat(plan.getNodes().size(), is(greaterThan(0)));
706695
}
707696

708697
@Test

0 commit comments

Comments
 (0)