diff --git a/.circleci/config.yml b/.circleci/config.yml
index 2bb3911dd..8b85836f0 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -49,7 +49,7 @@ commands:
parameters:
docker-img:
type: 'string'
- default: 'docker.io/arangodb/arangodb:latest'
+ default: 'docker.io/arangodb/enterprise:latest'
topology:
type: 'string'
default: 'single'
@@ -109,13 +109,6 @@ commands:
- run:
name: Deploy to Apache Maven Central
command: mvn -s .circleci/maven-release-settings.xml -Dmaven.test.skip deploy
- release:
- steps:
- - run:
- name: Release to Apache Maven Central
- command: mvn -s .circleci/maven-release-settings.xml -Dmaven.test.skip nexus-staging:release
- environment:
- MAVEN_OPTS: "--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
executors:
j17:
@@ -131,7 +124,7 @@ jobs:
parameters:
docker-img:
type: 'string'
- default: 'docker.io/arangodb/arangodb:latest'
+ default: 'docker.io/arangodb/enterprise:latest'
topology:
type: 'string'
default: 'single'
@@ -199,7 +192,7 @@ jobs:
parameters:
docker-img:
type: 'string'
- default: 'docker.io/arangodb/arangodb:latest'
+ default: 'docker.io/arangodb/enterprise:latest'
topology:
type: 'string'
default: 'single'
@@ -432,18 +425,6 @@ jobs:
- deploy
- store_cache
- release:
- executor: 'j17'
- steps:
- - timeout:
- duration: '30m'
- - checkout
- - load_cache
- - config_gpg
- - deploy
- - release
- - store_cache
-
workflows:
test-adb-version:
when:
@@ -454,9 +435,6 @@ workflows:
matrix:
parameters:
docker-img:
- - 'docker.io/arangodb/arangodb:3.11'
- - 'docker.io/arangodb/arangodb:3.12'
- - 'docker.io/arangodb/enterprise:3.11'
- 'docker.io/arangodb/enterprise:3.12'
topology:
- 'single'
@@ -467,9 +445,6 @@ workflows:
matrix:
parameters:
docker-img:
- - 'docker.io/arangodb/arangodb:3.11'
- - 'docker.io/arangodb/arangodb:3.12'
- - 'docker.io/arangodb/enterprise:3.11'
- 'docker.io/arangodb/enterprise:3.12'
topology:
- 'cluster'
@@ -528,9 +503,7 @@ workflows:
tags:
only: /^v.*/
branches:
- only:
- - main
- - next
+ ignore: /.*/
- test:
name: test-jackson-<
- * {@link Protocol#VST} == 1 * {@link Protocol#HTTP_JSON} == 20 * {@link Protocol#HTTP_VPACK} == 20 * {@link Protocol#HTTP2_JSON} == 1 @@ -570,19 +570,19 @@ public Builder connectionTtl(final Long connectionTtl) { * * @param keepAliveInterval interval in seconds * @return {@link ArangoDB.Builder} + * @deprecated for removal, no longer supported since ArangoDB 3.12 */ + @Deprecated public Builder keepAliveInterval(final Integer keepAliveInterval) { config.setKeepAliveInterval(keepAliveInterval); return this; } /** - * Whether the driver should acquire a list of available coordinators in an ArangoDB cluster or a single - * server with active failover. In case of Active-Failover deployment set to {@code true} to enable automatic - * master discovery. + * Whether the driver should acquire a list of available coordinators in an ArangoDB cluster. * *- * The host list will be used for failover and load balancing. + * The host list will be used for load balancing. *
* * @param acquireHostList whether automatically acquire a list of available hosts (default: false) @@ -605,8 +605,7 @@ public Builder acquireHostListInterval(final Integer acquireHostListInterval) { } /** - * Sets the load balancing strategy to be used in an ArangoDB cluster setup. In case of Active-Failover - * deployment set to {@link LoadBalancingStrategy#NONE} or not set at all, since that would be the default. + * Sets the load balancing strategy to be used in an ArangoDB cluster setup. * * @param loadBalancingStrategy the load balancing strategy to be used (default: * {@link LoadBalancingStrategy#NONE} @@ -767,8 +766,7 @@ protected HostHandler createHostHandler(@UnstableApi final HostResolver hostReso } LOG.debug("HostHandler is {}", hostHandler.getClass().getSimpleName()); - - return new DirtyReadHostHandler(hostHandler, new RoundRobinHostHandler(hostResolver)); + return hostHandler; } @UnstableApi diff --git a/core/src/main/java/com/arangodb/ArangoDBAsync.java b/core/src/main/java/com/arangodb/ArangoDBAsync.java index 8ea6985e3..bedf2315e 100644 --- a/core/src/main/java/com/arangodb/ArangoDBAsync.java +++ b/core/src/main/java/com/arangodb/ArangoDBAsync.java @@ -39,8 +39,7 @@ public interface ArangoDBAsync extends ArangoSerdeAccessor { void shutdown(); /** - * Updates the JWT used for requests authorization. It does not change already existing VST connections, since VST - * connections are authenticated during the initialization phase. + * Updates the JWT used for requests authorization. * * @param jwt token to use */ diff --git a/core/src/main/java/com/arangodb/Protocol.java b/core/src/main/java/com/arangodb/Protocol.java index 1ca4bb4ea..f11485df9 100644 --- a/core/src/main/java/com/arangodb/Protocol.java +++ b/core/src/main/java/com/arangodb/Protocol.java @@ -29,7 +29,9 @@ public enum Protocol { * VelocyStream * * @see VelocyStream specification + * @deprecated for removal, no longer supported since ArangoDB 3.12 */ + @Deprecated VST, /** diff --git a/core/src/main/java/com/arangodb/entity/CollectionPropertiesEntity.java b/core/src/main/java/com/arangodb/entity/CollectionPropertiesEntity.java index 8f5076639..c29d9ae89 100644 --- a/core/src/main/java/com/arangodb/entity/CollectionPropertiesEntity.java +++ b/core/src/main/java/com/arangodb/entity/CollectionPropertiesEntity.java @@ -38,7 +38,7 @@ public final class CollectionPropertiesEntity extends CollectionEntity { private CollectionshardKeys; private String shardingStrategy; // cluster option private String smartGraphAttribute; - private String smartJoinAttribute; // enterprise option + private String smartJoinAttribute; private Integer writeConcern; private Long count; diff --git a/core/src/main/java/com/arangodb/entity/EdgeDefinition.java b/core/src/main/java/com/arangodb/entity/EdgeDefinition.java index b89f67417..021aab42c 100644 --- a/core/src/main/java/com/arangodb/entity/EdgeDefinition.java +++ b/core/src/main/java/com/arangodb/entity/EdgeDefinition.java @@ -71,7 +71,7 @@ public Options getOptions() { /** * @param satellites collection names that will be used to create SatelliteCollections - * for a Hybrid (Disjoint) SmartGraph (Enterprise Edition only). Each array element + * for a Hybrid (Disjoint) SmartGraph. Each array element * must be a valid collection name. The collection type cannot be modified later. * @return this * @since ArangoDB 3.9.0 diff --git a/core/src/main/java/com/arangodb/entity/GraphEntity.java b/core/src/main/java/com/arangodb/entity/GraphEntity.java index 9a068c566..26ff52001 100644 --- a/core/src/main/java/com/arangodb/entity/GraphEntity.java +++ b/core/src/main/java/com/arangodb/entity/GraphEntity.java @@ -86,8 +86,7 @@ public String getRev() { } /** - * @return The replication factor used for every new collection in the graph. Can also be satellite for a SmartGraph - * (Enterprise Edition only). + * @return The replication factor used for every new collection in the graph. Can also be satellite for a SmartGraph. */ public ReplicationFactor getReplicationFactor() { return replicationFactor; @@ -104,28 +103,28 @@ public Integer getWriteConcern() { } /** - * @return Whether the graph is a SmartGraph (Enterprise Edition only). + * @return Whether the graph is a SmartGraph. */ public Boolean getIsSmart() { return isSmart; } /** - * @return Whether the graph is a Disjoint SmartGraph (Enterprise Edition only). + * @return Whether the graph is a Disjoint SmartGraph. */ public Boolean getIsDisjoint() { return isDisjoint; } /** - * @return Name of the sharding attribute in the SmartGraph case (Enterprise Edition only). + * @return Name of the sharding attribute in the SmartGraph case. */ public String getSmartGraphAttribute() { return smartGraphAttribute; } /** - * @return Flag if the graph is a SatelliteGraph (Enterprise Edition only) or not. + * @return Flag if the graph is a SatelliteGraph or not. */ public Boolean getIsSatellite() { return isSatellite; diff --git a/core/src/main/java/com/arangodb/entity/InvertedIndexField.java b/core/src/main/java/com/arangodb/entity/InvertedIndexField.java index 5c2494191..a05167612 100644 --- a/core/src/main/java/com/arangodb/entity/InvertedIndexField.java +++ b/core/src/main/java/com/arangodb/entity/InvertedIndexField.java @@ -111,7 +111,7 @@ public Boolean getCache() { * @param cache Enable this option to always cache the field normalization values in memory for this specific field. * This can improve the performance of scoring and ranking queries. Otherwise, these values are * memory-mapped and it is up to the operating system to load them from disk into memory and to evict - * them from memory. (Enterprise Edition only) + * them from memory. * @return this * @since ArangoDB 3.10.2 */ @@ -142,7 +142,7 @@ public Collection getNested() { * @param nested Index the specified sub-objects that are stored in an array. Other than with the fields property, * the values get indexed in a way that lets you query for co-occurring values. For example, you can * search the sub-objects and all the conditions need to be met by a single sub-object instead of - * across all of them. This property is available in the Enterprise Edition only. + * across all of them. * @return this */ public InvertedIndexField nested(InvertedIndexField... nested) { diff --git a/core/src/main/java/com/arangodb/entity/InvertedIndexPrimarySort.java b/core/src/main/java/com/arangodb/entity/InvertedIndexPrimarySort.java index 776130882..b1b00105f 100644 --- a/core/src/main/java/com/arangodb/entity/InvertedIndexPrimarySort.java +++ b/core/src/main/java/com/arangodb/entity/InvertedIndexPrimarySort.java @@ -52,7 +52,7 @@ public Boolean getCache() { * @param cache If you enable this option, then the primary sort columns are always cached in memory. This can * improve the performance of queries that utilize the primary sort order. Otherwise, these values are * memory-mapped and it is up to the operating system to load them from disk into memory and to evict - * them from memory (Enterprise Edition only). + * them from memory. * @return this * @since ArangoDB 3.10.2 */ diff --git a/core/src/main/java/com/arangodb/entity/arangosearch/AnalyzerFeature.java b/core/src/main/java/com/arangodb/entity/arangosearch/AnalyzerFeature.java index e0ed2d54f..4948e25a6 100644 --- a/core/src/main/java/com/arangodb/entity/arangosearch/AnalyzerFeature.java +++ b/core/src/main/java/com/arangodb/entity/arangosearch/AnalyzerFeature.java @@ -42,7 +42,7 @@ public enum AnalyzerFeature { position, /** - * enable search highlighting capabilities (Enterprise Edition only). If present, then the `position` and `frequency` features are also required. + * enable search highlighting capabilities. If present, then the `position` and `frequency` features are also required. * @since ArangoDB 3.10 */ offset diff --git a/core/src/main/java/com/arangodb/entity/arangosearch/ArangoSearchPropertiesEntity.java b/core/src/main/java/com/arangodb/entity/arangosearch/ArangoSearchPropertiesEntity.java index fa729e1e0..d17861430 100644 --- a/core/src/main/java/com/arangodb/entity/arangosearch/ArangoSearchPropertiesEntity.java +++ b/core/src/main/java/com/arangodb/entity/arangosearch/ArangoSearchPropertiesEntity.java @@ -124,7 +124,7 @@ public Collection getStoredValues() { /** * @return An array of strings defining optimized sort expressions. - * @since ArangoDB 3.11, Enterprise Edition only + * @since ArangoDB 3.11 */ public Collection getOptimizeTopK() { return optimizeTopK; diff --git a/core/src/main/java/com/arangodb/entity/arangosearch/CollectionLink.java b/core/src/main/java/com/arangodb/entity/arangosearch/CollectionLink.java index eb33ebb20..467b380c2 100644 --- a/core/src/main/java/com/arangodb/entity/arangosearch/CollectionLink.java +++ b/core/src/main/java/com/arangodb/entity/arangosearch/CollectionLink.java @@ -143,7 +143,7 @@ public CollectionLink inBackground(final Boolean inBackground) { * and it is up to the operating system to load them from disk into memory and to evict them from * memory. * @return link - * @since ArangoDB 3.9.5, Enterprise Edition only + * @since ArangoDB 3.9.5 */ public CollectionLink cache(final Boolean cache) { this.cache = cache; diff --git a/core/src/main/java/com/arangodb/entity/arangosearch/FieldLink.java b/core/src/main/java/com/arangodb/entity/arangosearch/FieldLink.java index 1d2f0f8f8..5d76a95db 100644 --- a/core/src/main/java/com/arangodb/entity/arangosearch/FieldLink.java +++ b/core/src/main/java/com/arangodb/entity/arangosearch/FieldLink.java @@ -120,7 +120,7 @@ public FieldLink inBackground(final Boolean inBackground) { * and it is up to the operating system to load them from disk into memory and to evict them from * memory. * @return link - * @since ArangoDB 3.9.5, Enterprise Edition only + * @since ArangoDB 3.9.5 */ public FieldLink cache(final Boolean cache) { this.cache = cache; diff --git a/core/src/main/java/com/arangodb/entity/arangosearch/StoredValue.java b/core/src/main/java/com/arangodb/entity/arangosearch/StoredValue.java index d300b7f99..824db2066 100644 --- a/core/src/main/java/com/arangodb/entity/arangosearch/StoredValue.java +++ b/core/src/main/java/com/arangodb/entity/arangosearch/StoredValue.java @@ -40,7 +40,7 @@ public final class StoredValue { /** * @param fields A list of attribute paths. The . character denotes sub-attributes. * @param compression Defines how to compress the attribute values. - * @param cache Whether to cache stored values in memory. (Since ArangoDB 3.9.5, Enterprise Edition only) + * @param cache Whether to cache stored values in memory. (Since ArangoDB 3.9.5) */ @JsonCreator public StoredValue(@JsonProperty("fields") List fields, diff --git a/core/src/main/java/com/arangodb/internal/ArangoDefaults.java b/core/src/main/java/com/arangodb/internal/ArangoDefaults.java index 25448187c..aabd5d5ee 100644 --- a/core/src/main/java/com/arangodb/internal/ArangoDefaults.java +++ b/core/src/main/java/com/arangodb/internal/ArangoDefaults.java @@ -33,10 +33,6 @@ */ public final class ArangoDefaults { - public static final int INTEGER_BYTES = Integer.SIZE / Byte.SIZE; - public static final int LONG_BYTES = Long.SIZE / Byte.SIZE; - public static final int CHUNK_MIN_HEADER_SIZE = INTEGER_BYTES + INTEGER_BYTES + LONG_BYTES; - public static final int CHUNK_MAX_HEADER_SIZE = CHUNK_MIN_HEADER_SIZE + LONG_BYTES; public static final int MAX_CONNECTIONS_VST_DEFAULT = 1; public static final int MAX_CONNECTIONS_HTTP_DEFAULT = 20; public static final int MAX_CONNECTIONS_HTTP2_DEFAULT = 1; diff --git a/core/src/main/java/com/arangodb/internal/RequestType.java b/core/src/main/java/com/arangodb/internal/RequestType.java index 5b9d27aae..380ee72bb 100644 --- a/core/src/main/java/com/arangodb/internal/RequestType.java +++ b/core/src/main/java/com/arangodb/internal/RequestType.java @@ -33,11 +33,7 @@ public enum RequestType { PUT(3), HEAD(4), PATCH(5), - OPTIONS(6), - VSTREAM_CRED(7), - VSTREAM_REGISTER(8), - VSTREAM_STATUS(9), - ILLEGAL(10); + OPTIONS(6); private final int type; diff --git a/core/src/main/java/com/arangodb/internal/config/ArangoConfig.java b/core/src/main/java/com/arangodb/internal/config/ArangoConfig.java index f95e0a4e2..95192e67c 100644 --- a/core/src/main/java/com/arangodb/internal/config/ArangoConfig.java +++ b/core/src/main/java/com/arangodb/internal/config/ArangoConfig.java @@ -74,8 +74,7 @@ public void loadProperties(final ArangoConfigProperties properties) { pipelining = properties.getPipelining().orElse(ArangoDefaults.DEFAULT_PIPELINING); // FIXME: make maxConnections field Optional maxConnections = properties.getMaxConnections().orElse(null); - // FIXME: make connectionTtl field Optional - connectionTtl = properties.getConnectionTtl().orElse(null); + connectionTtl = properties.getConnectionTtl().orElse(ArangoDefaults.DEFAULT_CONNECTION_TTL_HTTP); // FIXME: make keepAliveInterval field Optional keepAliveInterval = properties.getKeepAliveInterval().orElse(null); acquireHostList = properties.getAcquireHostList().orElse(ArangoDefaults.DEFAULT_ACQUIRE_HOST_LIST); @@ -215,9 +214,6 @@ public void setMaxConnections(Integer maxConnections) { } public Long getConnectionTtl() { - if (connectionTtl == null && getProtocol() != Protocol.VST) { - connectionTtl = ArangoDefaults.DEFAULT_CONNECTION_TTL_HTTP; - } return connectionTtl; } diff --git a/core/src/main/java/com/arangodb/internal/net/AccessType.java b/core/src/main/java/com/arangodb/internal/net/AccessType.java deleted file mode 100644 index c228074c5..000000000 --- a/core/src/main/java/com/arangodb/internal/net/AccessType.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2018 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.internal.net; - -/** - * @author Mark Vollmary - */ -public enum AccessType { - - WRITE, READ, DIRTY_READ - -} diff --git a/core/src/main/java/com/arangodb/internal/net/Communication.java b/core/src/main/java/com/arangodb/internal/net/Communication.java index 26251e33d..b4b23f53f 100644 --- a/core/src/main/java/com/arangodb/internal/net/Communication.java +++ b/core/src/main/java/com/arangodb/internal/net/Communication.java @@ -9,7 +9,6 @@ import com.arangodb.internal.config.ArangoConfig; import com.arangodb.internal.serde.InternalSerde; import com.arangodb.internal.util.HostUtils; -import com.arangodb.internal.util.RequestUtils; import com.arangodb.internal.util.ResponseUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,7 +44,7 @@ public void close() throws IOException { } public CompletableFuture executeAsync(final InternalRequest request, final HostHandle hostHandle) { - return executeAsync(request, hostHandle, hostHandler.get(hostHandle, RequestUtils.determineAccessType(request)), 0); + return executeAsync(request, hostHandle, hostHandler.get(hostHandle), 0); } private CompletableFuture executeAsync(final InternalRequest request, final HostHandle hostHandle, final Host host, final int attemptCount) { @@ -96,7 +95,7 @@ private CompletableFuture doExecuteAsync( final HostDescription redirectHost = HostUtils.createFromLocation(location); hostHandler.failIfNotMatch(redirectHost, errorEntityEx); mirror( - executeAsync(request, new HostHandle().setHost(redirectHost), hostHandler.get(hostHandle, RequestUtils.determineAccessType(request)), attemptCount + 1), + executeAsync(request, new HostHandle().setHost(redirectHost), hostHandler.get(hostHandle), attemptCount + 1), rfuture ); } @@ -123,9 +122,9 @@ private void handleException(boolean isSafe, Throwable e, HostHandle hostHandle, if (hostHandle != null && hostHandle.getHost() != null) { hostHandle.setHost(null); } - hostHandler.checkNext(hostHandle, RequestUtils.determineAccessType(request)); + hostHandler.checkNext(hostHandle); if (isSafe) { - Host nextHost = hostHandler.get(hostHandle, RequestUtils.determineAccessType(request)); + Host nextHost = hostHandler.get(hostHandle); LOGGER.warn("Could not connect to {} while executing request [id={}]", host.getDescription(), reqId, ioEx); LOGGER.debug("Try connecting to {}", nextHost.getDescription()); diff --git a/core/src/main/java/com/arangodb/internal/net/DirtyReadHostHandler.java b/core/src/main/java/com/arangodb/internal/net/DirtyReadHostHandler.java deleted file mode 100644 index b54354dcb..000000000 --- a/core/src/main/java/com/arangodb/internal/net/DirtyReadHostHandler.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2018 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.internal.net; - -import com.arangodb.config.HostDescription; - -import java.io.IOException; - -/** - * @author Mark Vollmary - */ -public class DirtyReadHostHandler implements HostHandler { - - private final HostHandler master; - private final HostHandler follower; - private AccessType currentAccessType; - - public DirtyReadHostHandler(final HostHandler master, final HostHandler follower) { - super(); - this.master = master; - this.follower = follower; - } - - private HostHandler determineHostHandler() { - if (currentAccessType == AccessType.DIRTY_READ) { - return follower; - } - return master; - } - - @Override - public Host get(final HostHandle hostHandle, final AccessType accessType) { - this.currentAccessType = accessType; - return determineHostHandler().get(hostHandle, accessType); - } - - @Override - public void checkNext(HostHandle hostHandle, AccessType accessType) { - this.currentAccessType = accessType; - determineHostHandler().checkNext(hostHandle, accessType); - } - - @Override - public void success() { - determineHostHandler().success(); - } - - @Override - public void fail(Exception exception) { - determineHostHandler().fail(exception); - } - - @Override - public void failIfNotMatch(HostDescription host, Exception exception) { - determineHostHandler().failIfNotMatch(host, exception); - } - - @Override - public void reset() { - determineHostHandler().reset(); - } - - @Override - public void close() throws IOException { - master.close(); - follower.close(); - } - - @Override - public void setJwt(String jwt) { - master.setJwt(jwt); - follower.setJwt(jwt); - } - -} diff --git a/core/src/main/java/com/arangodb/internal/net/FallbackHostHandler.java b/core/src/main/java/com/arangodb/internal/net/FallbackHostHandler.java index f1d9b3b75..305f5d1f1 100644 --- a/core/src/main/java/com/arangodb/internal/net/FallbackHostHandler.java +++ b/core/src/main/java/com/arangodb/internal/net/FallbackHostHandler.java @@ -49,8 +49,8 @@ public FallbackHostHandler(final HostResolver resolver) { } @Override - public Host get(final HostHandle hostHandle, AccessType accessType) { - checkNext(hostHandle, accessType); + public Host get(final HostHandle hostHandle) { + checkNext(hostHandle); if (current.isMarkforDeletion()) { fail(new ArangoDBException("Host marked for deletion")); } @@ -58,7 +58,7 @@ public Host get(final HostHandle hostHandle, AccessType accessType) { } @Override - public void checkNext(HostHandle hostHandle, AccessType accessType) { + public void checkNext(HostHandle hostHandle) { if (current == lastSuccess && iterations >= 3) { ArangoDBException e = ArangoDBException.of("Cannot contact any host!", new ArangoDBMultipleException(new ArrayList<>(lastFailExceptions))); diff --git a/core/src/main/java/com/arangodb/internal/net/HostHandler.java b/core/src/main/java/com/arangodb/internal/net/HostHandler.java index d9ec2ddb7..7c8274f3e 100644 --- a/core/src/main/java/com/arangodb/internal/net/HostHandler.java +++ b/core/src/main/java/com/arangodb/internal/net/HostHandler.java @@ -31,9 +31,9 @@ @UsedInApi public interface HostHandler { - Host get(HostHandle hostHandle, AccessType accessType); + Host get(HostHandle hostHandle); - void checkNext(HostHandle hostHandle, AccessType accessType); + void checkNext(HostHandle hostHandle); void success(); diff --git a/core/src/main/java/com/arangodb/internal/net/RandomHostHandler.java b/core/src/main/java/com/arangodb/internal/net/RandomHostHandler.java index b483765c4..217b57a7b 100644 --- a/core/src/main/java/com/arangodb/internal/net/RandomHostHandler.java +++ b/core/src/main/java/com/arangodb/internal/net/RandomHostHandler.java @@ -44,7 +44,7 @@ public RandomHostHandler(final HostResolver resolver, final HostHandler fallback } @Override - public Host get(final HostHandle hostHandle, AccessType accessType) { + public Host get(final HostHandle hostHandle) { if (current == null || current.isMarkforDeletion()) { hosts = resolver.getHosts(); current = getRandomHost(); @@ -53,7 +53,7 @@ public Host get(final HostHandle hostHandle, AccessType accessType) { } @Override - public void checkNext(HostHandle hostHandle, AccessType accessType) { + public void checkNext(HostHandle hostHandle) { } @Override @@ -64,7 +64,7 @@ public void success() { @Override public void fail(Exception exception) { fallback.fail(exception); - current = fallback.get(null, null); + current = fallback.get(null); } @Override diff --git a/core/src/main/java/com/arangodb/internal/net/RoundRobinHostHandler.java b/core/src/main/java/com/arangodb/internal/net/RoundRobinHostHandler.java index ec70f8e13..55c5694d4 100644 --- a/core/src/main/java/com/arangodb/internal/net/RoundRobinHostHandler.java +++ b/core/src/main/java/com/arangodb/internal/net/RoundRobinHostHandler.java @@ -53,8 +53,8 @@ public RoundRobinHostHandler(final HostResolver resolver) { } @Override - public Host get(final HostHandle hostHandle, AccessType accessType) { - checkNext(hostHandle, accessType); + public Host get(final HostHandle hostHandle) { + checkNext(hostHandle); final int size = hosts.getHostsList().size(); final int index = (int) ((current++) % size); Host host = hosts.getHostsList().get(index); @@ -76,7 +76,7 @@ public Host get(final HostHandle hostHandle, AccessType accessType) { } @Override - public void checkNext(HostHandle hostHandle, AccessType accessType) { + public void checkNext(HostHandle hostHandle) { hosts = resolver.getHosts(); final int size = hosts.getHostsList().size(); diff --git a/core/src/main/java/com/arangodb/internal/util/RequestUtils.java b/core/src/main/java/com/arangodb/internal/util/RequestUtils.java index 7074cfc3b..9bf9e72a1 100644 --- a/core/src/main/java/com/arangodb/internal/util/RequestUtils.java +++ b/core/src/main/java/com/arangodb/internal/util/RequestUtils.java @@ -20,9 +20,7 @@ package com.arangodb.internal.util; -import com.arangodb.internal.net.AccessType; import com.arangodb.internal.InternalRequest; -import com.arangodb.internal.RequestType; /** * @author Mark Vollmary @@ -39,14 +37,4 @@ public static InternalRequest allowDirtyRead(final InternalRequest request) { return request.putHeaderParam(HEADER_ALLOW_DIRTY_READ, "true"); } - public static AccessType determineAccessType(final InternalRequest request) { - if (request.containsHeaderParam(HEADER_ALLOW_DIRTY_READ)) { - return AccessType.DIRTY_READ; - } - if (request.getRequestType() == RequestType.GET) { - return AccessType.READ; - } - return AccessType.WRITE; - } - } diff --git a/core/src/main/java/com/arangodb/model/AqlQueryOptions.java b/core/src/main/java/com/arangodb/model/AqlQueryOptions.java index f51f419b2..381128f9d 100644 --- a/core/src/main/java/com/arangodb/model/AqlQueryOptions.java +++ b/core/src/main/java/com/arangodb/model/AqlQueryOptions.java @@ -61,10 +61,8 @@ public Boolean getAllowDirtyRead() { * ({@link AqlQueryOptions#streamTransactionId(String)}). The header set when creating the transaction decides * about dirty reads for the entire transaction, not the individual read operations. * - * @param allowDirtyRead Set to {@code true} allows reading from followers in an active-failover setup. + * @param allowDirtyRead Set to {@code true} allows reading from followers. * @return this - * @see API - * Documentation */ public AqlQueryOptions allowDirtyRead(final Boolean allowDirtyRead) { this.allowDirtyRead = allowDirtyRead; @@ -515,7 +513,7 @@ public Boolean getAllowDirtyReads() { * You may observe data inconsistencies (dirty reads) when reading from followers, namely * obsolete revisions of documents because changes have not yet been replicated to the * follower, as well as changes to documents before they are officially committed on the - * leader. This feature is only available in the Enterprise Edition. + * leader. * @return this */ public AqlQueryOptions allowDirtyReads(final Boolean allowDirtyReads) { @@ -841,7 +839,7 @@ public Double getSatelliteSyncWait() { } /** - * @param satelliteSyncWait This enterprise parameter allows to configure how long a DBServer will have time to + * @param satelliteSyncWait This parameter allows to configure how long a DBServer will have time to * bring the * satellite collections involved in the query into sync. The default value is 60.0 * (seconds). When the @@ -885,8 +883,6 @@ public Boolean getSkipInaccessibleCollections() { * collections and different users execute AQL queries on that graph. You can * now naturally limit the * accessible results by changing the access rights of users on collections. - * This feature is only - * available in the Enterprise Edition. * @return this * @since ArangoDB 3.2.0 */ diff --git a/core/src/main/java/com/arangodb/model/CollectionCreateOptions.java b/core/src/main/java/com/arangodb/model/CollectionCreateOptions.java index 143765c09..75e89cc2a 100644 --- a/core/src/main/java/com/arangodb/model/CollectionCreateOptions.java +++ b/core/src/main/java/com/arangodb/model/CollectionCreateOptions.java @@ -47,7 +47,7 @@ public final class CollectionCreateOptions { private String distributeShardsLike; private String shardingStrategy; // cluster option - private String smartJoinAttribute; // enterprise option + private String smartJoinAttribute; private CollectionSchema schema; @@ -255,7 +255,7 @@ public String getDistributeShardsLike() { } /** - * @param distributeShardsLike (The default is ""): in an enterprise cluster, this attribute binds the specifics + * @param distributeShardsLike (The default is ""): this attribute binds the specifics * of sharding for the * newly created collection to follow that of a specified existing collection. Note: * Using this parameter diff --git a/core/src/main/java/com/arangodb/model/CollectionPropertiesOptions.java b/core/src/main/java/com/arangodb/model/CollectionPropertiesOptions.java index 691b4344d..66de62730 100644 --- a/core/src/main/java/com/arangodb/model/CollectionPropertiesOptions.java +++ b/core/src/main/java/com/arangodb/model/CollectionPropertiesOptions.java @@ -86,7 +86,7 @@ public ReplicationFactor getReplicationFactor() { * different DB-Servers. The value 1 means that only one copy (no synchronous replication) * is kept. A value of k means that k-1 replicas are kept. For SatelliteCollections, it * needs to be the string "satellite", which matches the replication factor to the number - * of DB-Servers (Enterprise Edition only). + * of DB-Servers. * * Any two copies reside on different DB-Servers. Replication between them is synchronous, * that is, every write operation to the “leader” copy will be replicated to all “follower” diff --git a/core/src/main/java/com/arangodb/model/DocumentReadOptions.java b/core/src/main/java/com/arangodb/model/DocumentReadOptions.java index 74b976aae..143e3fc0b 100644 --- a/core/src/main/java/com/arangodb/model/DocumentReadOptions.java +++ b/core/src/main/java/com/arangodb/model/DocumentReadOptions.java @@ -64,8 +64,6 @@ public DocumentReadOptions ifMatch(final String ifMatch) { /** * @param allowDirtyRead Set to {@code true} allows reading from followers in an active-failover setup. * @return options - * @see API - * Documentation * @since ArangoDB 3.4.0 */ public DocumentReadOptions allowDirtyRead(final Boolean allowDirtyRead) { diff --git a/core/src/main/java/com/arangodb/model/ExplainAqlQueryOptions.java b/core/src/main/java/com/arangodb/model/ExplainAqlQueryOptions.java index 4d4d2f511..f9fb827ba 100644 --- a/core/src/main/java/com/arangodb/model/ExplainAqlQueryOptions.java +++ b/core/src/main/java/com/arangodb/model/ExplainAqlQueryOptions.java @@ -127,7 +127,7 @@ public Boolean getAllowDirtyReads() { * You may observe data inconsistencies (dirty reads) when reading from followers, namely * obsolete revisions of documents because changes have not yet been replicated to the * follower, as well as changes to documents before they are officially committed on the - * leader. This feature is only available in the Enterprise Edition. + * leader. * @return this */ public ExplainAqlQueryOptions allowDirtyReads(final Boolean allowDirtyReads) { @@ -434,7 +434,7 @@ public Double getSatelliteSyncWait() { } /** - * @param satelliteSyncWait This enterprise parameter allows to configure how long a DBServer will have time to + * @param satelliteSyncWait This parameter allows to configure how long a DBServer will have time to * bring the * satellite collections involved in the query into sync. The default value is 60.0 * (seconds). When the @@ -478,8 +478,6 @@ public Boolean getSkipInaccessibleCollections() { * collections and different users execute AQL queries on that graph. You can * now naturally limit the * accessible results by changing the access rights of users on collections. - * This feature is only - * available in the Enterprise Edition. * @return this * @since ArangoDB 3.2.0 */ diff --git a/core/src/main/java/com/arangodb/model/GraphCreateOptions.java b/core/src/main/java/com/arangodb/model/GraphCreateOptions.java index 957a64221..ded79177e 100644 --- a/core/src/main/java/com/arangodb/model/GraphCreateOptions.java +++ b/core/src/main/java/com/arangodb/model/GraphCreateOptions.java @@ -85,7 +85,7 @@ public Boolean getIsSmart() { } /** - * @param isSmart Define if the created graph should be smart. This only has effect in Enterprise version. + * @param isSmart Define if the created graph should be smart. * @return options */ public GraphCreateOptions isSmart(final Boolean isSmart) { @@ -190,7 +190,7 @@ public Collection
getSatellites() { /** * @param satellites collection names that will be used to create SatelliteCollections - * for a Hybrid (Disjoint) SmartGraph (Enterprise Edition only). Each array element + * for a Hybrid (Disjoint) SmartGraph. Each array element * must be a valid collection name. The collection type cannot be modified later. * @return options * @since ArangoDB 3.9.0 diff --git a/core/src/main/java/com/arangodb/model/GraphDocumentReadOptions.java b/core/src/main/java/com/arangodb/model/GraphDocumentReadOptions.java index d68cdba7a..d1e690ca5 100644 --- a/core/src/main/java/com/arangodb/model/GraphDocumentReadOptions.java +++ b/core/src/main/java/com/arangodb/model/GraphDocumentReadOptions.java @@ -63,8 +63,6 @@ public GraphDocumentReadOptions ifMatch(final String ifMatch) { /** * @param allowDirtyRead Set to {@code true} allows reading from followers in an active-failover setup. * @return options - * @see API - * Documentation * @since ArangoDB 3.4.0 */ public GraphDocumentReadOptions allowDirtyRead(final Boolean allowDirtyRead) { diff --git a/core/src/main/java/com/arangodb/model/InvertedIndexOptions.java b/core/src/main/java/com/arangodb/model/InvertedIndexOptions.java index 46a10eb84..3c22156c6 100644 --- a/core/src/main/java/com/arangodb/model/InvertedIndexOptions.java +++ b/core/src/main/java/com/arangodb/model/InvertedIndexOptions.java @@ -119,7 +119,7 @@ public Collection getOptimizeTopK() { /** * @param optimizeTopK An array of strings defining sort expressions that you want to optimize. * @return options - * @since ArangoDB 3.11, Enterprise Edition only + * @since ArangoDB 3.11 */ public InvertedIndexOptions optimizeTopK(String... optimizeTopK) { Collections.addAll(this.optimizeTopK, optimizeTopK); @@ -373,7 +373,7 @@ public Boolean getCache() { * are memory-mapped and it is up to the operating system to load them from disk into memory and to * evict them from memory. * - * Default: `false`. (Enterprise Edition only) + * Default: `false` * @return this * @since ArangoDB 3.10.2 */ @@ -390,7 +390,7 @@ public Boolean getPrimaryKeyCache() { * @param primaryKeyCache If you enable this option, then the primary key columns are always cached in memory. This * can improve the performance of queries that return many documents. Otherwise, these values * are memory-mapped and it is up to the operating system to load them from disk into memory - * and to evict them from memory (Enterprise Edition only). (default: false) + * and to evict them from memory. (default: false) * @return this * @since ArangoDB 3.10.2 */ diff --git a/core/src/main/java/com/arangodb/model/StreamTransactionOptions.java b/core/src/main/java/com/arangodb/model/StreamTransactionOptions.java index bd78d6c4f..cec5d8488 100644 --- a/core/src/main/java/com/arangodb/model/StreamTransactionOptions.java +++ b/core/src/main/java/com/arangodb/model/StreamTransactionOptions.java @@ -140,8 +140,6 @@ public Boolean getAllowDirtyRead() { /** * @param allowDirtyRead Set to {@code true} allows reading from followers in an active-failover setup. * @return options - * @see API - * Documentation * @since ArangoDB 3.4.0 */ public StreamTransactionOptions allowDirtyRead(final Boolean allowDirtyRead) { diff --git a/core/src/main/java/com/arangodb/model/VertexCollectionCreateOptions.java b/core/src/main/java/com/arangodb/model/VertexCollectionCreateOptions.java index d7ab02a70..ce526c6bf 100644 --- a/core/src/main/java/com/arangodb/model/VertexCollectionCreateOptions.java +++ b/core/src/main/java/com/arangodb/model/VertexCollectionCreateOptions.java @@ -58,7 +58,7 @@ public Collection getSatellites() { /** * @param satellites collection names that will be used to create SatelliteCollections - * for a Hybrid (Disjoint) SmartGraph (Enterprise Edition only). Each array element + * for a Hybrid (Disjoint) SmartGraph. Each array element * must be a valid collection name. The collection type cannot be modified later. * @return options * @since ArangoDB 3.9.0 diff --git a/core/src/main/java/com/arangodb/model/arangosearch/ArangoSearchCreateOptions.java b/core/src/main/java/com/arangodb/model/arangosearch/ArangoSearchCreateOptions.java index 1361f9c9d..319e38aeb 100644 --- a/core/src/main/java/com/arangodb/model/arangosearch/ArangoSearchCreateOptions.java +++ b/core/src/main/java/com/arangodb/model/arangosearch/ArangoSearchCreateOptions.java @@ -156,7 +156,7 @@ public ArangoSearchCreateOptions storedValues(final StoredValue... storedValues) /** * @param optimizeTopK An array of strings defining sort expressions that you want to optimize. * @return options - * @since ArangoDB 3.11, Enterprise Edition only + * @since ArangoDB 3.11 */ public ArangoSearchCreateOptions optimizeTopK(final String... optimizeTopK) { this.optimizeTopK = Arrays.asList(optimizeTopK); @@ -169,7 +169,7 @@ public ArangoSearchCreateOptions optimizeTopK(final String... optimizeTopK) { * Otherwise, these values are memory-mapped and it is up to the operating system to load * them from disk into memory and to evict them from memory. * @return options - * @since ArangoDB 3.9.6, Enterprise Edition only + * @since ArangoDB 3.9.6 */ public ArangoSearchCreateOptions primarySortCache(final Boolean primarySortCache) { this.primarySortCache = primarySortCache; @@ -182,7 +182,7 @@ public ArangoSearchCreateOptions primarySortCache(final Boolean primarySortCache * are memory-mapped and it is up to the operating system to load them from disk into memory * and to evict them from memory. * @return options - * @since ArangoDB 3.9.6, Enterprise Edition only + * @since ArangoDB 3.9.6 */ public ArangoSearchCreateOptions primaryKeyCache(final Boolean primaryKeyCache) { this.primaryKeyCache = primaryKeyCache; diff --git a/dev-README.md b/dev-README.md index 0eaaa61f0..e57e56d06 100644 --- a/dev-README.md +++ b/dev-README.md @@ -30,7 +30,6 @@ Reports: - [jackson-serde-json](jackson-serde-json/target/site/jacoco/index.html) - [jackson-serde-vpack](jackson-serde-vpack/target/site/jacoco/index.html) - [http-protocol](http-protocol/target/site/jacoco/index.html) -- [vst-protocol](vst-protocol/target/site/jacoco/index.html) ## update native image reflection configuration To generate reflection configuration run [NativeImageHelper](./driver/src/test/java/helper/NativeImageHelper.java) and diff --git a/docker/start_db.sh b/docker/start_db.sh index e8c58ebcd..563be265f 100755 --- a/docker/start_db.sh +++ b/docker/start_db.sh @@ -1,7 +1,7 @@ #!/bin/bash # Configuration environment variables: -# STARTER_MODE: (single|cluster|activefailover), default single +# STARTER_MODE: (single|cluster), default single # DOCKER_IMAGE: ArangoDB docker image, default docker.io/arangodb/arangodb:latest # STARTER_DOCKER_IMAGE: ArangoDB Starter docker image, default docker.io/arangodb/arangodb-starter:latest # SSL: (true|false), default false @@ -111,9 +111,3 @@ for a in ${COORDINATORS[*]} ; do echo "$SCHEME://$a" echo "" done - -if [ "$STARTER_MODE" == "activefailover" ]; then - LEADER=$("$LOCATION"/find_active_endpoint.sh) - echo "Leader: $SCHEME://$LEADER" - echo "" -fi diff --git a/driver/pom.xml b/driver/pom.xml index f7a2c181c..03d987735 100644 --- a/driver/pom.xml +++ b/driver/pom.xml @@ -8,7 +8,7 @@ ../release-parent com.arangodb release-parent -7.19.0 +7.20.0-SNAPSHOT arangodb-java-driver diff --git a/http-protocol/pom.xml b/http-protocol/pom.xml index 76d0b5ba8..74442ccd9 100644 --- a/http-protocol/pom.xml +++ b/http-protocol/pom.xml @@ -8,7 +8,7 @@../release-parent com.arangodb release-parent -7.19.0 +7.20.0-SNAPSHOT http-protocol diff --git a/jackson-serde-json/pom.xml b/jackson-serde-json/pom.xml index a435674c2..c663d920d 100644 --- a/jackson-serde-json/pom.xml +++ b/jackson-serde-json/pom.xml @@ -8,7 +8,7 @@../release-parent com.arangodb release-parent -7.19.0 +7.20.0-SNAPSHOT jackson-serde-json diff --git a/jackson-serde-vpack/pom.xml b/jackson-serde-vpack/pom.xml index 6e077be36..db0311aec 100644 --- a/jackson-serde-vpack/pom.xml +++ b/jackson-serde-vpack/pom.xml @@ -8,7 +8,7 @@../release-parent com.arangodb release-parent -7.19.0 +7.20.0-SNAPSHOT jackson-serde-vpack diff --git a/jsonb-serde/pom.xml b/jsonb-serde/pom.xml index 9923dbcf3..773160818 100644 --- a/jsonb-serde/pom.xml +++ b/jsonb-serde/pom.xml @@ -8,7 +8,7 @@../release-parent com.arangodb release-parent -7.19.0 +7.20.0-SNAPSHOT jsonb-serde diff --git a/pom.xml b/pom.xml index 0aa0fff95..9cf8a9a66 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@com.arangodb arangodb-java-driver-parent -7.19.0 +7.20.0-SNAPSHOT 2016 release-parent @@ -16,7 +16,6 @@jackson-serde-vpack jsonb-serde http-protocol -vst-protocol pom @@ -127,11 +126,6 @@http-protocol ${project.version} -- com.arangodb -vst-protocol -${project.version} -- com.arangodb jackson-serde-json diff --git a/release-parent/pom.xml b/release-parent/pom.xml index 0bb861fa0..6daa19a9b 100644 --- a/release-parent/pom.xml +++ b/release-parent/pom.xml @@ -6,7 +6,7 @@com.arangodb arangodb-java-driver-parent -7.19.0 +7.20.0-SNAPSHOT pom diff --git a/shaded/pom.xml b/shaded/pom.xml index 7af61af37..8b3ebce2a 100644 --- a/shaded/pom.xml +++ b/shaded/pom.xml @@ -8,7 +8,7 @@../release-parent com.arangodb release-parent -7.19.0 +7.20.0-SNAPSHOT arangodb-java-driver-shaded @@ -32,11 +32,6 @@http-protocol compile - com.arangodb -vst-protocol -compile -- com.arangodb jackson-dataformat-velocypack @@ -115,14 +110,6 @@META-INF/** -- com.arangodb:vst-protocol -- -META-INF/MANIFEST.MF -META-INF/services/** -META-INF/maven/** -com.arangodb:http-protocol diff --git a/shaded/src/main/resources/META-INF/services/com.arangodb.internal.net.ProtocolProvider b/shaded/src/main/resources/META-INF/services/com.arangodb.internal.net.ProtocolProvider index faf8cac63..f48d178b7 100644 --- a/shaded/src/main/resources/META-INF/services/com.arangodb.internal.net.ProtocolProvider +++ b/shaded/src/main/resources/META-INF/services/com.arangodb.internal.net.ProtocolProvider @@ -1,2 +1 @@ com.arangodb.http.HttpProtocolProvider -com.arangodb.vst.VstProtocolProvider diff --git a/spotbugs/spotbugs-exclude.xml b/spotbugs/spotbugs-exclude.xml index c7e8ee070..061b667ce 100644 --- a/spotbugs/spotbugs-exclude.xml +++ b/spotbugs/spotbugs-exclude.xml @@ -21,10 +21,6 @@ - - -- diff --git a/test-functional/pom.xml b/test-functional/pom.xml index b88b936e0..685cf8adf 100644 --- a/test-functional/pom.xml +++ b/test-functional/pom.xml @@ -8,7 +8,7 @@ ../test-parent com.arangodb test-parent -7.19.0 +7.20.0-SNAPSHOT test-functional diff --git a/test-functional/src/test-ssl/java/com/arangodb/ArangoSslTest.java b/test-functional/src/test-ssl/java/com/arangodb/ArangoSslTest.java index 092276a81..fe6ed87c2 100644 --- a/test-functional/src/test-ssl/java/com/arangodb/ArangoSslTest.java +++ b/test-functional/src/test-ssl/java/com/arangodb/ArangoSslTest.java @@ -22,14 +22,13 @@ import com.arangodb.entity.ArangoDBVersion; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import javax.net.ssl.SSLHandshakeException; import java.util.List; +import utils.ProtocolSource; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** @@ -39,10 +38,8 @@ class ArangoSslTest extends BaseTest { @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void connect(Protocol protocol) { - assumeTrue(protocol != Protocol.VST); - final ArangoDB arangoDB = new ArangoDB.Builder() .protocol(protocol) .host("172.28.0.1", 8529) @@ -56,10 +53,8 @@ void connect(Protocol protocol) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void connectWithoutValidSslContext(Protocol protocol) { - assumeTrue(protocol != Protocol.VST); - final ArangoDB arangoDB = new ArangoDB.Builder() .protocol(protocol) .host("172.28.0.1", 8529) diff --git a/test-functional/src/test-ssl/java/com/arangodb/HttpProxyTest.java b/test-functional/src/test-ssl/java/com/arangodb/HttpProxyTest.java index 2e74a1fb0..d973cf64e 100644 --- a/test-functional/src/test-ssl/java/com/arangodb/HttpProxyTest.java +++ b/test-functional/src/test-ssl/java/com/arangodb/HttpProxyTest.java @@ -26,13 +26,12 @@ import io.vertx.core.net.ProxyOptions; import io.vertx.core.net.ProxyType; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; +import utils.ProtocolSource; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** @@ -41,10 +40,8 @@ class HttpProxyTest extends BaseTest { @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void httpProxy(Protocol protocol) { - assumeTrue(protocol != Protocol.VST); - final ArangoDB arangoDB = new ArangoDB.Builder() .protocol(protocol) .host("172.28.0.1", 8529) @@ -67,10 +64,8 @@ void httpProxy(Protocol protocol) { @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void httpProxyWrongPassword(Protocol protocol) { - assumeTrue(protocol != Protocol.VST); - final ArangoDB arangoDB = new ArangoDB.Builder() .protocol(protocol) .host("172.28.0.1", 8529) diff --git a/test-functional/src/test-ssl/java/com/arangodb/SslExampleTest.java b/test-functional/src/test-ssl/java/com/arangodb/SslExampleTest.java index ffaec30cb..eb4039c8b 100644 --- a/test-functional/src/test-ssl/java/com/arangodb/SslExampleTest.java +++ b/test-functional/src/test-ssl/java/com/arangodb/SslExampleTest.java @@ -23,15 +23,13 @@ import com.arangodb.entity.ArangoDBVersion; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; -import utils.TestUtils; +import utils.ProtocolSource; import javax.net.ssl.SSLHandshakeException; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** * @author Mark Vollmary @@ -41,9 +39,8 @@ class SslExampleTest extends BaseTest { @Disabled("Only local execution, in CircleCI port 8529 exposed to localhost") @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void connect(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || TestUtils.isLessThanVersion(version.getVersion(), 3, 12, 0)); final ArangoDB arangoDB = new ArangoDB.Builder() .host("localhost", 8529) .password("test") @@ -56,9 +53,8 @@ void connect(Protocol protocol) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void noopHostnameVerifier(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || TestUtils.isLessThanVersion(version.getVersion(), 3, 12, 0)); final ArangoDB arangoDB = new ArangoDB.Builder() .host("172.28.0.1", 8529) .password("test") @@ -72,9 +68,8 @@ void noopHostnameVerifier(Protocol protocol) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void hostnameVerifierFailure(Protocol protocol) { - assumeTrue(protocol != Protocol.VST, "VST does not support hostname verification"); final ArangoDB arangoDB = new ArangoDB.Builder() .host("172.28.0.1", 8529) .password("test") diff --git a/test-functional/src/test-ssl/java/utils/ProtocolSource.java b/test-functional/src/test-ssl/java/utils/ProtocolSource.java new file mode 100644 index 000000000..bda1f1385 --- /dev/null +++ b/test-functional/src/test-ssl/java/utils/ProtocolSource.java @@ -0,0 +1,19 @@ +package utils; + +import com.arangodb.Protocol; +import org.junit.jupiter.params.provider.EnumSource; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@EnumSource( + value = Protocol.class, + mode = EnumSource.Mode.EXCLUDE, + names = "VST" +) +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ProtocolSource { +} diff --git a/test-functional/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java b/test-functional/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java index 866dfe5e4..24c53d9a3 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java @@ -145,7 +145,6 @@ void insertDocumentReturnNew(ArangoCollectionAsync collection) throws ExecutionE @ParameterizedTest @MethodSource("asyncCols") void insertDocumentWithTypeOverwriteModeReplace(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); assumeTrue(collection.getSerde().getUserSerde() instanceof JacksonSerde, "polymorphic deserialization support" + " required"); @@ -180,8 +179,6 @@ void insertDocumentWithTypeOverwriteModeReplace(ArangoCollectionAsync collection @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeIgnore(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); - String key = "key-" + UUID.randomUUID(); final BaseDocument doc = new BaseDocument(key); doc.addAttribute("foo", "a"); @@ -199,8 +196,6 @@ void insertDocumentOverwriteModeIgnore(ArangoCollectionAsync collection) throws @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeConflict(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); - String key = "key-" + UUID.randomUUID(); final BaseDocument doc = new BaseDocument(key); doc.addAttribute("foo", "a"); @@ -218,8 +213,6 @@ void insertDocumentOverwriteModeConflict(ArangoCollectionAsync collection) throw @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeReplace(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); - String key = "key-" + UUID.randomUUID(); final BaseDocument doc = new BaseDocument(key); doc.addAttribute("foo", "a"); @@ -239,8 +232,6 @@ void insertDocumentOverwriteModeReplace(ArangoCollectionAsync collection) throws @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdate(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("foo", "a"); final DocumentCreateEntity> meta = collection.insertDocument(doc).get(); @@ -258,8 +249,6 @@ void insertDocumentOverwriteModeUpdate(ArangoCollectionAsync collection) throws @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdateMergeObjectsFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); MapfieldA = Collections.singletonMap("a", "a"); doc.addAttribute("foo", fieldA); @@ -278,8 +267,6 @@ void insertDocumentOverwriteModeUpdateMergeObjectsFalse(ArangoCollectionAsync co @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdateKeepNullTrue(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("foo", "bar"); collection.insertDocument(doc).get(); @@ -296,8 +283,6 @@ void insertDocumentOverwriteModeUpdateKeepNullTrue(ArangoCollectionAsync collect @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdateKeepNullFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("foo", "bar"); collection.insertDocument(doc).get(); @@ -314,8 +299,6 @@ void insertDocumentOverwriteModeUpdateKeepNullFalse(ArangoCollectionAsync collec @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdateWithExternalVersioning(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc).get(); @@ -333,8 +316,6 @@ void insertDocumentOverwriteModeUpdateWithExternalVersioning(ArangoCollectionAsy @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdateWithExternalVersioningFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc).get(); @@ -353,8 +334,6 @@ void insertDocumentOverwriteModeUpdateWithExternalVersioningFail(ArangoCollectio @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsOverwriteModeUpdateWithExternalVersioning(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -382,8 +361,6 @@ void insertDocumentsOverwriteModeUpdateWithExternalVersioning(ArangoCollectionAs @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsOverwriteModeUpdateWithExternalVersioningFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -411,8 +388,6 @@ void insertDocumentsOverwriteModeUpdateWithExternalVersioningFail(ArangoCollecti @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeReplaceWithExternalVersioning(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc).get(); @@ -430,8 +405,6 @@ void insertDocumentOverwriteModeReplaceWithExternalVersioning(ArangoCollectionAs @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeReplaceUpdateWithExternalVersioningFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc).get(); @@ -450,8 +423,6 @@ void insertDocumentOverwriteModeReplaceUpdateWithExternalVersioningFail(ArangoCo @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsOverwriteModeReplaceWithExternalVersioning(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -479,8 +450,6 @@ void insertDocumentsOverwriteModeReplaceWithExternalVersioning(ArangoCollectionA @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsOverwriteModeReplaceWithExternalVersioningFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -754,7 +723,7 @@ void getDocumentsWithCustomShardingKey(ArangoCollectionAsync c) throws Execution @ParameterizedTest @MethodSource("asyncCols") void getDocumentsDirtyRead(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isCluster()); // skip activefailover + assumeTrue(isCluster()); final Collection values = new ArrayList<>(); values.add(new BaseDocument("1")); values.add(new BaseDocument("2")); @@ -763,9 +732,7 @@ void getDocumentsDirtyRead(ArangoCollectionAsync collection) throws ExecutionExc final MultiDocumentEntity documents = collection.getDocuments(Arrays.asList("1", "2", "3"), BaseDocument.class, new DocumentReadOptions().allowDirtyRead(true)).get(); assertThat(documents).isNotNull(); - if (isAtLeastVersion(3, 10)) { - assertThat(documents.isPotentialDirtyRead()).isTrue(); - } + assertThat(documents.isPotentialDirtyRead()).isTrue(); assertThat(documents.getDocuments()).hasSize(3); for (final BaseDocument document : documents.getDocuments()) { assertThat(document.getId()).isIn(COLLECTION_NAME + "/" + "1", COLLECTION_NAME + "/" + "2", @@ -902,8 +869,6 @@ void updateDocumentIfMatchFail(ArangoCollectionAsync collection) throws Executio @ParameterizedTest @MethodSource("asyncCols") void updateDocumentWithExternalVersioning(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc).get(); @@ -919,8 +884,6 @@ void updateDocumentWithExternalVersioning(ArangoCollectionAsync collection) thro @ParameterizedTest @MethodSource("asyncCols") void updateDocumentWithExternalVersioningFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc).get(); @@ -936,8 +899,6 @@ void updateDocumentWithExternalVersioningFail(ArangoCollectionAsync collection) @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsWithExternalVersioning(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -962,8 +923,6 @@ void updateDocumentsWithExternalVersioning(ArangoCollectionAsync collection) thr @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsWithExternalVersioningFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -1361,8 +1320,6 @@ void replaceDocumentIgnoreRevsFalse(ArangoCollectionAsync collection) throws Exe @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentWithExternalVersioning(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc).get(); @@ -1378,8 +1335,6 @@ void replaceDocumentWithExternalVersioning(ArangoCollectionAsync collection) thr @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentWithExternalVersioningFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc).get(); @@ -1395,8 +1350,6 @@ void replaceDocumentWithExternalVersioningFail(ArangoCollectionAsync collection) @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsWithExternalVersioning(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -1421,8 +1374,6 @@ void replaceDocumentsWithExternalVersioning(ArangoCollectionAsync collection) th @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsWithExternalVersioningFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -1738,21 +1689,13 @@ void createGeoIndex(ArangoCollectionAsync collection) throws ExecutionException, assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo1); - } - if (isAtLeastVersion(3, 10)) { - assertThat(indexResult.getLegacyPolygons()).isFalse(); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); + assertThat(indexResult.getLegacyPolygons()).isFalse(); } @ParameterizedTest @MethodSource("asyncCols") void createGeoIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "geoIndex-" + rnd(); final GeoIndexOptions options = new GeoIndexOptions(); options.name(name); @@ -1767,22 +1710,14 @@ void createGeoIndexWithOptions(ArangoCollectionAsync collection) throws Executio assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo1); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); assertThat(indexResult.getName()).isEqualTo(name); - if (isAtLeastVersion(3, 10)) { - assertThat(indexResult.getLegacyPolygons()).isFalse(); - } + assertThat(indexResult.getLegacyPolygons()).isFalse(); } @ParameterizedTest @MethodSource("asyncCols") void createGeoIndexLegacyPolygons(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - String name = "geoIndex-" + rnd(); final GeoIndexOptions options = new GeoIndexOptions(); options.name(name); @@ -1798,15 +1733,9 @@ void createGeoIndexLegacyPolygons(ArangoCollectionAsync collection) throws Execu assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo1); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); assertThat(indexResult.getName()).isEqualTo(name); - if (isAtLeastVersion(3, 10)) { - assertThat(indexResult.getLegacyPolygons()).isTrue(); - } + assertThat(indexResult.getLegacyPolygons()).isTrue(); } @ParameterizedTest @@ -1825,18 +1754,12 @@ void createGeo2Index(ArangoCollectionAsync collection) throws ExecutionException assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo2); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); } @ParameterizedTest @MethodSource("asyncCols") void createGeo2IndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "geoIndex-" + rnd(); final GeoIndexOptions options = new GeoIndexOptions(); options.name(name); @@ -1854,11 +1777,7 @@ void createGeo2IndexWithOptions(ArangoCollectionAsync collection) throws Executi assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo2); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); assertThat(indexResult.getName()).isEqualTo(name); } @@ -1881,16 +1800,12 @@ void createPersistentIndex(ArangoCollectionAsync collection) throws ExecutionExc assertThat(indexResult.getType()).isEqualTo(IndexType.persistent); assertThat(indexResult.getUnique()).isFalse(); assertThat(indexResult.getDeduplicate()).isTrue(); - if (isAtLeastVersion(3, 10)) { - assertThat(indexResult.getCacheEnabled()).isFalse(); - } + assertThat(indexResult.getCacheEnabled()).isFalse(); } @ParameterizedTest @MethodSource("asyncCols") void createPersistentIndexCacheEnabled(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - String f1 = "field-" + rnd(); String f2 = "field-" + rnd(); final Collection fields = Arrays.asList(f1, f2); @@ -1913,8 +1828,6 @@ void createPersistentIndexCacheEnabled(ArangoCollectionAsync collection) throws @ParameterizedTest @MethodSource("asyncCols") void createPersistentIndexStoredValues(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - String f1 = "field-" + rnd(); String f2 = "field-" + rnd(); final Collection fields = Arrays.asList(f1, f2); @@ -1940,8 +1853,6 @@ void createPersistentIndexStoredValues(ArangoCollectionAsync collection) throws @ParameterizedTest @MethodSource("asyncCols") void createPersistentIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "persistentIndex-" + rnd(); final PersistentIndexOptions options = new PersistentIndexOptions(); options.name(name); @@ -1967,7 +1878,6 @@ void createPersistentIndexWithOptions(ArangoCollectionAsync collection) throws E @ParameterizedTest @MethodSource("asyncCols") void createZKDIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 9)); collection.truncate().get(); String f1 = "field-" + rnd(); String f2 = "field-" + rnd(); @@ -1989,7 +1899,6 @@ void createZKDIndex(ArangoCollectionAsync collection) throws ExecutionException, @ParameterizedTest @MethodSource("asyncCols") void createZKDIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 9)); collection.truncate().get(); String name = "ZKDIndex-" + rnd(); @@ -2017,7 +1926,6 @@ void createZKDIndexWithOptions(ArangoCollectionAsync collection) throws Executio @ParameterizedTest @MethodSource("asyncCols") void createMDIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); collection.truncate().get(); String f1 = "field-" + rnd(); @@ -2039,7 +1947,6 @@ void createMDIndex(ArangoCollectionAsync collection) throws ExecutionException, @ParameterizedTest @MethodSource("asyncCols") void createMDIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); collection.truncate().get(); String name = "MDIndex-" + rnd(); @@ -2073,7 +1980,6 @@ void createMDIndexWithOptions(ArangoCollectionAsync collection) throws Execution @ParameterizedTest @MethodSource("asyncCols") void createMDPrefixedIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); collection.truncate().get(); String name = "MDPrefixedIndex-" + rnd(); @@ -2109,7 +2015,6 @@ void createMDPrefixedIndexWithOptions(ArangoCollectionAsync collection) throws E @ParameterizedTest @MethodSource("asyncCols") void indexEstimates(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); assumeTrue(isSingleServer()); String name = "persistentIndex-" + rnd(); @@ -2130,7 +2035,6 @@ void indexEstimates(ArangoCollectionAsync collection) throws ExecutionException, @ParameterizedTest @MethodSource("asyncCols") void indexEstimatesFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); assumeTrue(isSingleServer()); String name = "persistentIndex-" + rnd(); @@ -2151,8 +2055,6 @@ void indexEstimatesFalse(ArangoCollectionAsync collection) throws ExecutionExcep @ParameterizedTest @MethodSource("asyncCols") void indexDeduplicate(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); - String name = "persistentIndex-" + rnd(); final PersistentIndexOptions options = new PersistentIndexOptions(); options.name(name); @@ -2170,8 +2072,6 @@ void indexDeduplicate(ArangoCollectionAsync collection) throws ExecutionExceptio @ParameterizedTest @MethodSource("asyncCols") void indexDeduplicateFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); - String name = "persistentIndex-" + rnd(); final PersistentIndexOptions options = new PersistentIndexOptions(); options.name(name); @@ -2205,8 +2105,6 @@ void createFulltextIndex(ArangoCollectionAsync collection) throws ExecutionExcep @ParameterizedTest @MethodSource("asyncCols") void createFulltextIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "fulltextIndex-" + rnd(); final FulltextIndexOptions options = new FulltextIndexOptions(); options.name(name); @@ -2228,7 +2126,6 @@ void createFulltextIndexWithOptions(ArangoCollectionAsync collection) throws Exe @ParameterizedTest @MethodSource("asyncCols") void createTtlIndexWithoutOptions(ArangoCollectionAsync collection) { - assumeTrue(isAtLeastVersion(3, 5)); final Collection fields = new ArrayList<>(); fields.add("a"); @@ -2243,8 +2140,6 @@ void createTtlIndexWithoutOptions(ArangoCollectionAsync collection) { @ParameterizedTest @MethodSource("asyncCols") void createTtlIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String f1 = "field-" + rnd(); final Collection fields = Collections.singletonList(f1); @@ -2391,8 +2286,6 @@ void insertDocuments(ArangoCollectionAsync collection) throws ExecutionException @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsOverwriteModeUpdate(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc1 = new BaseDocument(UUID.randomUUID().toString()); doc1.addAttribute("foo", "a"); final DocumentCreateEntity> meta1 = collection.insertDocument(doc1).get(); @@ -3374,9 +3267,7 @@ void getPropeties(ArangoCollectionAsync collection) throws ExecutionException, I void changeProperties(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final CollectionPropertiesEntity properties = collection.getProperties().get(); assertThat(properties.getWaitForSync()).isNotNull(); - if (isAtLeastVersion(3, 7)) { - assertThat(properties.getSchema()).isNull(); - } + assertThat(properties.getSchema()).isNull(); String schemaRule = ("{ " + " \"properties\": {" + " \"number\": {" + " " + " \"type\": \"number\"" + " }" + " }" + " }").replaceAll("\\s", ""); @@ -3388,20 +3279,15 @@ void changeProperties(ArangoCollectionAsync collection) throws ExecutionExceptio final CollectionPropertiesEntity changedProperties = collection.changeProperties(updatedOptions).get(); assertThat(changedProperties.getWaitForSync()).isNotNull(); assertThat(changedProperties.getWaitForSync()).isEqualTo(!properties.getWaitForSync()); - if (isAtLeastVersion(3, 7)) { - assertThat(changedProperties.getSchema()).isNotNull(); - assertThat(changedProperties.getSchema().getLevel()).isEqualTo(CollectionSchema.Level.NEW); - assertThat(changedProperties.getSchema().getMessage()).isEqualTo(schemaMessage); - assertThat(changedProperties.getSchema().getRule()).isEqualTo(schemaRule); - } + assertThat(changedProperties.getSchema()).isNotNull(); + assertThat(changedProperties.getSchema().getLevel()).isEqualTo(CollectionSchema.Level.NEW); + assertThat(changedProperties.getSchema().getMessage()).isEqualTo(schemaMessage); + assertThat(changedProperties.getSchema().getRule()).isEqualTo(schemaRule); // revert changes CollectionPropertiesEntity revertedProperties = collection.changeProperties(new CollectionPropertiesOptions() .waitForSync(properties.getWaitForSync()).schema(new CollectionSchema())).get(); - if (isAtLeastVersion(3, 7)) { - assertThat(revertedProperties.getSchema()).isNull(); - } - + assertThat(revertedProperties.getSchema()).isNull(); } @ParameterizedTest @@ -3435,7 +3321,6 @@ void rename(ArangoCollectionAsync collection) throws ExecutionException, Interru @MethodSource("asyncCols") void responsibleShard(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); - assumeTrue(isAtLeastVersion(3, 5)); ShardEntity shard = collection.getResponsibleShard(new BaseDocument("testKey")).get(); assertThat(shard).isNotNull(); assertThat(shard.getShardId()).isNotNull(); diff --git a/test-functional/src/test/java/com/arangodb/ArangoCollectionTest.java b/test-functional/src/test/java/com/arangodb/ArangoCollectionTest.java index aa28ef9c1..c3422e889 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoCollectionTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoCollectionTest.java @@ -148,7 +148,6 @@ void insertDocumentReturnNew(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void insertDocumentWithTypeOverwriteModeReplace(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); assumeTrue(collection.getSerde().getUserSerde() instanceof JacksonSerde, "polymorphic deserialization support" + " required"); @@ -183,8 +182,6 @@ void insertDocumentWithTypeOverwriteModeReplace(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeIgnore(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); - String key = "key-" + UUID.randomUUID(); final BaseDocument doc = new BaseDocument(key); doc.addAttribute("foo", "a"); @@ -202,8 +199,6 @@ void insertDocumentOverwriteModeIgnore(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeConflict(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); - String key = "key-" + UUID.randomUUID(); final BaseDocument doc = new BaseDocument(key); doc.addAttribute("foo", "a"); @@ -221,8 +216,6 @@ void insertDocumentOverwriteModeConflict(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeReplace(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); - String key = "key-" + UUID.randomUUID(); final BaseDocument doc = new BaseDocument(key); doc.addAttribute("foo", "a"); @@ -242,8 +235,6 @@ void insertDocumentOverwriteModeReplace(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdate(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("foo", "a"); final DocumentCreateEntity> meta = collection.insertDocument(doc); @@ -261,8 +252,6 @@ void insertDocumentOverwriteModeUpdate(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdateMergeObjectsFalse(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); Map fieldA = Collections.singletonMap("a", "a"); doc.addAttribute("foo", fieldA); @@ -281,8 +270,6 @@ void insertDocumentOverwriteModeUpdateMergeObjectsFalse(ArangoCollection collect @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdateKeepNullTrue(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("foo", "bar"); collection.insertDocument(doc); @@ -299,8 +286,6 @@ void insertDocumentOverwriteModeUpdateKeepNullTrue(ArangoCollection collection) @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdateKeepNullFalse(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("foo", "bar"); collection.insertDocument(doc); @@ -317,8 +302,6 @@ void insertDocumentOverwriteModeUpdateKeepNullFalse(ArangoCollection collection) @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdateWithExternalVersioning(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc); @@ -336,8 +319,6 @@ void insertDocumentOverwriteModeUpdateWithExternalVersioning(ArangoCollection co @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdateWithExternalVersioningFail(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc); @@ -356,8 +337,6 @@ void insertDocumentOverwriteModeUpdateWithExternalVersioningFail(ArangoCollectio @ParameterizedTest @MethodSource("cols") void insertDocumentsOverwriteModeUpdateWithExternalVersioning(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -385,8 +364,6 @@ void insertDocumentsOverwriteModeUpdateWithExternalVersioning(ArangoCollection c @ParameterizedTest @MethodSource("cols") void insertDocumentsOverwriteModeUpdateWithExternalVersioningFail(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -414,8 +391,6 @@ void insertDocumentsOverwriteModeUpdateWithExternalVersioningFail(ArangoCollecti @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeReplaceWithExternalVersioning(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc); @@ -433,8 +408,6 @@ void insertDocumentOverwriteModeReplaceWithExternalVersioning(ArangoCollection c @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeReplaceUpdateWithExternalVersioningFail(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc); @@ -453,8 +426,6 @@ void insertDocumentOverwriteModeReplaceUpdateWithExternalVersioningFail(ArangoCo @ParameterizedTest @MethodSource("cols") void insertDocumentsOverwriteModeReplaceWithExternalVersioning(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -482,8 +453,6 @@ void insertDocumentsOverwriteModeReplaceWithExternalVersioning(ArangoCollection @ParameterizedTest @MethodSource("cols") void insertDocumentsOverwriteModeReplaceWithExternalVersioningFail(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -606,9 +575,6 @@ void insertDocumentsSilent(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void insertDocumentsWithErrors(ArangoCollection collection) { - // BTS-615 - assumeTrue(isAtLeastVersion(3, 11)); - final MultiDocumentEntity > res = collection.insertDocuments(Arrays.asList( new BaseDocument(), @@ -807,7 +773,7 @@ void getDocumentsWithCustomShardingKey(ArangoCollection c) { @ParameterizedTest @MethodSource("cols") void getDocumentsDirtyRead(ArangoCollection collection) { - assumeTrue(isCluster()); // skip activefailover + assumeTrue(isCluster()); final Collection values = new ArrayList<>(); values.add(new BaseDocument("1")); values.add(new BaseDocument("2")); @@ -816,9 +782,7 @@ void getDocumentsDirtyRead(ArangoCollection collection) { final MultiDocumentEntity documents = collection.getDocuments(Arrays.asList("1", "2", "3"), BaseDocument.class, new DocumentReadOptions().allowDirtyRead(true)); assertThat(documents).isNotNull(); - if (isAtLeastVersion(3, 10)) { - assertThat(documents.isPotentialDirtyRead()).isTrue(); - } + assertThat(documents.isPotentialDirtyRead()).isTrue(); assertThat(documents.getDocuments()).hasSize(3); for (final BaseDocument document : documents.getDocuments()) { assertThat(document.getId()).isIn(COLLECTION_NAME + "/" + "1", COLLECTION_NAME + "/" + "2", @@ -955,8 +919,6 @@ void updateDocumentIfMatchFail(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void updateDocumentWithExternalVersioning(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc); @@ -972,8 +934,6 @@ void updateDocumentWithExternalVersioning(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void updateDocumentWithExternalVersioningFail(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc); @@ -989,8 +949,6 @@ void updateDocumentWithExternalVersioningFail(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void updateDocumentsWithExternalVersioning(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -1015,8 +973,6 @@ void updateDocumentsWithExternalVersioning(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void updateDocumentsWithExternalVersioningFail(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -1414,8 +1370,6 @@ void replaceDocumentIgnoreRevsFalse(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void replaceDocumentWithExternalVersioning(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc); @@ -1431,8 +1385,6 @@ void replaceDocumentWithExternalVersioning(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void replaceDocumentWithExternalVersioningFail(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("_version", 1); collection.insertDocument(doc); @@ -1448,8 +1400,6 @@ void replaceDocumentWithExternalVersioningFail(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void replaceDocumentsWithExternalVersioning(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -1474,8 +1424,6 @@ void replaceDocumentsWithExternalVersioning(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void replaceDocumentsWithExternalVersioningFail(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); - BaseDocument d1 = new BaseDocument(UUID.randomUUID().toString()); d1.addAttribute("_version", 1); BaseDocument d2 = new BaseDocument(UUID.randomUUID().toString()); @@ -1791,21 +1739,13 @@ void createGeoIndex(ArangoCollection collection) { assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo1); - } - if (isAtLeastVersion(3, 10)) { - assertThat(indexResult.getLegacyPolygons()).isFalse(); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); + assertThat(indexResult.getLegacyPolygons()).isFalse(); } @ParameterizedTest @MethodSource("cols") void createGeoIndexWithOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "geoIndex-" + rnd(); final GeoIndexOptions options = new GeoIndexOptions(); options.name(name); @@ -1820,22 +1760,14 @@ void createGeoIndexWithOptions(ArangoCollection collection) { assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo1); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); assertThat(indexResult.getName()).isEqualTo(name); - if (isAtLeastVersion(3, 10)) { - assertThat(indexResult.getLegacyPolygons()).isFalse(); - } + assertThat(indexResult.getLegacyPolygons()).isFalse(); } @ParameterizedTest @MethodSource("cols") void createGeoIndexLegacyPolygons(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 10)); - String name = "geoIndex-" + rnd(); final GeoIndexOptions options = new GeoIndexOptions(); options.name(name); @@ -1851,15 +1783,9 @@ void createGeoIndexLegacyPolygons(ArangoCollection collection) { assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo1); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); assertThat(indexResult.getName()).isEqualTo(name); - if (isAtLeastVersion(3, 10)) { - assertThat(indexResult.getLegacyPolygons()).isTrue(); - } + assertThat(indexResult.getLegacyPolygons()).isTrue(); } @ParameterizedTest @@ -1878,18 +1804,12 @@ void createGeo2Index(ArangoCollection collection) { assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo2); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); } @ParameterizedTest @MethodSource("cols") void createGeo2IndexWithOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "geoIndex-" + rnd(); final GeoIndexOptions options = new GeoIndexOptions(); options.name(name); @@ -1907,11 +1827,7 @@ void createGeo2IndexWithOptions(ArangoCollection collection) { assertThat(indexResult.getMinLength()).isNull(); assertThat(indexResult.getSparse()).isTrue(); assertThat(indexResult.getUnique()).isFalse(); - if (isAtLeastVersion(3, 4)) { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo); - } else { - assertThat(indexResult.getType()).isEqualTo(IndexType.geo2); - } + assertThat(indexResult.getType()).isEqualTo(IndexType.geo); assertThat(indexResult.getName()).isEqualTo(name); } @@ -1934,16 +1850,12 @@ void createPersistentIndex(ArangoCollection collection) { assertThat(indexResult.getType()).isEqualTo(IndexType.persistent); assertThat(indexResult.getUnique()).isFalse(); assertThat(indexResult.getDeduplicate()).isTrue(); - if (isAtLeastVersion(3, 10)) { assertThat(indexResult.getCacheEnabled()).isFalse(); - } } @ParameterizedTest @MethodSource("cols") void createPersistentIndexCacheEnabled(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 10)); - String f1 = "field-" + rnd(); String f2 = "field-" + rnd(); final Collection fields = Arrays.asList(f1, f2); @@ -1966,8 +1878,6 @@ void createPersistentIndexCacheEnabled(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createPersistentIndexStoredValues(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 10)); - String f1 = "field-" + rnd(); String f2 = "field-" + rnd(); final Collection fields = Arrays.asList(f1, f2); @@ -1993,8 +1903,6 @@ void createPersistentIndexStoredValues(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createPersistentIndexWithOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "persistentIndex-" + rnd(); final PersistentIndexOptions options = new PersistentIndexOptions(); options.name(name); @@ -2020,7 +1928,6 @@ void createPersistentIndexWithOptions(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createZKDIndex(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 9)); collection.truncate(); String f1 = "field-" + rnd(); String f2 = "field-" + rnd(); @@ -2042,7 +1949,6 @@ void createZKDIndex(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createZKDIndexWithOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 9)); collection.truncate(); String name = "ZKDIndex-" + rnd(); @@ -2070,7 +1976,6 @@ void createZKDIndexWithOptions(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createMDIndex(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); collection.truncate(); String f1 = "field-" + rnd(); @@ -2092,7 +1997,6 @@ void createMDIndex(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createMDIndexWithOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); collection.truncate(); String name = "MDIndex-" + rnd(); @@ -2126,7 +2030,6 @@ void createMDIndexWithOptions(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createMDPrefixedIndexWithOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 12)); collection.truncate(); String name = "MDPrefixedIndex-" + rnd(); @@ -2162,7 +2065,6 @@ void createMDPrefixedIndexWithOptions(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void indexEstimates(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 8)); assumeTrue(isSingleServer()); String name = "persistentIndex-" + rnd(); @@ -2183,7 +2085,6 @@ void indexEstimates(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void indexEstimatesFalse(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 8)); assumeTrue(isSingleServer()); String name = "persistentIndex-" + rnd(); @@ -2204,8 +2105,6 @@ void indexEstimatesFalse(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void indexDeduplicate(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 8)); - String name = "persistentIndex-" + rnd(); final PersistentIndexOptions options = new PersistentIndexOptions(); options.name(name); @@ -2223,8 +2122,6 @@ void indexDeduplicate(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void indexDeduplicateFalse(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 8)); - String name = "persistentIndex-" + rnd(); final PersistentIndexOptions options = new PersistentIndexOptions(); options.name(name); @@ -2258,8 +2155,6 @@ void createFulltextIndex(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createFulltextIndexWithOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "fulltextIndex-" + rnd(); final FulltextIndexOptions options = new FulltextIndexOptions(); options.name(name); @@ -2281,7 +2176,6 @@ void createFulltextIndexWithOptions(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createTtlIndexWithoutOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 5)); final Collection fields = new ArrayList<>(); fields.add("a"); @@ -2296,8 +2190,6 @@ void createTtlIndexWithoutOptions(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void createTtlIndexWithOptions(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 5)); - String f1 = "field-" + rnd(); final Collection fields = Collections.singletonList(f1); @@ -2471,8 +2363,6 @@ void insertDocumentsReturnNewUserData(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void insertDocumentsOverwriteModeUpdate(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 7)); - final BaseDocument doc1 = new BaseDocument(UUID.randomUUID().toString()); doc1.addAttribute("foo", "a"); final DocumentCreateEntity> meta1 = collection.insertDocument(doc1); @@ -3531,7 +3421,6 @@ void rename(ArangoCollection collection) { @MethodSource("cols") void responsibleShard(ArangoCollection collection) { assumeTrue(isCluster()); - assumeTrue(isAtLeastVersion(3, 5)); ShardEntity shard = collection.getResponsibleShard(new BaseDocument("testKey")); assertThat(shard).isNotNull(); assertThat(shard.getShardId()).isNotNull(); diff --git a/test-functional/src/test/java/com/arangodb/ArangoDBAsyncTest.java b/test-functional/src/test/java/com/arangodb/ArangoDBAsyncTest.java index 1598a7ca1..ef10a3df8 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoDBAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoDBAsyncTest.java @@ -26,6 +26,7 @@ import com.arangodb.internal.serde.SerdeUtils; import com.arangodb.model.*; import com.arangodb.model.LogOptions.SortOrder; +import com.arangodb.util.ProtocolSource; import com.arangodb.util.RawJson; import com.arangodb.util.SlowTest; import com.arangodb.util.UnicodeUtils; @@ -34,7 +35,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; import java.util.*; @@ -113,7 +113,6 @@ void createWithNotNormalizedName(ArangoDBAsync arangoDB) throws ExecutionExcepti @MethodSource("asyncArangos") void createDatabaseWithOptions(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); - assumeTrue(isAtLeastVersion(3, 6)); final String dbName = rndDbName(); final Boolean resultCreate = arangoDB.createDatabase(new DBCreateOptions() .name(dbName) @@ -139,8 +138,6 @@ void createDatabaseWithOptions(ArangoDBAsync arangoDB) throws ExecutionException @MethodSource("asyncArangos") void createDatabaseWithOptionsSatellite(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); - assumeTrue(isEnterprise()); - assumeTrue(isAtLeastVersion(3, 6)); final String dbName = rndDbName(); final Boolean resultCreate = arangoDB.createDatabase(new DBCreateOptions() @@ -191,9 +188,6 @@ void createDatabaseWithUsers(ArangoDBAsync arangoDB) throws InterruptedException assertThat(retrievedUser.getActive()).isTrue(); assertThat(retrievedUser.getExtra()).isEqualTo(extra); - // needed for active-failover tests only - Thread.sleep(2_000); - ArangoDBAsync arangoDBTestUser = new ArangoDB.Builder() .loadProperties(config) .user("testUser") @@ -358,10 +352,8 @@ void updateUserDefaultCollectionAccess(ArangoDBAsync arangoDB) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void authenticationFailPassword(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - final ArangoDBAsync arangoDB = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) @@ -375,10 +367,8 @@ void authenticationFailPassword(Protocol protocol) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void authenticationFailUser(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - final ArangoDBAsync arangoDB = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) @@ -405,16 +395,13 @@ void executeGetVersion(ArangoDBAsync arangoDB) throws ExecutionException, Interr assertThat(body.get("version").isTextual()).isTrue(); assertThat(body.get("details").isObject()).isTrue(); assertThat(response.getResponseCode()).isEqualTo(200); - if (isAtLeastVersion(3, 9)) { - String header = response.getHeaders().get("x-arango-queue-time-seconds"); - assertThat(header).isNotNull(); - } + String header = response.getHeaders().get("x-arango-queue-time-seconds"); + assertThat(header).isNotNull(); } @ParameterizedTest @MethodSource("asyncArangos") void getLogEntries(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null).get(); assertThat(logs.getTotal()).isPositive(); assertThat(logs.getMessages()).hasSize(logs.getTotal().intValue()); @@ -423,7 +410,6 @@ void getLogEntries(ArangoDBAsync arangoDB) throws ExecutionException, Interrupte @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesUpto(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logsUpto = arangoDB.getLogEntries(new LogOptions().upto(LogLevel.WARNING)).get(); assertThat(logsUpto.getMessages()) .map(LogEntriesEntity.Message::getLevel) @@ -433,7 +419,6 @@ void getLogEntriesUpto(ArangoDBAsync arangoDB) throws ExecutionException, Interr @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logsInfo = arangoDB.getLogEntries(new LogOptions().level(LogLevel.INFO)).get(); assertThat(logsInfo.getMessages()) .map(LogEntriesEntity.Message::getLevel) @@ -443,7 +428,6 @@ void getLogEntriesLevel(ArangoDBAsync arangoDB) throws ExecutionException, Inter @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesStart(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null).get(); final Long firstId = logs.getMessages().get(0).getId(); final LogEntriesEntity logsStart = arangoDB.getLogEntries(new LogOptions().start(firstId + 1)).get(); @@ -455,7 +439,6 @@ void getLogEntriesStart(ArangoDBAsync arangoDB) throws ExecutionException, Inter @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesSize(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null).get(); int count = logs.getMessages().size(); assertThat(count).isPositive(); @@ -466,7 +449,6 @@ void getLogEntriesSize(ArangoDBAsync arangoDB) throws ExecutionException, Interr @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesOffset(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null).get(); assertThat(logs.getTotal()).isPositive(); Long firstId = logs.getMessages().get(0).getId(); @@ -479,7 +461,6 @@ void getLogEntriesOffset(ArangoDBAsync arangoDB) throws ExecutionException, Inte @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesSearch(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null).get(); final LogEntriesEntity logsSearch = arangoDB.getLogEntries(new LogOptions().search(getTestDb())).get(); assertThat(logs.getTotal()).isGreaterThan(logsSearch.getTotal()); @@ -488,7 +469,6 @@ void getLogEntriesSearch(ArangoDBAsync arangoDB) throws ExecutionException, Inte @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesSortAsc(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(new LogOptions().sort(SortOrder.asc)).get(); long lastId = -1; List ids = logs.getMessages().stream() @@ -503,7 +483,6 @@ void getLogEntriesSortAsc(ArangoDBAsync arangoDB) throws ExecutionException, Int @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesSortDesc(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(new LogOptions().sort(SortOrder.desc)).get(); long lastId = Long.MAX_VALUE; List ids = logs.getMessages().stream() @@ -518,7 +497,6 @@ void getLogEntriesSortDesc(ArangoDBAsync arangoDB) throws ExecutionException, In @ParameterizedTest @MethodSource("asyncArangos") void getLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); // it fails in 3.6 active-failover (BTS-362) final LogLevelEntity logLevel = arangoDB.getLogLevel().get(); assertThat(logLevel.getAgency()).isEqualTo(LogLevelEntity.LogLevel.INFO); } @@ -526,7 +504,6 @@ void getLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedE @ParameterizedTest @MethodSource("asyncArangos") void setLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); // it fails in 3.6 active-failover (BTS-362) final LogLevelEntity entity = new LogLevelEntity(); try { entity.setAgency(LogLevelEntity.LogLevel.ERROR); @@ -541,7 +518,6 @@ void setLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedE @ParameterizedTest @MethodSource("asyncArangos") void setAllLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 9)); final LogLevelEntity entity = new LogLevelEntity(); try { entity.setAll(LogLevelEntity.LogLevel.ERROR); @@ -559,7 +535,6 @@ void setAllLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, Interrupt @ParameterizedTest @MethodSource("asyncArangos") void logLevelWithServerId(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); assumeTrue(isCluster()); String serverId = arangoDB.getServerId().get(); LogLevelOptions options = new LogLevelOptions().serverId(serverId); @@ -578,7 +553,6 @@ void logLevelWithServerId(ArangoDBAsync arangoDB) throws ExecutionException, Int @ParameterizedTest @MethodSource("asyncArangos") void resetLogLevels(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); LogLevelOptions options = new LogLevelOptions(); LogLevelEntity entity = new LogLevelEntity(); entity.setGraphs(LogLevelEntity.LogLevel.ERROR); @@ -593,7 +567,6 @@ void resetLogLevels(ArangoDBAsync arangoDB) throws ExecutionException, Interrupt @ParameterizedTest @MethodSource("asyncArangos") void resetLogLevelsWithServerId(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); assumeTrue(isCluster()); String serverId = arangoDB.getServerId().get(); LogLevelOptions options = new LogLevelOptions().serverId(serverId); @@ -611,7 +584,6 @@ void resetLogLevelsWithServerId(ArangoDBAsync arangoDB) throws ExecutionExceptio @ParameterizedTest @MethodSource("asyncArangos") void getQueryOptimizerRules(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); final Collection rules = arangoDB.getQueryOptimizerRules().get(); assertThat(rules).isNotEmpty(); for (QueryOptimizerRule rule : rules) { @@ -683,27 +655,22 @@ void queueTime(ArangoDBAsync arangoDB) throws InterruptedException, ExecutionExc QueueTimeMetrics qt = arangoDB.metrics().getQueueTime(); double avg = qt.getAvg(); QueueTimeSample[] values = qt.getValues(); - if (isAtLeastVersion(3, 9)) { - assertThat(values).hasSize(20); - for (int i = 0; i < values.length; i++) { - assertThat(values[i].value).isNotNegative(); - if (i > 0) { - assertThat(values[i].timestamp).isGreaterThanOrEqualTo(values[i - 1].timestamp); - } + assertThat(values).hasSize(20); + for (int i = 0; i < values.length; i++) { + assertThat(values[i].value).isNotNegative(); + if (i > 0) { + assertThat(values[i].timestamp).isGreaterThanOrEqualTo(values[i - 1].timestamp); } + } - if (avg < 0.0) { - System.err.println("avg < 0: " + avg); - System.err.println("got values:"); - for (QueueTimeSample v : values) { - System.err.println(v.value); - } + if (avg < 0.0) { + System.err.println("avg < 0: " + avg); + System.err.println("got values:"); + for (QueueTimeSample v : values) { + System.err.println(v.value); } - assertThat(avg).isNotNegative(); - } else { - assertThat(avg).isEqualTo(0.0); - assertThat(values).isEmpty(); } + assertThat(avg).isNotNegative(); } } diff --git a/test-functional/src/test/java/com/arangodb/ArangoDBTest.java b/test-functional/src/test/java/com/arangodb/ArangoDBTest.java index 7085c7ae7..467e1dddc 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoDBTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoDBTest.java @@ -26,6 +26,7 @@ import com.arangodb.internal.serde.SerdeUtils; import com.arangodb.model.*; import com.arangodb.model.LogOptions.SortOrder; +import com.arangodb.util.ProtocolSource; import com.arangodb.util.RawJson; import com.arangodb.util.SlowTest; import com.arangodb.util.UnicodeUtils; @@ -36,7 +37,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; import java.util.*; @@ -117,7 +117,6 @@ void createWithNotNormalizedName(ArangoDB arangoDB) { @MethodSource("arangos") void createDatabaseWithOptions(ArangoDB arangoDB) { assumeTrue(isCluster()); - assumeTrue(isAtLeastVersion(3, 6)); final String dbName = rndDbName(); final Boolean resultCreate = arangoDB.createDatabase(new DBCreateOptions() .name(dbName) @@ -143,8 +142,6 @@ void createDatabaseWithOptions(ArangoDB arangoDB) { @MethodSource("arangos") void createDatabaseWithOptionsSatellite(ArangoDB arangoDB) { assumeTrue(isCluster()); - assumeTrue(isEnterprise()); - assumeTrue(isAtLeastVersion(3, 6)); final String dbName = rndDbName(); final Boolean resultCreate = arangoDB.createDatabase(new DBCreateOptions() @@ -195,9 +192,6 @@ void createDatabaseWithUsers(ArangoDB arangoDB) throws InterruptedException { assertThat(retrievedUser.getActive()).isTrue(); assertThat(retrievedUser.getExtra()).isEqualTo(extra); - // needed for active-failover tests only - Thread.sleep(2_000); - ArangoDB arangoDBTestUser = new ArangoDB.Builder() .loadProperties(config) .user("testUser") @@ -360,10 +354,8 @@ void updateUserDefaultCollectionAccess(ArangoDB arangoDB) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void authenticationFailPassword(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - final ArangoDB arangoDB = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) @@ -375,10 +367,8 @@ void authenticationFailPassword(Protocol protocol) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void authenticationFailUser(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - final ArangoDB arangoDB = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) @@ -403,16 +393,13 @@ void executeGetVersion(ArangoDB arangoDB) { assertThat(body.get("version").isTextual()).isTrue(); assertThat(body.get("details").isObject()).isTrue(); assertThat(response.getResponseCode()).isEqualTo(200); - if (isAtLeastVersion(3, 9)) { - String header = response.getHeaders().get("x-arango-queue-time-seconds"); - assertThat(header).isNotNull(); - } + String header = response.getHeaders().get("x-arango-queue-time-seconds"); + assertThat(header).isNotNull(); } @ParameterizedTest @MethodSource("arangos") void executeJS(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 11)); Request> request = Request.builder() .db(ArangoRequestParam.SYSTEM) .method(Request.Method.POST) @@ -426,7 +413,6 @@ void executeJS(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntries(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null); assertThat(logs.getTotal()).isPositive(); assertThat(logs.getMessages()).hasSize(logs.getTotal().intValue()); @@ -435,7 +421,6 @@ void getLogEntries(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntriesUpto(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logsUpto = arangoDB.getLogEntries(new LogOptions().upto(LogLevel.WARNING)); assertThat(logsUpto.getMessages()) .map(LogEntriesEntity.Message::getLevel) @@ -445,7 +430,6 @@ void getLogEntriesUpto(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntriesLevel(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logsInfo = arangoDB.getLogEntries(new LogOptions().level(LogLevel.INFO)); assertThat(logsInfo.getMessages()) .map(LogEntriesEntity.Message::getLevel) @@ -455,7 +439,6 @@ void getLogEntriesLevel(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntriesStart(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null); final Long firstId = logs.getMessages().get(0).getId(); final LogEntriesEntity logsStart = arangoDB.getLogEntries(new LogOptions().start(firstId + 1)); @@ -467,7 +450,6 @@ void getLogEntriesStart(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntriesSize(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null); int count = logs.getMessages().size(); assertThat(count).isPositive(); @@ -478,7 +460,6 @@ void getLogEntriesSize(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntriesOffset(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null); assertThat(logs.getTotal()).isPositive(); Long firstId = logs.getMessages().get(0).getId(); @@ -491,7 +472,6 @@ void getLogEntriesOffset(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntriesSearch(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null); final LogEntriesEntity logsSearch = arangoDB.getLogEntries(new LogOptions().search(getTestDb())); assertThat(logs.getTotal()).isGreaterThan(logsSearch.getTotal()); @@ -500,7 +480,6 @@ void getLogEntriesSearch(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntriesSortAsc(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(new LogOptions().sort(SortOrder.asc)); long lastId = -1; List ids = logs.getMessages().stream() @@ -515,7 +494,6 @@ void getLogEntriesSortAsc(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogEntriesSortDesc(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(new LogOptions().sort(SortOrder.desc)); long lastId = Long.MAX_VALUE; List ids = logs.getMessages().stream() @@ -530,7 +508,6 @@ void getLogEntriesSortDesc(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getLogLevel(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 7)); // it fails in 3.6 active-failover (BTS-362) final LogLevelEntity logLevel = arangoDB.getLogLevel(); assertThat(logLevel.getAgency()).isEqualTo(LogLevelEntity.LogLevel.INFO); } @@ -538,7 +515,6 @@ void getLogLevel(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void setLogLevel(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 7)); // it fails in 3.6 active-failover (BTS-362) final LogLevelEntity entity = new LogLevelEntity(); try { entity.setAgency(LogLevelEntity.LogLevel.ERROR); @@ -553,7 +529,6 @@ void setLogLevel(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void setAllLogLevel(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 12)); final LogLevelEntity entity = new LogLevelEntity(); try { entity.setAll(LogLevelEntity.LogLevel.ERROR); @@ -573,7 +548,6 @@ void setAllLogLevel(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void logLevelWithServerId(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 10)); assumeTrue(isCluster()); String serverId = arangoDB.getServerId(); LogLevelOptions options = new LogLevelOptions().serverId(serverId); @@ -592,7 +566,6 @@ void logLevelWithServerId(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void resetLogLevels(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 12)); LogLevelOptions options = new LogLevelOptions(); LogLevelEntity entity = new LogLevelEntity(); entity.setGraphs(LogLevelEntity.LogLevel.ERROR); @@ -607,7 +580,6 @@ void resetLogLevels(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void resetLogLevelsWithServerId(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 12)); assumeTrue(isCluster()); String serverId = arangoDB.getServerId(); LogLevelOptions options = new LogLevelOptions().serverId(serverId); @@ -625,7 +597,6 @@ void resetLogLevelsWithServerId(ArangoDB arangoDB) { @ParameterizedTest @MethodSource("arangos") void getQueryOptimizerRules(ArangoDB arangoDB) { - assumeTrue(isAtLeastVersion(3, 10)); final Collection rules = arangoDB.getQueryOptimizerRules(); assertThat(rules).isNotEmpty(); for (QueryOptimizerRule rule : rules) { @@ -719,27 +690,22 @@ void queueTime(ArangoDB arangoDB) throws InterruptedException, ExecutionExceptio QueueTimeMetrics qt = arangoDB.metrics().getQueueTime(); double avg = qt.getAvg(); QueueTimeSample[] values = qt.getValues(); - if (isAtLeastVersion(3, 9)) { - assertThat(values).hasSize(20); - for (int i = 0; i < values.length; i++) { - assertThat(values[i].value).isNotNegative(); - if (i > 0) { - assertThat(values[i].timestamp).isGreaterThanOrEqualTo(values[i - 1].timestamp); - } + assertThat(values).hasSize(20); + for (int i = 0; i < values.length; i++) { + assertThat(values[i].value).isNotNegative(); + if (i > 0) { + assertThat(values[i].timestamp).isGreaterThanOrEqualTo(values[i - 1].timestamp); } + } - if (avg < 0.0) { - System.err.println("avg < 0: " + avg); - System.err.println("got values:"); - for (QueueTimeSample v : values) { - System.err.println(v.value); - } + if (avg < 0.0) { + System.err.println("avg < 0: " + avg); + System.err.println("got values:"); + for (QueueTimeSample v : values) { + System.err.println(v.value); } - assertThat(avg).isNotNegative(); - } else { - assertThat(avg).isEqualTo(0.0); - assertThat(values).isEmpty(); } + assertThat(avg).isNotNegative(); } @ParameterizedTest diff --git a/test-functional/src/test/java/com/arangodb/ArangoDatabaseAsyncTest.java b/test-functional/src/test/java/com/arangodb/ArangoDatabaseAsyncTest.java index bd6f45a2b..7a578e022 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoDatabaseAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoDatabaseAsyncTest.java @@ -133,7 +133,6 @@ void createCollectionWithReplicationFactor(ArangoDatabaseAsync db) throws Execut @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithWriteConcern(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); assumeTrue(isCluster()); String name = rndName(); @@ -149,7 +148,6 @@ void createCollectionWithWriteConcern(ArangoDatabaseAsync db) throws ExecutionEx @ParameterizedTest @MethodSource("asyncDbs") void createSatelliteCollection(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isEnterprise()); assumeTrue(isCluster()); String name = rndName(); @@ -179,7 +177,6 @@ void createCollectionWithNumberOfShards(ArangoDatabaseAsync db) throws Execution @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithShardingStrategys(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); assumeTrue(isCluster()); String name = rndName(); @@ -195,8 +192,6 @@ void createCollectionWithShardingStrategys(ArangoDatabaseAsync db) throws Execut @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithSmartJoinAttribute(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isEnterprise()); assumeTrue(isCluster()); String fooName = rndName(); @@ -213,8 +208,6 @@ void createCollectionWithSmartJoinAttribute(ArangoDatabaseAsync db) throws Execu @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithSmartJoinAttributeWrong(ArangoDatabaseAsync db) { - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isEnterprise()); assumeTrue(isCluster()); String name = rndName(); @@ -257,7 +250,6 @@ void createCollectionWithNumberOfShardsAndShardKeys(ArangoDatabaseAsync db) thro @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithDistributeShardsLike(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isEnterprise()); assumeTrue(isCluster()); final Integer numberOfShards = 3; @@ -292,7 +284,6 @@ void createCollectionWithKeyTypeAutoincrement(ArangoDatabaseAsync db) throws Exe @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithKeyTypePadded(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); createCollectionWithKeyType(db, KeyType.padded); } @@ -305,14 +296,12 @@ void createCollectionWithKeyTypeTraditional(ArangoDatabaseAsync db) throws Execu @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithKeyTypeUuid(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); createCollectionWithKeyType(db, KeyType.uuid); } @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithJsonSchema(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); String name = rndName(); String rule = ("{ " + " \"properties\": {" + @@ -360,7 +349,6 @@ void createCollectionWithJsonSchema(ArangoDatabaseAsync db) throws ExecutionExce @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithComputedFields(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); String cName = rndName(); ComputedValue cv = new ComputedValue() .name("foo") @@ -633,10 +621,8 @@ void queryStats(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx assertThat(cursor.getExtra().getStats().getExecutionTime()).isNotNull(); assertThat(cursor.getExtra().getStats().getPeakMemoryUsage()).isNotNull(); assertThat(cursor.getExtra().getStats().getIntermediateCommits()).isNotNull(); - if (isAtLeastVersion(3, 12)) { - assertThat(cursor.getExtra().getStats().getDocumentLookups()).isNotNull(); - assertThat(cursor.getExtra().getStats().getSeeks()).isNotNull(); - } + assertThat(cursor.getExtra().getStats().getDocumentLookups()).isNotNull(); + assertThat(cursor.getExtra().getStats().getSeeks()).isNotNull(); } @ParameterizedTest @@ -762,7 +748,6 @@ void queryWithFailOnWarningFalse(ArangoDatabaseAsync db) throws ExecutionExcepti @ParameterizedTest @MethodSource("asyncDbs") void queryWithTimeout(ArangoDatabaseAsync db) { - assumeTrue(isAtLeastVersion(3, 6)); Throwable thrown = catchThrowable(() -> db.query("RETURN SLEEP(1)", String.class, new AqlQueryOptions().maxRuntime(0.1)).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -821,7 +806,6 @@ void queryCursorInTx(ArangoDatabaseAsync db) throws ExecutionException, Interrup @ParameterizedTest @MethodSource("asyncDbs") void queryCursorRetry(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 11)); ArangoCursorAsync c1 = db.query("for i in 1..4 return i", Integer.class, new AqlQueryOptions().batchSize(1).allowRetry(true)).get(); List result = new ArrayList<>(); @@ -840,7 +824,6 @@ void queryCursorRetry(ArangoDatabaseAsync db) throws ExecutionException, Interru @ParameterizedTest @MethodSource("asyncDbs") void queryCursorRetryInTx(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 11)); StreamTransactionEntity tx = db.beginStreamTransaction(new StreamTransactionOptions()).get(); ArangoCursorAsync c1 = db.query("for i in 1..4 return i", Integer.class, new AqlQueryOptions().batchSize(1).allowRetry(true).streamTransactionId(tx.getId())).get(); @@ -937,9 +920,7 @@ void queryStream(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE @ParameterizedTest @MethodSource("asyncDbs") void queryForceOneShardAttributeValue(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); assumeTrue(isCluster()); - assumeTrue(isEnterprise()); String cname = "forceOneShardAttr-" + UUID.randomUUID(); db.createCollection(cname, new CollectionCreateOptions() @@ -1018,7 +999,6 @@ BaseDocument.class, new MapBuilder().put("@col", CNAME1).put("test", null).get() @ParameterizedTest @MethodSource("asyncArangos") void queryAllowRetry(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 11)); final ArangoCursorAsync cursor = arangoDB.db() .query("for i in 1..2 return i", String.class, new AqlQueryOptions().allowRetry(true).batchSize(1)).get(); assertThat(cursor.getResult()).containsExactly("1"); @@ -1036,7 +1016,6 @@ void queryAllowRetry(ArangoDBAsync arangoDB) throws ExecutionException, Interrup @ParameterizedTest @MethodSource("asyncArangos") void queryAllowRetryClose(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 11)); final ArangoCursorAsync cursor = arangoDB.db() .query("for i in 1..2 return i", String.class, new AqlQueryOptions().allowRetry(true).batchSize(1)).get(); assertThat(cursor.getResult()).containsExactly("1"); @@ -1050,7 +1029,6 @@ void queryAllowRetryClose(ArangoDBAsync arangoDB) throws ExecutionException, Int @ParameterizedTest @MethodSource("asyncArangos") void queryAllowRetryCloseBeforeLatestBatch(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 11)); final ArangoCursorAsync cursor = arangoDB.db() .query("for i in 1..2 return i", String.class, new AqlQueryOptions().allowRetry(true).batchSize(1)).get(); assertThat(cursor.getResult()).containsExactly("1"); @@ -1061,7 +1039,6 @@ void queryAllowRetryCloseBeforeLatestBatch(ArangoDBAsync arangoDB) throws Execut @ParameterizedTest @MethodSource("asyncArangos") void queryAllowRetryCloseSingleBatch(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 11)); final ArangoCursorAsync cursor = arangoDB.db() .query("for i in 1..2 return i", String.class, new AqlQueryOptions().allowRetry(true)).get(); assertThat(cursor.getResult()).containsExactly("1", "2"); @@ -1317,9 +1294,7 @@ void getCurrentlyRunningQueries(ArangoDatabaseAsync db) throws InterruptedExcept assertThat(queryEntity.getBindVars()).isEmpty(); assertThat(queryEntity.getStarted()).isInThePast(); assertThat(queryEntity.getRunTime()).isPositive(); - if (isAtLeastVersion(3, 11)) { - assertThat(queryEntity.getPeakMemoryUsage()).isNotNull(); - } + assertThat(queryEntity.getPeakMemoryUsage()).isNotNull(); assertThat(queryEntity.getState()).isEqualTo(QueryExecutionState.EXECUTING); assertThat(queryEntity.getStream()).isFalse(); q.get(); @@ -1373,9 +1348,7 @@ void getAndClearSlowQueries(ArangoDatabaseAsync db) throws ExecutionException, I assertThat(queryEntity.getBindVars()).isEmpty(); assertThat(queryEntity.getStarted()).isInThePast(); assertThat(queryEntity.getRunTime()).isPositive(); - if (isAtLeastVersion(3, 11)) { - assertThat(queryEntity.getPeakMemoryUsage()).isNotNull(); - } + assertThat(queryEntity.getPeakMemoryUsage()).isNotNull(); assertThat(queryEntity.getState()).isEqualTo(QueryExecutionState.FINISHED); assertThat(queryEntity.getStream()).isFalse(); @@ -1399,11 +1372,7 @@ void createGetDeleteAqlFunction(ArangoDatabaseAsync db) throws ExecutionExceptio } finally { final Integer deleteCount = db.deleteAqlFunction("myfunctions::temperature::celsiustofahrenheit", null).get(); // compatibility with ArangoDB < 3.4 - if (isAtLeastVersion(3, 4)) { - assertThat(deleteCount).isEqualTo(1); - } else { - assertThat(deleteCount).isNull(); - } + assertThat(deleteCount).isEqualTo(1); final Collection aqlFunctions = db.getAqlFunctions(null).get(); assertThat(aqlFunctions).hasSize(aqlFunctionsInitial.size()); } @@ -1423,12 +1392,7 @@ void createGetDeleteAqlFunctionWithNamespace(ArangoDatabaseAsync db) throws Exec } finally { final Integer deleteCount = db .deleteAqlFunction("myfunctions::temperature", new AqlFunctionDeleteOptions().group(true)).get(); - // compatibility with ArangoDB < 3.4 - if (isAtLeastVersion(3, 4)) { - assertThat(deleteCount).isEqualTo(2); - } else { - assertThat(deleteCount).isNull(); - } + assertThat(deleteCount).isEqualTo(2); final Collection aqlFunctions = db.getAqlFunctions(null).get(); assertThat(aqlFunctions).hasSize(aqlFunctionsInitial.size()); } @@ -1445,9 +1409,7 @@ void createGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE @ParameterizedTest @MethodSource("asyncDbs") void createGraphSatellite(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 7)); assumeTrue(isCluster()); - assumeTrue(isEnterprise()); String name = "graph-" + rnd(); final GraphEntity result = db.createGraph(name, null, new GraphCreateOptions().replicationFactor(ReplicationFactor.ofSatellite())).get(); @@ -1603,7 +1565,6 @@ void transactionInsertJson(ArangoDatabaseAsync db) throws ExecutionException, In @ParameterizedTest @MethodSource("asyncDbs") void transactionExclusiveWrite(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String key = "key-" + rnd(); final TransactionOptions options = new TransactionOptions().params("{\"_key\":\"" + key + "\"}") .exclusiveCollections(CNAME1); @@ -1655,7 +1616,7 @@ void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcep assertThat(info.getPath()).isNotNull(); assertThat(info.getIsSystem()).isFalse(); - if (isAtLeastVersion(3, 6) && isCluster()) { + if (isCluster()) { assertThat(info.getSharding()).isNotNull(); assertThat(info.getWriteConcern()).isNotNull(); assertThat(info.getReplicationFactor()).isNotNull(); @@ -1665,8 +1626,6 @@ void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcep @ParameterizedTest @MethodSource("asyncDbs") void shouldIncludeExceptionMessage(ArangoDatabaseAsync db) { - assumeTrue(isAtLeastVersion(3, 4)); - final String exceptionMessage = "My error context"; final String action = "function (params) {" + "throw '" + exceptionMessage + "';" + "}"; Throwable thrown = catchThrowable(() -> db.transaction(action, Void.class, null).get()).getCause(); diff --git a/test-functional/src/test/java/com/arangodb/ArangoDatabaseTest.java b/test-functional/src/test/java/com/arangodb/ArangoDatabaseTest.java index ea487e07c..19541e134 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoDatabaseTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoDatabaseTest.java @@ -134,7 +134,6 @@ void createCollectionWithReplicationFactor(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createCollectionWithWriteConcern(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); assumeTrue(isCluster()); String name = rndName(); @@ -150,7 +149,6 @@ void createCollectionWithWriteConcern(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createSatelliteCollection(ArangoDatabase db) { - assumeTrue(isEnterprise()); assumeTrue(isCluster()); String name = rndName(); @@ -180,7 +178,6 @@ void createCollectionWithNumberOfShards(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createCollectionWithShardingStrategys(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); assumeTrue(isCluster()); String name = rndName(); @@ -196,8 +193,6 @@ void createCollectionWithShardingStrategys(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createCollectionWithSmartJoinAttribute(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isEnterprise()); assumeTrue(isCluster()); String fooName = rndName(); @@ -214,8 +209,6 @@ void createCollectionWithSmartJoinAttribute(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createCollectionWithSmartJoinAttributeWrong(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isEnterprise()); assumeTrue(isCluster()); String name = rndName(); @@ -260,7 +253,6 @@ void createCollectionWithNumberOfShardsAndShardKeys(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createCollectionWithDistributeShardsLike(ArangoDatabase db) { - assumeTrue(isEnterprise()); assumeTrue(isCluster()); final Integer numberOfShards = 3; @@ -295,7 +287,6 @@ void createCollectionWithKeyTypeAutoincrement(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createCollectionWithKeyTypePadded(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); createCollectionWithKeyType(db, KeyType.padded); } @@ -308,14 +299,12 @@ void createCollectionWithKeyTypeTraditional(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createCollectionWithKeyTypeUuid(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); createCollectionWithKeyType(db, KeyType.uuid); } @ParameterizedTest @MethodSource("dbs") void createCollectionWithJsonSchema(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 7)); String name = rndName(); String rule = ("{ " + " \"properties\": {" + @@ -363,7 +352,6 @@ void createCollectionWithJsonSchema(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createCollectionWithComputedFields(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); String cName = rndName(); ComputedValue cv = new ComputedValue() .name("foo") @@ -687,10 +675,8 @@ void queryStats(ArangoDatabase db) { assertThat(cursor.getStats().getCacheHits()).isNotNull(); assertThat(cursor.getStats().getCacheMisses()).isNotNull(); assertThat(cursor.getStats().getIntermediateCommits()).isNotNull(); - if (isAtLeastVersion(3, 12)) { - assertThat(cursor.getStats().getDocumentLookups()).isNotNull(); - assertThat(cursor.getStats().getSeeks()).isNotNull(); - } + assertThat(cursor.getStats().getDocumentLookups()).isNotNull(); + assertThat(cursor.getStats().getSeeks()).isNotNull(); } @ParameterizedTest @@ -882,7 +868,6 @@ void queryWithFailOnWarningFalse(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void queryWithTimeout(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 6)); Throwable thrown = catchThrowable(() -> db.query("RETURN SLEEP(1)", String.class, new AqlQueryOptions().maxRuntime(0.1)).next()); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -938,7 +923,6 @@ void queryCursorInTx(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void queryCursorRetry(ArangoDatabase db) throws IOException { - assumeTrue(isAtLeastVersion(3, 11)); ArangoCursor cursor = db.query("for i in 1..4 return i", Integer.class, new AqlQueryOptions().batchSize(1).allowRetry(true)); List result = new ArrayList<>(); @@ -955,7 +939,6 @@ void queryCursorRetry(ArangoDatabase db) throws IOException { @ParameterizedTest @MethodSource("dbs") void queryCursorRetryInTx(ArangoDatabase db) throws IOException { - assumeTrue(isAtLeastVersion(3, 11)); StreamTransactionEntity tx = db.beginStreamTransaction(new StreamTransactionOptions()); ArangoCursor cursor = db.query("for i in 1..4 return i", Integer.class, new AqlQueryOptions().batchSize(1).allowRetry(true).streamTransactionId(tx.getId())); @@ -1053,9 +1036,7 @@ void queryStream(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void queryForceOneShardAttributeValue(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); assumeTrue(isCluster()); - assumeTrue(isEnterprise()); String cname = "forceOneShardAttr-" + UUID.randomUUID(); db.createCollection(cname, new CollectionCreateOptions() @@ -1135,16 +1116,13 @@ void queryAllowDirtyRead(ArangoDatabase db) throws IOException { final ArangoCursor cursor = db.query("FOR i IN @@col FILTER i.test == @test RETURN i", BaseDocument.class, new MapBuilder().put("@col", CNAME1).put("test", null).get(), new AqlQueryOptions().allowDirtyRead(true)); - if (isAtLeastVersion(3, 10)) { - assertThat(cursor.isPotentialDirtyRead()).isTrue(); - } + assertThat(cursor.isPotentialDirtyRead()).isTrue(); cursor.close(); } @ParameterizedTest @MethodSource("arangos") void queryAllowRetry(ArangoDB arangoDB) throws IOException { - assumeTrue(isAtLeastVersion(3, 11)); final ArangoCursor cursor = arangoDB.db() .query("for i in 1..2 return i", String.class, new AqlQueryOptions().allowRetry(true).batchSize(1)); assertThat(cursor.asListRemaining()).containsExactly("1", "2"); @@ -1153,7 +1131,6 @@ void queryAllowRetry(ArangoDB arangoDB) throws IOException { @ParameterizedTest @MethodSource("arangos") void queryAllowRetryClose(ArangoDB arangoDB) throws IOException { - assumeTrue(isAtLeastVersion(3, 11)); final ArangoCursor cursor = arangoDB.db() .query("for i in 1..2 return i", String.class, new AqlQueryOptions().allowRetry(true).batchSize(1)); assertThat(cursor.hasNext()).isTrue(); @@ -1167,7 +1144,6 @@ void queryAllowRetryClose(ArangoDB arangoDB) throws IOException { @ParameterizedTest @MethodSource("arangos") void queryAllowRetryCloseBeforeLatestBatch(ArangoDB arangoDB) throws IOException { - assumeTrue(isAtLeastVersion(3, 11)); final ArangoCursor cursor = arangoDB.db() .query("for i in 1..2 return i", String.class, new AqlQueryOptions().allowRetry(true).batchSize(1)); assertThat(cursor.hasNext()).isTrue(); @@ -1179,7 +1155,6 @@ void queryAllowRetryCloseBeforeLatestBatch(ArangoDB arangoDB) throws IOException @ParameterizedTest @MethodSource("arangos") void queryAllowRetryCloseSingleBatch(ArangoDB arangoDB) throws IOException { - assumeTrue(isAtLeastVersion(3, 11)); final ArangoCursor cursor = arangoDB.db() .query("for i in 1..2 return i", String.class, new AqlQueryOptions().allowRetry(true)); assertThat(cursor.hasNext()).isTrue(); @@ -1439,9 +1414,7 @@ void getCurrentlyRunningQueries(ArangoDatabase db) throws InterruptedException { assertThat(queryEntity.getBindVars()).isEmpty(); assertThat(queryEntity.getStarted()).isInThePast(); assertThat(queryEntity.getRunTime()).isPositive(); - if (isAtLeastVersion(3, 11)) { - assertThat(queryEntity.getPeakMemoryUsage()).isNotNull(); - } + assertThat(queryEntity.getPeakMemoryUsage()).isNotNull(); assertThat(queryEntity.getState()).isEqualTo(QueryExecutionState.EXECUTING); assertThat(queryEntity.getStream()).isFalse(); t.join(); @@ -1501,9 +1474,7 @@ void getAndClearSlowQueries(ArangoDatabase db) { assertThat(queryEntity.getBindVars()).isEmpty(); assertThat(queryEntity.getStarted()).isInThePast(); assertThat(queryEntity.getRunTime()).isPositive(); - if (isAtLeastVersion(3, 11)) { - assertThat(queryEntity.getPeakMemoryUsage()).isNotNull(); - } + assertThat(queryEntity.getPeakMemoryUsage()).isNotNull(); assertThat(queryEntity.getState()).isEqualTo(QueryExecutionState.FINISHED); assertThat(queryEntity.getStream()).isFalse(); @@ -1526,12 +1497,7 @@ void createGetDeleteAqlFunction(ArangoDatabase db) { assertThat(aqlFunctions).hasSizeGreaterThan(aqlFunctionsInitial.size()); } finally { final Integer deleteCount = db.deleteAqlFunction("myfunctions::temperature::celsiustofahrenheit", null); - // compatibility with ArangoDB < 3.4 - if (isAtLeastVersion(3, 4)) { - assertThat(deleteCount).isEqualTo(1); - } else { - assertThat(deleteCount).isNull(); - } + assertThat(deleteCount).isEqualTo(1); final Collection aqlFunctions = db.getAqlFunctions(null); assertThat(aqlFunctions).hasSize(aqlFunctionsInitial.size()); } @@ -1551,12 +1517,7 @@ void createGetDeleteAqlFunctionWithNamespace(ArangoDatabase db) { } finally { final Integer deleteCount = db .deleteAqlFunction("myfunctions::temperature", new AqlFunctionDeleteOptions().group(true)); - // compatibility with ArangoDB < 3.4 - if (isAtLeastVersion(3, 4)) { - assertThat(deleteCount).isEqualTo(2); - } else { - assertThat(deleteCount).isNull(); - } + assertThat(deleteCount).isEqualTo(2); final Collection aqlFunctions = db.getAqlFunctions(null); assertThat(aqlFunctions).hasSize(aqlFunctionsInitial.size()); } @@ -1573,9 +1534,7 @@ void createGraph(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createGraphSatellite(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 7)); assumeTrue(isCluster()); - assumeTrue(isEnterprise()); String name = "graph-" + rnd(); final GraphEntity result = db.createGraph(name, null, new GraphCreateOptions().replicationFactor(ReplicationFactor.ofSatellite())); @@ -1731,7 +1690,6 @@ void transactionInsertJson(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void transactionExclusiveWrite(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String key = "key-" + rnd(); final TransactionOptions options = new TransactionOptions().params("{\"_key\":\"" + key + "\"}") .exclusiveCollections(CNAME1); @@ -1783,7 +1741,7 @@ void getInfo(ArangoDatabase db) { assertThat(info.getPath()).isNotNull(); assertThat(info.getIsSystem()).isFalse(); - if (isAtLeastVersion(3, 6) && isCluster()) { + if (isCluster()) { assertThat(info.getSharding()).isNotNull(); assertThat(info.getWriteConcern()).isNotNull(); assertThat(info.getReplicationFactor()).isNotNull(); @@ -1793,8 +1751,6 @@ void getInfo(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void shouldIncludeExceptionMessage(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); - final String exceptionMessage = "My error context"; final String action = "function (params) {" + "throw '" + exceptionMessage + "';" + "}"; try { diff --git a/test-functional/src/test/java/com/arangodb/ArangoGraphAsyncTest.java b/test-functional/src/test/java/com/arangodb/ArangoGraphAsyncTest.java index ecda8505f..f1165b243 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoGraphAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoGraphAsyncTest.java @@ -96,7 +96,6 @@ void exists(ArangoGraphAsync graph) throws ExecutionException, InterruptedExcept @ParameterizedTest @MethodSource("asyncDbs") void createWithReplicationAndWriteConcern(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); assumeTrue(isCluster()); final Collection edgeDefinitions = new ArrayList<>(); @@ -171,10 +170,6 @@ void addVertexCollection(ArangoGraphAsync graph) throws ExecutionException, Inte @ParameterizedTest @MethodSource("asyncDbs") void addSatelliteVertexCollection(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - assumeTrue(isAtLeastVersion(3, 9)); - String v1Name = "vertex-" + rnd(); ArangoGraphAsync g = db.graph(GRAPH_NAME + rnd()); @@ -232,10 +227,6 @@ void addEdgeDefinition(ArangoGraphAsync graph) throws ExecutionException, Interr @ParameterizedTest @MethodSource("asyncDbs") void addSatelliteEdgeDefinition(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - assumeTrue(isAtLeastVersion(3, 9)); - String eName = "edge-" + rnd(); String v1Name = "vertex-" + rnd(); String v2Name = "vertex-" + rnd(); @@ -349,9 +340,6 @@ void removeEdgeDefinitionDropCollections(ArangoGraphAsync graph) throws Executio @ParameterizedTest @MethodSource("asyncDbs") void smartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - final Collection edgeDefinitions = new ArrayList<>(); edgeDefinitions.add(new EdgeDefinition().collection("smartGraph-edge-" + rnd()).from("smartGraph-vertex-" + rnd()).to("smartGraph-vertex-" + rnd())); @@ -368,10 +356,6 @@ void smartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx @ParameterizedTest @MethodSource("asyncDbs") void hybridSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue((isAtLeastVersion(3, 9))); - final Collection edgeDefinitions = new ArrayList<>(); String eName = "hybridSmartGraph-edge-" + rnd(); String v1Name = "hybridSmartGraph-vertex-" + rnd(); @@ -396,10 +380,6 @@ void hybridSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, Interru @ParameterizedTest @MethodSource("asyncDbs") void disjointSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue((isAtLeastVersion(3, 7))); - final Collection edgeDefinitions = new ArrayList<>(); edgeDefinitions.add(new EdgeDefinition().collection("smartGraph-edge-" + rnd()).from("smartGraph-vertex-" + rnd()).to("smartGraph-vertex-" + rnd())); @@ -417,10 +397,6 @@ void disjointSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, Inter @ParameterizedTest @MethodSource("asyncDbs") void hybridDisjointSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue((isAtLeastVersion(3, 9))); - final Collection edgeDefinitions = new ArrayList<>(); String eName = "hybridDisjointSmartGraph-edge-" + rnd(); String v1Name = "hybridDisjointSmartGraph-vertex-" + rnd(); @@ -445,9 +421,6 @@ void hybridDisjointSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, @ParameterizedTest @MethodSource("asyncDbs") void enterpriseGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - final Collection edgeDefinitions = new ArrayList<>(); edgeDefinitions.add(new EdgeDefinition().collection("enterpriseGraph-edge-" + rnd()).from("enterpriseGraph-vertex-" + rnd()).to("enterpriseGraph-vertex-" + rnd())); @@ -457,11 +430,7 @@ void enterpriseGraph(ArangoDatabaseAsync db) throws ExecutionException, Interrup assertThat(g).isNotNull(); assertThat(g.getSmartGraphAttribute()).isNull(); assertThat(g.getNumberOfShards()).isEqualTo(2); - if (isAtLeastVersion(3, 10)) { - assertThat(g.getIsSmart()).isTrue(); - } else { - assertThat(g.getIsSmart()).isFalse(); - } + assertThat(g.getIsSmart()).isTrue(); } @ParameterizedTest diff --git a/test-functional/src/test/java/com/arangodb/ArangoGraphTest.java b/test-functional/src/test/java/com/arangodb/ArangoGraphTest.java index 730db4e10..e8fa2a597 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoGraphTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoGraphTest.java @@ -92,7 +92,6 @@ void exists(ArangoGraph graph) { @ParameterizedTest @MethodSource("dbs") void createWithReplicationAndWriteConcern(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); assumeTrue(isCluster()); final Collection edgeDefinitions = new ArrayList<>(); @@ -167,10 +166,6 @@ void addVertexCollection(ArangoGraph graph) { @ParameterizedTest @MethodSource("dbs") void addSatelliteVertexCollection(ArangoDatabase db) { - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - assumeTrue(isAtLeastVersion(3, 9)); - String v1Name = "vertex-" + rnd(); ArangoGraph g = db.graph(GRAPH_NAME + rnd()); @@ -228,10 +223,6 @@ void addEdgeDefinition(ArangoGraph graph) { @ParameterizedTest @MethodSource("dbs") void addSatelliteEdgeDefinition(ArangoDatabase db) { - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - assumeTrue(isAtLeastVersion(3, 9)); - String eName = "edge-" + rnd(); String v1Name = "vertex-" + rnd(); String v2Name = "vertex-" + rnd(); @@ -286,7 +277,7 @@ void replaceEdgeDefinition(ArangoGraph graph) { @ParameterizedTest @MethodSource("graphs") @Disabled - // FIXME: with dropCollections=true the vertex collections remain in the graph as orphan and not dropped + // FIXME: with dropCollections=true the vertex collections remain in the graph as orphan and not dropped void replaceEdgeDefinitionDropCollections(ArangoGraph graph) { final GraphEntity g = graph .replaceEdgeDefinition(new EdgeDefinition().collection(EDGE_COL_1).from(VERTEX_COL_3).to(VERTEX_COL_4), @@ -345,9 +336,6 @@ void removeEdgeDefinitionDropCollections(ArangoGraph graph) { @ParameterizedTest @MethodSource("dbs") void smartGraph(ArangoDatabase db) { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - final Collection edgeDefinitions = new ArrayList<>(); edgeDefinitions.add(new EdgeDefinition().collection("smartGraph-edge-" + rnd()).from("smartGraph-vertex-" + rnd()).to("smartGraph-vertex-" + rnd())); @@ -364,10 +352,6 @@ void smartGraph(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void hybridSmartGraph(ArangoDatabase db) { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue((isAtLeastVersion(3, 9))); - final Collection edgeDefinitions = new ArrayList<>(); String eName = "hybridSmartGraph-edge-" + rnd(); String v1Name = "hybridSmartGraph-vertex-" + rnd(); @@ -392,10 +376,6 @@ void hybridSmartGraph(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void disjointSmartGraph(ArangoDatabase db) { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue((isAtLeastVersion(3, 7))); - final Collection edgeDefinitions = new ArrayList<>(); edgeDefinitions.add(new EdgeDefinition().collection("smartGraph-edge-" + rnd()).from("smartGraph-vertex-" + rnd()).to("smartGraph-vertex-" + rnd())); @@ -413,10 +393,6 @@ void disjointSmartGraph(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void hybridDisjointSmartGraph(ArangoDatabase db) { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - assumeTrue((isAtLeastVersion(3, 9))); - final Collection edgeDefinitions = new ArrayList<>(); String eName = "hybridDisjointSmartGraph-edge-" + rnd(); String v1Name = "hybridDisjointSmartGraph-vertex-" + rnd(); @@ -441,9 +417,6 @@ void hybridDisjointSmartGraph(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void enterpriseGraph(ArangoDatabase db) { - assumeTrue(isEnterprise()); - assumeTrue(isCluster() || isAtLeastVersion(3, 10)); - final Collection edgeDefinitions = new ArrayList<>(); edgeDefinitions.add(new EdgeDefinition().collection("enterpriseGraph-edge-" + rnd()).from("enterpriseGraph-vertex-" + rnd()).to("enterpriseGraph-vertex-" + rnd())); @@ -453,11 +426,7 @@ void enterpriseGraph(ArangoDatabase db) { assertThat(g).isNotNull(); assertThat(g.getSmartGraphAttribute()).isNull(); assertThat(g.getNumberOfShards()).isEqualTo(2); - if (isAtLeastVersion(3, 10)) { - assertThat(g.getIsSmart()).isTrue(); - } else { - assertThat(g.getIsSmart()).isFalse(); - } + assertThat(g.getIsSmart()).isTrue(); } @ParameterizedTest diff --git a/test-functional/src/test/java/com/arangodb/ArangoSearchAsyncTest.java b/test-functional/src/test/java/com/arangodb/ArangoSearchAsyncTest.java index 27cf4e31e..b77905790 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoSearchAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoSearchAsyncTest.java @@ -55,7 +55,6 @@ static void init() { @ParameterizedTest @MethodSource("asyncDbs") void exists(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); db.createArangoSearch(viewName, new ArangoSearchCreateOptions()).get(); assertThat(db.arangoSearch(viewName).exists().get()).isTrue(); @@ -64,7 +63,6 @@ void exists(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcept @ParameterizedTest @MethodSource("asyncDbs") void createAndExistsSearchAlias(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); String viewName = rndName(); db.createSearchAlias(viewName, new SearchAliasCreateOptions()).get(); assertThat(db.arangoSearch(viewName).exists().get()).isTrue(); @@ -73,7 +71,6 @@ void createAndExistsSearchAlias(ArangoDatabaseAsync db) throws ExecutionExceptio @ParameterizedTest @MethodSource("asyncDbs") void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); db.createArangoSearch(viewName, new ArangoSearchCreateOptions()).get(); final ViewEntity info = db.arangoSearch(viewName).getInfo().get(); @@ -86,7 +83,6 @@ void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcep @ParameterizedTest @MethodSource("asyncDbs") void drop(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); db.createArangoSearch(viewName, new ArangoSearchCreateOptions()).get(); final ArangoSearchAsync view = db.arangoSearch(viewName); @@ -98,7 +94,6 @@ void drop(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExceptio @MethodSource("asyncDbs") void rename(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final String name = viewName + "_new"; db.createArangoSearch(name, new ArangoSearchCreateOptions()).get(); @@ -110,7 +105,6 @@ void rename(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcept @ParameterizedTest @MethodSource("asyncDbs") void createArangoSearchView(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ViewEntity info = db.arangoSearch(viewName).create().get(); assertThat(info).isNotNull(); @@ -123,7 +117,6 @@ void createArangoSearchView(ArangoDatabaseAsync db) throws ExecutionException, I @ParameterizedTest @MethodSource("asyncDbs") void createSearchAliasView(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); String viewName = rndName(); final ViewEntity info = db.searchAlias(viewName).create().get(); assertThat(info).isNotNull(); @@ -136,7 +129,6 @@ void createSearchAliasView(ArangoDatabaseAsync db) throws ExecutionException, In @ParameterizedTest @MethodSource("asyncDbs") void createArangoSearchViewWithOptions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions(); final ViewEntity info = db.arangoSearch(viewName).create(options).get(); @@ -150,7 +142,6 @@ void createArangoSearchViewWithOptions(ArangoDatabaseAsync db) throws ExecutionE @ParameterizedTest @MethodSource("asyncDbs") void createArangoSearchViewWithPrimarySort(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); String viewName = rndName(); final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions(); @@ -170,23 +161,20 @@ void createArangoSearchViewWithPrimarySort(ArangoDatabaseAsync db) throws Execut assertThat(info.getType()).isEqualTo(ViewType.ARANGO_SEARCH); assertThat(db.arangoSearch(viewName).exists().get()).isTrue(); - if (isAtLeastVersion(3, 7)) { - final ArangoSearchPropertiesEntity properties = view.getProperties().get(); - assertThat(properties.getPrimarySortCompression()).isEqualTo(ArangoSearchCompression.none); - Collection retrievedStoredValues = properties.getStoredValues(); - assertThat(retrievedStoredValues).isNotNull(); - assertThat(retrievedStoredValues).hasSize(1); - StoredValue retrievedStoredValue = retrievedStoredValues.iterator().next(); - assertThat(retrievedStoredValue).isNotNull(); - assertThat(retrievedStoredValue.getFields()).isEqualTo(storedValue.getFields()); - assertThat(retrievedStoredValue.getCompression()).isEqualTo(storedValue.getCompression()); - } + final ArangoSearchPropertiesEntity properties = view.getProperties().get(); + assertThat(properties.getPrimarySortCompression()).isEqualTo(ArangoSearchCompression.none); + Collection retrievedStoredValues = properties.getStoredValues(); + assertThat(retrievedStoredValues).isNotNull(); + assertThat(retrievedStoredValues).hasSize(1); + StoredValue retrievedStoredValue = retrievedStoredValues.iterator().next(); + assertThat(retrievedStoredValue).isNotNull(); + assertThat(retrievedStoredValue.getFields()).isEqualTo(storedValue.getFields()); + assertThat(retrievedStoredValue.getCompression()).isEqualTo(storedValue.getCompression()); } @ParameterizedTest @MethodSource("asyncDbs") void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); String viewName = rndName(); final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions(); options.commitIntervalMsec(666666L); @@ -207,7 +195,6 @@ void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabaseAsync db) throws @ParameterizedTest @MethodSource("asyncDbs") void createSearchAliasViewWithOptions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); String viewName = rndName(); final SearchAliasCreateOptions options = new SearchAliasCreateOptions(); final ViewEntity info = db.searchAlias(viewName).create(options).get(); @@ -221,7 +208,6 @@ void createSearchAliasViewWithOptions(ArangoDatabaseAsync db) throws ExecutionEx @ParameterizedTest @MethodSource("asyncDbs") void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); ArangoCollectionAsync col = db.collection(COLL_1); String idxName1 = rndName(); col.ensureInvertedIndex(new InvertedIndexOptions() @@ -260,7 +246,6 @@ void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) th @ParameterizedTest @MethodSource("asyncDbs") void getArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ArangoSearchAsync view = db.arangoSearch(viewName); view.create(new ArangoSearchCreateOptions()).get(); @@ -280,7 +265,6 @@ void getArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionExcep @ParameterizedTest @MethodSource("asyncDbs") void updateArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ArangoSearchAsync view = db.arangoSearch(viewName); view.create(new ArangoSearchCreateOptions()).get(); @@ -313,7 +297,6 @@ void updateArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionEx @ParameterizedTest @MethodSource("asyncDbs") void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); ArangoCollectionAsync col = db.collection(COLL_1); String idxName = rndName(); col.ensureInvertedIndex(new InvertedIndexOptions() @@ -353,7 +336,6 @@ void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) th @ParameterizedTest @MethodSource("asyncDbs") void replaceArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ArangoSearchAsync view = db.arangoSearch(viewName); view.create(new ArangoSearchCreateOptions()).get(); @@ -372,7 +354,6 @@ void replaceArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionE @ParameterizedTest @MethodSource("asyncDbs") void replaceSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); ArangoCollectionAsync col = db.collection(COLL_1); String idxName = rndName(); col.ensureInvertedIndex(new InvertedIndexOptions() @@ -443,8 +424,6 @@ private void createGetAndDeleteTypedAnalyzer(ArangoDatabaseAsync db, SearchAnaly @ParameterizedTest @MethodSource("asyncDbs") void identityAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -462,8 +441,6 @@ void identityAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, In @ParameterizedTest @MethodSource("asyncDbs") void delimiterAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -485,8 +462,6 @@ void delimiterAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, I @ParameterizedTest @MethodSource("asyncDbs") void multiDelimiterAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -508,8 +483,6 @@ void multiDelimiterAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionExcepti @ParameterizedTest @MethodSource("asyncDbs") void stemAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -531,8 +504,6 @@ void stemAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, Interr @ParameterizedTest @MethodSource("asyncDbs") void normAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -556,8 +527,6 @@ void normAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, Interr @ParameterizedTest @MethodSource("asyncDbs") void ngramAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -582,8 +551,6 @@ void ngramAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, Inter @ParameterizedTest @MethodSource("asyncDbs") void enhancedNgramAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 6)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -610,8 +577,6 @@ void enhancedNgramAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionExceptio @ParameterizedTest @MethodSource("asyncDbs") void textAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -637,8 +602,6 @@ void textAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, Interr @ParameterizedTest @MethodSource("asyncDbs") void enhancedTextAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 6)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -669,14 +632,11 @@ void enhancedTextAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException @ParameterizedTest @MethodSource("asyncDbs") void arangoSearchOptions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); FieldLink field = FieldLink.on("f1") .inBackground(true) .cache(false); - if (isEnterprise()) { - field.nested(FieldLink.on("f2")); - } + field.nested(FieldLink.on("f2")); CollectionLink link = CollectionLink.on(COLL_1) .analyzers("identity") .fields(field) @@ -685,10 +645,7 @@ void arangoSearchOptions(ArangoDatabaseAsync db) throws ExecutionException, Inte .trackListPositions(false) .inBackground(true) .cache(true); - - if (isEnterprise()) { - link.nested(FieldLink.on("f3")); - } + link.nested(FieldLink.on("f3")); ArangoSearchCreateOptions options = new ArangoSearchCreateOptions() .link(link) .primarySortCache(true) @@ -716,40 +673,27 @@ void arangoSearchOptions(ArangoDatabaseAsync db) throws ExecutionException, Inte assertThat(createdLink.getTrackListPositions()).isFalse(); FieldLink fieldLink = createdLink.getFields().iterator().next(); - if (isEnterprise()) { - assertThat(createdLink.getCache()).isTrue(); - assertThat(fieldLink.getCache()).isFalse(); - assertThat(properties.getPrimaryKeyCache()).isTrue(); - assertThat(properties.getPrimarySortCache()).isTrue(); - assertThat(properties.getStoredValues()) - .isNotEmpty() - .allSatisfy(it -> assertThat(it.getCache()).isTrue()); - } - - if (isEnterprise() && isAtLeastVersion(3, 10)) { - assertThat(createdLink.getNested()).isNotEmpty(); - FieldLink nested = createdLink.getNested().iterator().next(); - assertThat(nested.getName()).isEqualTo("f3"); - } + assertThat(createdLink.getCache()).isTrue(); + assertThat(fieldLink.getCache()).isFalse(); + assertThat(properties.getPrimaryKeyCache()).isTrue(); + assertThat(properties.getPrimarySortCache()).isTrue(); + assertThat(properties.getStoredValues()) + .isNotEmpty() + .allSatisfy(it -> assertThat(it.getCache()).isTrue()); + assertThat(createdLink.getNested()).isNotEmpty(); + FieldLink nested = createdLink.getNested().iterator().next(); + assertThat(nested.getName()).isEqualTo("f3"); assertThat(fieldLink.getName()).isEqualTo("f1"); - if (isEnterprise() && isAtLeastVersion(3, 10)) { - assertThat(fieldLink.getNested()).isNotEmpty(); - FieldLink nested = fieldLink.getNested().iterator().next(); - assertThat(nested.getName()).isEqualTo("f2"); - } - - if (isEnterprise() && isAtLeastVersion(3, 12)) { - assertThat(properties.getOptimizeTopK()).containsExactly(optimizeTopK); - } - + assertThat(fieldLink.getNested()).isNotEmpty(); + FieldLink nested2 = fieldLink.getNested().iterator().next(); + assertThat(nested2.getName()).isEqualTo("f2"); + assertThat(properties.getOptimizeTopK()).containsExactly(optimizeTopK); } @ParameterizedTest @MethodSource("asyncDbs") void pipelineAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); - // comma delimiter DelimiterAnalyzerProperties commaDelimiterProperties = new DelimiterAnalyzerProperties(); commaDelimiterProperties.setDelimiter(","); @@ -793,8 +737,6 @@ void pipelineAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interru @ParameterizedTest @MethodSource("asyncDbs") void stopwordsAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); - Set features = new HashSet<>(); features.add(AnalyzerFeature.frequency); features.add(AnalyzerFeature.norm); @@ -825,8 +767,6 @@ void stopwordsAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interr @ParameterizedTest @MethodSource("asyncDbs") void aqlAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); - AQLAnalyzerProperties properties = new AQLAnalyzerProperties(); properties.setBatchSize(2); properties.setCollapsePositions(true); @@ -851,8 +791,6 @@ void aqlAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE @ParameterizedTest @MethodSource("asyncDbs") void geoJsonAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); - GeoAnalyzerOptions options = new GeoAnalyzerOptions(); options.setMaxLevel(10); options.setMaxCells(11); @@ -880,9 +818,6 @@ void geoJsonAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interrup @ParameterizedTest @MethodSource("asyncDbs") void geoS2Analyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isEnterprise()); - assumeTrue(isAtLeastVersion(3, 10, 5)); - GeoAnalyzerOptions options = new GeoAnalyzerOptions(); options.setMaxLevel(10); options.setMaxCells(11); @@ -910,8 +845,6 @@ void geoS2Analyzer(ArangoDatabaseAsync db) throws ExecutionException, Interrupte @ParameterizedTest @MethodSource("asyncDbs") void geoPointAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 8)); - GeoAnalyzerOptions options = new GeoAnalyzerOptions(); options.setMaxLevel(10); options.setMaxCells(11); @@ -939,8 +872,6 @@ void geoPointAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interru @ParameterizedTest @MethodSource("asyncDbs") void segmentationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 9)); - SegmentationAnalyzerProperties properties = new SegmentationAnalyzerProperties(); properties.setBreakMode(SegmentationAnalyzerProperties.BreakMode.graphic); properties.setAnalyzerCase(SearchAnalyzerCase.upper); @@ -961,8 +892,6 @@ void segmentationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Int @ParameterizedTest @MethodSource("asyncDbs") void collationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 9)); - CollationAnalyzerProperties properties = new CollationAnalyzerProperties(); properties.setLocale("ru"); @@ -983,9 +912,6 @@ void collationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interr @ParameterizedTest @MethodSource("asyncDbs") void classificationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - ClassificationAnalyzerProperties properties = new ClassificationAnalyzerProperties(); properties.setModelLocation("/tmp/foo.bin"); properties.setTopK(2); @@ -1007,9 +933,6 @@ void classificationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, I @ParameterizedTest @MethodSource("asyncDbs") void nearestNeighborsAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - NearestNeighborsAnalyzerProperties properties = new NearestNeighborsAnalyzerProperties(); properties.setModelLocation("/tmp/foo.bin"); properties.setTopK(2); @@ -1030,9 +953,6 @@ void nearestNeighborsAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, @ParameterizedTest @MethodSource("asyncDbs") void MinHashAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - SegmentationAnalyzerProperties segProperties = new SegmentationAnalyzerProperties(); segProperties.setBreakMode(SegmentationAnalyzerProperties.BreakMode.alpha); segProperties.setAnalyzerCase(SearchAnalyzerCase.lower); @@ -1060,8 +980,6 @@ void MinHashAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interrup @ParameterizedTest @MethodSource("asyncDbs") void WildcardAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 12)); - NormAnalyzerProperties properties = new NormAnalyzerProperties(); properties.setLocale("ru"); properties.setAnalyzerCase(SearchAnalyzerCase.lower); @@ -1089,8 +1007,6 @@ void WildcardAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interru @ParameterizedTest @MethodSource("asyncDbs") void offsetFeature(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); diff --git a/test-functional/src/test/java/com/arangodb/ArangoSearchTest.java b/test-functional/src/test/java/com/arangodb/ArangoSearchTest.java index 0af1e8941..dc13db24d 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoSearchTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoSearchTest.java @@ -54,7 +54,6 @@ static void init() { @ParameterizedTest @MethodSource("dbs") void exists(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); db.createArangoSearch(viewName, new ArangoSearchCreateOptions()); assertThat(db.arangoSearch(viewName).exists()).isTrue(); @@ -63,7 +62,6 @@ void exists(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createAndExistsSearchAlias(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); String viewName = rndName(); db.createSearchAlias(viewName, new SearchAliasCreateOptions()); assertThat(db.arangoSearch(viewName).exists()).isTrue(); @@ -72,7 +70,6 @@ void createAndExistsSearchAlias(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void getInfo(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); db.createArangoSearch(viewName, new ArangoSearchCreateOptions()); final ViewEntity info = db.arangoSearch(viewName).getInfo(); @@ -85,7 +82,6 @@ void getInfo(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void drop(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); db.createArangoSearch(viewName, new ArangoSearchCreateOptions()); final ArangoView view = db.arangoSearch(viewName); @@ -97,7 +93,6 @@ void drop(ArangoDatabase db) { @MethodSource("dbs") void rename(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final String name = viewName + "_new"; db.createArangoSearch(name, new ArangoSearchCreateOptions()); @@ -109,7 +104,6 @@ void rename(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createArangoSearchView(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ViewEntity info = db.arangoSearch(viewName).create(); assertThat(info).isNotNull(); @@ -122,7 +116,6 @@ void createArangoSearchView(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createSearchAliasView(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); String viewName = rndName(); final ViewEntity info = db.searchAlias(viewName).create(); assertThat(info).isNotNull(); @@ -135,7 +128,6 @@ void createSearchAliasView(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createArangoSearchViewWithOptions(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions(); final ViewEntity info = db.arangoSearch(viewName).create(options); @@ -149,7 +141,6 @@ void createArangoSearchViewWithOptions(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createArangoSearchViewWithPrimarySort(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); String viewName = rndName(); final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions(); @@ -169,30 +160,27 @@ void createArangoSearchViewWithPrimarySort(ArangoDatabase db) { assertThat(info.getType()).isEqualTo(ViewType.ARANGO_SEARCH); assertThat(db.arangoSearch(viewName).exists()).isTrue(); - if (isAtLeastVersion(3, 7)) { - final ArangoSearchPropertiesEntity properties = view.getProperties(); - assertThat(properties.getPrimarySortCompression()).isEqualTo(ArangoSearchCompression.none); - Collection retrievedStoredValues = properties.getStoredValues(); - assertThat(retrievedStoredValues).isNotNull(); - assertThat(retrievedStoredValues).hasSize(1); - StoredValue retrievedStoredValue = retrievedStoredValues.iterator().next(); - assertThat(retrievedStoredValue).isNotNull(); - assertThat(retrievedStoredValue.getFields()).isEqualTo(storedValue.getFields()); - assertThat(retrievedStoredValue.getCompression()).isEqualTo(storedValue.getCompression()); - assertThat(properties.getPrimarySort()) - .hasSize(1) - .allSatisfy(ps -> { - assertThat(ps).isNotNull(); - assertThat(ps.getField()).isEqualTo(primarySort.getField()); - assertThat(ps.getAscending()).isEqualTo(primarySort.getAscending()); - }); - } + final ArangoSearchPropertiesEntity properties = view.getProperties(); + assertThat(properties.getPrimarySortCompression()).isEqualTo(ArangoSearchCompression.none); + Collection retrievedStoredValues = properties.getStoredValues(); + assertThat(retrievedStoredValues).isNotNull(); + assertThat(retrievedStoredValues).hasSize(1); + StoredValue retrievedStoredValue = retrievedStoredValues.iterator().next(); + assertThat(retrievedStoredValue).isNotNull(); + assertThat(retrievedStoredValue.getFields()).isEqualTo(storedValue.getFields()); + assertThat(retrievedStoredValue.getCompression()).isEqualTo(storedValue.getCompression()); + assertThat(properties.getPrimarySort()) + .hasSize(1) + .allSatisfy(ps -> { + assertThat(ps).isNotNull(); + assertThat(ps.getField()).isEqualTo(primarySort.getField()); + assertThat(ps.getAscending()).isEqualTo(primarySort.getAscending()); + }); } @ParameterizedTest @MethodSource("dbs") void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); String viewName = rndName(); final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions(); options.commitIntervalMsec(666666L); @@ -213,7 +201,6 @@ void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createSearchAliasViewWithOptions(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); String viewName = rndName(); final SearchAliasCreateOptions options = new SearchAliasCreateOptions(); final ViewEntity info = db.searchAlias(viewName).create(options); @@ -227,7 +214,6 @@ void createSearchAliasViewWithOptions(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); ArangoCollection col = db.collection(COLL_1); String idxName1 = rndName(); col.ensureInvertedIndex(new InvertedIndexOptions() @@ -266,7 +252,6 @@ void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void getArangoSearchViewProperties(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ArangoSearch view = db.arangoSearch(viewName); view.create(new ArangoSearchCreateOptions()); @@ -286,7 +271,6 @@ void getArangoSearchViewProperties(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void updateArangoSearchViewProperties(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ArangoSearch view = db.arangoSearch(viewName); view.create(new ArangoSearchCreateOptions()); @@ -319,7 +303,6 @@ void updateArangoSearchViewProperties(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); ArangoCollection col = db.collection(COLL_1); String idxName = rndName(); col.ensureInvertedIndex(new InvertedIndexOptions() @@ -359,7 +342,6 @@ void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void replaceArangoSearchViewProperties(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); final ArangoSearch view = db.arangoSearch(viewName); view.create(new ArangoSearchCreateOptions()); @@ -378,7 +360,6 @@ void replaceArangoSearchViewProperties(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void replaceSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); ArangoCollection col = db.collection(COLL_1); String idxName = rndName(); col.ensureInvertedIndex(new InvertedIndexOptions() @@ -449,8 +430,6 @@ private void createGetAndDeleteTypedAnalyzer(ArangoDatabase db, SearchAnalyzer a @ParameterizedTest @MethodSource("dbs") void identityAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -468,8 +447,6 @@ void identityAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void delimiterAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -491,8 +468,6 @@ void delimiterAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void multiDelimiterAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 12)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -514,8 +489,6 @@ void multiDelimiterAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void stemAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -537,8 +510,6 @@ void stemAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void normAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -562,8 +533,6 @@ void normAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void ngramAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -588,8 +557,6 @@ void ngramAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void enhancedNgramAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 6)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -616,8 +583,6 @@ void enhancedNgramAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void textAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 5)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -643,8 +608,6 @@ void textAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void enhancedTextAnalyzerTyped(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 6)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); @@ -675,14 +638,11 @@ void enhancedTextAnalyzerTyped(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void arangoSearchOptions(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 4)); String viewName = rndName(); FieldLink field = FieldLink.on("f1") .inBackground(true) .cache(false); - if (isEnterprise()) { - field.nested(FieldLink.on("f2")); - } + field.nested(FieldLink.on("f2")); CollectionLink link = CollectionLink.on(COLL_1) .analyzers("identity") .fields(field) @@ -692,9 +652,7 @@ void arangoSearchOptions(ArangoDatabase db) { .inBackground(true) .cache(true); - if (isEnterprise()) { - link.nested(FieldLink.on("f3")); - } + link.nested(FieldLink.on("f3")); ArangoSearchCreateOptions options = new ArangoSearchCreateOptions() .link(link) .primarySortCache(true) @@ -722,40 +680,26 @@ void arangoSearchOptions(ArangoDatabase db) { assertThat(createdLink.getTrackListPositions()).isFalse(); FieldLink fieldLink = createdLink.getFields().iterator().next(); - if (isEnterprise()) { - assertThat(createdLink.getCache()).isTrue(); - assertThat(fieldLink.getCache()).isFalse(); - assertThat(properties.getPrimaryKeyCache()).isTrue(); - assertThat(properties.getPrimarySortCache()).isTrue(); - assertThat(properties.getStoredValues()) - .isNotEmpty() - .allSatisfy(it -> assertThat(it.getCache()).isTrue()); - } - - if (isEnterprise() && isAtLeastVersion(3, 10)) { - assertThat(createdLink.getNested()).isNotEmpty(); - FieldLink nested = createdLink.getNested().iterator().next(); - assertThat(nested.getName()).isEqualTo("f3"); - } - + assertThat(createdLink.getCache()).isTrue(); + assertThat(fieldLink.getCache()).isFalse(); + assertThat(properties.getPrimaryKeyCache()).isTrue(); + assertThat(properties.getPrimarySortCache()).isTrue(); + assertThat(properties.getStoredValues()) + .isNotEmpty() + .allSatisfy(it -> assertThat(it.getCache()).isTrue()); + assertThat(createdLink.getNested()).isNotEmpty(); + FieldLink nested = createdLink.getNested().iterator().next(); + assertThat(nested.getName()).isEqualTo("f3"); assertThat(fieldLink.getName()).isEqualTo("f1"); - if (isEnterprise() && isAtLeastVersion(3, 10)) { - assertThat(fieldLink.getNested()).isNotEmpty(); - FieldLink nested = fieldLink.getNested().iterator().next(); - assertThat(nested.getName()).isEqualTo("f2"); - } - - if (isEnterprise() && isAtLeastVersion(3, 12)) { - assertThat(properties.getOptimizeTopK()).containsExactly(optimizeTopK); - } - + assertThat(fieldLink.getNested()).isNotEmpty(); + FieldLink nested2 = fieldLink.getNested().iterator().next(); + assertThat(nested2.getName()).isEqualTo("f2"); + assertThat(properties.getOptimizeTopK()).containsExactly(optimizeTopK); } @ParameterizedTest @MethodSource("dbs") void pipelineAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 8)); - // comma delimiter DelimiterAnalyzerProperties commaDelimiterProperties = new DelimiterAnalyzerProperties(); commaDelimiterProperties.setDelimiter(","); @@ -799,8 +743,6 @@ void pipelineAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void stopwordsAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 8)); - Set features = new HashSet<>(); features.add(AnalyzerFeature.frequency); features.add(AnalyzerFeature.norm); @@ -831,8 +773,6 @@ void stopwordsAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void aqlAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 8)); - AQLAnalyzerProperties properties = new AQLAnalyzerProperties(); properties.setBatchSize(2); properties.setCollapsePositions(true); @@ -857,8 +797,6 @@ void aqlAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void geoJsonAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 8)); - GeoAnalyzerOptions options = new GeoAnalyzerOptions(); options.setMaxLevel(10); options.setMaxCells(11); @@ -886,9 +824,6 @@ void geoJsonAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void geoS2Analyzer(ArangoDatabase db) { - assumeTrue(isEnterprise()); - assumeTrue(isAtLeastVersion(3, 10, 5)); - GeoAnalyzerOptions options = new GeoAnalyzerOptions(); options.setMaxLevel(10); options.setMaxCells(11); @@ -916,8 +851,6 @@ void geoS2Analyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void geoPointAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 8)); - GeoAnalyzerOptions options = new GeoAnalyzerOptions(); options.setMaxLevel(10); options.setMaxCells(11); @@ -945,8 +878,6 @@ void geoPointAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void segmentationAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 9)); - SegmentationAnalyzerProperties properties = new SegmentationAnalyzerProperties(); properties.setBreakMode(SegmentationAnalyzerProperties.BreakMode.graphic); properties.setAnalyzerCase(SearchAnalyzerCase.upper); @@ -967,8 +898,6 @@ void segmentationAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void collationAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 9)); - CollationAnalyzerProperties properties = new CollationAnalyzerProperties(); properties.setLocale("ru"); @@ -989,9 +918,6 @@ void collationAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void classificationAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - ClassificationAnalyzerProperties properties = new ClassificationAnalyzerProperties(); properties.setModelLocation("/tmp/foo.bin"); properties.setTopK(2); @@ -1013,9 +939,6 @@ void classificationAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void nearestNeighborsAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - NearestNeighborsAnalyzerProperties properties = new NearestNeighborsAnalyzerProperties(); properties.setModelLocation("/tmp/foo.bin"); properties.setTopK(2); @@ -1036,9 +959,6 @@ void nearestNeighborsAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void MinHashAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); - assumeTrue(isEnterprise()); - SegmentationAnalyzerProperties segProperties = new SegmentationAnalyzerProperties(); segProperties.setBreakMode(SegmentationAnalyzerProperties.BreakMode.alpha); segProperties.setAnalyzerCase(SearchAnalyzerCase.lower); @@ -1066,8 +986,6 @@ void MinHashAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void WildcardAnalyzer(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 12)); - NormAnalyzerProperties properties = new NormAnalyzerProperties(); properties.setLocale("ru"); properties.setAnalyzerCase(SearchAnalyzerCase.lower); @@ -1095,8 +1013,6 @@ void WildcardAnalyzer(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void offsetFeature(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); - String name = "test-" + UUID.randomUUID(); Set features = new HashSet<>(); diff --git a/test-functional/src/test/java/com/arangodb/ArangoViewAsyncTest.java b/test-functional/src/test/java/com/arangodb/ArangoViewAsyncTest.java index 362d07447..4caf0f3cf 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoViewAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoViewAsyncTest.java @@ -80,7 +80,6 @@ void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcep @ParameterizedTest @MethodSource("asyncDbs") void getInfoSearchAlias(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); String name = rndName(); db.createView(name, ViewType.SEARCH_ALIAS).get(); final ViewEntity info = db.view(name).getInfo().get(); @@ -93,7 +92,6 @@ void getInfoSearchAlias(ArangoDatabaseAsync db) throws ExecutionException, Inter @ParameterizedTest @MethodSource("asyncDbs") void getViews(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); String name1 = rndName(); String name2 = rndName(); db.createView(name1, ViewType.ARANGO_SEARCH).get(); diff --git a/test-functional/src/test/java/com/arangodb/ArangoViewTest.java b/test-functional/src/test/java/com/arangodb/ArangoViewTest.java index 6a2d67c2d..67a9380e1 100644 --- a/test-functional/src/test/java/com/arangodb/ArangoViewTest.java +++ b/test-functional/src/test/java/com/arangodb/ArangoViewTest.java @@ -79,7 +79,6 @@ void getInfo(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void getInfoSearchAlias(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); String name = rndName(); db.createView(name, ViewType.SEARCH_ALIAS); final ViewEntity info = db.view(name).getInfo(); @@ -92,7 +91,6 @@ void getInfoSearchAlias(ArangoDatabase db) { @ParameterizedTest @MethodSource("dbs") void getViews(ArangoDatabase db) { - assumeTrue(isAtLeastVersion(3, 10)); String name1 = rndName(); String name2 = rndName(); db.createView(name1, ViewType.ARANGO_SEARCH); diff --git a/test-functional/src/test/java/com/arangodb/BaseJunit5.java b/test-functional/src/test/java/com/arangodb/BaseJunit5.java index d5c491361..bb51f4736 100644 --- a/test-functional/src/test/java/com/arangodb/BaseJunit5.java +++ b/test-functional/src/test/java/com/arangodb/BaseJunit5.java @@ -34,7 +34,7 @@ public class BaseJunit5 { private static final ServerRole role = adb.getRole(); private static final List > adbs = Arrays.stream(Protocol.values()) - .filter(p -> !p.equals(Protocol.VST) || isLessThanVersion(3, 12)) + .filter(p -> !p.equals(Protocol.VST)) .map(p -> Named.of(p.toString(), new ArangoDB.Builder() .loadProperties(config) .protocol(p) @@ -206,10 +206,6 @@ public static boolean isLessThanVersion(final int major, final int minor, final return TestUtils.isLessThanVersion(version.getVersion(), major, minor, patch); } - public static boolean isStorageEngine(ArangoDBEngine.StorageEngineName name) { - return name.equals(adb.getEngine().getName()); - } - public static boolean isSingleServer() { return role == ServerRole.SINGLE; } @@ -218,8 +214,4 @@ public static boolean isCluster() { return role == ServerRole.COORDINATOR; } - public static boolean isEnterprise() { - return version.getLicense() == License.ENTERPRISE; - } - } diff --git a/test-functional/src/test/java/com/arangodb/CompressionTest.java b/test-functional/src/test/java/com/arangodb/CompressionTest.java index fa81c5bef..812dee6cd 100644 --- a/test-functional/src/test/java/com/arangodb/CompressionTest.java +++ b/test-functional/src/test/java/com/arangodb/CompressionTest.java @@ -1,9 +1,9 @@ package com.arangodb; import com.arangodb.config.ArangoConfigProperties; +import com.arangodb.util.ProtocolSource; import com.fasterxml.jackson.databind.JsonNode; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.Locale; import java.util.UUID; @@ -20,21 +20,18 @@ class CompressionTest extends BaseJunit5 { @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void gzip(Protocol protocol) { doTest(protocol, Compression.GZIP); } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void deflate(Protocol protocol) { doTest(protocol, Compression.DEFLATE); } void doTest(Protocol protocol, Compression compression) { - assumeTrue(isAtLeastVersion(3, 12)); - assumeTrue(protocol != Protocol.VST); - ArangoDB adb = new ArangoDB.Builder() .loadProperties(ArangoConfigProperties.fromFile()) .protocol(protocol) diff --git a/test-functional/src/test/java/com/arangodb/ConcurrencyAsyncTests.java b/test-functional/src/test/java/com/arangodb/ConcurrencyAsyncTests.java index 2b9c20e09..7d1bf9684 100644 --- a/test-functional/src/test/java/com/arangodb/ConcurrencyAsyncTests.java +++ b/test-functional/src/test/java/com/arangodb/ConcurrencyAsyncTests.java @@ -2,11 +2,11 @@ import com.arangodb.config.ConfigUtils; import com.arangodb.entity.ArangoDBVersion; +import com.arangodb.util.ProtocolSource; import com.arangodb.util.SlowTest; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.ArrayList; import java.util.List; @@ -18,17 +18,14 @@ import java.util.stream.IntStream; import static org.junit.jupiter.api.Assertions.fail; -import static org.junit.jupiter.api.Assumptions.assumeTrue; class ConcurrencyAsyncTests { @SlowTest @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource @Timeout(2) void executorLimit(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ExecutorService asyncExecutor = Executors.newCachedThreadPool(); ArangoDBAsync adb = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) @@ -62,7 +59,7 @@ void executorLimit(Protocol protocol) { @Disabled @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource @Timeout(2) void outgoingRequestsParallelismTest(Protocol protocol) throws ExecutionException, InterruptedException { ArangoDBAsync adb = new ArangoDB.Builder() @@ -82,10 +79,8 @@ void outgoingRequestsParallelismTest(Protocol protocol) throws ExecutionExceptio @SlowTest @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void concurrentPendingRequests(Protocol protocol) throws ExecutionException, InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ArangoDBAsync adb = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) .protocol(protocol).build().async(); diff --git a/test-functional/src/test/java/com/arangodb/ConcurrencyTests.java b/test-functional/src/test/java/com/arangodb/ConcurrencyTests.java index 80aaa3ff9..9b303c6ee 100644 --- a/test-functional/src/test/java/com/arangodb/ConcurrencyTests.java +++ b/test-functional/src/test/java/com/arangodb/ConcurrencyTests.java @@ -1,9 +1,9 @@ package com.arangodb; import com.arangodb.config.ConfigUtils; +import com.arangodb.util.ProtocolSource; import com.arangodb.util.SlowTest; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -13,16 +13,12 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import static org.junit.jupiter.api.Assumptions.assumeTrue; - class ConcurrencyTests { @SlowTest @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void concurrentPendingRequests(Protocol protocol) throws ExecutionException, InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ExecutorService es = Executors.newFixedThreadPool(10); ArangoDB adb = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) diff --git a/test-functional/src/test/java/com/arangodb/ConsumerThreadAsyncTest.java b/test-functional/src/test/java/com/arangodb/ConsumerThreadAsyncTest.java index c7c219d06..ba7c92b6c 100644 --- a/test-functional/src/test/java/com/arangodb/ConsumerThreadAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/ConsumerThreadAsyncTest.java @@ -1,20 +1,16 @@ package com.arangodb; import com.arangodb.config.ArangoConfigProperties; +import com.arangodb.util.ProtocolSource; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.concurrent.ExecutionException; -import static org.junit.jupiter.api.Assumptions.assumeTrue; - public class ConsumerThreadAsyncTest extends BaseJunit5 { @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void nestedRequests(Protocol protocol) throws ExecutionException, InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ArangoDBAsync adb = new ArangoDB.Builder() .loadProperties(ArangoConfigProperties.fromFile()) .protocol(protocol) diff --git a/test-functional/src/test/java/com/arangodb/InvertedIndexAsyncTest.java b/test-functional/src/test/java/com/arangodb/InvertedIndexAsyncTest.java index fe9620264..0790dc184 100644 --- a/test-functional/src/test/java/com/arangodb/InvertedIndexAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/InvertedIndexAsyncTest.java @@ -48,8 +48,8 @@ private void createAnalyzer(String analyzerName, ArangoDatabaseAsync db) throws } private InvertedIndexOptions createOptions(String analyzerName) { - Boolean cache = isEnterprise() ? true : null; - Boolean fieldCache = cache != null ? false : null; + Boolean cache = true; + Boolean fieldCache = false; InvertedIndexField field = new InvertedIndexField() .name("foo") .analyzer(AnalyzerType.identity.toString()) @@ -64,22 +64,20 @@ private InvertedIndexOptions createOptions(String analyzerName) { AnalyzerFeature.offset ); - if (isEnterprise()) { - field.nested( - new InvertedIndexField() - .name("bar") - .analyzer(analyzerName) - .searchField(true) - .features(AnalyzerFeature.position, AnalyzerFeature.frequency) - .nested( - new InvertedIndexField() - .name("baz") - .analyzer(AnalyzerType.identity.toString()) - .searchField(false) - .features(AnalyzerFeature.frequency) - ) - ); - } + field.nested( + new InvertedIndexField() + .name("bar") + .analyzer(analyzerName) + .searchField(true) + .features(AnalyzerFeature.position, AnalyzerFeature.frequency) + .nested( + new InvertedIndexField() + .name("baz") + .analyzer(AnalyzerType.identity.toString()) + .searchField(false) + .features(AnalyzerFeature.frequency) + ) + ); return new InvertedIndexOptions() .name(rndName()) @@ -146,16 +144,12 @@ private void assertCorrectIndexEntity(InvertedIndexEntity indexResult, InvertedI assertThat(indexResult.getWritebufferSizeMax()).isEqualTo(options.getWritebufferSizeMax()); assertThat(indexResult.getCache()).isEqualTo(options.getCache()); assertThat(indexResult.getPrimaryKeyCache()).isEqualTo(options.getPrimaryKeyCache()); - - if (isEnterprise() && isAtLeastVersion(3, 12)) { - assertThat(indexResult.getOptimizeTopK()).containsExactlyElementsOf(options.getOptimizeTopK()); - } + assertThat(indexResult.getOptimizeTopK()).containsExactlyElementsOf(options.getOptimizeTopK()); } @ParameterizedTest @MethodSource("asyncCols") void createAndGetInvertedIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); String analyzerName = "delimiter-" + UUID.randomUUID(); createAnalyzer(analyzerName, collection.db()); InvertedIndexOptions options = createOptions(analyzerName); @@ -168,8 +162,6 @@ void createAndGetInvertedIndex(ArangoCollectionAsync collection) throws Executio @ParameterizedTest @MethodSource("asyncCols") void getInvertedIndexesShouldNotReturnOtherIndexTypes(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - // create persistent index collection.ensurePersistentIndex(Collections.singletonList("foo"), new PersistentIndexOptions().name("persistentIndex")); @@ -188,8 +180,6 @@ void getInvertedIndexesShouldNotReturnOtherIndexTypes(ArangoCollectionAsync coll @ParameterizedTest @MethodSource("asyncCols") void getIndexesShouldNotReturnInvertedIndexes(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { - assumeTrue(isAtLeastVersion(3, 10)); - // create persistent index collection.ensurePersistentIndex(Collections.singletonList("foo"), new PersistentIndexOptions().name("persistentIndex")); diff --git a/test-functional/src/test/java/com/arangodb/InvertedIndexTest.java b/test-functional/src/test/java/com/arangodb/InvertedIndexTest.java index 7476b4c4f..932d1d877 100644 --- a/test-functional/src/test/java/com/arangodb/InvertedIndexTest.java +++ b/test-functional/src/test/java/com/arangodb/InvertedIndexTest.java @@ -47,8 +47,8 @@ private void createAnalyzer(String analyzerName, ArangoDatabase db) { } private InvertedIndexOptions createOptions(String analyzerName) { - Boolean cache = isEnterprise() ? true : null; - Boolean fieldCache = cache != null ? false : null; + Boolean cache = true; + Boolean fieldCache = false; InvertedIndexField field = new InvertedIndexField() .name("foo") .analyzer(AnalyzerType.identity.toString()) @@ -63,22 +63,20 @@ private InvertedIndexOptions createOptions(String analyzerName) { AnalyzerFeature.offset ); - if (isEnterprise()) { - field.nested( - new InvertedIndexField() - .name("bar") - .analyzer(analyzerName) - .searchField(true) - .features(AnalyzerFeature.position, AnalyzerFeature.frequency) - .nested( - new InvertedIndexField() - .name("baz") - .analyzer(AnalyzerType.identity.toString()) - .searchField(false) - .features(AnalyzerFeature.frequency) - ) - ); - } + field.nested( + new InvertedIndexField() + .name("bar") + .analyzer(analyzerName) + .searchField(true) + .features(AnalyzerFeature.position, AnalyzerFeature.frequency) + .nested( + new InvertedIndexField() + .name("baz") + .analyzer(AnalyzerType.identity.toString()) + .searchField(false) + .features(AnalyzerFeature.frequency) + ) + ); return new InvertedIndexOptions() .name(rndName()) @@ -145,16 +143,12 @@ private void assertCorrectIndexEntity(InvertedIndexEntity indexResult, InvertedI assertThat(indexResult.getWritebufferSizeMax()).isEqualTo(options.getWritebufferSizeMax()); assertThat(indexResult.getCache()).isEqualTo(options.getCache()); assertThat(indexResult.getPrimaryKeyCache()).isEqualTo(options.getPrimaryKeyCache()); - - if (isEnterprise() && isAtLeastVersion(3, 12)) { - assertThat(indexResult.getOptimizeTopK()).containsExactlyElementsOf(options.getOptimizeTopK()); - } + assertThat(indexResult.getOptimizeTopK()).containsExactlyElementsOf(options.getOptimizeTopK()); } @ParameterizedTest @MethodSource("cols") void createAndGetInvertedIndex(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 10)); String analyzerName = "delimiter-" + UUID.randomUUID(); createAnalyzer(analyzerName, collection.db()); InvertedIndexOptions options = createOptions(analyzerName); @@ -167,8 +161,6 @@ void createAndGetInvertedIndex(ArangoCollection collection) { @ParameterizedTest @MethodSource("cols") void getInvertedIndexesShouldNotReturnOtherIndexTypes(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 10)); - // create persistent index collection.ensurePersistentIndex(Collections.singletonList("foo"), new PersistentIndexOptions().name("persistentIndex")); @@ -187,8 +179,6 @@ void getInvertedIndexesShouldNotReturnOtherIndexTypes(ArangoCollection collectio @ParameterizedTest @MethodSource("cols") void getIndexesShouldNotReturnInvertedIndexes(ArangoCollection collection) { - assumeTrue(isAtLeastVersion(3, 10)); - // create persistent index collection.ensurePersistentIndex(Collections.singletonList("foo"), new PersistentIndexOptions().name("persistentIndex")); diff --git a/test-functional/src/test/java/com/arangodb/JwtAuthAsyncTest.java b/test-functional/src/test/java/com/arangodb/JwtAuthAsyncTest.java index 895dc8687..530a4b026 100644 --- a/test-functional/src/test/java/com/arangodb/JwtAuthAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/JwtAuthAsyncTest.java @@ -2,9 +2,9 @@ import com.arangodb.config.ConfigUtils; import com.arangodb.internal.ArangoRequestParam; +import com.arangodb.util.ProtocolSource; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.HashMap; import java.util.Map; @@ -12,7 +12,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** @@ -48,10 +47,8 @@ private static String getJwt(ArangoDB arangoDB) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void notAuthenticated(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ArangoDBAsync arangoDB = getBuilder(protocol).acquireHostList(false).build().async(); Throwable thrown = catchThrowable(() -> arangoDB.getVersion().get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -61,10 +58,8 @@ void notAuthenticated(Protocol protocol) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void authenticated(Protocol protocol) throws ExecutionException, InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ArangoDBAsync arangoDB = getBuilder(protocol) .jwt(jwt) .build() @@ -74,9 +69,8 @@ void authenticated(Protocol protocol) throws ExecutionException, InterruptedExce } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void updateJwt(Protocol protocol) throws ExecutionException, InterruptedException { - assumeTrue(protocol != Protocol.VST, "DE-423"); ArangoDBAsync arangoDB = getBuilder(protocol) .jwt(jwt) .build() diff --git a/test-functional/src/test/java/com/arangodb/JwtAuthTest.java b/test-functional/src/test/java/com/arangodb/JwtAuthTest.java index 1f9185430..f43208b1d 100644 --- a/test-functional/src/test/java/com/arangodb/JwtAuthTest.java +++ b/test-functional/src/test/java/com/arangodb/JwtAuthTest.java @@ -2,16 +2,15 @@ import com.arangodb.config.ConfigUtils; import com.arangodb.internal.ArangoRequestParam; +import com.arangodb.util.ProtocolSource; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.HashMap; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** @@ -47,10 +46,8 @@ private static String getJwt(ArangoDB arangoDB) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void notAuthenticated(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ArangoDB arangoDB = getBuilder(protocol).acquireHostList(false).build(); Throwable thrown = catchThrowable(arangoDB::getVersion); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -60,10 +57,8 @@ void notAuthenticated(Protocol protocol) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void authenticated(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ArangoDB arangoDB = getBuilder(protocol) .jwt(jwt) .build(); @@ -72,9 +67,8 @@ void authenticated(Protocol protocol) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void updateJwt(Protocol protocol) { - assumeTrue(protocol != Protocol.VST, "DE-423"); ArangoDB arangoDB = getBuilder(protocol) .jwt(jwt) .build(); diff --git a/test-functional/src/test/java/com/arangodb/JwtTest.java b/test-functional/src/test/java/com/arangodb/JwtTest.java index 23b18a3d3..0669b0c21 100644 --- a/test-functional/src/test/java/com/arangodb/JwtTest.java +++ b/test-functional/src/test/java/com/arangodb/JwtTest.java @@ -1,20 +1,18 @@ package com.arangodb; import com.arangodb.entity.ArangoDBVersion; +import com.arangodb.util.ProtocolSource; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assumptions.assumeTrue; public class JwtTest extends BaseJunit5 { private final String jwt = getJwt(); @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void getVersion(Protocol p) { - assumeTrue(!p.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); ArangoDB.Builder builder = new ArangoDB.Builder() .protocol(p) .jwt(jwt); diff --git a/test-functional/src/test/java/com/arangodb/ParallelAsyncTest.java b/test-functional/src/test/java/com/arangodb/ParallelAsyncTest.java index 5a697f7f4..e2171a7ab 100644 --- a/test-functional/src/test/java/com/arangodb/ParallelAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/ParallelAsyncTest.java @@ -1,9 +1,9 @@ package com.arangodb; import com.arangodb.config.ConfigUtils; +import com.arangodb.util.ProtocolSource; import com.arangodb.util.SlowTest; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.ArrayList; import java.util.List; @@ -16,10 +16,8 @@ class ParallelAsyncTest { @SlowTest @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void connectionParallelism(Protocol protocol) throws InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - // test that connections are internally async and can have multiple pending requests // BTS-1102: the server does not run pipelined HTTP/1.1 requests in parallel assumeTrue(protocol != Protocol.HTTP_JSON && protocol != Protocol.HTTP_VPACK); diff --git a/test-functional/src/test/java/com/arangodb/ParallelTest.java b/test-functional/src/test/java/com/arangodb/ParallelTest.java index 00bf1eaba..6e1143866 100644 --- a/test-functional/src/test/java/com/arangodb/ParallelTest.java +++ b/test-functional/src/test/java/com/arangodb/ParallelTest.java @@ -1,9 +1,9 @@ package com.arangodb; import com.arangodb.config.ConfigUtils; +import com.arangodb.util.ProtocolSource; import com.arangodb.util.SlowTest; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.ArrayList; import java.util.List; @@ -18,10 +18,8 @@ class ParallelTest { @SlowTest @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void connectionParallelism(Protocol protocol) throws InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - // test that connections are internally async and can have multiple pending requests // BTS-1102: the server does not run pipelined HTTP/1.1 requests in parallel assumeTrue(protocol != Protocol.HTTP_JSON && protocol != Protocol.HTTP_VPACK); diff --git a/test-functional/src/test/java/com/arangodb/StreamTransactionAsyncTest.java b/test-functional/src/test/java/com/arangodb/StreamTransactionAsyncTest.java index 5c28f8b40..cd2d82397 100644 --- a/test-functional/src/test/java/com/arangodb/StreamTransactionAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/StreamTransactionAsyncTest.java @@ -51,8 +51,6 @@ static void init() { @MethodSource("asyncDbs") void beginStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db.beginStreamTransaction(null).get(); assertThat(tx.getId()).isNotNull(); @@ -64,8 +62,6 @@ void beginStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, I @MethodSource("asyncDbs") void beginStreamTransactionWithNonExistingCollectionsShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.beginStreamTransaction(new StreamTransactionOptions().writeCollections("notExistingCollection")).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -75,8 +71,6 @@ void beginStreamTransactionWithNonExistingCollectionsShouldThrow(ArangoDatabaseA @MethodSource("asyncDbs") void abortStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity begunTx = db.beginStreamTransaction(null).get(); StreamTransactionEntity abortedTx = db.abortStreamTransaction(begunTx.getId()).get(); @@ -90,8 +84,6 @@ void abortStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, I @MethodSource("asyncDbs") void abortStreamTransactionTwice(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity begunTx = db.beginStreamTransaction(null).get(); db.abortStreamTransaction(begunTx.getId()); @@ -102,8 +94,6 @@ void abortStreamTransactionTwice(ArangoDatabaseAsync db) throws ExecutionExcepti @MethodSource("asyncDbs") void abortStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.abortStreamTransaction("000000").get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); } @@ -112,8 +102,6 @@ void abortStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatab @MethodSource("asyncDbs") void abortStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.abortStreamTransaction("invalidTransactionId").get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); } @@ -122,8 +110,6 @@ void abortStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsy @MethodSource("asyncDbs") void abortCommittedStreamTransactionShouldThrow(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null).get(); db.commitStreamTransaction(createdTx.getId()).get(); @@ -135,8 +121,6 @@ void abortCommittedStreamTransactionShouldThrow(ArangoDatabaseAsync db) throws E @MethodSource("asyncDbs") void getStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null).get(); StreamTransactionEntity gotTx = db.getStreamTransaction(createdTx.getId()).get(); @@ -152,8 +136,6 @@ void getStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, Int @MethodSource("asyncDbs") void getStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.getStreamTransaction("000000").get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -163,8 +145,6 @@ void getStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabas @MethodSource("asyncDbs") void getStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.getStreamTransaction("invalidTransactionId").get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -174,8 +154,6 @@ void getStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync @MethodSource("asyncDbs") void commitStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null).get(); StreamTransactionEntity committedTx = db.commitStreamTransaction(createdTx.getId()).get(); @@ -189,8 +167,6 @@ void commitStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, @MethodSource("asyncDbs") void commitStreamTransactionTwice(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null).get(); db.commitStreamTransaction(createdTx.getId()); @@ -201,8 +177,6 @@ void commitStreamTransactionTwice(ArangoDatabaseAsync db) throws ExecutionExcept @MethodSource("asyncDbs") void commitStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.commitStreamTransaction("000000").get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -212,8 +186,6 @@ void commitStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoData @MethodSource("asyncDbs") void commitStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.commitStreamTransaction("invalidTransactionId").get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -223,8 +195,6 @@ void commitStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAs @MethodSource("asyncDbs") void commitAbortedStreamTransactionShouldThrow(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null).get(); db.abortStreamTransaction(createdTx.getId()).get(); @@ -236,8 +206,6 @@ void commitAbortedStreamTransactionShouldThrow(ArangoDatabaseAsync db) throws Ex @MethodSource("asyncDbs") void getDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().readCollections(COLLECTION_NAME)).get(); @@ -258,8 +226,6 @@ void getDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE @MethodSource("asyncDbs") void getDocumentWithNonExistingTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollectionAsync collection = db.collection(COLLECTION_NAME); @@ -272,8 +238,6 @@ void getDocumentWithNonExistingTransactionIdShouldThrow(ArangoDatabaseAsync db) @MethodSource("asyncDbs") void getDocumentWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollectionAsync collection = db.collection(COLLECTION_NAME); Throwable thrown = catchThrowable(() -> collection @@ -285,8 +249,6 @@ void getDocumentWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { @MethodSource("asyncDbs") void getDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().readCollections(COLLECTION_NAME)).get(); @@ -313,8 +275,6 @@ void getDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interrupted @MethodSource("asyncDbs") void insertDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)).get(); @@ -341,8 +301,6 @@ void insertDocument(ArangoDatabaseAsync db) throws ExecutionException, Interrupt @MethodSource("asyncDbs") void insertDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)).get(); @@ -373,8 +331,6 @@ void insertDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interrup @MethodSource("asyncDbs") void replaceDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("test", "foo"); @@ -410,8 +366,6 @@ void replaceDocument(ArangoDatabaseAsync db) throws ExecutionException, Interrup @MethodSource("asyncDbs") void replaceDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); List docs = IntStream.range(0, 3).mapToObj(it -> new BaseDocument()) .peek(doc -> doc.addAttribute("test", "foo")).collect(Collectors.toList()); @@ -455,8 +409,6 @@ void replaceDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interru @MethodSource("asyncDbs") void updateDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("test", "foo"); @@ -492,8 +444,6 @@ void updateDocument(ArangoDatabaseAsync db) throws ExecutionException, Interrupt @MethodSource("asyncDbs") void updateDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); List docs = IntStream.range(0, 3).mapToObj(it -> new BaseDocument()) .peek(doc -> doc.addAttribute("test", "foo")).collect(Collectors.toList()); @@ -537,8 +487,6 @@ void updateDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interrup @MethodSource("asyncDbs") void deleteDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollectionAsync collection = db.collection(COLLECTION_NAME); DocumentCreateEntity createdDoc = collection @@ -568,8 +516,6 @@ void deleteDocument(ArangoDatabaseAsync db) throws ExecutionException, Interrupt @MethodSource("asyncDbs") void deleteDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollectionAsync collection = db.collection(COLLECTION_NAME); List keys = collection @@ -601,8 +547,6 @@ void deleteDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interrup @MethodSource("asyncDbs") void documentExists(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().readCollections(COLLECTION_NAME)).get(); @@ -623,8 +567,6 @@ void documentExists(ArangoDatabaseAsync db) throws ExecutionException, Interrupt @MethodSource("asyncDbs") void count(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollectionAsync collection = db.collection(COLLECTION_NAME); Long initialCount = collection.count().get().getCount(); @@ -646,8 +588,6 @@ void count(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcepti @MethodSource("asyncDbs") void truncate(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollectionAsync collection = db.collection(COLLECTION_NAME); collection.insertDocument(new BaseDocument(), null).get(); @@ -675,8 +615,6 @@ void truncate(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExce @MethodSource("asyncDbs") void createCursor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().readCollections(COLLECTION_NAME)).get(); @@ -704,8 +642,6 @@ void createCursor(ArangoDatabaseAsync db) throws ExecutionException, Interrupted @MethodSource("asyncDbs") void nextCursor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)).get(); @@ -740,8 +676,6 @@ void nextCursor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx @MethodSource("asyncDbs") void getStreamTransactions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx1 = db.beginStreamTransaction(null).get(); StreamTransactionEntity tx2 = db.beginStreamTransaction(null).get(); @@ -762,8 +696,6 @@ void getStreamTransactions(ArangoDatabaseAsync db) throws ExecutionException, In @MethodSource("asyncDbs") void transactionAllowImplicitFalse(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().allowImplicit(false)).get(); @@ -789,7 +721,6 @@ void transactionAllowImplicitFalse(ArangoDatabaseAsync db) throws ExecutionExcep @MethodSource("asyncDbs") void transactionDirtyRead(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); - assumeTrue(isAtLeastVersion(3, 10)); ArangoCollectionAsync collection = db.collection(COLLECTION_NAME); DocumentCreateEntity> doc = collection.insertDocument(new BaseDocument()).get(); diff --git a/test-functional/src/test/java/com/arangodb/StreamTransactionConflictsAsyncTest.java b/test-functional/src/test/java/com/arangodb/StreamTransactionConflictsAsyncTest.java index 94e3996df..88097903a 100644 --- a/test-functional/src/test/java/com/arangodb/StreamTransactionConflictsAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/StreamTransactionConflictsAsyncTest.java @@ -53,8 +53,6 @@ static void init() { @MethodSource("asyncDbs") void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx1 = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)).get(); @@ -73,11 +71,8 @@ void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabaseAsync db) throw new DocumentCreateOptions().streamTransactionId(tx2.getId())).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); ArangoDBException e = (ArangoDBException) thrown; - - if (isAtLeastVersion(3, 8)) { - assertThat(e.getResponseCode()).isEqualTo(409); - assertThat(e.getErrorNum()).isEqualTo(1200); - } + assertThat(e.getResponseCode()).isEqualTo(409); + assertThat(e.getErrorNum()).isEqualTo(1200); db.abortStreamTransaction(tx1.getId()).get(); db.abortStreamTransaction(tx2.getId()).get(); @@ -87,8 +82,6 @@ void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabaseAsync db) throw @MethodSource("asyncDbs") void conflictOnInsertDocumentWithAlreadyCommittedTx(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx1 = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)).get(); @@ -110,10 +103,8 @@ void conflictOnInsertDocumentWithAlreadyCommittedTx(ArangoDatabaseAsync db) thro new DocumentCreateOptions().streamTransactionId(tx2.getId())).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); ArangoDBException e = (ArangoDBException) thrown; - if (isAtLeastVersion(3, 8)) { - assertThat(e.getResponseCode()).isEqualTo(409); - assertThat(e.getErrorNum()).isEqualTo(1200); - } + assertThat(e.getResponseCode()).isEqualTo(409); + assertThat(e.getErrorNum()).isEqualTo(1200); db.abortStreamTransaction(tx2.getId()); } diff --git a/test-functional/src/test/java/com/arangodb/StreamTransactionConflictsTest.java b/test-functional/src/test/java/com/arangodb/StreamTransactionConflictsTest.java index 71b4a01ed..00cd8a61f 100644 --- a/test-functional/src/test/java/com/arangodb/StreamTransactionConflictsTest.java +++ b/test-functional/src/test/java/com/arangodb/StreamTransactionConflictsTest.java @@ -52,8 +52,6 @@ static void init() { @MethodSource("dbs") void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx1 = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)); @@ -72,11 +70,8 @@ void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabase db) { new DocumentCreateOptions().streamTransactionId(tx2.getId()))); assertThat(thrown).isInstanceOf(ArangoDBException.class); ArangoDBException e = (ArangoDBException) thrown; - - if (isAtLeastVersion(3, 8)) { - assertThat(e.getResponseCode()).isEqualTo(409); - assertThat(e.getErrorNum()).isEqualTo(1200); - } + assertThat(e.getResponseCode()).isEqualTo(409); + assertThat(e.getErrorNum()).isEqualTo(1200); db.abortStreamTransaction(tx1.getId()); db.abortStreamTransaction(tx2.getId()); @@ -86,8 +81,6 @@ void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabase db) { @MethodSource("dbs") void conflictOnInsertDocumentWithAlreadyCommittedTx(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx1 = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)); @@ -109,10 +102,8 @@ void conflictOnInsertDocumentWithAlreadyCommittedTx(ArangoDatabase db) { new DocumentCreateOptions().streamTransactionId(tx2.getId()))); assertThat(thrown).isInstanceOf(ArangoDBException.class); ArangoDBException e = (ArangoDBException) thrown; - if (isAtLeastVersion(3, 8)) { - assertThat(e.getResponseCode()).isEqualTo(409); - assertThat(e.getErrorNum()).isEqualTo(1200); - } + assertThat(e.getResponseCode()).isEqualTo(409); + assertThat(e.getErrorNum()).isEqualTo(1200); db.abortStreamTransaction(tx2.getId()); } diff --git a/test-functional/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java b/test-functional/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java index b83f453ae..f7ed508d7 100644 --- a/test-functional/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java @@ -83,8 +83,6 @@ private BaseEdgeDocument createEdgeValue(String streamTransactionId, ArangoGraph @MethodSource("asyncVertices") void getVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoDatabaseAsync db = vertexCollection1.graph().db(); StreamTransactionEntity tx = db @@ -107,8 +105,6 @@ void getVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionEx @MethodSource("asyncVertices") void createVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoDatabaseAsync db = vertexCollection1.graph().db(); StreamTransactionEntity tx = db.beginStreamTransaction( @@ -137,8 +133,6 @@ void createVertex(ArangoVertexCollectionAsync vertexCollection1) throws Executio @MethodSource("asyncVertices") void replaceVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("test", "foo"); @@ -176,8 +170,6 @@ void replaceVertex(ArangoVertexCollectionAsync vertexCollection1) throws Executi @MethodSource("asyncVertices") void updateVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("test", "foo"); @@ -215,8 +207,6 @@ void updateVertex(ArangoVertexCollectionAsync vertexCollection1) throws Executio @MethodSource("asyncVertices") void deleteVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); VertexEntity createdDoc = vertexCollection1.insertVertex(new BaseDocument(), null).get(); @@ -247,8 +237,6 @@ void deleteVertex(ArangoVertexCollectionAsync vertexCollection1) throws Executio @MethodSource("asyncEdges") void getEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoDatabaseAsync db = edgeCollection.graph().db(); StreamTransactionEntity tx = db @@ -271,8 +259,6 @@ void getEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException @MethodSource("asyncEdges") void createEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoDatabaseAsync db = edgeCollection.graph().db(); StreamTransactionEntity tx = db.beginStreamTransaction( @@ -301,8 +287,6 @@ void createEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionExcept @MethodSource("asyncEdges") void replaceEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseEdgeDocument doc = createEdgeValue(null, edgeCollection.graph()); doc.addAttribute("test", "foo"); @@ -340,8 +324,6 @@ void replaceEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionExcep @MethodSource("asyncEdges") void updateEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseEdgeDocument doc = createEdgeValue(null, edgeCollection.graph()); doc.addAttribute("test", "foo"); @@ -378,8 +360,6 @@ void updateEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionExcept @MethodSource("asyncEdges") void deleteEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); EdgeEntity createdDoc = edgeCollection.insertEdge(createEdgeValue(null, edgeCollection.graph()), null).get(); diff --git a/test-functional/src/test/java/com/arangodb/StreamTransactionGraphTest.java b/test-functional/src/test/java/com/arangodb/StreamTransactionGraphTest.java index d4337788a..a3bf6b47b 100644 --- a/test-functional/src/test/java/com/arangodb/StreamTransactionGraphTest.java +++ b/test-functional/src/test/java/com/arangodb/StreamTransactionGraphTest.java @@ -82,8 +82,6 @@ private BaseEdgeDocument createEdgeValue(String streamTransactionId, ArangoGraph @MethodSource("vertices") void getVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoDatabase db = vertexCollection1.graph().db(); StreamTransactionEntity tx = db @@ -106,8 +104,6 @@ void getVertex(ArangoVertexCollection vertexCollection1) { @MethodSource("vertices") void createVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoDatabase db = vertexCollection1.graph().db(); StreamTransactionEntity tx = db.beginStreamTransaction( @@ -136,8 +132,6 @@ void createVertex(ArangoVertexCollection vertexCollection1) { @MethodSource("vertices") void replaceVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("test", "foo"); @@ -175,8 +169,6 @@ void replaceVertex(ArangoVertexCollection vertexCollection1) { @MethodSource("vertices") void updateVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("test", "foo"); @@ -214,8 +206,6 @@ void updateVertex(ArangoVertexCollection vertexCollection1) { @MethodSource("vertices") void deleteVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); VertexEntity createdDoc = vertexCollection1.insertVertex(new BaseDocument(), null); @@ -246,8 +236,6 @@ void deleteVertex(ArangoVertexCollection vertexCollection1) { @MethodSource("edges") void getEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoDatabase db = edgeCollection.graph().db(); StreamTransactionEntity tx = db @@ -270,8 +258,6 @@ void getEdge(ArangoEdgeCollection edgeCollection) { @MethodSource("edges") void createEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoDatabase db = edgeCollection.graph().db(); StreamTransactionEntity tx = db.beginStreamTransaction( @@ -300,8 +286,6 @@ void createEdge(ArangoEdgeCollection edgeCollection) { @MethodSource("edges") void replaceEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseEdgeDocument doc = createEdgeValue(null, edgeCollection.graph()); doc.addAttribute("test", "foo"); @@ -339,8 +323,6 @@ void replaceEdge(ArangoEdgeCollection edgeCollection) { @MethodSource("edges") void updateEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseEdgeDocument doc = createEdgeValue(null, edgeCollection.graph()); doc.addAttribute("test", "foo"); @@ -377,8 +359,6 @@ void updateEdge(ArangoEdgeCollection edgeCollection) { @MethodSource("edges") void deleteEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); EdgeEntity createdDoc = edgeCollection.insertEdge(createEdgeValue(null, edgeCollection.graph()), null); diff --git a/test-functional/src/test/java/com/arangodb/StreamTransactionTest.java b/test-functional/src/test/java/com/arangodb/StreamTransactionTest.java index dff39ef83..8dc1475f4 100644 --- a/test-functional/src/test/java/com/arangodb/StreamTransactionTest.java +++ b/test-functional/src/test/java/com/arangodb/StreamTransactionTest.java @@ -51,8 +51,6 @@ static void init() { @MethodSource("dbs") void beginStreamTransaction(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db.beginStreamTransaction(null); assertThat(tx.getId()).isNotNull(); @@ -64,8 +62,6 @@ void beginStreamTransaction(ArangoDatabase db) { @MethodSource("dbs") void beginStreamTransactionWithNonExistingCollectionsShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.beginStreamTransaction(new StreamTransactionOptions().writeCollections("notExistingCollection"))); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -75,8 +71,6 @@ void beginStreamTransactionWithNonExistingCollectionsShouldThrow(ArangoDatabase @MethodSource("dbs") void abortStreamTransaction(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity begunTx = db.beginStreamTransaction(null); StreamTransactionEntity abortedTx = db.abortStreamTransaction(begunTx.getId()); @@ -90,8 +84,6 @@ void abortStreamTransaction(ArangoDatabase db) { @MethodSource("dbs") void abortStreamTransactionTwice(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity begunTx = db.beginStreamTransaction(null); db.abortStreamTransaction(begunTx.getId()); @@ -102,8 +94,6 @@ void abortStreamTransactionTwice(ArangoDatabase db) { @MethodSource("dbs") void abortStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.abortStreamTransaction("000000")); assertThat(thrown).isInstanceOf(ArangoDBException.class); } @@ -112,8 +102,6 @@ void abortStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatab @MethodSource("dbs") void abortStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.abortStreamTransaction("invalidTransactionId")); assertThat(thrown).isInstanceOf(ArangoDBException.class); } @@ -122,8 +110,6 @@ void abortStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db @MethodSource("dbs") void abortCommittedStreamTransactionShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null); db.commitStreamTransaction(createdTx.getId()); @@ -135,8 +121,6 @@ void abortCommittedStreamTransactionShouldThrow(ArangoDatabase db) { @MethodSource("dbs") void getStreamTransaction(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null); StreamTransactionEntity gotTx = db.getStreamTransaction(createdTx.getId()); @@ -152,8 +136,6 @@ void getStreamTransaction(ArangoDatabase db) { @MethodSource("dbs") void getStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.getStreamTransaction("000000")); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -163,8 +145,6 @@ void getStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabas @MethodSource("dbs") void getStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.getStreamTransaction("invalidTransactionId")); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -174,8 +154,6 @@ void getStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db) @MethodSource("dbs") void commitStreamTransaction(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null); StreamTransactionEntity committedTx = db.commitStreamTransaction(createdTx.getId()); @@ -189,8 +167,6 @@ void commitStreamTransaction(ArangoDatabase db) { @MethodSource("dbs") void commitStreamTransactionTwice(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null); db.commitStreamTransaction(createdTx.getId()); @@ -201,8 +177,6 @@ void commitStreamTransactionTwice(ArangoDatabase db) { @MethodSource("dbs") void commitStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.commitStreamTransaction("000000")); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -212,8 +186,6 @@ void commitStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoData @MethodSource("dbs") void commitStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); Throwable thrown = catchThrowable(() -> db.commitStreamTransaction("invalidTransactionId")); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -223,8 +195,6 @@ void commitStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase d @MethodSource("dbs") void commitAbortedStreamTransactionShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity createdTx = db.beginStreamTransaction(null); db.abortStreamTransaction(createdTx.getId()); @@ -236,8 +206,6 @@ void commitAbortedStreamTransactionShouldThrow(ArangoDatabase db) { @MethodSource("dbs") void getDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().readCollections(COLLECTION_NAME)); @@ -258,8 +226,6 @@ void getDocument(ArangoDatabase db) { @MethodSource("dbs") void getDocumentWithNonExistingTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollection collection = db.collection(COLLECTION_NAME); @@ -272,8 +238,6 @@ void getDocumentWithNonExistingTransactionIdShouldThrow(ArangoDatabase db) { @MethodSource("dbs") void getDocumentWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollection collection = db.collection(COLLECTION_NAME); Throwable thrown = catchThrowable(() -> collection @@ -285,8 +249,6 @@ void getDocumentWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { @MethodSource("dbs") void getDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().readCollections(COLLECTION_NAME)); @@ -313,8 +275,6 @@ void getDocuments(ArangoDatabase db) { @MethodSource("dbs") void insertDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)); @@ -341,8 +301,6 @@ void insertDocument(ArangoDatabase db) { @MethodSource("dbs") void insertDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)); @@ -373,8 +331,6 @@ void insertDocuments(ArangoDatabase db) { @MethodSource("dbs") void replaceDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("test", "foo"); @@ -410,8 +366,6 @@ void replaceDocument(ArangoDatabase db) { @MethodSource("dbs") void replaceDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); List docs = IntStream.range(0, 3).mapToObj(it -> new BaseDocument()) .peek(doc -> doc.addAttribute("test", "foo")).collect(Collectors.toList()); @@ -457,8 +411,6 @@ void replaceDocuments(ArangoDatabase db) { @MethodSource("dbs") void updateDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); doc.addAttribute("test", "foo"); @@ -495,8 +447,6 @@ void updateDocument(ArangoDatabase db) { @MethodSource("dbs") void updateDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); List docs = IntStream.range(0, 3).mapToObj(it -> new BaseDocument()) .peek(doc -> doc.addAttribute("test", "foo")).collect(Collectors.toList()); @@ -542,8 +492,6 @@ void updateDocuments(ArangoDatabase db) { @MethodSource("dbs") void deleteDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollection collection = db.collection(COLLECTION_NAME); DocumentCreateEntity createdDoc = collection @@ -573,8 +521,6 @@ void deleteDocument(ArangoDatabase db) { @MethodSource("dbs") void deleteDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollection collection = db.collection(COLLECTION_NAME); List keys = collection @@ -606,8 +552,6 @@ void deleteDocuments(ArangoDatabase db) { @MethodSource("dbs") void documentExists(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().readCollections(COLLECTION_NAME)); @@ -628,8 +572,6 @@ void documentExists(ArangoDatabase db) { @MethodSource("dbs") void count(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollection collection = db.collection(COLLECTION_NAME); Long initialCount = collection.count().getCount(); @@ -651,8 +593,6 @@ void count(ArangoDatabase db) { @MethodSource("dbs") void truncate(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); ArangoCollection collection = db.collection(COLLECTION_NAME); collection.insertDocument(new BaseDocument(), null); @@ -680,8 +620,6 @@ void truncate(ArangoDatabase db) { @MethodSource("dbs") void createCursor(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().readCollections(COLLECTION_NAME)); @@ -709,8 +647,6 @@ void createCursor(ArangoDatabase db) { @MethodSource("dbs") void nextCursor(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db.beginStreamTransaction( new StreamTransactionOptions().readCollections(COLLECTION_NAME).writeCollections(COLLECTION_NAME)); @@ -742,8 +678,6 @@ void nextCursor(ArangoDatabase db) { @MethodSource("dbs") void getStreamTransactions(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx1 = db.beginStreamTransaction(null); StreamTransactionEntity tx2 = db.beginStreamTransaction(null); @@ -764,8 +698,6 @@ void getStreamTransactions(ArangoDatabase db) { @MethodSource("dbs") void transactionAllowImplicitFalse(ArangoDatabase db) { assumeTrue(isSingleServer()); - assumeTrue(isAtLeastVersion(3, 5)); - assumeTrue(isStorageEngine(ArangoDBEngine.StorageEngineName.rocksdb)); StreamTransactionEntity tx = db .beginStreamTransaction(new StreamTransactionOptions().allowImplicit(false)); @@ -791,7 +723,6 @@ void transactionAllowImplicitFalse(ArangoDatabase db) { @MethodSource("dbs") void transactionDirtyRead(ArangoDatabase db) throws IOException { assumeTrue(isCluster()); - assumeTrue(isAtLeastVersion(3, 10)); ArangoCollection collection = db.collection(COLLECTION_NAME); DocumentCreateEntity> doc = collection.insertDocument(new BaseDocument()); diff --git a/test-functional/src/test/java/com/arangodb/UserAgentAsyncTest.java b/test-functional/src/test/java/com/arangodb/UserAgentAsyncTest.java index a1059b86c..2b66e9fbb 100644 --- a/test-functional/src/test/java/com/arangodb/UserAgentAsyncTest.java +++ b/test-functional/src/test/java/com/arangodb/UserAgentAsyncTest.java @@ -1,21 +1,17 @@ package com.arangodb; +import com.arangodb.util.ProtocolSource; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import java.util.concurrent.ExecutionException; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assumptions.assumeTrue; class UserAgentAsyncTest extends BaseJunit5 { @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void userAgentHeader(Protocol protocol) throws ExecutionException, InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ArangoDBAsync adb = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) diff --git a/test-functional/src/test/java/com/arangodb/UserAgentTest.java b/test-functional/src/test/java/com/arangodb/UserAgentTest.java index 5f56d59b4..7c7d31d3d 100644 --- a/test-functional/src/test/java/com/arangodb/UserAgentTest.java +++ b/test-functional/src/test/java/com/arangodb/UserAgentTest.java @@ -1,16 +1,15 @@ package com.arangodb; +import com.arangodb.util.ProtocolSource; import com.fasterxml.jackson.databind.JsonNode; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assumptions.assumeTrue; class UserAgentTest extends BaseJunit5 { - private static final String EXPECTED_VERSION = "7.19.0"; + private static final String EXPECTED_VERSION = "7.20.0-SNAPSHOT"; private static final boolean SHADED = Boolean.parseBoolean(System.getProperty("shaded")); @@ -25,10 +24,8 @@ void packageVersionIsShaded() { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void userAgentHeader(Protocol protocol) { - assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); - ArangoDB adb = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) diff --git a/test-functional/src/test/java/com/arangodb/internal/HostHandlerTest.java b/test-functional/src/test/java/com/arangodb/internal/HostHandlerTest.java index 109a9eb5e..025d93b47 100644 --- a/test-functional/src/test/java/com/arangodb/internal/HostHandlerTest.java +++ b/test-functional/src/test/java/com/arangodb/internal/HostHandlerTest.java @@ -84,26 +84,26 @@ public void close() { @Test void fallbackHostHandlerSingleHost() { final HostHandler handler = new FallbackHostHandler(SINGLE_HOST); - assertThat(handler.get(null, null)).isEqualTo(HOST_0); + assertThat(handler.get(null)).isEqualTo(HOST_0); handler.fail(new RuntimeException()); - assertThat(handler.get(null, null)).isEqualTo(HOST_0); + assertThat(handler.get(null)).isEqualTo(HOST_0); } @Test void fallbackHostHandlerMultipleHosts() { final HostHandler handler = new FallbackHostHandler(MULTIPLE_HOSTS); for (int i = 0; i < 3; i++) { - assertThat(handler.get(null, null)).isEqualTo(HOST_0); + assertThat(handler.get(null)).isEqualTo(HOST_0); handler.fail(new RuntimeException("HOST_0 failed")); - assertThat(handler.get(null, null)).isEqualTo(HOST_1); + assertThat(handler.get(null)).isEqualTo(HOST_1); handler.fail(new RuntimeException("HOST_1 failed")); - assertThat(handler.get(null, null)).isEqualTo(HOST_2); + assertThat(handler.get(null)).isEqualTo(HOST_2); handler.fail(new RuntimeException("HOST_2 failed")); if (i < 2) { - assertThat(handler.get(null, null)).isEqualTo(HOST_0); + assertThat(handler.get(null)).isEqualTo(HOST_0); } else { try { - handler.get(null, null); + handler.get(null); fail(); } catch (ArangoDBException e) { assertThat(e.getCause()).isNotNull(); @@ -123,24 +123,24 @@ void fallbackHostHandlerMultipleHosts() { @Test void randomHostHandlerSingleHost() { final HostHandler handler = new RandomHostHandler(SINGLE_HOST, new FallbackHostHandler(SINGLE_HOST)); - assertThat(handler.get(null, null)).isEqualTo(HOST_0); + assertThat(handler.get(null)).isEqualTo(HOST_0); handler.fail(new RuntimeException()); - assertThat(handler.get(null, null)).isEqualTo(HOST_0); + assertThat(handler.get(null)).isEqualTo(HOST_0); } @Test void randomHostHandlerMultipleHosts() { final HostHandler handler = new RandomHostHandler(MULTIPLE_HOSTS, new FallbackHostHandler(MULTIPLE_HOSTS)); - final Host pick0 = handler.get(null, null); + final Host pick0 = handler.get(null); assertThat(pick0).isIn(HOST_0, HOST_1, HOST_2); handler.fail(new RuntimeException()); - final Host pick1 = handler.get(null, null); + final Host pick1 = handler.get(null); assertThat(pick1).isIn(HOST_0, HOST_1, HOST_2); handler.success(); - final Host pick3 = handler.get(null, null); + final Host pick3 = handler.get(null); assertThat(pick3) .isIn(HOST_0, HOST_1, HOST_2) .isEqualTo(pick1); @@ -149,25 +149,25 @@ void randomHostHandlerMultipleHosts() { @Test void roundRobinHostHandlerSingleHost() { final HostHandler handler = new RoundRobinHostHandler(SINGLE_HOST); - assertThat(handler.get(null, null)).isEqualTo(HOST_0); + assertThat(handler.get(null)).isEqualTo(HOST_0); handler.fail(new RuntimeException()); - assertThat(handler.get(null, null)).isEqualTo(HOST_0); + assertThat(handler.get(null)).isEqualTo(HOST_0); } @Test void roundRobinHostHandlerMultipleHosts() { final HostHandler handler = new RoundRobinHostHandler(MULTIPLE_HOSTS); - final Host pick0 = handler.get(null, null); + final Host pick0 = handler.get(null); assertThat(pick0).isIn(HOST_0, HOST_1, HOST_2); - final Host pick1 = handler.get(null, null); + final Host pick1 = handler.get(null); assertThat(pick1) .isIn(HOST_0, HOST_1, HOST_2) .isNotEqualTo(pick0); - final Host pick2 = handler.get(null, null); + final Host pick2 = handler.get(null); assertThat(pick2) .isIn(HOST_0, HOST_1, HOST_2) .isNotIn(pick0, pick1); - final Host pick4 = handler.get(null, null); + final Host pick4 = handler.get(null); assertThat(pick4).isEqualTo(pick0); } diff --git a/test-functional/src/test/java/com/arangodb/internal/velocystream/CommunicationTest.java b/test-functional/src/test/java/com/arangodb/internal/velocystream/CommunicationTest.java index 5219179fc..69f8063f5 100644 --- a/test-functional/src/test/java/com/arangodb/internal/velocystream/CommunicationTest.java +++ b/test-functional/src/test/java/com/arangodb/internal/velocystream/CommunicationTest.java @@ -56,7 +56,6 @@ void multiThread() throws Exception { final ArangoDB arangoDB = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) .build(); - arangoDB.getUsers(); // authentication and active-failover connection redirect to master final Collection result = new ConcurrentLinkedQueue<>(); final Thread fast = new Thread(() -> { @@ -85,7 +84,6 @@ void multiThreadSameDatabases() throws Exception { final ArangoDB arangoDB = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) .build(); - arangoDB.getUsers(); // authentication and active-failover connection redirect to master final ArangoDatabase db = arangoDB.db(); diff --git a/test-functional/src/test/java/com/arangodb/util/ProtocolSource.java b/test-functional/src/test/java/com/arangodb/util/ProtocolSource.java new file mode 100644 index 000000000..e02d84cfb --- /dev/null +++ b/test-functional/src/test/java/com/arangodb/util/ProtocolSource.java @@ -0,0 +1,19 @@ +package com.arangodb.util; + +import com.arangodb.Protocol; +import org.junit.jupiter.params.provider.EnumSource; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@EnumSource( + value = Protocol.class, + mode = EnumSource.Mode.EXCLUDE, + names = "VST" +) +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ProtocolSource { +} diff --git a/test-non-functional/pom.xml b/test-non-functional/pom.xml index d842f3732..8fc7919e9 100644 --- a/test-non-functional/pom.xml +++ b/test-non-functional/pom.xml @@ -8,7 +8,7 @@ ../test-parent com.arangodb test-parent -7.19.0 +7.20.0-SNAPSHOT test-non-functional diff --git a/test-non-functional/src/test/java/CommunicationTest.java b/test-non-functional/src/test/java/CommunicationTest.java index 158a1b3d8..472c4ec0f 100644 --- a/test-non-functional/src/test/java/CommunicationTest.java +++ b/test-non-functional/src/test/java/CommunicationTest.java @@ -2,7 +2,7 @@ import com.arangodb.config.ArangoConfigProperties; import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; +import util.ProtocolSource; import util.TestUtils; import java.io.IOException; @@ -11,16 +11,13 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; public class CommunicationTest { @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource @Timeout(5) void disconnectAsync(Protocol protocol) throws InterruptedException, ExecutionException { - assumeTrue(!Protocol.VST.equals(protocol)); - ArangoDBAsync arangoDB = new ArangoDB.Builder() .loadProperties(ArangoConfigProperties.fromFile()) .protocol(protocol) @@ -42,11 +39,9 @@ void disconnectAsync(Protocol protocol) throws InterruptedException, ExecutionEx } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource @Timeout(5) void disconnect(Protocol protocol) { - assumeTrue(!Protocol.VST.equals(protocol)); - ArangoDB arangoDB = new ArangoDB.Builder() .loadProperties(ArangoConfigProperties.fromFile()) .protocol(protocol) diff --git a/test-non-functional/src/test/java/concurrency/ConnectionLoadBalanceTest.java b/test-non-functional/src/test/java/concurrency/ConnectionLoadBalanceTest.java index a3f5200a2..ff7a74a60 100644 --- a/test-non-functional/src/test/java/concurrency/ConnectionLoadBalanceTest.java +++ b/test-non-functional/src/test/java/concurrency/ConnectionLoadBalanceTest.java @@ -23,9 +23,6 @@ public class ConnectionLoadBalanceTest { public static Streamconfigs() { return Stream.of( - // FIXME: DE-1017 - // new Config(Protocol.VST, 1), - // new Config(Protocol.VST, 2), new Config(Protocol.HTTP_JSON, 10), new Config(Protocol.HTTP_JSON, 20), new Config(Protocol.HTTP2_JSON, 1), diff --git a/test-non-functional/src/test/java/perf/SimpleAsyncPerfTest.java b/test-non-functional/src/test/java/perf/SimpleAsyncPerfTest.java index 16cf43cfc..5a3cc4bca 100644 --- a/test-non-functional/src/test/java/perf/SimpleAsyncPerfTest.java +++ b/test-non-functional/src/test/java/perf/SimpleAsyncPerfTest.java @@ -25,7 +25,7 @@ import com.arangodb.Protocol; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; +import util.ProtocolSource; import java.util.Date; import java.util.concurrent.atomic.AtomicInteger; @@ -56,7 +56,7 @@ private void doGetVersion(ArangoDBAsync arangoDB) throws InterruptedException { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void getVersion(Protocol protocol) throws InterruptedException { ArangoDBAsync arangoDB = new ArangoDB.Builder() .host("172.28.0.1", 8529) diff --git a/test-non-functional/src/test/java/perf/SimpleSyncPerfTest.java b/test-non-functional/src/test/java/perf/SimpleSyncPerfTest.java index 4e18b71f4..4ceffd984 100644 --- a/test-non-functional/src/test/java/perf/SimpleSyncPerfTest.java +++ b/test-non-functional/src/test/java/perf/SimpleSyncPerfTest.java @@ -24,7 +24,7 @@ import com.arangodb.Protocol; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; +import util.ProtocolSource; import java.util.Date; @@ -42,7 +42,7 @@ private void doGetVersion(ArangoDB arangoDB) { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void getVersion(Protocol protocol) throws InterruptedException { ArangoDB arangoDB = new ArangoDB.Builder() .host("172.28.0.1", 8529) diff --git a/test-non-functional/src/test/java/perf/SyncBenchmarkTest.java b/test-non-functional/src/test/java/perf/SyncBenchmarkTest.java index cc7651c9b..b065ab657 100644 --- a/test-non-functional/src/test/java/perf/SyncBenchmarkTest.java +++ b/test-non-functional/src/test/java/perf/SyncBenchmarkTest.java @@ -6,7 +6,7 @@ import com.arangodb.internal.ArangoRequestParam; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; +import util.ProtocolSource; @Disabled public class SyncBenchmarkTest { @@ -14,7 +14,7 @@ public class SyncBenchmarkTest { private final int numberOfRequests = 1_000_000; @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void getVersion(Protocol protocol) { System.out.println("-----------------------------------------"); System.out.println("--- getVersion(): " + protocol); @@ -43,7 +43,7 @@ protected void shutdown() { } @ParameterizedTest - @EnumSource(Protocol.class) + @ProtocolSource void getVersionWithDetails(Protocol protocol) { System.out.println("-----------------------------------------"); System.out.println("--- getVersion w/ details: " + protocol); diff --git a/test-non-functional/src/test/java/util/ProtocolSource.java b/test-non-functional/src/test/java/util/ProtocolSource.java new file mode 100644 index 000000000..d19ff8e45 --- /dev/null +++ b/test-non-functional/src/test/java/util/ProtocolSource.java @@ -0,0 +1,19 @@ +package util; + +import com.arangodb.Protocol; +import org.junit.jupiter.params.provider.EnumSource; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@EnumSource( + value = Protocol.class, + mode = EnumSource.Mode.EXCLUDE, + names = "VST" +) +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ProtocolSource { +} diff --git a/test-parent/pom.xml b/test-parent/pom.xml index 09568371d..2abdd1291 100644 --- a/test-parent/pom.xml +++ b/test-parent/pom.xml @@ -7,7 +7,7 @@ com.arangodb arangodb-java-driver-parent -7.19.0 +7.20.0-SNAPSHOT pom @@ -174,11 +174,6 @@arangodb-java-driver compile - com.arangodb -vst-protocol -compile -diff --git a/test-perf/pom.xml b/test-perf/pom.xml index a10f0d30c..4e95e86f7 100644 --- a/test-perf/pom.xml +++ b/test-perf/pom.xml @@ -7,7 +7,7 @@ ../test-parent com.arangodb test-parent -7.19.0 +7.20.0-SNAPSHOT test-perf diff --git a/test-resilience/pom.xml b/test-resilience/pom.xml index e278b6319..5f5e18dac 100644 --- a/test-resilience/pom.xml +++ b/test-resilience/pom.xml @@ -6,7 +6,7 @@../test-parent com.arangodb test-parent -7.19.0 +7.20.0-SNAPSHOT 4.0.0 diff --git a/test-resilience/src/test/java/resilience/ClusterTest.java b/test-resilience/src/test/java/resilience/ClusterTest.java index d15bbbcf6..82980ae84 100644 --- a/test-resilience/src/test/java/resilience/ClusterTest.java +++ b/test-resilience/src/test/java/resilience/ClusterTest.java @@ -71,13 +71,10 @@ protected static ArangoDB.Builder dbBuilder() { return builder.password(PASSWORD); } - protected static StreamprotocolProvider() { - return Stream.of(Protocol.values()) - .filter(p -> !p.equals(Protocol.VST) || isLessThanVersion(3, 12)); - } - protected static Stream builderProvider() { - return protocolProvider().map(p -> dbBuilder().protocol(p)); + return Stream.of(Protocol.values()) + .filter(p -> !p.equals(Protocol.VST)) + .map(p -> dbBuilder().protocol(p)); } protected static Stream adbProvider() { diff --git a/test-resilience/src/test/java/resilience/SingleServerTest.java b/test-resilience/src/test/java/resilience/SingleServerTest.java index 852d0a013..47cb03a6d 100644 --- a/test-resilience/src/test/java/resilience/SingleServerTest.java +++ b/test-resilience/src/test/java/resilience/SingleServerTest.java @@ -58,13 +58,10 @@ protected static ArangoDB.Builder dbBuilder() { .password(PASSWORD); } - protected static Stream protocolProvider() { - return Stream.of(Protocol.values()) - .filter(p -> !p.equals(Protocol.VST) || isLessThanVersion(3, 12)); - } - protected static Stream builderProvider() { - return protocolProvider().map(p -> dbBuilder().protocol(p)); + return Stream.of(Protocol.values()) + .filter(p -> !p.equals(Protocol.VST)) + .map(p -> dbBuilder().protocol(p)); } protected static Stream adbProvider() { diff --git a/test-resilience/src/test/java/resilience/compression/CompressionTest.java b/test-resilience/src/test/java/resilience/compression/CompressionTest.java index d33e345d0..7c5a721aa 100644 --- a/test-resilience/src/test/java/resilience/compression/CompressionTest.java +++ b/test-resilience/src/test/java/resilience/compression/CompressionTest.java @@ -7,8 +7,8 @@ import com.arangodb.Protocol; import io.netty.handler.codec.http2.Http2FrameLogger; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; import resilience.ClusterTest; +import resilience.utils.ProtocolSource; import java.util.*; import java.util.stream.Collectors; @@ -27,21 +27,18 @@ class CompressionTest extends ClusterTest { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void gzip(Protocol protocol) { doTest(protocol, Compression.GZIP); } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void deflate(Protocol protocol) { doTest(protocol, Compression.DEFLATE); } void doTest(Protocol protocol, Compression compression) { - assumeTrue(isAtLeastVersion(3, 12)); - assumeTrue(protocol != Protocol.VST); - assumeTrue(protocol != Protocol.HTTP_VPACK, "hex dumps logs"); // FIXME assumeTrue(protocol != Protocol.HTTP_JSON, "hex dumps logs"); // FIXME diff --git a/test-resilience/src/test/java/resilience/connection/AcquireHostListTest.java b/test-resilience/src/test/java/resilience/connection/AcquireHostListTest.java index be8d02d5f..a059f66be 100644 --- a/test-resilience/src/test/java/resilience/connection/AcquireHostListTest.java +++ b/test-resilience/src/test/java/resilience/connection/AcquireHostListTest.java @@ -5,9 +5,9 @@ import com.arangodb.entity.LoadBalancingStrategy; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; import resilience.ClusterTest; import resilience.Endpoint; +import resilience.utils.ProtocolSource; import java.util.HashSet; import java.util.Set; @@ -18,7 +18,7 @@ public class AcquireHostListTest extends ClusterTest { @ParameterizedTest(name = "{index}") - @MethodSource("protocolProvider") + @ProtocolSource void acquireHostList(Protocol protocol) { ArangoDB adb = new ArangoDB.Builder() .host("172.28.0.1", 8529) diff --git a/test-resilience/src/test/java/resilience/connection/ConnectionClusterTest.java b/test-resilience/src/test/java/resilience/connection/ConnectionClusterTest.java index 3748ea975..358bfe151 100644 --- a/test-resilience/src/test/java/resilience/connection/ConnectionClusterTest.java +++ b/test-resilience/src/test/java/resilience/connection/ConnectionClusterTest.java @@ -6,6 +6,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import resilience.ClusterTest; +import resilience.utils.ProtocolSource; import java.net.ConnectException; import java.net.UnknownHostException; @@ -20,7 +21,7 @@ class ConnectionClusterTest extends ClusterTest { @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource @Disabled void nameResolutionFail(Protocol protocol) { // FIXME: make this test faster and re-enable @@ -42,7 +43,7 @@ void nameResolutionFail(Protocol protocol) { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource @Disabled void nameResolutionFailAsync(Protocol protocol) { // FIXME: make this test faster and re-enable @@ -65,7 +66,7 @@ void nameResolutionFailAsync(Protocol protocol) { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource @Disabled void nameResolutionFailover(Protocol protocol) { // FIXME: make this test faster and re-enable @@ -86,7 +87,7 @@ void nameResolutionFailover(Protocol protocol) { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource @Disabled void nameResolutionFailoverAsync(Protocol protocol) throws ExecutionException, InterruptedException { // FIXME: make this test faster and re-enable diff --git a/test-resilience/src/test/java/resilience/connection/ConnectionTest.java b/test-resilience/src/test/java/resilience/connection/ConnectionTest.java index b64f1dd42..342a20b4f 100644 --- a/test-resilience/src/test/java/resilience/connection/ConnectionTest.java +++ b/test-resilience/src/test/java/resilience/connection/ConnectionTest.java @@ -7,6 +7,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import resilience.SingleServerTest; +import resilience.utils.ProtocolSource; import java.io.IOException; import java.net.ConnectException; @@ -14,7 +15,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** * @author Michele Rastelli @@ -22,7 +22,7 @@ class ConnectionTest extends SingleServerTest { @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource @Disabled void nameResolutionFail(Protocol protocol) { // FIXME: make this test faster and re-enable @@ -44,7 +44,7 @@ void nameResolutionFail(Protocol protocol) { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource @Disabled void nameResolutionFailAsync(Protocol protocol) { // FIXME: make this test faster and re-enable @@ -98,7 +98,7 @@ void connectionFailAsync(ArangoDBAsync arangoDB) { } @ParameterizedTest(name = "{index}") - @MethodSource("protocolProvider") + @ProtocolSource void authFail(Protocol protocol) { ArangoDB adb = new ArangoDB.Builder() .host(getEndpoint().getHost(), getEndpoint().getPort()) @@ -114,7 +114,7 @@ void authFail(Protocol protocol) { } @ParameterizedTest(name = "{index}") - @MethodSource("protocolProvider") + @ProtocolSource void authFailAsync(Protocol protocol) { ArangoDBAsync adb = new ArangoDB.Builder() .host(getEndpoint().getHost(), getEndpoint().getPort()) @@ -151,9 +151,8 @@ void connCloseAsync(ArangoDBAsync adb) { } @ParameterizedTest(name = "{index}") - @MethodSource("protocolProvider") + @ProtocolSource void connReset(Protocol protocol) throws IOException, InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST), "DE-776"); // FIXME ArangoDB adb = new ArangoDB.Builder() .host(getEndpoint().getHost(), getEndpoint().getPort()) .protocol(protocol) @@ -171,9 +170,8 @@ void connReset(Protocol protocol) throws IOException, InterruptedException { } @ParameterizedTest(name = "{index}") - @MethodSource("protocolProvider") + @ProtocolSource void connResetAsync(Protocol protocol) throws IOException, InterruptedException { - assumeTrue(!protocol.equals(Protocol.VST), "DE-776"); // FIXME ArangoDBAsync adb = new ArangoDB.Builder() .host(getEndpoint().getHost(), getEndpoint().getPort()) .protocol(protocol) diff --git a/test-resilience/src/test/java/resilience/loadbalance/LoadBalanceRoundRobinClusterTest.java b/test-resilience/src/test/java/resilience/loadbalance/LoadBalanceRoundRobinClusterTest.java index 1efb0305d..47cbe74ae 100644 --- a/test-resilience/src/test/java/resilience/loadbalance/LoadBalanceRoundRobinClusterTest.java +++ b/test-resilience/src/test/java/resilience/loadbalance/LoadBalanceRoundRobinClusterTest.java @@ -13,7 +13,6 @@ import java.io.IOException; import java.util.List; -import java.util.concurrent.ExecutionException; import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; @@ -112,11 +111,6 @@ void retryGETAsync(ArangoDBAsync arangoDB) throws IOException, InterruptedExcept @ParameterizedTest(name = "{index}") @MethodSource("arangoProvider") void retryPOST(ArangoDB arangoDB) throws IOException, InterruptedException { - // create VST connections - for (int i = 0; i < getEndpoints().size(); i++) { - arangoDB.getVersion(); - } - // slow down the driver connection Latency toxic = getEndpoints().get(0).getProxy().toxics().latency("latency", ToxicDirection.DOWNSTREAM, 10_000); Thread.sleep(100); @@ -137,12 +131,7 @@ void retryPOST(ArangoDB arangoDB) throws IOException, InterruptedException { @ParameterizedTest(name = "{index}") @MethodSource("asyncArangoProvider") - void retryPOSTAsync(ArangoDBAsync arangoDB) throws IOException, InterruptedException, ExecutionException { - // create VST connections - for (int i = 0; i < getEndpoints().size(); i++) { - arangoDB.getVersion().get(); - } - + void retryPOSTAsync(ArangoDBAsync arangoDB) throws IOException, InterruptedException { // slow down the driver connection Latency toxic = getEndpoints().get(0).getProxy().toxics().latency("latency", ToxicDirection.DOWNSTREAM, 10_000); Thread.sleep(100); diff --git a/test-resilience/src/test/java/resilience/logging/RequestLoggingTest.java b/test-resilience/src/test/java/resilience/logging/RequestLoggingTest.java index ce5d33386..5b0ba1589 100644 --- a/test-resilience/src/test/java/resilience/logging/RequestLoggingTest.java +++ b/test-resilience/src/test/java/resilience/logging/RequestLoggingTest.java @@ -8,8 +8,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; import resilience.SingleServerTest; +import resilience.utils.ProtocolSource; import java.util.Collections; import java.util.Map; @@ -24,7 +24,7 @@ public RequestLoggingTest() { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void requestLogging(Protocol protocol) { ArangoDB adb = new ArangoDB.Builder() .host("172.28.0.1", 8529) diff --git a/test-resilience/src/test/java/resilience/protocol/ProtocolTest.java b/test-resilience/src/test/java/resilience/protocol/ProtocolTest.java index a242b76a9..174c925fd 100644 --- a/test-resilience/src/test/java/resilience/protocol/ProtocolTest.java +++ b/test-resilience/src/test/java/resilience/protocol/ProtocolTest.java @@ -3,7 +3,6 @@ import ch.qos.logback.classic.Level; import com.arangodb.ArangoDB; import com.arangodb.Protocol; -import com.arangodb.vst.internal.VstConnection; import io.netty.handler.codec.http2.Http2FrameLogger; import io.netty.handler.logging.LoggingHandler; import org.junit.jupiter.api.*; @@ -18,13 +17,11 @@ import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assumptions.assumeTrue; public class ProtocolTest extends TestUtils { private static final Map , Level> logLevels = new HashMap<>(); static { - logLevels.put(VstConnection.class, Level.DEBUG); logLevels.put(LoggingHandler.class, Level.DEBUG); logLevels.put(Http2FrameLogger.class, Level.DEBUG); } @@ -47,7 +44,6 @@ void shutdown() { static Stream args() { return Stream.of( - Arguments.of(Protocol.VST, "VstConnection"), Arguments.of(Protocol.HTTP_JSON, "LoggingHandler"), Arguments.of(Protocol.HTTP2_JSON, "Http2FrameLogger") ); @@ -56,7 +52,6 @@ static Stream args() { @ParameterizedTest @MethodSource("args") void shouldUseConfiguredProtocol(Protocol p, String expectedLog) { - assumeTrue(!p.equals(Protocol.VST) || isLessThanVersion(3, 12)); ArangoDB adb = new ArangoDB.Builder() .host("172.28.0.1", 8529) .password("test") diff --git a/test-resilience/src/test/java/resilience/retry/RetryClusterTest.java b/test-resilience/src/test/java/resilience/retry/RetryClusterTest.java index d2f44eba2..0953550dc 100644 --- a/test-resilience/src/test/java/resilience/retry/RetryClusterTest.java +++ b/test-resilience/src/test/java/resilience/retry/RetryClusterTest.java @@ -8,6 +8,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import resilience.ClusterTest; +import resilience.utils.ProtocolSource; import java.io.IOException; import java.net.ConnectException; @@ -15,7 +16,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** * @author Michele Rastelli @@ -124,9 +124,8 @@ void unreachableHostFailoverAsync(ArangoDBAsync arangoDB) throws ExecutionExcept @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void retryGetOnClosedConnection(Protocol protocol) throws IOException, InterruptedException { - assumeTrue(protocol != Protocol.VST); ArangoDB arangoDB = dbBuilder() .protocol(protocol) .build(); @@ -150,9 +149,8 @@ void retryGetOnClosedConnection(Protocol protocol) throws IOException, Interrupt } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void retryGetOnClosedConnectionAsync(Protocol protocol) throws IOException, InterruptedException, ExecutionException { - assumeTrue(protocol != Protocol.VST); ArangoDBAsync arangoDB = dbBuilder() .protocol(protocol) .build() @@ -183,7 +181,7 @@ void retryGetOnClosedConnectionAsync(Protocol protocol) throws IOException, Inte * the subsequent requests should fail over to a different coordinator and be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void notRetryPostOnClosedConnection(Protocol protocol) throws IOException, InterruptedException { ArangoDB arangoDB = dbBuilder() .protocol(protocol) @@ -199,9 +197,7 @@ void notRetryPostOnClosedConnection(Protocol protocol) throws IOException, Inter Throwable thrown = catchThrowable(() -> arangoDB.db().query("return null", Void.class)); assertThat(thrown).isInstanceOf(ArangoDBException.class); assertThat(thrown.getCause()).isInstanceOf(IOException.class); - if (protocol != Protocol.VST) { - assertThat(thrown.getCause().getCause()).isInstanceOf(HttpClosedException.class); - } + assertThat(thrown.getCause().getCause()).isInstanceOf(HttpClosedException.class); arangoDB.db().query("return null", Void.class); @@ -216,7 +212,7 @@ void notRetryPostOnClosedConnection(Protocol protocol) throws IOException, Inter * the subsequent requests should fail over to a different coordinator and be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void notRetryPostOnClosedConnectionAsync(Protocol protocol) throws IOException, InterruptedException, ExecutionException { ArangoDBAsync arangoDB = dbBuilder() .protocol(protocol) @@ -233,9 +229,7 @@ void notRetryPostOnClosedConnectionAsync(Protocol protocol) throws IOException, Throwable thrown = catchThrowable(() -> arangoDB.db().query("return null", Void.class).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); assertThat(thrown.getCause()).isInstanceOf(IOException.class); - if (protocol != Protocol.VST) { - assertThat(thrown.getCause().getCause()).isInstanceOf(HttpClosedException.class); - } + assertThat(thrown.getCause().getCause()).isInstanceOf(HttpClosedException.class); arangoDB.db().query("return null", Void.class).get(); diff --git a/test-resilience/src/test/java/resilience/retry/RetryTest.java b/test-resilience/src/test/java/resilience/retry/RetryTest.java index 81875c4aa..cf68cdafe 100644 --- a/test-resilience/src/test/java/resilience/retry/RetryTest.java +++ b/test-resilience/src/test/java/resilience/retry/RetryTest.java @@ -8,6 +8,7 @@ import eu.rekawek.toxiproxy.model.toxic.Latency; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import resilience.utils.ProtocolSource; import java.io.IOException; import java.net.ConnectException; @@ -16,7 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** * @author Michele Rastelli @@ -97,7 +97,7 @@ void unreachableHostAsync(ArangoDBAsync arangoDB) throws ExecutionException, Int * - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void connectionTimeout(Protocol protocol) throws IOException, InterruptedException { ArangoDB arangoDB = dbBuilder() .timeout(500) @@ -131,7 +131,7 @@ void connectionTimeout(Protocol protocol) throws IOException, InterruptedExcepti * - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void connectionTimeoutAsync(Protocol protocol) throws IOException, InterruptedException, ExecutionException { ArangoDBAsync arangoDB = dbBuilder() .timeout(500) @@ -170,9 +170,8 @@ void connectionTimeoutAsync(Protocol protocol) throws IOException, InterruptedEx * - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void retryGetOnClosedConnection(Protocol protocol) throws IOException, InterruptedException { - assumeTrue(protocol != Protocol.VST); ArangoDB arangoDB = dbBuilder() .protocol(protocol) .build(); @@ -212,9 +211,8 @@ void retryGetOnClosedConnection(Protocol protocol) throws IOException, Interrupt * - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void retryGetOnClosedConnectionAsync(Protocol protocol) throws IOException, InterruptedException, ExecutionException { - assumeTrue(protocol != Protocol.VST); ArangoDBAsync arangoDB = dbBuilder() .protocol(protocol) .build() @@ -251,7 +249,7 @@ void retryGetOnClosedConnectionAsync(Protocol protocol) throws IOException, Inte * once restored: - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void notRetryPostOnClosedConnection(Protocol protocol) throws IOException, InterruptedException { ArangoDB arangoDB = dbBuilder() .protocol(protocol) @@ -267,9 +265,7 @@ void notRetryPostOnClosedConnection(Protocol protocol) throws IOException, Inter Throwable thrown = catchThrowable(() -> arangoDB.db().query("return null", Void.class)); assertThat(thrown).isInstanceOf(ArangoDBException.class); assertThat(thrown.getCause()).isInstanceOf(IOException.class); - if (protocol != Protocol.VST) { - assertThat(thrown.getCause().getCause()).isInstanceOf(HttpClosedException.class); - } + assertThat(thrown.getCause().getCause()).isInstanceOf(HttpClosedException.class); toxic.remove(); getEndpoint().enable(); @@ -284,7 +280,7 @@ void notRetryPostOnClosedConnection(Protocol protocol) throws IOException, Inter * once restored: - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void notRetryPostOnClosedConnectionAsync(Protocol protocol) throws IOException, InterruptedException, ExecutionException { ArangoDBAsync arangoDB = dbBuilder() .protocol(protocol) @@ -301,9 +297,7 @@ void notRetryPostOnClosedConnectionAsync(Protocol protocol) throws IOException, Throwable thrown = catchThrowable(() -> arangoDB.db().query("return null", Void.class).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); assertThat(thrown.getCause()).isInstanceOf(IOException.class); - if (protocol != Protocol.VST) { - assertThat(thrown.getCause().getCause()).isInstanceOf(HttpClosedException.class); - } + assertThat(thrown.getCause().getCause()).isInstanceOf(HttpClosedException.class); toxic.remove(); getEndpoint().enable(); diff --git a/test-resilience/src/test/java/resilience/shutdown/ShutdownClusterTest.java b/test-resilience/src/test/java/resilience/shutdown/ShutdownClusterTest.java index 0ff83e7c6..70b0c7dc8 100644 --- a/test-resilience/src/test/java/resilience/shutdown/ShutdownClusterTest.java +++ b/test-resilience/src/test/java/resilience/shutdown/ShutdownClusterTest.java @@ -6,8 +6,8 @@ import com.arangodb.Protocol; import io.vertx.core.http.HttpClosedException; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; import resilience.ClusterTest; +import resilience.utils.ProtocolSource; import java.io.IOException; import java.util.concurrent.ExecutionException; @@ -17,7 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** * @author Michele Rastelli @@ -25,7 +24,7 @@ class ShutdownClusterTest extends ClusterTest { @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void shutdown(Protocol protocol) throws InterruptedException { ArangoDB arangoDB = dbBuilder() .protocol(protocol) @@ -40,7 +39,7 @@ void shutdown(Protocol protocol) throws InterruptedException { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void shutdownAsync(Protocol protocol) throws InterruptedException, ExecutionException { ArangoDBAsync arangoDB = dbBuilder() .protocol(protocol) @@ -56,9 +55,8 @@ void shutdownAsync(Protocol protocol) throws InterruptedException, ExecutionExce } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void shutdownWithPendingRequests(Protocol protocol) { - assumeTrue(protocol != Protocol.VST); ArangoDB arangoDB = dbBuilder() .protocol(protocol) .build(); @@ -73,9 +71,8 @@ void shutdownWithPendingRequests(Protocol protocol) { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void shutdownWithPendingRequestsAsync(Protocol protocol) { - assumeTrue(protocol != Protocol.VST); ArangoDBAsync arangoDB = dbBuilder() .protocol(protocol) .build() diff --git a/test-resilience/src/test/java/resilience/shutdown/ShutdownTest.java b/test-resilience/src/test/java/resilience/shutdown/ShutdownTest.java index 4132f6036..7135dd8af 100644 --- a/test-resilience/src/test/java/resilience/shutdown/ShutdownTest.java +++ b/test-resilience/src/test/java/resilience/shutdown/ShutdownTest.java @@ -6,8 +6,8 @@ import com.arangodb.Protocol; import io.vertx.core.http.HttpClosedException; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; import resilience.SingleServerTest; +import resilience.utils.ProtocolSource; import java.io.IOException; import java.util.concurrent.ExecutionException; @@ -17,7 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** * @author Michele Rastelli @@ -25,7 +24,7 @@ class ShutdownTest extends SingleServerTest { @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void shutdown(Protocol protocol) throws InterruptedException { ArangoDB arangoDB = dbBuilder() .protocol(protocol) @@ -40,7 +39,7 @@ void shutdown(Protocol protocol) throws InterruptedException { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void shutdownAsync(Protocol protocol) throws InterruptedException, ExecutionException { ArangoDBAsync arangoDB = dbBuilder() .protocol(protocol) @@ -56,9 +55,8 @@ void shutdownAsync(Protocol protocol) throws InterruptedException, ExecutionExce } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void shutdownWithPendingRequests(Protocol protocol) { - assumeTrue(protocol != Protocol.VST); ArangoDB arangoDB = dbBuilder() .protocol(protocol) .build(); @@ -73,9 +71,8 @@ void shutdownWithPendingRequests(Protocol protocol) { } @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void shutdownWithPendingRequestsAsync(Protocol protocol) { - assumeTrue(protocol != Protocol.VST); ArangoDBAsync arangoDB = dbBuilder() .protocol(protocol) .build() diff --git a/test-resilience/src/test/java/resilience/timeout/TimeoutClusterTest.java b/test-resilience/src/test/java/resilience/timeout/TimeoutClusterTest.java index fa80f1364..fd1eeed72 100644 --- a/test-resilience/src/test/java/resilience/timeout/TimeoutClusterTest.java +++ b/test-resilience/src/test/java/resilience/timeout/TimeoutClusterTest.java @@ -2,8 +2,8 @@ import com.arangodb.*; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; import resilience.ClusterTest; +import resilience.utils.ProtocolSource; import java.util.Collections; import java.util.Map; @@ -27,7 +27,7 @@ class TimeoutClusterTest extends ClusterTest { * - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void requestTimeout(Protocol protocol) throws InterruptedException { ArangoDB arangoDB = dbBuilder() .timeout(500) @@ -68,7 +68,7 @@ void requestTimeout(Protocol protocol) throws InterruptedException { * - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void requestTimeoutAsync(Protocol protocol) throws InterruptedException, ExecutionException { ArangoDBAsync arangoDB = dbBuilder() .timeout(500) diff --git a/test-resilience/src/test/java/resilience/timeout/TimeoutTest.java b/test-resilience/src/test/java/resilience/timeout/TimeoutTest.java index 00f0f6aab..75ab8a363 100644 --- a/test-resilience/src/test/java/resilience/timeout/TimeoutTest.java +++ b/test-resilience/src/test/java/resilience/timeout/TimeoutTest.java @@ -2,8 +2,8 @@ import com.arangodb.*; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; import resilience.SingleServerTest; +import resilience.utils.ProtocolSource; import java.util.Collections; import java.util.Map; @@ -27,7 +27,7 @@ class TimeoutTest extends SingleServerTest { * - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void requestTimeout(Protocol protocol) throws InterruptedException { ArangoDB arangoDB = dbBuilder() .timeout(500) @@ -68,7 +68,7 @@ void requestTimeout(Protocol protocol) throws InterruptedException { * - the subsequent requests should be successful */ @ParameterizedTest - @MethodSource("protocolProvider") + @ProtocolSource void requestTimeoutAsync(Protocol protocol) throws InterruptedException, ExecutionException { ArangoDBAsync arangoDB = dbBuilder() .timeout(500) diff --git a/test-resilience/src/test/java/resilience/utils/ProtocolSource.java b/test-resilience/src/test/java/resilience/utils/ProtocolSource.java new file mode 100644 index 000000000..88974ed25 --- /dev/null +++ b/test-resilience/src/test/java/resilience/utils/ProtocolSource.java @@ -0,0 +1,19 @@ +package resilience.utils; + +import com.arangodb.Protocol; +import org.junit.jupiter.params.provider.EnumSource; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@EnumSource( + value = Protocol.class, + mode = EnumSource.Mode.EXCLUDE, + names = "VST" +) +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface ProtocolSource { +} diff --git a/test-resilience/src/test/java/resilience/vstKeepAlive/VstKeepAliveCloseTest.java b/test-resilience/src/test/java/resilience/vstKeepAlive/VstKeepAliveCloseTest.java deleted file mode 100644 index c38309a12..000000000 --- a/test-resilience/src/test/java/resilience/vstKeepAlive/VstKeepAliveCloseTest.java +++ /dev/null @@ -1,89 +0,0 @@ -package resilience.vstKeepAlive; - -import ch.qos.logback.classic.Level; -import com.arangodb.ArangoDB; -import com.arangodb.Protocol; -import resilience.SingleServerTest; -import eu.rekawek.toxiproxy.model.ToxicDirection; -import eu.rekawek.toxiproxy.model.toxic.Latency; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; - -import java.io.IOException; -import java.time.Duration; -import java.util.concurrent.ExecutionException; - -import static org.awaitility.Awaitility.await; -import static org.junit.jupiter.api.Assumptions.assumeTrue; - -/** - * @author Michele Rastelli - */ -class VstKeepAliveCloseTest extends SingleServerTest { - - private ArangoDB arangoDB; - - @BeforeEach - void init() { - assumeTrue(isLessThanVersion(3, 12)); - arangoDB = dbBuilder() - .protocol(Protocol.VST) - .timeout(1000) - .keepAliveInterval(1) - .build(); - } - - @AfterEach - void shutDown() { - if (arangoDB != null) { - arangoDB.shutdown(); - } - } - - /** - * after 3 consecutive VST keepAlive failures: - * - log ERROR Connection unresponsive - * - reconnect on next request - */ - @Test - @Timeout(10) - void keepAliveCloseAndReconnect() throws IOException, InterruptedException { - arangoDB.getVersion(); - Latency toxic = getEndpoint().getProxy().toxics().latency("latency", ToxicDirection.DOWNSTREAM, 10_000); - await() - .timeout(Duration.ofSeconds(3)) - .until(() -> logs.getLogs() - .filter(e -> e.getLevel().equals(Level.ERROR)) - .filter(e -> e.getFormattedMessage() != null) - .anyMatch(e -> e.getFormattedMessage().contains("Connection unresponsive!"))); - toxic.setLatency(0); - toxic.remove(); - Thread.sleep(100); - arangoDB.getVersion(); - } - - /** - * after 3 consecutive VST keepAlive failures: - * - log ERROR Connection unresponsive - * - reconnect on next request - */ - @Test - @Timeout(10) - void keepAliveCloseAndReconnectAsync() throws IOException, ExecutionException, InterruptedException { - arangoDB.async().getVersion().get(); - Latency toxic = getEndpoint().getProxy().toxics().latency("latency", ToxicDirection.DOWNSTREAM, 10_000); - await() - .timeout(Duration.ofSeconds(3)) - .until(() -> logs.getLogs() - .filter(e -> e.getLevel().equals(Level.ERROR)) - .filter(e -> e.getFormattedMessage() != null) - .anyMatch(e -> e.getFormattedMessage().contains("Connection unresponsive!"))); - toxic.setLatency(0); - toxic.remove(); - Thread.sleep(100); - arangoDB.async().getVersion().get(); - } - -} diff --git a/tutorial/gradle/build.gradle b/tutorial/gradle/build.gradle index b7abd1bc9..9296bd593 100644 --- a/tutorial/gradle/build.gradle +++ b/tutorial/gradle/build.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - implementation 'com.arangodb:arangodb-java-driver:7.19.0' + implementation 'com.arangodb:arangodb-java-driver:7.20.0-SNAPSHOT' } ext { diff --git a/tutorial/maven/pom.xml b/tutorial/maven/pom.xml index 845cdd7a1..19bc269ac 100644 --- a/tutorial/maven/pom.xml +++ b/tutorial/maven/pom.xml @@ -19,7 +19,7 @@ diff --git a/vst-protocol/pom.xml b/vst-protocol/pom.xml deleted file mode 100644 index 342dd8889..000000000 --- a/vst-protocol/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - com.arangodb arangodb-java-driver -7.19.0 +7.20.0-SNAPSHOT - \ No newline at end of file diff --git a/vst-protocol/src/main/java/com/arangodb/vst/VstCommunication.java b/vst-protocol/src/main/java/com/arangodb/vst/VstCommunication.java deleted file mode 100644 index c9150f5e1..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/VstCommunication.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst; - -import com.arangodb.ArangoDBException; -import com.arangodb.arch.UnstableApi; -import com.arangodb.internal.InternalRequest; -import com.arangodb.internal.InternalResponse; -import com.arangodb.internal.config.ArangoConfig; -import com.arangodb.internal.net.Communication; -import com.arangodb.internal.net.Connection; -import com.arangodb.internal.net.HostHandler; -import com.arangodb.internal.util.ResponseUtils; -import com.arangodb.vst.internal.AuthenticationRequest; -import com.arangodb.vst.internal.JwtAuthenticationRequest; -import com.arangodb.vst.internal.VstConnectionAsync; - -import java.io.IOException; -import java.util.concurrent.ExecutionException; - -/** - * @author Mark Vollmary - */ -@UnstableApi -public final class VstCommunication extends Communication { - private static final String ENCRYPTION_PLAIN = "plain"; - private static final String ENCRYPTION_JWT = "jwt"; - - private final String user; - private final String password; - private volatile String jwt; - - public VstCommunication(@UnstableApi final ArangoConfig config, @UnstableApi final HostHandler hostHandler) { - super(config, hostHandler); - user = config.getUser(); - password = config.getPassword(); - jwt = config.getJwt(); - } - - @Override - protected void connect(@UnstableApi Connection conn) throws IOException { - VstConnectionAsync connection = (VstConnectionAsync) conn; - if (!connection.isOpen()) { - connection.open(); - if (jwt != null || user != null) { - tryAuthenticate(connection); - } - } - } - - private void tryAuthenticate(final VstConnectionAsync connection) throws IOException { - try { - authenticate(connection); - } catch (final ArangoDBException authException) { - connection.close(); - throw authException; - } - } - - private void authenticate(final VstConnectionAsync connection) throws IOException { - InternalRequest authRequest; - if (jwt != null) { - authRequest = new JwtAuthenticationRequest(jwt, ENCRYPTION_JWT); - } else { - authRequest = new AuthenticationRequest(user, password != null ? password : "", ENCRYPTION_PLAIN); - } - - InternalResponse response; - try { - response = connection.executeAsync(authRequest).get(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw ArangoDBException.of(e); - } catch (ExecutionException e) { - throw new IOException(e.getCause()); - } - checkError(response); - } - - - private void checkError(final InternalResponse response) { - ArangoDBException e = ResponseUtils.translateError(serde, response); - if (e != null) throw e; - } - - public void setJwt(String jwt) { - this.jwt = jwt; - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/VstConnectionFactoryAsync.java b/vst-protocol/src/main/java/com/arangodb/vst/VstConnectionFactoryAsync.java deleted file mode 100644 index 1db7852a0..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/VstConnectionFactoryAsync.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2018 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst; - -import com.arangodb.arch.UnstableApi; -import com.arangodb.config.HostDescription; -import com.arangodb.internal.config.ArangoConfig; -import com.arangodb.internal.net.Connection; -import com.arangodb.internal.net.ConnectionFactory; -import com.arangodb.internal.net.ConnectionPool; -import com.arangodb.vst.internal.VstConnectionAsync; - -/** - * @author Mark Vollmary - */ -@UnstableApi -public class VstConnectionFactoryAsync implements ConnectionFactory { - - @Override - @UnstableApi - public Connection create(@UnstableApi final ArangoConfig config, final HostDescription host, @UnstableApi final ConnectionPool pool) { - return new VstConnectionAsync(config, host, pool); - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/VstModule.java b/vst-protocol/src/main/java/com/arangodb/vst/VstModule.java deleted file mode 100644 index 255a041fd..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/VstModule.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.arangodb.vst; - -import com.arangodb.vst.internal.AuthenticationRequest; -import com.arangodb.vst.internal.JwtAuthenticationRequest; -import com.fasterxml.jackson.databind.Module; -import com.fasterxml.jackson.databind.module.SimpleModule; - -import java.util.function.Supplier; - -enum VstModule implements Supplier4.0.0 - -- - -../release-parent -com.arangodb -release-parent -7.19.0 -vst-protocol -vst-protocol -VST Protocol module for ArangoDB Java Driver - -- - -com.arangodb.vst -false -- - -- -com.arangodb -core -provided -- -com.arangodb -velocypack -compile -{ - INSTANCE; - - private final SimpleModule module; - - VstModule() { - module = new SimpleModule(); - module.addSerializer(AuthenticationRequest.class, VstSerializers.AUTHENTICATION_REQUEST); - module.addSerializer(JwtAuthenticationRequest.class, VstSerializers.JWT_AUTHENTICATION_REQUEST); - } - - @Override - public Module get() { - return module; - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/VstProtocol.java b/vst-protocol/src/main/java/com/arangodb/vst/VstProtocol.java deleted file mode 100644 index 7d840a8ab..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/VstProtocol.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst; - -import com.arangodb.ArangoDBException; -import com.arangodb.arch.UnstableApi; -import com.arangodb.internal.InternalRequest; -import com.arangodb.internal.InternalResponse; -import com.arangodb.internal.net.CommunicationProtocol; -import com.arangodb.internal.net.HostHandle; - -import java.io.IOException; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -/** - * @author Mark Vollmary - */ -@UnstableApi -public class VstProtocol implements CommunicationProtocol { - - private final VstCommunication communication; - private final ExecutorService outgoingExecutor = Executors.newCachedThreadPool(); - - public VstProtocol(final VstCommunication communication) { - super(); - this.communication = communication; - } - - @Override - @UnstableApi - public CompletableFuture executeAsync(@UnstableApi InternalRequest request, @UnstableApi HostHandle hostHandle) { - if (outgoingExecutor.isShutdown()) { - CompletableFuture cf = new CompletableFuture<>(); - cf.completeExceptionally(new ArangoDBException("VstProtocol already closed!")); - return cf; - } - return CompletableFuture.completedFuture(null) - .thenComposeAsync(__ -> communication.executeAsync(request, hostHandle), outgoingExecutor); - } - - @Override - public void setJwt(String jwt) { - communication.setJwt(jwt); - } - - @Override - public void close() throws IOException { - outgoingExecutor.shutdown(); - communication.close(); - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/VstProtocolProvider.java b/vst-protocol/src/main/java/com/arangodb/vst/VstProtocolProvider.java deleted file mode 100644 index 274cd0284..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/VstProtocolProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.arangodb.vst; - -import com.arangodb.Protocol; -import com.arangodb.arch.UnstableApi; -import com.arangodb.internal.config.ArangoConfig; -import com.arangodb.internal.net.CommunicationProtocol; -import com.arangodb.internal.net.ConnectionFactory; -import com.arangodb.internal.net.HostHandler; -import com.arangodb.internal.net.ProtocolProvider; -import com.fasterxml.jackson.databind.Module; - -@UnstableApi -public class VstProtocolProvider implements ProtocolProvider { - @Override - public boolean supportsProtocol(Protocol protocol) { - return Protocol.VST.equals(protocol); - } - - @Override - @UnstableApi - public ConnectionFactory createConnectionFactory() { - return new VstConnectionFactoryAsync(); - } - - @Override - @UnstableApi - public CommunicationProtocol createProtocol(@UnstableApi ArangoConfig config, @UnstableApi HostHandler hostHandler) { - return new VstProtocol(new VstCommunication(config, hostHandler)); - } - - @Override - public Module protocolModule() { - return VstModule.INSTANCE.get(); - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/VstSerializers.java b/vst-protocol/src/main/java/com/arangodb/vst/VstSerializers.java deleted file mode 100644 index 2ba762a52..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/VstSerializers.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.arangodb.vst; - -import com.arangodb.arch.UnstableApi; -import com.arangodb.vst.internal.AuthenticationRequest; -import com.arangodb.vst.internal.JwtAuthenticationRequest; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; - -import java.io.IOException; - -public final class VstSerializers { - - static final JsonSerializer AUTHENTICATION_REQUEST = - new JsonSerializer () { - @Override - public void serialize(@UnstableApi AuthenticationRequest value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - gen.writeStartArray(); - gen.writeNumber(value.getVersion()); - gen.writeNumber(value.getType()); - gen.writeString(value.getEncryption()); - gen.writeString(value.getUser()); - gen.writeString(value.getPassword()); - gen.writeEndArray(); - } - }; - static final JsonSerializer JWT_AUTHENTICATION_REQUEST = - new JsonSerializer () { - @Override - public void serialize(@UnstableApi JwtAuthenticationRequest value, JsonGenerator gen, - SerializerProvider serializers) throws IOException { - gen.writeStartArray(); - gen.writeNumber(value.getVersion()); - gen.writeNumber(value.getType()); - gen.writeString(value.getEncryption()); - gen.writeString(value.getToken()); - gen.writeEndArray(); - } - }; - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/AuthenticationRequest.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/AuthenticationRequest.java deleted file mode 100644 index 8a0e11288..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/AuthenticationRequest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst.internal; - -import com.arangodb.arch.UsedInApi; -import com.arangodb.internal.InternalRequest; - -/** - * @author Mark Vollmary - */ -@UsedInApi -public class AuthenticationRequest extends InternalRequest { - - private final String user; - private final String password; - private final String encryption;// "plain" - - public AuthenticationRequest(final String user, final String password, final String encryption) { - super(null, null, null); - this.user = user; - this.password = password; - this.encryption = encryption; - setType(1000); - } - - public String getUser() { - return user; - } - - public String getPassword() { - return password; - } - - public String getEncryption() { - return encryption; - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/Chunk.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/Chunk.java deleted file mode 100644 index 93e2d7848..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/Chunk.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst.internal; - -/** - * @author Mark Vollmary - */ -public class Chunk { - - private final long messageId; - private final long messageLength; - private final int chunkX; - private final int contentOffset; - private final int contentLength; - - public Chunk(final long messageId, final int chunkX, final long messageLength, final int contentOffset, - final int contentLength) { - this.messageId = messageId; - this.chunkX = chunkX; - this.messageLength = messageLength; - this.contentOffset = contentOffset; - this.contentLength = contentLength; - } - - public Chunk(final long messageId, final int chunkIndex, final int numberOfChunks, final long messageLength, - final int contentOffset, final int contentLength) { - this(messageId, chunkX(chunkIndex, numberOfChunks), messageLength, contentOffset, contentLength); - } - - private static int chunkX(final int chunkIndex, final int numberOfChunks) { - int chunkX; - if (numberOfChunks == 1) { - chunkX = 3;// last byte: 0000 0011 - } else if (chunkIndex == 0) { - chunkX = (numberOfChunks << 1) + 1; - } else { - chunkX = chunkIndex << 1; - } - return chunkX; - } - - public long getMessageId() { - return messageId; - } - - public long getMessageLength() { - return messageLength; - } - - public boolean isFirstChunk() { - return 1 == (chunkX & 0x1); - } - - public int getChunk() { - return chunkX >> 1; - } - - public int getChunkX() { - return chunkX; - } - - public int getContentOffset() { - return contentOffset; - } - - public int getContentLength() { - return contentLength; - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/ChunkStore.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/ChunkStore.java deleted file mode 100644 index a945ec79d..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/ChunkStore.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst.internal; - -import java.nio.BufferUnderflowException; -import java.nio.ByteBuffer; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Mark Vollmary - */ -public class ChunkStore { - - private final MessageStore messageStore; - private final Map data; - - public ChunkStore(final MessageStore messageStore) { - super(); - this.messageStore = messageStore; - data = new HashMap<>(); - } - - public ByteBuffer storeChunk(final Chunk chunk) throws BufferUnderflowException, IndexOutOfBoundsException { - final long messageId = chunk.getMessageId(); - ByteBuffer chunkBuffer = data.get(messageId); - if (chunkBuffer == null) { - if (!chunk.isFirstChunk()) { - messageStore.cancel(messageId); - return null; - } - final int length = (int) (chunk.getMessageLength() > 0 ? chunk.getMessageLength() - : chunk.getContentLength()); - chunkBuffer = ByteBuffer.allocate(length); - data.put(messageId, chunkBuffer); - } - return chunkBuffer; - } - - public void checkCompleteness(final long messageId) { - checkCompleteness(messageId, data.get(messageId)); - } - - private void checkCompleteness(final long messageId, final ByteBuffer chunkBuffer) - throws BufferUnderflowException, IndexOutOfBoundsException { - if (chunkBuffer.position() == chunkBuffer.limit()) { - messageStore.consume(new Message(messageId, chunkBuffer.array())); - data.remove(messageId); - } - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/JwtAuthenticationRequest.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/JwtAuthenticationRequest.java deleted file mode 100644 index 726057c16..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/JwtAuthenticationRequest.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.arangodb.vst.internal; - -import com.arangodb.arch.UsedInApi; -import com.arangodb.internal.InternalRequest; - -@UsedInApi -public class JwtAuthenticationRequest extends InternalRequest { - - private final String token; - private final String encryption; // "jwt" - - public JwtAuthenticationRequest(final String token, final String encryption) { - super(null, null, null); - this.token = token; - this.encryption = encryption; - setType(1000); - } - - public String getToken() { - return token; - } - - public String getEncryption() { - return encryption; - } - -} \ No newline at end of file diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/Message.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/Message.java deleted file mode 100644 index 7b673fb68..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/Message.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst.internal; - -import com.arangodb.velocypack.VPackSlice; - -import java.nio.BufferUnderflowException; - -/** - * @author Mark Vollmary - */ -public class Message { - - private final long id; - private final VPackSlice head; - private final VPackSlice body; - - public Message(final long id, final byte[] chunkBuffer) throws BufferUnderflowException, IndexOutOfBoundsException { - super(); - this.id = id; - head = new VPackSlice(chunkBuffer); - final int headSize = head.getByteSize(); - if (chunkBuffer.length > headSize) { - body = new VPackSlice(chunkBuffer, headSize); - } else { - body = null; - } - } - - public Message(final long id, final byte[] head, final byte[] body) { - super(); - this.id = id; - this.head = new VPackSlice(head); - this.body = body != null ? new VPackSlice(body) : null; - } - - public long getId() { - return id; - } - - public VPackSlice getHead() { - return head; - } - - public VPackSlice getBody() { - return body; - } - -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/MessageStore.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/MessageStore.java deleted file mode 100644 index 1d8d6effb..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/MessageStore.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst.internal; - -import com.arangodb.ArangoDBException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.FutureTask; - -/** - * @author Mark Vollmary - */ -public class MessageStore { - - private static final Logger LOGGER = LoggerFactory.getLogger(MessageStore.class); - - private final Map > task; - private final Map response; - private final Map error; - - public MessageStore() { - super(); - task = new ConcurrentHashMap<>(); - response = new ConcurrentHashMap<>(); - error = new ConcurrentHashMap<>(); - } - - public void storeMessage(final long messageId, final FutureTask future) { - task.put(messageId, future); - } - - public void consume(final Message message) { - final FutureTask future = task.remove(message.getId()); - if (future != null) { - response.put(message.getId(), message); - future.run(); - } - } - - public Message get(final long messageId) { - final Message result = response.remove(messageId); - if (result == null) { - final Exception e = error.remove(messageId); - if (e != null) { - throw ArangoDBException.of(e); - } - } - return result; - } - - public void cancel(final long messageId) { - final FutureTask future = task.remove(messageId); - if (future != null) { - LOGGER.error("Cancel Message unexpected (id={}).", messageId); - future.cancel(true); - } - } - - public synchronized void clear(final Exception e) { - if (!task.isEmpty()) { - LOGGER.error(e.getMessage(), e); - } - for (final Entry > entry : task.entrySet()) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("Exceptionally complete Message (id=%s).", entry.getKey())); - } - error.put(entry.getKey(), e); - entry.getValue().run(); - } - task.clear(); - } - - public boolean isEmpty() { - return task.isEmpty(); - } -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/VstConnection.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/VstConnection.java deleted file mode 100644 index 8b4cdc211..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/VstConnection.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst.internal; - -import com.arangodb.ArangoDBException; -import com.arangodb.config.HostDescription; -import com.arangodb.internal.ArangoDefaults; -import com.arangodb.internal.config.ArangoConfig; -import com.arangodb.internal.net.Connection; -import com.arangodb.internal.net.ConnectionPool; -import com.arangodb.velocypack.VPackBuilder; -import com.arangodb.velocypack.VPackSlice; -import com.arangodb.velocypack.ValueType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.net.SocketFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; -import java.io.BufferedOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.Map; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author Mark Vollmary - */ -public abstract class VstConnection implements Connection { - private static final Logger LOGGER = LoggerFactory.getLogger(VstConnection.class); - private static final AtomicInteger THREAD_COUNT = new AtomicInteger(); - private static final byte[] PROTOCOL_HEADER = "VST/1.0\r\n\r\n".getBytes(); - protected final MessageStore messageStore = new MessageStore(); - protected final Integer timeout; - private final AtomicLong keepAliveId = new AtomicLong(); - private final Long ttl; - private final Integer keepAliveInterval; - private final Boolean useSsl; - private final SSLContext sslContext; - private final HostDescription host; - private final Map sendTimestamps = new ConcurrentHashMap<>(); - private final String connectionName; - private final ConnectionPool pool; - private final byte[] keepAliveRequest = new VPackBuilder() - .add(ValueType.ARRAY) - .add(1) - .add(1) - .add("_system") - .add(1) - .add("/_admin/server/availability") - .add(ValueType.OBJECT) - .close() - .add(ValueType.OBJECT) - .close() - .close() - .slice() - .toByteArray(); - private ExecutorService executor; - private ScheduledExecutorService keepAliveScheduler; - private int keepAliveFailCounter = 0; - private Socket socket; - private OutputStream outputStream; - private InputStream inputStream; - - protected VstConnection(final ArangoConfig config, final HostDescription host, final ConnectionPool pool) { - super(); - timeout = config.getTimeout(); - ttl = config.getConnectionTtl(); - keepAliveInterval = config.getKeepAliveInterval(); - useSsl = config.getUseSsl(); - sslContext = config.getSslContext(); - this.host = host; - this.pool = pool; - - connectionName = "connection_" + System.currentTimeMillis() + "_" + Math.random(); - LOGGER.debug("[" + connectionName + "]: Connection created"); - } - - protected T sendKeepAlive() { - long id = keepAliveId.decrementAndGet(); - Message message = new Message(id, keepAliveRequest, null); - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("[%s]: Send keepalive probe (id=%s, head=%s, body=%s)", connectionName, - message.getId(), message.getHead(), - message.getBody() != null ? message.getBody() : "{}")); - } - return write(message, Collections.singleton(new Chunk( - id, 0, 1, -1, - 0, keepAliveRequest.length - ))); - } - - public abstract T write(final Message message, final Collection chunks); - - protected abstract void doKeepAlive(); - - private void keepAlive() { - try { - doKeepAlive(); - keepAliveFailCounter = 0; - } catch (Exception e) { - LOGGER.error("Got exception while performing keepAlive request:", e); - keepAliveFailCounter++; - if (keepAliveFailCounter >= 3) { - LOGGER.error("KeepAlive request failed consecutively for 3 times, closing connection now..."); - messageStore.clear(new IOException("Connection unresponsive!")); - close(); - } - } - } - - public boolean isOpen() { - return socket != null && socket.isConnected() && !socket.isClosed(); - } - - public synchronized void open() throws IOException { - if (isOpen()) { - return; - } - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("[%s]: Open connection to %s", connectionName, host)); - } - if (Boolean.TRUE.equals(useSsl)) { - if (sslContext != null) { - socket = sslContext.getSocketFactory().createSocket(); - } else { - socket = SSLSocketFactory.getDefault().createSocket(); - } - } else { - socket = SocketFactory.getDefault().createSocket(); - } - socket.connect(new InetSocketAddress(host.getHost(), host.getPort()), timeout); - socket.setKeepAlive(true); - socket.setTcpNoDelay(true); - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("[%s]: Connected to %s", connectionName, socket)); - } - - outputStream = new BufferedOutputStream(socket.getOutputStream()); - inputStream = socket.getInputStream(); - - if (Boolean.TRUE.equals(useSsl)) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("[%s]: Start Handshake on %s", connectionName, socket)); - } - ((SSLSocket) socket).startHandshake(); - } - sendProtocolHeader(); - - executor = Executors.newSingleThreadExecutor(r -> { - Thread t = Executors.defaultThreadFactory().newThread(r); - t.setDaemon(true); - t.setName("adb-vst-" + THREAD_COUNT.getAndIncrement()); - return t; - }); - executor.submit((Callable ) () -> { - LOGGER.debug("[" + connectionName + "]: Start Callable"); - - final long openTime = new Date().getTime(); - final Long ttlTime = ttl != null && ttl > 0 ? openTime + ttl : null; - final ChunkStore chunkStore = new ChunkStore(messageStore); - while (true) { - if (ttlTime != null && new Date().getTime() > ttlTime && messageStore.isEmpty()) { - close(); - break; - } - if (!isOpen()) { - messageStore.clear(new IOException("The socket is closed.")); - close(); - break; - } - try { - final Chunk chunk = readChunk(); - final ByteBuffer chunkBuffer = chunkStore.storeChunk(chunk); - if (chunkBuffer != null) { - final byte[] buf = new byte[chunk.getContentLength()]; - readBytesIntoBuffer(buf, 0, buf.length); - chunkBuffer.put(buf); - chunkStore.checkCompleteness(chunk.getMessageId()); - } - } catch (final Exception e) { - messageStore.clear(e); - close(); - break; - } - } - - LOGGER.debug("[" + connectionName + "]: Stop Callable"); - - return null; - }); - - if (keepAliveInterval != null) { - keepAliveScheduler = Executors.newScheduledThreadPool(1); - keepAliveScheduler.scheduleAtFixedRate(this::keepAlive, 0, keepAliveInterval, TimeUnit.SECONDS); - } - - } - - @Override - public synchronized void close() { - if (keepAliveScheduler != null) { - keepAliveScheduler.shutdown(); - } - messageStore.clear(new IOException("Connection closed")); - if (executor != null && !executor.isShutdown()) { - executor.shutdown(); - } - if (socket != null && !socket.isClosed()) { - try { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("[%s]: Close connection %s", connectionName, socket)); - } - socket.close(); - } catch (final IOException e) { - throw ArangoDBException.of(e); - } - } - } - - @Override - public void release() { - pool.release(this); - } - - private synchronized void sendProtocolHeader() throws IOException { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("[%s]: Send velocystream protocol header to %s", connectionName, socket)); - } - outputStream.write(PROTOCOL_HEADER); - outputStream.flush(); - } - - protected synchronized void writeIntern(final Message message, final Collection chunks) { - for (final Chunk chunk : chunks) { - try { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("[%s]: Send chunk %s:%s from message %s", connectionName, - chunk.getChunk(), - chunk.isFirstChunk() ? 1 : 0, chunk.getMessageId())); - sendTimestamps.put(chunk.getMessageId(), System.currentTimeMillis()); - } - writeChunkHead(chunk); - final int contentOffset = chunk.getContentOffset(); - final int contentLength = chunk.getContentLength(); - final VPackSlice head = message.getHead(); - final int headLength = head.getByteSize(); - int written = 0; - if (contentOffset < headLength) { - written = Math.min(contentLength, headLength - contentOffset); - outputStream.write(head.getBuffer(), contentOffset, written); - } - if (written < contentLength) { - final VPackSlice body = message.getBody(); - outputStream.write(body.getBuffer(), contentOffset + written - headLength, contentLength - written); - } - outputStream.flush(); - } catch (final IOException e) { - LOGGER.error("Error on Connection " + connectionName); - throw ArangoDBException.of(e); - } - } - } - - private synchronized void writeChunkHead(final Chunk chunk) throws IOException { - final long messageLength = chunk.getMessageLength(); - final int headLength = messageLength > -1L ? ArangoDefaults.CHUNK_MAX_HEADER_SIZE - : ArangoDefaults.CHUNK_MIN_HEADER_SIZE; - final int length = chunk.getContentLength() + headLength; - final ByteBuffer buffer = ByteBuffer.allocate(headLength).order(ByteOrder.LITTLE_ENDIAN); - buffer.putInt(length); - buffer.putInt(chunk.getChunkX()); - buffer.putLong(chunk.getMessageId()); - if (messageLength > -1L) { - buffer.putLong(messageLength); - } - outputStream.write(buffer.array()); - } - - protected Chunk readChunk() throws IOException { - final ByteBuffer chunkHeadBuffer = readBytes(ArangoDefaults.CHUNK_MIN_HEADER_SIZE); - final int length = chunkHeadBuffer.getInt(); - final int chunkX = chunkHeadBuffer.getInt(); - final long messageId = chunkHeadBuffer.getLong(); - final long messageLength; - final int contentLength; - if ((1 == (chunkX & 0x1)) && ((chunkX >> 1) > 1)) { - messageLength = readBytes(ArangoDefaults.LONG_BYTES).getLong(); - contentLength = length - ArangoDefaults.CHUNK_MAX_HEADER_SIZE; - } else { - messageLength = -1L; - contentLength = length - ArangoDefaults.CHUNK_MIN_HEADER_SIZE; - } - final Chunk chunk = new Chunk(messageId, chunkX, messageLength, 0, contentLength); - - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("[%s]: Received chunk %s:%s from message %s", connectionName, chunk.getChunk() - , chunk.isFirstChunk() ? 1 : 0, chunk.getMessageId())); - LOGGER.debug("[" + connectionName + "]: Responsetime for Message " + chunk.getMessageId() + " is " + (System.currentTimeMillis() - sendTimestamps.get(chunk.getMessageId()))); - } - - return chunk; - } - - private ByteBuffer readBytes(final int len) throws IOException { - final byte[] buf = new byte[len]; - readBytesIntoBuffer(buf, 0, len); - return ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN); - } - - protected void readBytesIntoBuffer(final byte[] buf, final int off, final int len) throws IOException { - for (int readed = 0; readed < len; ) { - final int read = inputStream.read(buf, off + readed, len - readed); - if (read == -1) { - throw new IOException("Reached the end of the stream."); - } else { - readed += read; - } - } - } - - @Override - public void setJwt(String jwt) { - // no-op: VST connections send jwt token only at initialization time - } -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/VstConnectionAsync.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/VstConnectionAsync.java deleted file mode 100644 index 5b128340e..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/VstConnectionAsync.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * DISCLAIMER - * - * Copyright 2016 ArangoDB GmbH, Cologne, Germany - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright holder is ArangoDB GmbH, Cologne, Germany - */ - -package com.arangodb.vst.internal; - -import com.arangodb.PackageVersion; -import com.arangodb.config.HostDescription; -import com.arangodb.internal.InternalRequest; -import com.arangodb.internal.InternalResponse; -import com.arangodb.internal.config.ArangoConfig; -import com.arangodb.internal.net.ConnectionPool; -import com.arangodb.internal.serde.InternalSerde; -import com.arangodb.velocypack.VPackSlice; -import com.arangodb.velocypack.exception.VPackParserException; -import com.arangodb.vst.internal.utils.CompletableFutureUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionException; -import java.util.concurrent.FutureTask; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author Mark Vollmary - */ -public class VstConnectionAsync extends VstConnection > { - private final static Logger LOGGER = LoggerFactory.getLogger(VstConnectionAsync.class); - private static final AtomicLong mId = new AtomicLong(0L); - private static final String X_ARANGO_DRIVER = "JavaDriver/" + PackageVersion.VERSION + " (JVM/" + System.getProperty("java.specification.version") + ")"; - private final Integer chunkSize; - private final InternalSerde serde; - - - public VstConnectionAsync(final ArangoConfig config, final HostDescription host, final ConnectionPool pool) { - super(config, host, pool); - chunkSize = config.getChunkSize(); - serde = config.getInternalSerde(); - } - - @Override - public synchronized CompletableFuture write(final Message message, final Collection chunks) { - final CompletableFuture future = new CompletableFuture<>(); - final FutureTask task = new FutureTask<>(() -> { - try { - future.complete(messageStore.get(message.getId())); - } catch (final Exception e) { - future.completeExceptionally(e); - } - return null; - }); - messageStore.storeMessage(message.getId(), task); - super.writeIntern(message, chunks); - if (timeout == null || timeout == 0L) { - return future; - } else { - return CompletableFutureUtils.orTimeout(future, timeout, TimeUnit.MILLISECONDS); - } - } - - @Override - protected void doKeepAlive() { - sendKeepAlive().join(); - } - - @Override - public CompletableFuture executeAsync(final InternalRequest request) { - // TODO: refactor using Future composition - final CompletableFuture rfuture = new CompletableFuture<>(); - try { - final Message message = createMessage(request); - send(message).whenComplete((m, ex) -> { - if (m != null) { - final InternalResponse response; - try { - response = createResponse(m); - } catch (final Exception e) { - rfuture.completeExceptionally(e); - return; - } - rfuture.complete(response); - } else { - Throwable e = ex instanceof CompletionException ? ex.getCause() : ex; - rfuture.completeExceptionally(e); - } - }); - } catch (Exception e) { - LOGGER.error(e.getMessage(), e); - rfuture.completeExceptionally(e); - } - return rfuture; - } - - private Message createMessage(final InternalRequest request) throws VPackParserException { - request.putHeaderParam("accept", "application/x-velocypack"); - request.putHeaderParam("content-type", "application/x-velocypack"); - request.putHeaderParam("x-arango-driver", X_ARANGO_DRIVER); - final long id = mId.incrementAndGet(); - return new Message(id, serde.serialize(request), request.getBody()); - } - - private CompletableFuture send(final Message message) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug(String.format("Send Message (id=%s, head=%s, body=%s)", - message.getId(), - serde.toJsonString(message.getHead().toByteArray()), - message.getBody() != null ? serde.toJsonString(message.getBody().toByteArray()) : "{}")); - } - return write(message, buildChunks(message)); - } - - private Collection buildChunks(final Message message) { - final Collection chunks = new ArrayList<>(); - final VPackSlice head = message.getHead(); - int size = head.getByteSize(); - final VPackSlice body = message.getBody(); - if (body != null) { - size += body.getByteSize(); - } - final int n = size / chunkSize; - final int numberOfChunks = (size % chunkSize != 0) ? (n + 1) : n; - int off = 0; - for (int i = 0; size > 0; i++) { - final int len = Math.min(chunkSize, size); - final long messageLength = (i == 0 && numberOfChunks > 1) ? size : -1L; - final Chunk chunk = new Chunk(message.getId(), i, numberOfChunks, messageLength, off, len); - size -= len; - off += len; - chunks.add(chunk); - } - return chunks; - } - - private InternalResponse createResponse(final Message message) throws VPackParserException { - InternalResponse response = serde.deserialize(message.getHead().toByteArray(), InternalResponse.class); - if (message.getBody() != null) { - response.setBody(message.getBody().toByteArray()); - } - return response; - } -} diff --git a/vst-protocol/src/main/java/com/arangodb/vst/internal/utils/CompletableFutureUtils.java b/vst-protocol/src/main/java/com/arangodb/vst/internal/utils/CompletableFutureUtils.java deleted file mode 100644 index 2321ac5aa..000000000 --- a/vst-protocol/src/main/java/com/arangodb/vst/internal/utils/CompletableFutureUtils.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.arangodb.vst.internal.utils; - -import java.util.concurrent.*; - -public class CompletableFutureUtils { - - private CompletableFutureUtils() { - } - - private static final ScheduledExecutorService timeoutScheduler = Executors.newSingleThreadScheduledExecutor(r -> { - Thread t = Executors.defaultThreadFactory().newThread(r); - t.setDaemon(true); - return t; - } - ); - - public static CompletableFuture orTimeout(CompletableFuture completableFuture, long timeout, TimeUnit unit) { - ScheduledFuture> timeoutTask = timeoutScheduler.schedule(() -> - completableFuture.completeExceptionally(new TimeoutException()), timeout, unit); - completableFuture.whenComplete((v, e) -> timeoutTask.cancel(false)); - return completableFuture; - } - -} diff --git a/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/native-image.properties b/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/native-image.properties deleted file mode 100644 index f6d4bf39a..000000000 --- a/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/native-image.properties +++ /dev/null @@ -1,3 +0,0 @@ -Args=\ --H:ResourceConfigurationResources=${.}/resource-config-spi.json \ --H:ReflectionConfigurationResources=${.}/reflect-config-spi.json diff --git a/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/reflect-config-spi.json b/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/reflect-config-spi.json deleted file mode 100644 index 57c85201e..000000000 --- a/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/reflect-config-spi.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "name": "com.arangodb.vst.VstProtocolProvider", - "methods": [ - { - "name": " ", - "parameterTypes": [] - } - ] - } -] diff --git a/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/resource-config-spi.json b/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/resource-config-spi.json deleted file mode 100644 index 9037d85e5..000000000 --- a/vst-protocol/src/main/resources/META-INF/native-image/com.arangodb/vst-protocol/resource-config-spi.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": "META-INF/services/com.arangodb.internal.net.ProtocolProvider" - } - ] - }, - "bundles": [] -} diff --git a/vst-protocol/src/main/resources/META-INF/services/com.arangodb.internal.net.ProtocolProvider b/vst-protocol/src/main/resources/META-INF/services/com.arangodb.internal.net.ProtocolProvider deleted file mode 100644 index 6d11ca0c7..000000000 --- a/vst-protocol/src/main/resources/META-INF/services/com.arangodb.internal.net.ProtocolProvider +++ /dev/null @@ -1 +0,0 @@ -com.arangodb.vst.VstProtocolProvider