Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 0dec396

Browse files
committed
tests fixes
1 parent 00ec7af commit 0dec396

File tree

8 files changed

+598
-16
lines changed

8 files changed

+598
-16
lines changed

src/main/java/com/arangodb/tinkerpop/gremlin/structure/ArangoDBGraph.java

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@
197197
method = "g_mergeVXlabel_person_name_markoX_optionXonMatch_age_19X_option",
198198
reason = "FIXME: DE-995"
199199
)
200+
@Graph.OptOut(
201+
test = "org.apache.tinkerpop.gremlin.process.traversal.step.OrderabilityTest$Traversals",
202+
method = "*",
203+
reason = "replaced by com.arangodb.tinkerpop.gremlin.custom.process.traversal.step.OrderabilityTest"
204+
)
200205
public class ArangoDBGraph implements Graph {
201206

202207
/**
@@ -209,7 +214,7 @@ public class ArangoDBGraphFeatures implements Features {
209214
* The Class ArangoDBGraphGraphFeatures.
210215
*/
211216

212-
private class ArangoDBGraphGraphFeatures implements GraphFeatures {
217+
protected class ArangoDBGraphGraphFeatures implements GraphFeatures {
213218

214219
/**
215220
* The variable features.
@@ -220,7 +225,7 @@ private class ArangoDBGraphGraphFeatures implements GraphFeatures {
220225
* Instantiates a new ArangoDB graph graph features.
221226
*/
222227

223-
ArangoDBGraphGraphFeatures() {
228+
protected ArangoDBGraphGraphFeatures() {
224229
}
225230

226231
@Override
@@ -248,13 +253,13 @@ public VariableFeatures variables() {
248253
* The Class ArangoDBGraphElementFeatures.
249254
*/
250255

251-
private class ArangoDBGraphElementFeatures implements ElementFeatures {
256+
protected class ArangoDBGraphElementFeatures implements ElementFeatures {
252257

253258
/**
254259
* Instantiates a new ArangoDB graph element features.
255260
*/
256261

257-
ArangoDBGraphElementFeatures() {
262+
protected ArangoDBGraphElementFeatures() {
258263
}
259264

260265
@Override
@@ -288,7 +293,7 @@ public boolean supportsUuidIds() {
288293
* The Class ArangoDBGraphVertexFeatures.
289294
*/
290295

291-
private class ArangoDBGraphVertexFeatures extends ArangoDBGraphElementFeatures implements VertexFeatures {
296+
protected class ArangoDBGraphVertexFeatures extends ArangoDBGraphElementFeatures implements VertexFeatures {
292297

293298
/**
294299
* The vertex property features.
@@ -300,7 +305,7 @@ private class ArangoDBGraphVertexFeatures extends ArangoDBGraphElementFeatures i
300305
* Instantiates a new ArangoDB graph vertex features.
301306
*/
302307

303-
ArangoDBGraphVertexFeatures() {
308+
protected ArangoDBGraphVertexFeatures() {
304309
}
305310

306311

@@ -325,7 +330,7 @@ public class ArangoDBGraphEdgeFeatures extends ArangoDBGraphElementFeatures impl
325330
* Instantiates a new ArangoDB graph edge features.
326331
*/
327332

328-
ArangoDBGraphEdgeFeatures() {
333+
protected ArangoDBGraphEdgeFeatures() {
329334
}
330335

331336
@Override
@@ -338,13 +343,13 @@ public EdgePropertyFeatures properties() {
338343
* The Class ArangoDBGraphVertexPropertyFeatures.
339344
*/
340345

341-
private class ArangoDBGraphVertexPropertyFeatures implements VertexPropertyFeatures {
346+
protected class ArangoDBGraphVertexPropertyFeatures implements VertexPropertyFeatures {
342347

343348
/**
344349
* Instantiates a new ArangoDB graph vertex property features.
345350
*/
346351

347-
ArangoDBGraphVertexPropertyFeatures() {
352+
protected ArangoDBGraphVertexPropertyFeatures() {
348353
}
349354

350355
@Override
@@ -377,13 +382,13 @@ public boolean supportsUuidIds() {
377382
/**
378383
* The Class ArangoDBGraphEdgePropertyFeatures.
379384
*/
380-
private class ArangoDBGraphEdgePropertyFeatures implements EdgePropertyFeatures {
385+
protected class ArangoDBGraphEdgePropertyFeatures implements EdgePropertyFeatures {
381386

382387
/**
383388
* Instantiates a new ArangoDB graph edge property features.
384389
*/
385390

386-
ArangoDBGraphEdgePropertyFeatures() {
391+
protected ArangoDBGraphEdgePropertyFeatures() {
387392
}
388393
}
389394

src/main/java/com/arangodb/tinkerpop/gremlin/utils/ArangoDBUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ public static String getId(Graph.Features.ElementFeatures features, String label
609609
id = parts[1];
610610
}
611611
}
612-
Matcher m = ArangoDBUtil.DOCUMENT_KEY.matcher((String) id);
612+
Matcher m = ArangoDBUtil.DOCUMENT_KEY.matcher(id.toString());
613613
if (m.matches()) {
614614
return id.toString();
615615
} else {
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package com.arangodb.tinkerpop.gremlin.custom;
2+
3+
import com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph;
4+
import org.apache.commons.configuration2.Configuration;
5+
6+
7+
public class CustomGraph extends ArangoDBGraph {
8+
9+
public static CustomGraph open(Configuration configuration) {
10+
return new CustomGraph(configuration);
11+
}
12+
13+
class CustomFeatures extends ArangoDBGraph.ArangoDBGraphFeatures {
14+
15+
@Override
16+
public EdgeFeatures edge() {
17+
return new ArangoDBGraphEdgeFeatures() {
18+
@Override
19+
public boolean supportsNumericIds() {
20+
return true;
21+
}
22+
};
23+
}
24+
25+
@Override
26+
public VertexFeatures vertex() {
27+
return new ArangoDBGraphVertexFeatures() {
28+
@Override
29+
public boolean supportsNumericIds() {
30+
return true;
31+
}
32+
33+
@Override
34+
public VertexPropertyFeatures properties() {
35+
return new ArangoDBGraphVertexPropertyFeatures() {
36+
@Override
37+
public boolean supportsNumericIds() {
38+
return true;
39+
}
40+
};
41+
}
42+
};
43+
}
44+
}
45+
46+
public CustomGraph(Configuration configuration) {
47+
super(configuration);
48+
}
49+
50+
@Override
51+
public Features features() {
52+
return new CustomFeatures();
53+
}
54+
}

src/test/java/com/arangodb/tinkerpop/gremlin/custom/CustomGraphProvider.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@
22

33
import com.arangodb.tinkerpop.gremlin.util.BaseGraphProvider;
44
import com.arangodb.tinkerpop.gremlin.utils.ArangoDBConfigurationBuilder;
5-
import org.apache.tinkerpop.gremlin.structure.VertexTest;
5+
import org.apache.commons.configuration2.Configuration;
6+
import org.apache.tinkerpop.gremlin.LoadGraphWith;
7+
import org.apache.tinkerpop.gremlin.structure.Graph;
8+
9+
import java.util.Map;
610

711
public class CustomGraphProvider extends BaseGraphProvider {
812

13+
@Override
14+
public Configuration newGraphConfiguration(String graphName, Class<?> test, String testMethodName, Map<String, Object> configurationOverrides, LoadGraphWith.GraphData loadGraphWith) {
15+
Configuration conf = super.newGraphConfiguration(graphName, test, testMethodName, configurationOverrides, loadGraphWith);
16+
conf.setProperty(Graph.GRAPH, CustomGraph.class.getName());
17+
return conf;
18+
}
19+
920
@Override
1021
protected void configure(ArangoDBConfigurationBuilder builder, Class<?> test, String testMethodName) {
1122
switch (testMethodName) {

src/test/java/com/arangodb/tinkerpop/gremlin/custom/CustomStandardSuite.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.arangodb.tinkerpop.gremlin.custom;
22

3+
import com.arangodb.tinkerpop.gremlin.custom.process.traversal.step.OrderabilityTest;
34
import com.arangodb.tinkerpop.gremlin.custom.process.traversal.step.map.MergeEdgeTest;
45
import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
56
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
@@ -10,7 +11,8 @@
1011
public class CustomStandardSuite extends AbstractGremlinSuite {
1112

1213
private static final Class<?>[] allTests = new Class<?>[]{
13-
MergeEdgeTest.Traversals.class
14+
MergeEdgeTest.Traversals.class,
15+
OrderabilityTest.Traversals.class,
1416
};
1517

1618
public CustomStandardSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
package com.arangodb.tinkerpop.gremlin.custom;
22

3-
import com.arangodb.tinkerpop.gremlin.structure.ArangoDBGraph;
43
import org.apache.tinkerpop.gremlin.GraphProviderClass;
54
import org.junit.runner.RunWith;
65

76
@RunWith(CustomStandardSuite.class)
8-
@GraphProviderClass(provider = CustomGraphProvider.class, graph = ArangoDBGraph.class)
7+
@GraphProviderClass(provider = CustomGraphProvider.class, graph = CustomGraph.class)
98
public class CustomStandardSuiteTest {
109

1110
}

0 commit comments

Comments
 (0)