27
27
import com .arangodb .entity .arangosearch .analyzer .*;
28
28
import com .arangodb .model .InvertedIndexOptions ;
29
29
import com .arangodb .model .arangosearch .*;
30
+ import com .arangodb .util .TestUtils ;
30
31
import org .junit .jupiter .api .BeforeAll ;
31
32
import org .junit .jupiter .params .ParameterizedTest ;
32
33
import org .junit .jupiter .params .provider .MethodSource ;
@@ -55,7 +56,7 @@ static void init() {
55
56
@ MethodSource ("dbs" )
56
57
void exists (ArangoDatabase db ) {
57
58
assumeTrue (isAtLeastVersion (3 , 4 ));
58
- String viewName = "view-" + rnd ( );
59
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
59
60
db .createArangoSearch (viewName , new ArangoSearchCreateOptions ());
60
61
assertThat (db .arangoSearch (viewName ).exists ()).isTrue ();
61
62
}
@@ -64,7 +65,7 @@ void exists(ArangoDatabase db) {
64
65
@ MethodSource ("dbs" )
65
66
void createAndExistsSearchAlias (ArangoDatabase db ) {
66
67
assumeTrue (isAtLeastVersion (3 , 10 ));
67
- String viewName = "view-" + rnd ( );
68
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
68
69
db .createSearchAlias (viewName , new SearchAliasCreateOptions ());
69
70
assertThat (db .arangoSearch (viewName ).exists ()).isTrue ();
70
71
}
@@ -73,7 +74,7 @@ void createAndExistsSearchAlias(ArangoDatabase db) {
73
74
@ MethodSource ("dbs" )
74
75
void getInfo (ArangoDatabase db ) {
75
76
assumeTrue (isAtLeastVersion (3 , 4 ));
76
- String viewName = "view-" + rnd ( );
77
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
77
78
db .createArangoSearch (viewName , new ArangoSearchCreateOptions ());
78
79
final ViewEntity info = db .arangoSearch (viewName ).getInfo ();
79
80
assertThat (info ).isNotNull ();
@@ -86,7 +87,7 @@ void getInfo(ArangoDatabase db) {
86
87
@ MethodSource ("dbs" )
87
88
void drop (ArangoDatabase db ) {
88
89
assumeTrue (isAtLeastVersion (3 , 4 ));
89
- String viewName = "view-" + rnd ( );
90
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
90
91
db .createArangoSearch (viewName , new ArangoSearchCreateOptions ());
91
92
final ArangoView view = db .arangoSearch (viewName );
92
93
view .drop ();
@@ -98,7 +99,7 @@ void drop(ArangoDatabase db) {
98
99
void rename (ArangoDatabase db ) {
99
100
assumeTrue (isSingleServer ());
100
101
assumeTrue (isAtLeastVersion (3 , 4 ));
101
- String viewName = "view-" + rnd ( );
102
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
102
103
final String name = viewName + "_new" ;
103
104
db .createArangoSearch (name , new ArangoSearchCreateOptions ());
104
105
db .arangoSearch (name ).rename (viewName );
@@ -110,7 +111,7 @@ void rename(ArangoDatabase db) {
110
111
@ MethodSource ("dbs" )
111
112
void createArangoSearchView (ArangoDatabase db ) {
112
113
assumeTrue (isAtLeastVersion (3 , 4 ));
113
- String viewName = "view-" + rnd ( );
114
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
114
115
final ViewEntity info = db .arangoSearch (viewName ).create ();
115
116
assertThat (info ).isNotNull ();
116
117
assertThat (info .getId ()).isNotNull ();
@@ -123,7 +124,7 @@ void createArangoSearchView(ArangoDatabase db) {
123
124
@ MethodSource ("dbs" )
124
125
void createSearchAliasView (ArangoDatabase db ) {
125
126
assumeTrue (isAtLeastVersion (3 , 10 ));
126
- String viewName = "view-" + rnd ( );
127
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
127
128
final ViewEntity info = db .searchAlias (viewName ).create ();
128
129
assertThat (info ).isNotNull ();
129
130
assertThat (info .getId ()).isNotNull ();
@@ -136,7 +137,7 @@ void createSearchAliasView(ArangoDatabase db) {
136
137
@ MethodSource ("dbs" )
137
138
void createArangoSearchViewWithOptions (ArangoDatabase db ) {
138
139
assumeTrue (isAtLeastVersion (3 , 4 ));
139
- String viewName = "view-" + rnd ( );
140
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
140
141
final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions ();
141
142
final ViewEntity info = db .arangoSearch (viewName ).create (options );
142
143
assertThat (info ).isNotNull ();
@@ -150,7 +151,7 @@ void createArangoSearchViewWithOptions(ArangoDatabase db) {
150
151
@ MethodSource ("dbs" )
151
152
void createArangoSearchViewWithPrimarySort (ArangoDatabase db ) {
152
153
assumeTrue (isAtLeastVersion (3 , 5 ));
153
- String viewName = "view-" + rnd ( );
154
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
154
155
final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions ();
155
156
156
157
final PrimarySort primarySort = PrimarySort .on ("myFieldName" );
@@ -186,7 +187,7 @@ void createArangoSearchViewWithPrimarySort(ArangoDatabase db) {
186
187
@ MethodSource ("dbs" )
187
188
void createArangoSearchViewWithCommitIntervalMsec (ArangoDatabase db ) {
188
189
assumeTrue (isAtLeastVersion (3 , 5 ));
189
- String viewName = "view-" + rnd ( );
190
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
190
191
final ArangoSearchCreateOptions options = new ArangoSearchCreateOptions ();
191
192
options .commitIntervalMsec (666666L );
192
193
@@ -207,7 +208,7 @@ void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabase db) {
207
208
@ MethodSource ("dbs" )
208
209
void createSearchAliasViewWithOptions (ArangoDatabase db ) {
209
210
assumeTrue (isAtLeastVersion (3 , 10 ));
210
- String viewName = "view-" + rnd ( );
211
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
211
212
final SearchAliasCreateOptions options = new SearchAliasCreateOptions ();
212
213
final ViewEntity info = db .searchAlias (viewName ).create (options );
213
214
assertThat (info ).isNotNull ();
@@ -222,17 +223,17 @@ void createSearchAliasViewWithOptions(ArangoDatabase db) {
222
223
void createSearchAliasViewWithIndexesAndGetProperties (ArangoDatabase db ) {
223
224
assumeTrue (isAtLeastVersion (3 , 10 ));
224
225
ArangoCollection col = db .collection (COLL_1 );
225
- String idxName1 = "idx-" + rnd ( );
226
+ String idxName1 = "idx-" + TestUtils . generateRandomName ( supportsExtendedNames () );
226
227
col .ensureInvertedIndex (new InvertedIndexOptions ()
227
228
.name (idxName1 )
228
229
.fields (new InvertedIndexField ().name ("a" + rnd ())));
229
230
230
- String idxName2 = "idx-" + rnd ( );
231
+ String idxName2 = "idx-" + TestUtils . generateRandomName ( supportsExtendedNames () );
231
232
col .ensureInvertedIndex (new InvertedIndexOptions ()
232
233
.name (idxName2 )
233
234
.fields (new InvertedIndexField ().name ("a" + rnd ())));
234
235
235
- String viewName = "view-" + rnd ( );
236
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
236
237
final SearchAliasCreateOptions options = new SearchAliasCreateOptions ()
237
238
.indexes (
238
239
new SearchAliasIndex (COLL_1 , idxName1 , SearchAliasIndex .OperationType .add ),
@@ -260,7 +261,7 @@ void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) {
260
261
@ MethodSource ("dbs" )
261
262
void getArangoSearchViewProperties (ArangoDatabase db ) {
262
263
assumeTrue (isAtLeastVersion (3 , 4 ));
263
- String viewName = "view-" + rnd ( );
264
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
264
265
final ArangoSearch view = db .arangoSearch (viewName );
265
266
view .create (new ArangoSearchCreateOptions ());
266
267
final ArangoSearchPropertiesEntity properties = view .getProperties ();
@@ -280,7 +281,7 @@ void getArangoSearchViewProperties(ArangoDatabase db) {
280
281
@ MethodSource ("dbs" )
281
282
void updateArangoSearchViewProperties (ArangoDatabase db ) {
282
283
assumeTrue (isAtLeastVersion (3 , 4 ));
283
- String viewName = "view-" + rnd ( );
284
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
284
285
final ArangoSearch view = db .arangoSearch (viewName );
285
286
view .create (new ArangoSearchCreateOptions ());
286
287
final ArangoSearchPropertiesOptions options = new ArangoSearchPropertiesOptions ();
@@ -314,17 +315,17 @@ void updateArangoSearchViewProperties(ArangoDatabase db) {
314
315
void updateSearchAliasViewWithIndexesAndGetProperties (ArangoDatabase db ) {
315
316
assumeTrue (isAtLeastVersion (3 , 10 ));
316
317
ArangoCollection col = db .collection (COLL_1 );
317
- String idxName = "idx-" + rnd ( );
318
+ String idxName = "idx-" + TestUtils . generateRandomName ( supportsExtendedNames () );
318
319
col .ensureInvertedIndex (new InvertedIndexOptions ()
319
320
.name (idxName )
320
321
.fields (new InvertedIndexField ().name ("a" + rnd ())));
321
322
ArangoCollection col2 = db .collection (COLL_2 );
322
- String idxName2 = "idx-" + rnd ( );
323
+ String idxName2 = "idx-" + TestUtils . generateRandomName ( supportsExtendedNames () );
323
324
col2 .ensureInvertedIndex (new InvertedIndexOptions ()
324
325
.name (idxName2 )
325
326
.fields (new InvertedIndexField ().name ("a" + rnd ())));
326
327
327
- String viewName = "view-" + rnd ( );
328
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
328
329
final SearchAliasCreateOptions options = new SearchAliasCreateOptions ()
329
330
.indexes (new SearchAliasIndex (COLL_1 , idxName ));
330
331
final ViewEntity info = db .searchAlias (viewName ).create (options );
@@ -353,7 +354,7 @@ void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) {
353
354
@ MethodSource ("dbs" )
354
355
void replaceArangoSearchViewProperties (ArangoDatabase db ) {
355
356
assumeTrue (isAtLeastVersion (3 , 4 ));
356
- String viewName = "view-" + rnd ( );
357
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
357
358
final ArangoSearch view = db .arangoSearch (viewName );
358
359
view .create (new ArangoSearchCreateOptions ());
359
360
final ArangoSearchPropertiesOptions options = new ArangoSearchPropertiesOptions ();
@@ -373,17 +374,17 @@ void replaceArangoSearchViewProperties(ArangoDatabase db) {
373
374
void replaceSearchAliasViewWithIndexesAndGetProperties (ArangoDatabase db ) {
374
375
assumeTrue (isAtLeastVersion (3 , 10 ));
375
376
ArangoCollection col = db .collection (COLL_1 );
376
- String idxName = "idx-" + rnd ( );
377
+ String idxName = "idx-" + TestUtils . generateRandomName ( supportsExtendedNames () );
377
378
col .ensureInvertedIndex (new InvertedIndexOptions ()
378
379
.name (idxName )
379
380
.fields (new InvertedIndexField ().name ("a" + rnd ())));
380
381
ArangoCollection col2 = db .collection (COLL_2 );
381
- String idxName2 = "idx-" + rnd ( );
382
+ String idxName2 = "idx-" + TestUtils . generateRandomName ( supportsExtendedNames () );
382
383
col2 .ensureInvertedIndex (new InvertedIndexOptions ()
383
384
.name (idxName2 )
384
385
.fields (new InvertedIndexField ().name ("a" + rnd ())));
385
386
386
- String viewName = "view-" + rnd ( );
387
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
387
388
final SearchAliasCreateOptions options = new SearchAliasCreateOptions ()
388
389
.indexes (new SearchAliasIndex (COLL_1 , idxName ));
389
390
final ViewEntity info = db .searchAlias (viewName ).create (options );
@@ -646,7 +647,7 @@ void enhancedTextAnalyzerTyped(ArangoDatabase db) {
646
647
@ MethodSource ("dbs" )
647
648
void arangoSearchOptions (ArangoDatabase db ) {
648
649
assumeTrue (isAtLeastVersion (3 , 4 ));
649
- String viewName = "view-" + rnd ( );
650
+ String viewName = "view-" + TestUtils . generateRandomName ( supportsExtendedNames () );
650
651
FieldLink field = FieldLink .on ("f1" ).inBackground (true );
651
652
if (isEnterprise ()) {
652
653
field .nested (FieldLink .on ("f2" ));
0 commit comments