@@ -343,197 +343,216 @@ public void testCloseStatement(TestContext ctx) {
343
343
}
344
344
345
345
@ Test
346
- public void testInferDataTypeString (TestContext ctx ) {
347
- testInferDataType (ctx , String .class , "WORLD" , "WORLD" );
346
+ public void testInferDataTypeString42P18 (TestContext ctx ) {
347
+ testInferDataType42P18 (ctx , String .class , "WORLD" , "WORLD" );
348
348
}
349
349
350
350
@ Test
351
- public void testInferDataTypeBoolean (TestContext ctx ) {
352
- testInferDataType (ctx , Boolean .class , true , "t" );
351
+ public void testInferDataTypeBoolean42P18 (TestContext ctx ) {
352
+ testInferDataType42P18 (ctx , Boolean .class , true , "t" );
353
353
}
354
354
355
355
@ Test
356
- public void testInferDataTypeShort (TestContext ctx ) {
357
- testInferDataType (ctx , Short .class , (short )2 , "2" );
356
+ public void testInferDataTypeShort42P18 (TestContext ctx ) {
357
+ testInferDataType42P18 (ctx , Short .class , (short )2 , "2" );
358
358
}
359
359
360
360
@ Test
361
- public void testInferDataTypeInteger (TestContext ctx ) {
362
- testInferDataType (ctx , Integer .class , Integer .MAX_VALUE , "" + Integer .MAX_VALUE );
361
+ public void testInferDataTypeInteger42P18 (TestContext ctx ) {
362
+ testInferDataType42P18 (ctx , Integer .class , Integer .MAX_VALUE , "" + Integer .MAX_VALUE );
363
363
}
364
364
365
365
@ Test
366
- public void testInferDataTypeLong (TestContext ctx ) {
367
- testInferDataType (ctx , Long .class , Long .MAX_VALUE , "" + Long .MAX_VALUE );
366
+ public void testInferDataTypeLong42P18 (TestContext ctx ) {
367
+ testInferDataType42P18 (ctx , Long .class , Long .MAX_VALUE , "" + Long .MAX_VALUE );
368
368
}
369
369
370
370
@ Test
371
- public void testInferDataTypeFloat (TestContext ctx ) {
372
- testInferDataType (ctx , Float .class , 0F , "0" );
371
+ public void testInferDataTypeFloat42P18 (TestContext ctx ) {
372
+ testInferDataType42P18 (ctx , Float .class , 0F , "0" );
373
373
}
374
374
375
375
@ Test
376
- public void testInferDataTypeDouble (TestContext ctx ) {
377
- testInferDataType (ctx , Double .class , 0D , "0" );
376
+ public void testInferDataTypeDouble42P18 (TestContext ctx ) {
377
+ testInferDataType42P18 (ctx , Double .class , 0D , "0" );
378
378
}
379
379
380
380
@ Test
381
- public void testInferDataTypeLocalDate (TestContext ctx ) {
381
+ public void testInferDataTypeLocalDate42P18 (TestContext ctx ) {
382
382
LocalDate value = LocalDate .now ();
383
- testInferDataType (ctx , LocalDate .class , value , value .toString ());
383
+ testInferDataType42P18 (ctx , LocalDate .class , value , value .toString ());
384
384
}
385
385
386
386
@ Test
387
- public void testInferDataTypeLocalDateTime (TestContext ctx ) {
387
+ public void testInferDataTypeLocalDateTime42P18 (TestContext ctx ) {
388
388
LocalDateTime value = LocalDateTime .of (LocalDate .now (), LocalTime .NOON );
389
389
String suffix = value .toLocalDate () + " " + value .toLocalTime ().format (DateTimeFormatter .ISO_LOCAL_TIME );
390
- testInferDataType (ctx , LocalDateTime .class , value , suffix , "{\" " + suffix + "\" }" );
390
+ testInferDataType42P18 (ctx , LocalDateTime .class , value , suffix , "{\" " + suffix + "\" }" );
391
391
}
392
392
393
393
@ Test
394
- public void testInferDataTypeOffsetDateTime (TestContext ctx ) {
394
+ public void testInferDataTypeOffsetDateTime42P18 (TestContext ctx ) {
395
395
OffsetDateTime value = OffsetDateTime .of (LocalDateTime .of (LocalDate .now (), LocalTime .NOON ), ZoneOffset .UTC );
396
396
String suffix = value .toLocalDate () + " " + value .toLocalTime ().format (DateTimeFormatter .ISO_LOCAL_TIME ) + "+00" ;
397
- testInferDataType (ctx , OffsetDateTime .class , value , suffix , "{\" " + suffix + "\" }" );
397
+ testInferDataType42P18 (ctx , OffsetDateTime .class , value , suffix , "{\" " + suffix + "\" }" );
398
398
}
399
399
400
400
@ Test
401
- public void testInferDataTypeOffsetInterval (TestContext ctx ) {
401
+ public void testInferDataTypeOffsetInterval42P18 (TestContext ctx ) {
402
402
Interval value = Interval .of (1 );
403
- testInferDataType (ctx , Interval .class , value , "1 year" , "{\" 1 year\" }" );
403
+ testInferDataType42P18 (ctx , Interval .class , value , "1 year" , "{\" 1 year\" }" );
404
404
}
405
405
406
406
@ Test
407
- public void testInferDataTypeBuffer (TestContext ctx ) {
408
- testInferDataType (ctx , Buffer .class , Buffer .buffer ("WORLD" ), "\\ x574f524c44" , "{\" \\ \\ x574f524c44\" }" );
407
+ public void testInferDataTypeBuffer42P18 (TestContext ctx ) {
408
+ testInferDataType42P18 (ctx , Buffer .class , Buffer .buffer ("WORLD" ), "\\ x574f524c44" , "{\" \\ \\ x574f524c44\" }" );
409
409
}
410
410
411
411
@ Test
412
- public void testInferDataTypeUUID (TestContext ctx ) {
412
+ public void testInferDataTypeUUID42P18 (TestContext ctx ) {
413
413
UUID value = UUID .randomUUID ();
414
- testInferDataType (ctx , UUID .class , value , "" + value );
414
+ testInferDataType42P18 (ctx , UUID .class , value , "" + value );
415
415
}
416
416
417
417
@ Test
418
- public void testInferDataTypeJsonObject (TestContext ctx ) {
418
+ public void testInferDataTypeJsonObject42P18 (TestContext ctx ) {
419
419
JsonObject value = new JsonObject ().put ("foo" , "bar" );
420
- testInferDataType (ctx , JsonObject .class , value , "" + value , "{\" {\\ \" foo\\ \" :\\ \" bar\\ \" }\" }" );
420
+ testInferDataType42P18 (ctx , JsonObject .class , value , "" + value , "{\" {\\ \" foo\\ \" :\\ \" bar\\ \" }\" }" );
421
421
}
422
422
423
423
@ Test
424
- public void testInferDataTypeJsonArray (TestContext ctx ) {
424
+ public void testInferDataTypeJsonArray42P18 (TestContext ctx ) {
425
425
JsonArray value = new JsonArray ().add (1 ).add ("foo" ).add (true );
426
- testInferDataType (ctx , JsonArray .class , value , "" + value , "{\" [1,\\ \" foo\\ \" ,true]\" }" );
426
+ testInferDataType42P18 (ctx , JsonArray .class , value , "" + value , "{\" [1,\\ \" foo\\ \" ,true]\" }" );
427
427
}
428
428
429
429
@ Test
430
- public void testInferDataTypePoint (TestContext ctx ) {
430
+ public void testInferDataTypePoint42P18 (TestContext ctx ) {
431
431
Point value = new Point ();
432
- testInferDataType (ctx , Point .class , value , "(0,0)" , "{\" (0,0)\" }" );
432
+ testInferDataType42P18 (ctx , Point .class , value , "(0,0)" , "{\" (0,0)\" }" );
433
433
}
434
434
435
435
@ Test
436
- public void testInferDataTypeLine (TestContext ctx ) {
436
+ public void testInferDataTypeLine42P18 (TestContext ctx ) {
437
437
Line value = new Line (1.0 , 0.0 , 0.0 );
438
- testInferDataType (ctx , Line .class , value , "{1,0,0}" , "{\" {1,0,0}\" }" );
438
+ testInferDataType42P18 (ctx , Line .class , value , "{1,0,0}" , "{\" {1,0,0}\" }" );
439
439
}
440
440
441
441
@ Test
442
- public void testInferDataTypeLineSegment (TestContext ctx ) {
442
+ public void testInferDataTypeLineSegment42P18 (TestContext ctx ) {
443
443
LineSegment value = new LineSegment ();
444
- testInferDataType (ctx , LineSegment .class , value , "[(0,0),(0,0)]" , "{\" [(0,0),(0,0)]\" }" );
444
+ testInferDataType42P18 (ctx , LineSegment .class , value , "[(0,0),(0,0)]" , "{\" [(0,0),(0,0)]\" }" );
445
445
}
446
446
447
447
@ Test
448
- public void testInferDataTypeBox (TestContext ctx ) {
448
+ public void testInferDataTypeBox42P18 (TestContext ctx ) {
449
449
Box value = new Box ();
450
- testInferDataType (ctx , Box .class , value , "(0,0),(0,0)" );
450
+ testInferDataType42P18 (ctx , Box .class , value , "(0,0),(0,0)" );
451
451
}
452
452
453
453
@ Test
454
- public void testInferDataTypePath (TestContext ctx ) {
454
+ public void testInferDataTypePath42P18 (TestContext ctx ) {
455
455
Path value = new Path ().addPoint (new Point ());
456
- testInferDataType (ctx , Path .class , value , "((0,0))" , "{\" ((0,0))\" }" );
456
+ testInferDataType42P18 (ctx , Path .class , value , "((0,0))" , "{\" ((0,0))\" }" );
457
457
}
458
458
459
459
@ Test
460
- public void testInferDataTypePolygon (TestContext ctx ) {
460
+ public void testInferDataTypePolygon42P18 (TestContext ctx ) {
461
461
Polygon value = new Polygon ().addPoint (new Point ()).addPoint (new Point ()).addPoint (new Point ());
462
- testInferDataType (ctx , Polygon .class , value , "((0,0),(0,0),(0,0))" , "{\" ((0,0),(0,0),(0,0))\" }" );
462
+ testInferDataType42P18 (ctx , Polygon .class , value , "((0,0),(0,0),(0,0))" , "{\" ((0,0),(0,0),(0,0))\" }" );
463
463
}
464
464
465
465
@ Test
466
- public void testInferDataTypeCircle (TestContext ctx ) {
466
+ public void testInferDataTypeCircle42P18 (TestContext ctx ) {
467
467
Circle value = new Circle ();
468
- testInferDataType (ctx , Circle .class , value , "<(0,0),0>" , "{\" <(0,0),0>\" }" );
468
+ testInferDataType42P18 (ctx , Circle .class , value , "<(0,0),0>" , "{\" <(0,0),0>\" }" );
469
469
}
470
470
471
- private <T > void testInferDataType (TestContext ctx , Class <T > type , T value , String suffix ) {
472
- testInferDataType (ctx , type , value , suffix , "{" + suffix + "}" );
471
+ private <T > void testInferDataType42P18 (TestContext ctx , Class <T > type , T value , String suffix ) {
472
+ testInferDataType42P18 (ctx , type , value , suffix , "{" + suffix + "}" );
473
473
}
474
474
475
- private <T > void testInferDataType (TestContext ctx , Class <T > type , T value , String suffix1 , String suffix2 ) {
475
+ private <T > void testInferDataType42P18 (TestContext ctx , Class <T > type , T value , String suffix1 , String suffix2 ) {
476
+ Object array = Array .newInstance (type , 1 );
477
+ Array .set (array , 0 , value );
476
478
PgConnection .connect (vertx , options (), ctx .asyncAssertSuccess (conn -> {
477
- conn .preparedQuery ("SELECT CONCAT('HELLO ', $1)" )
478
- .execute (Tuple .of (value ), ctx .asyncAssertSuccess (result1 -> {
479
+ conn
480
+ .preparedQuery ("SELECT CONCAT('HELLO ', $1)" ).execute (Tuple .of (value ))
481
+ .map (result1 -> {
479
482
Row row1 = result1 .iterator ().next ();
480
483
ctx .assertEquals ("HELLO " + suffix1 , row1 .getString (0 ));
481
- Object array = Array . newInstance ( type , 1 ) ;
482
- Array . set ( array , 0 , value );
483
- conn .preparedQuery ("SELECT CONCAT('HELLO ', $1)" )
484
- . execute ( Tuple . of ( array ), ctx . asyncAssertSuccess (result2 -> {
485
- Row row2 = result2 .iterator ().next ();
486
- String v = row2 .getString (0 );
487
- ctx .assertEquals ("HELLO " + suffix2 , row2 .getString (0 ));
488
- conn . close () ;
489
- }));
490
- } ));
484
+ return "" ;
485
+ })
486
+ . compose ( v -> conn .preparedQuery ("SELECT CONCAT('HELLO ', $1)" ). execute ( Tuple . of ( array )) )
487
+ . map (result2 -> {
488
+ Row row2 = result2 .iterator ().next ();
489
+ String v = row2 .getString (0 );
490
+ ctx .assertEquals ("HELLO " + suffix2 , row2 .getString (0 ));
491
+ return "" ;
492
+ })
493
+ . eventually ( v -> conn . close ( ));
491
494
}));
492
495
}
493
496
494
497
@ Test
495
- public void testInferDataTypeFailure (TestContext ctx ) {
498
+ public void testInferDataTypeLazy42P18 (TestContext ctx ) {
496
499
PgConnection .connect (vertx , options (), ctx .asyncAssertSuccess (conn -> {
497
- conn .preparedQuery ("SELECT CONCAT('HELLO', $1)" )
498
- .execute (Tuple .of (null ), ctx .asyncAssertFailure (result -> {
499
- conn .close ();
500
- }));
500
+ conn
501
+ .prepare ("SELECT CONCAT('HELLO', $1)" )
502
+ .compose (ps -> ps .query ().execute (Tuple .of ("__" )))
503
+ .map (result -> {
504
+ Row row = result .iterator ().next ();
505
+ ctx .assertEquals ("HELLO__" , row .getString (0 ));
506
+ return "" ;
507
+ })
508
+ .eventually (v -> conn .close ());
501
509
}));
502
510
}
503
511
504
512
@ Test
505
- public void testInferDataTypeLazy (TestContext ctx ) {
513
+ public void testInferDataTypeFailure42P18 (TestContext ctx ) {
506
514
PgConnection .connect (vertx , options (), ctx .asyncAssertSuccess (conn -> {
507
- conn .prepare ("SELECT CONCAT('HELLO', $1)" , ctx .asyncAssertSuccess (ps -> {
508
- ps .query ().execute (Tuple .of ("__" ), ctx .asyncAssertSuccess (result -> {
509
- Row row = result .iterator ().next ();
510
- ctx .assertEquals ("HELLO__" , row .getString (0 ));
511
- conn .close ();
512
- }));
513
- }));
515
+ conn .preparedQuery ("SELECT CONCAT('HELLO', $1)" )
516
+ .execute (Tuple .of (null ))
517
+ .eventually (v -> conn .close ())
518
+ .onComplete (ctx .asyncAssertFailure ());
514
519
}));
515
520
}
516
521
517
522
@ Test
518
- public void testInferDataTypeLazyFailure (TestContext ctx ) {
523
+ public void testInferDataTypeLazyFailure42P18 (TestContext ctx ) {
519
524
PgConnection .connect (vertx , options (), ctx .asyncAssertSuccess (conn -> {
520
- conn . prepare ( "SELECT CONCAT('HELLO', $1)" , ctx . asyncAssertSuccess ( ps -> {
521
- ps . query (). execute ( Tuple . of ( null ), ctx . asyncAssertFailure ( result -> {
522
- conn . close ();
523
- }));
524
- } ));
525
+ conn
526
+ . prepare ( "SELECT CONCAT('HELLO', $1)" )
527
+ . compose ( ps -> ps . query (). execute ( Tuple . of ( null )))
528
+ . eventually ( v -> conn . close ())
529
+ . onComplete ( ctx . asyncAssertFailure ( ));
525
530
}));
526
531
}
527
532
528
533
@ Test
529
- public void testInferDataTypeLazyPolymorphic (TestContext ctx ) {
534
+ public void testInferDataTypeLazy42804 (TestContext ctx ) {
530
535
PgConnection .connect (vertx , options (), ctx .asyncAssertSuccess (conn -> {
531
- conn .prepare ("SELECT to_jsonb($1)" , ctx .asyncAssertSuccess (ps -> {
532
- ps .query ().execute (Tuple .of ("foo" ), ctx .asyncAssertSuccess (result -> {
536
+ conn
537
+ .prepare ("SELECT to_jsonb($1)" )
538
+ .compose (ps -> ps .query ().execute (Tuple .of ("foo" )))
539
+ .map (result -> {
533
540
ctx .assertEquals ("foo" , result .iterator ().next ().getString (0 ));
534
- conn .close ();
535
- }));
536
- }));
541
+ return "" ;
542
+ })
543
+ .eventually (v -> conn .close ())
544
+ .onComplete (ctx .asyncAssertSuccess ());
545
+ }));
546
+ }
547
+
548
+ @ Test
549
+ public void testInferDataTypeLazy42P08 (TestContext ctx ) {
550
+ PgConnection .connect (vertx , options (), ctx .asyncAssertSuccess (conn -> {
551
+ conn
552
+ .prepare ("UPDATE Fortune SET message=$2 WHERE id=$1 AND (Fortune.*) IS DISTINCT FROM ($1, $2)" )
553
+ .compose (ps -> ps .query ().execute (Tuple .of (9 , "Feature: A bug with seniority." )))
554
+ .eventually (v -> conn .close ())
555
+ .onComplete (ctx .asyncAssertSuccess ());
537
556
}));
538
557
}
539
558
}
0 commit comments