File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
src/test/java/io/vertx/ext/asyncsql Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 2020import io .vertx .core .Handler ;
2121import io .vertx .core .json .JsonArray ;
2222import io .vertx .core .json .JsonObject ;
23+ import io .vertx .ext .sql .ResultSet ;
2324import io .vertx .ext .sql .SQLConnection ;
2425import io .vertx .ext .sql .UpdateResult ;
2526import io .vertx .ext .unit .Async ;
2627import io .vertx .ext .unit .TestContext ;
2728import org .junit .Before ;
2829import org .junit .Test ;
2930
31+ import java .util .Arrays ;
32+
3033public class MySQLClientTest extends SQLTestBase {
3134
3235
@@ -93,6 +96,22 @@ public void testInsertedIds(TestContext context) {
9396 });
9497 }
9598
99+ protected String createByteArray1TableColumn () {
100+ return "BIT(1)" ;
101+ }
102+
103+ protected String createByteArray2TableColumn () {
104+ return "BIT(2)" ;
105+ }
106+
107+ protected String [] insertByteArray1Values () {
108+ return new String []{"B'1'" , "B'0'" , "B'1'" };
109+ }
110+
111+ protected String [] insertByteArray2Values () {
112+ return new String []{"B'10'" , "B'01'" , "B'11'" };
113+ }
114+
96115 private void setupAutoIncrementTable (SQLConnection conn , Handler <AsyncResult <Void >> handler ) {
97116 conn .execute ("BEGIN" ,
98117 ar -> conn .execute ("DROP TABLE IF EXISTS test_table" ,
Original file line number Diff line number Diff line change 2727import org .junit .Before ;
2828import org .junit .Test ;
2929
30+ import java .util .Arrays ;
3031import java .util .UUID ;
3132
3233public class PostgreSQLClientTest extends SQLTestBase {
@@ -111,6 +112,22 @@ public void testUsingUUIDsInTables(TestContext context) {
111112 });
112113 }
113114
115+ protected String createByteArray1TableColumn () {
116+ return "BYTEA" ;
117+ }
118+
119+ protected String createByteArray2TableColumn () {
120+ return "BYTEA" ;
121+ }
122+
123+ protected String [] insertByteArray1Values () {
124+ return new String []{"E'\\ 001'" , "E'\\ \\ 000'" , "E'\\ \\ 001'" };
125+ }
126+
127+ protected String [] insertByteArray2Values () {
128+ return new String []{"E'\\ x2'" , "E'\\ x1'" , "E'\\ x3'" };
129+ }
130+
114131 private void setupAutoIncrementTable (SQLConnection conn , Handler <AsyncResult <Void >> handler ) {
115132 conn .execute ("BEGIN" ,
116133 ar -> conn .execute ("DROP TABLE IF EXISTS test_table" ,
Original file line number Diff line number Diff line change 2828import io .vertx .ext .unit .TestContext ;
2929import org .junit .Test ;
3030
31+ import java .util .Arrays ;
3132import java .util .List ;
3233
3334public abstract class SQLTestBase extends AbstractTestBase {
You can’t perform that action at this time.
0 commit comments