@@ -109,18 +109,18 @@ public void setUp() throws Exception {
109
109
resp = session .execute (insertEdges );
110
110
Assert .assertTrue (resp .getErrorMessage (), resp .isSucceeded ());
111
111
112
- String insertShape = "INSERT VERTEX any_shape(geo) VALUES 'Point':(ST_GeogFromText('POINT"
113
- + " (3 8)'));" ;
112
+ String insertShape =
113
+ "INSERT VERTEX any_shape(geo) VALUES 'Point':(ST_GeogFromText('POINT (3 8)'));" ;
114
114
resp = session .execute (insertShape );
115
115
Assert .assertTrue (resp .getErrorMessage (), resp .isSucceeded ());
116
116
117
- insertShape = "INSERT VERTEX any_shape(geo) VALUES 'LString':(ST_GeogFromText('LINESTRING "
118
- + "(3 8, 4.7 73.23)'));" ;
117
+ insertShape = "INSERT VERTEX any_shape(geo) VALUES 'LString':"
118
+ + "(ST_GeogFromText('LINESTRING (3 8, 4.7 73.23)'));" ;
119
119
resp = session .execute (insertShape );
120
120
Assert .assertTrue (resp .getErrorMessage (), resp .isSucceeded ());
121
121
122
- insertShape = "INSERT VERTEX any_shape(geo) VALUES 'Polygon':(ST_GeogFromText('POLYGON((0 "
123
- + "1, 1 2, 2 3, 0 1))'));" ;
122
+ insertShape = "INSERT VERTEX any_shape(geo) VALUES 'Polygon':"
123
+ + "(ST_GeogFromText('POLYGON((0 1, 1 2, 2 3, 0 1))'));" ;
124
124
resp = session .execute (insertShape );
125
125
Assert .assertTrue (resp .getErrorMessage (), resp .isSucceeded ());
126
126
}
@@ -136,7 +136,8 @@ public void tearDown() {
136
136
@ Test
137
137
public void testAllSchemaType () {
138
138
try {
139
- ResultSet result = session .execute ("FETCH PROP ON person 'Bob';" );
139
+ ResultSet result = session .execute (
140
+ "FETCH PROP ON person 'Bob' yield vertex as vertices_;" );
140
141
Assert .assertTrue (result .isSucceeded ());
141
142
Assert .assertEquals ("" , result .getErrorMessage ());
142
143
Assert .assertFalse (result .getLatency () <= 0 );
@@ -193,7 +194,8 @@ public void testAllSchemaType() {
193
194
Assert .assertEquals (ValueWrapper .NullType .__NULL__ ,
194
195
properties .get ("hobby" ).asNull ().getNullType ());
195
196
196
- result = session .execute ("FETCH PROP ON any_shape 'Point';" );
197
+ result = session .execute (
198
+ "FETCH PROP ON any_shape 'Point' yield vertex as vertices_;" );
197
199
Assert .assertTrue (result .isSucceeded ());
198
200
Assert .assertEquals ("" , result .getErrorMessage ());
199
201
Assert .assertFalse (result .getLatency () <= 0 );
@@ -214,7 +216,8 @@ public void testAllSchemaType() {
214
216
Assert .assertEquals (geographyWrapper .toString (),
215
217
properties .get ("geo" ).asGeography ().toString ());
216
218
217
- result = session .execute ("FETCH PROP ON any_shape 'LString';" );
219
+ result = session .execute (
220
+ "FETCH PROP ON any_shape 'LString' yield vertex as vertices_;" );
218
221
Assert .assertTrue (result .isSucceeded ());
219
222
Assert .assertEquals ("" , result .getErrorMessage ());
220
223
Assert .assertFalse (result .getLatency () <= 0 );
@@ -237,7 +240,8 @@ public void testAllSchemaType() {
237
240
properties .get ("geo" ).asGeography ().toString ());
238
241
239
242
240
- result = session .execute ("FETCH PROP ON any_shape 'Polygon';" );
243
+ result = session .execute (
244
+ "FETCH PROP ON any_shape 'Polygon' yield vertex as vertices_;" );
241
245
Assert .assertTrue (result .isSucceeded ());
242
246
Assert .assertEquals ("" , result .getErrorMessage ());
243
247
Assert .assertFalse (result .getLatency () <= 0 );
@@ -254,12 +258,12 @@ public void testAllSchemaType() {
254
258
properties = node .properties ("any_shape" );
255
259
geographyWrapper = new GeographyWrapper (
256
260
new Geography (Geography .PGVAL ,
257
- new Polygon (Arrays .asList (Arrays .asList (
258
- new Coordinate (0 , 1 ),
259
- new Coordinate (1 , 2 ),
260
- new Coordinate (2 , 3 ),
261
- new Coordinate (0 ,1 ))
262
- ))));
261
+ new Polygon (Arrays .asList (Arrays .asList (
262
+ new Coordinate (0 , 1 ),
263
+ new Coordinate (1 , 2 ),
264
+ new Coordinate (2 , 3 ),
265
+ new Coordinate (0 , 1 ))
266
+ ))));
263
267
Assert .assertEquals (geographyWrapper , properties .get ("geo" ).asGeography ());
264
268
Assert .assertEquals (geographyWrapper .toString (),
265
269
properties .get ("geo" ).asGeography ().toString ());
@@ -478,7 +482,8 @@ public void tesDataset() {
478
482
@ Test
479
483
public void testErrorResult () {
480
484
try {
481
- ResultSet result = session .execute ("FETCH PROP ON no_exist_tag \" nobody\" " );
485
+ ResultSet result = session .execute (
486
+ "FETCH PROP ON no_exist_tag \" nobody\" yield vertex as vertices_" );
482
487
Assert .assertTrue (result .toString ().contains ("ExecutionResponse" ));
483
488
} catch (IOErrorException e ) {
484
489
e .printStackTrace ();
@@ -514,11 +519,11 @@ public void testComplexTypeForJson() {
514
519
String rowData = resp .getJSONArray ("results" ).getJSONObject (0 ).getJSONArray ("data" )
515
520
.getJSONObject (0 ).getJSONArray ("row" ).toJSONString ();
516
521
Assert .assertEquals (rowData , "[{\" person.first_out_city\" :1111,\" person"
517
- + ".book_num\" :100,\" person.age\" :10,\" person.expend\" :100,\" person.is_girl\" :"
518
- + "false,\" person.name\" :\" Bob\" ,\" person.grade\" :3,\" person.birthday\" :\" 2010"
519
- + "-09-10T02:08:02.0Z\" ,\" student.name\" :\" Bob\" ,\" person.child_name\" :\" Hello"
520
- + " Worl\" ,\" person.property\" :1000,\" person.morning\" :\" 23:10:00.000000Z\" ,\" "
521
- + "person.start_school\" :\" 2017-09-10\" ,\" person.friends\" :10}]" );
522
+ + ".book_num\" :100,\" person.age\" :10,\" person.expend\" :100,\" person.is_girl\" :"
523
+ + "false,\" person.name\" :\" Bob\" ,\" person.grade\" :3,\" person.birthday\" :\" 2010"
524
+ + "-09-10T02:08:02.0Z\" ,\" student.name\" :\" Bob\" ,\" person.child_name\" :\" Hello"
525
+ + " Worl\" ,\" person.property\" :1000,\" person.morning\" :\" 23:10:00.000000Z\" ,\" "
526
+ + "person.start_school\" :\" 2017-09-10\" ,\" person.friends\" :10}]" );
522
527
} catch (IOErrorException e ) {
523
528
e .printStackTrace ();
524
529
assert false ;
@@ -552,7 +557,7 @@ public void testSelfSignedSsl() {
552
557
try {
553
558
Runtime runtime = Runtime .getRuntime ();
554
559
runtime .exec ("docker-compose -f src/test/resources/docker-compose"
555
- + "-selfsigned.yaml up -d" );
560
+ + "-selfsigned.yaml up -d" );
556
561
557
562
NebulaPoolConfig nebulaSslPoolConfig = new NebulaPoolConfig ();
558
563
nebulaSslPoolConfig .setMaxConnSize (100 );
@@ -574,7 +579,7 @@ public void testSelfSignedSsl() {
574
579
Assert .assertEquals (rowData , exp );
575
580
576
581
runtime .exec ("docker-compose -f src/test/resources/docker-compose"
577
- + "-selfsigned.yaml down" ).waitFor (60 ,TimeUnit .SECONDS );
582
+ + "-selfsigned.yaml down" ).waitFor (60 , TimeUnit .SECONDS );
578
583
} catch (Exception e ) {
579
584
e .printStackTrace ();
580
585
assert false ;
@@ -593,7 +598,7 @@ public void testCASignedSsl() {
593
598
try {
594
599
Runtime runtime = Runtime .getRuntime ();
595
600
runtime .exec ("docker-compose -f src/test/resources/docker-compose"
596
- + "-casigned.yaml up -d" );
601
+ + "-casigned.yaml up -d" );
597
602
598
603
NebulaPoolConfig nebulaSslPoolConfig = new NebulaPoolConfig ();
599
604
nebulaSslPoolConfig .setMaxConnSize (100 );
@@ -615,7 +620,7 @@ public void testCASignedSsl() {
615
620
Assert .assertEquals (rowData , exp );
616
621
617
622
runtime .exec ("docker-compose -f src/test/resources/docker-compose"
618
- + "-casigned.yaml down" ).waitFor (60 ,TimeUnit .SECONDS );
623
+ + "-casigned.yaml down" ).waitFor (60 , TimeUnit .SECONDS );
619
624
} catch (Exception e ) {
620
625
e .printStackTrace ();
621
626
assert false ;
0 commit comments