Skip to content

Commit 327f599

Browse files
committed
Add auxiliary test
1 parent ea33154 commit 327f599

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

vertx-pg-client/src/test/java/io/vertx/pgclient/PgConnectionCopyTest.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,35 @@ public void testCopyToRows(TestContext ctx) {
3131
});
3232
}));
3333
}
34+
35+
/**
36+
* Just a thingy to eavesdrop protocol interactions.
37+
*
38+
* tips:
39+
* - frontend / backend protocol -> message flow -> binary
40+
* - start with CommandBase, SimpleQueryCommandCodecBase, builder.executeSimpleQuery, QueryExecutor, QueryResultBuilder
41+
* - PgDecoder
42+
* - startup message
43+
* - auth
44+
* - Simple Query
45+
* - use wireshark - `tcp port 5432`
46+
* - add VM option - port - such that it's fixed
47+
*
48+
* TODO: drop this.
49+
*
50+
* @param ctx
51+
*/
52+
@Test
53+
public void testSimpleQuery(TestContext ctx) {
54+
Async async = ctx.async();
55+
connector.accept(ctx.asyncAssertSuccess(conn -> {
56+
conn
57+
.query("SELECT 1")
58+
.execute()
59+
.onComplete(ctx.asyncAssertSuccess(result1 -> {
60+
ctx.assertEquals(1, result1.size());
61+
async.complete();
62+
}));
63+
}));
64+
}
3465
}

0 commit comments

Comments
 (0)