@@ -118,8 +118,8 @@ void testPathWithConstantValues() {
118118 KeySpace root = new KeySpace (
119119 new KeySpaceDirectory ("application" , KeyType .STRING , appUuid )
120120 .addSubdirectory (new KeySpaceDirectory ("version" , KeyType .LONG , 1L )
121- .addSubdirectory (new KeySpaceDirectory ("environment" , KeyType .STRING , "production" )
122- .addSubdirectory (new KeySpaceDirectory ("data" , KeyType .STRING )))));
121+ .addSubdirectory (new KeySpaceDirectory ("environment" , KeyType .STRING , "production" )
122+ .addSubdirectory (new KeySpaceDirectory ("data" , KeyType .STRING )))));
123123
124124 final FDBDatabase database = dbExtension .getDatabase ();
125125
@@ -249,77 +249,6 @@ void testPathWithBinaryData() {
249249 }
250250 }
251251
252- @ ParameterizedTest
253- @ ValueSource (ints = {1 , 2 , 3 , 4 , 5 })
254- void testVariableDepthPaths (int depth ) {
255- // Build a KeySpace with the specified depth
256- final String rootUuid = UUID .randomUUID ().toString ();
257- KeySpaceDirectory rootDir = new KeySpaceDirectory ("root" , KeyType .STRING , rootUuid );
258- KeySpace root = new KeySpace (rootDir );
259- KeySpaceDirectory dir = rootDir ;
260- for (int i = 1 ; i < depth ; i ++) {
261- final KeySpaceDirectory next = new KeySpaceDirectory ("level" + i , KeyType .LONG );
262- dir .addSubdirectory (next );
263- dir = next ;
264- }
265-
266- final FDBDatabase database = dbExtension .getDatabase ();
267-
268- try (FDBRecordContext context = database .openContext ()) {
269- Transaction tr = context .ensureActive ();
270-
271- // Build a path with the specified depth
272- KeySpacePath currentPath = root .path ("root" );
273- for (int i = 1 ; i < depth ; i ++) {
274- currentPath = currentPath .add ("level" + i , i * 100L );
275- }
276-
277- Tuple keyTuple = currentPath .toTuple (context );
278- byte [] keyBytes = keyTuple .pack ();
279- byte [] valueBytes = Tuple .from ("depth_test_" + depth ).pack ();
280-
281- tr .set (keyBytes , valueBytes );
282- KeyValue keyValue = new KeyValue (keyBytes , valueBytes );
283-
284- // Create DataInKeySpacePath from the root-level path
285- KeySpacePath rootPath = root .path ("root" );
286- root .resolveFromKey (context , Tuple .fromBytes (keyValue .getKey ()));
287- DataInKeySpacePath dataInPath = new DataInKeySpacePath (rootPath , keyValue , context );
288-
289- ResolvedKeySpacePath resolved = dataInPath .getResolvedPath ().join ();
290-
291- // Verify the path using assertNameAndValue by traversing up the hierarchy
292- ResolvedKeySpacePath current = resolved ;
293- for (int i = depth - 1 ; i >= 1 ; i --) {
294- current = assertNameAndValue (current , "level" + i , i * 100L );
295- }
296- // Finally verify the root level
297- assertNull (assertNameAndValue (current , "root" , rootUuid ));
298-
299- // Verify the depth by traversing up the path
300- int actualDepth = 1 ; // Start at 1 for the root
301- current = resolved ;
302- while (current .getParent () != null ) {
303- actualDepth ++;
304- current = current .getParent ();
305- }
306- assertEquals (depth , actualDepth );
307-
308- // Verify the deepest level has the expected name and value
309- if (depth > 1 ) {
310- assertEquals ("level" + (depth - 1 ), resolved .getDirectoryName ());
311- assertEquals ((depth - 1 ) * 100L , resolved .getResolvedValue ());
312- } else {
313- assertEquals ("root" , resolved .getDirectoryName ());
314- }
315-
316- // Verify the resolved path can recreate the original key
317- assertEquals (keyTuple , resolved .toTuple ());
318-
319- context .commit ();
320- }
321- }
322-
323252 @ Test
324253 void testKeyValueAccessors () {
325254 KeySpace root = new KeySpace (
@@ -349,44 +278,6 @@ void testKeyValueAccessors() {
349278 }
350279 }
351280
352- @ Test
353- void testNullKeyTypeDirectory () {
354- final String baseUuid = UUID .randomUUID ().toString ();
355- KeySpace root = new KeySpace (
356- new KeySpaceDirectory ("base" , KeyType .STRING , baseUuid )
357- .addSubdirectory (new KeySpaceDirectory ("null_dir" , KeyType .NULL )));
358-
359- final FDBDatabase database = dbExtension .getDatabase ();
360-
361- try (FDBRecordContext context = database .openContext ()) {
362- Transaction tr = context .ensureActive ();
363-
364- KeySpacePath nullPath = root .path ("base" ).add ("null_dir" );
365-
366- Tuple keyTuple = nullPath .toTuple (context );
367- byte [] keyBytes = keyTuple .pack ();
368- byte [] valueBytes = Tuple .from ("null_type_test" ).pack ();
369-
370- tr .set (keyBytes , valueBytes );
371- KeyValue keyValue = new KeyValue (keyBytes , valueBytes );
372-
373- // Create DataInKeySpacePath from the base-level path
374- KeySpacePath basePath = root .path ("base" );
375- DataInKeySpacePath dataInPath = new DataInKeySpacePath (basePath , keyValue , context );
376-
377- ResolvedKeySpacePath resolved = dataInPath .getResolvedPath ().join ();
378-
379- // Verify the path using assertNameAndValue
380- ResolvedKeySpacePath baseLevel = assertNameAndValue (resolved , "null_dir" , null );
381- assertNull (assertNameAndValue (baseLevel , "base" , baseUuid ));
382-
383- // Verify the resolved path can recreate the original key
384- assertEquals (keyTuple , resolved .toTuple ());
385-
386- context .commit ();
387- }
388- }
389-
390281 @ Test
391282 void testWithWrapper () {
392283 final FDBDatabase database = dbExtension .getDatabase ();
0 commit comments