Skip to content

Commit bd0f74d

Browse files
authored
Merge pull request #598 from aguibert/db2-unique-prdid
Use unique PRDID of JNT
2 parents 0720d75 + aa41b3d commit bd0f74d

14 files changed

+131
-27
lines changed

vertx-db2-client/src/main/java/io/vertx/db2client/impl/drda/DRDAConnectResponse.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,8 +1771,7 @@ private void parseEXCSATRD() {
17711771
}
17721772

17731773
if (!foundInPass) {
1774-
throw new IllegalStateException(String.format("Did not find a codepoint in this pass: %02x", peekCP));
1775-
//doPrmnsprmSemantics(peekCP);
1774+
throwUnknownCodepoint(peekCP);
17761775
}
17771776

17781777
if (!srvrlslvReceived)

vertx-db2-client/src/main/java/io/vertx/db2client/impl/drda/DRDAConstants.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,9 @@ public class DRDAConstants {
347347
/** Constant indicating that the user stream was too long. */
348348
public static final byte STREAM_TOO_LONG = 0x04;
349349

350-
// // Product id of the ClientDNC.
351-
public static final String PRDID = "JCC04250";
352-
353-
public static final String EXTNAM = "db2jcc_application " + PRDID + "300";
350+
// Product id
351+
public static final String PRDID = "JNT00001";
352+
public static final String EXTNAM = "db2jnt_application " + PRDID + "300";
354353

355354
static final DateTimeFormatter DB2_DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy'-'MM'-'dd");
356355
static final DateTimeFormatter DB2_TIME_FORMAT = DateTimeFormatter.ofPattern("HH'.'mm'.'ss");

vertx-db2-client/src/main/java/io/vertx/db2client/impl/drda/DRDAQueryResponse.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3311,12 +3311,6 @@ private void parseSQLDXGRP(ColumnMetaData columnMetaData, int column) {
33113311
// SQLXNAME_s; PROTOCOL TYPE VCS; ENVLID 0x32; Length Override 255
33123312
String sqlxname = parseFastVCMorVCS(); // ID
33133313

3314-
// @AGG manually skip 1 unknown byte
3315-
if (!metadata.isZos()) {
3316-
if (readUnsignedByte() != CodePoint.NULLDATA)
3317-
throw new IllegalStateException("@AGG expecting 0xFF here");
3318-
}
3319-
33203314
if (columnMetaData.sqlxKeymem_ == null) {
33213315
columnMetaData.sqlxKeymem_ = new short[columnMetaData.columns_];
33223316
}

vertx-db2-client/src/test/java/io/vertx/db2client/tck/DB2BinaryDataTypeDecodeTest.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
import static org.junit.Assume.assumeFalse;
44

5+
import org.junit.Before;
56
import org.junit.ClassRule;
7+
import org.junit.Rule;
68
import org.junit.Test;
9+
import org.junit.rules.TestName;
710
import org.junit.runner.RunWith;
811

912
import io.vertx.db2client.junit.DB2Resource;
@@ -16,6 +19,14 @@
1619
public class DB2BinaryDataTypeDecodeTest extends BinaryDataTypeDecodeTestBase {
1720
@ClassRule
1821
public static DB2Resource rule = DB2Resource.SHARED_INSTANCE;
22+
23+
@Rule
24+
public TestName testName = new TestName();
25+
26+
@Before
27+
public void printTestName(TestContext ctx) throws Exception {
28+
System.out.println(">>> BEGIN " + getClass().getSimpleName() + "." + testName.getMethodName());
29+
}
1930

2031
@Override
2132
protected void initConnector() {
@@ -25,12 +36,8 @@ protected void initConnector() {
2536
@Test
2637
@Override
2738
public void testBoolean(TestContext ctx) {
28-
if (!rule.isZOS()) {
29-
super.testBoolean(ctx);
30-
return;
31-
}
32-
3339
// DB2/Z does not support BOOLEAN column type, use TINYINT instead
40+
// DB2/LUW has a BOOLEAN column type but it is just an alias for TINYINT
3441
connector.connect(ctx.asyncAssertSuccess(conn -> {
3542
conn
3643
.preparedQuery("SELECT test_boolean FROM basicdatatype WHERE id = 1")

vertx-db2-client/src/test/java/io/vertx/db2client/tck/DB2BinaryDataTypeEncodeTest.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package io.vertx.db2client.tck;
22

3+
import org.junit.Before;
34
import org.junit.ClassRule;
5+
import org.junit.Rule;
46
import org.junit.Test;
7+
import org.junit.rules.TestName;
58
import org.junit.runner.RunWith;
69

710
import io.vertx.db2client.junit.DB2Resource;
@@ -15,6 +18,14 @@
1518
public class DB2BinaryDataTypeEncodeTest extends BinaryDataTypeEncodeTestBase {
1619
@ClassRule
1720
public static DB2Resource rule = DB2Resource.SHARED_INSTANCE;
21+
22+
@Rule
23+
public TestName testName = new TestName();
24+
25+
@Before
26+
public void printTestName(TestContext ctx) throws Exception {
27+
System.out.println(">>> BEGIN " + getClass().getSimpleName() + "." + testName.getMethodName());
28+
}
1829

1930
@Override
2031
protected void initConnector() {
@@ -35,12 +46,8 @@ public void testDouble(TestContext ctx) {
3546

3647
@Override
3748
public void testBoolean(TestContext ctx) {
38-
if (!rule.isZOS()) {
39-
super.testBoolean(ctx);
40-
return;
41-
}
42-
4349
// DB2/Z doesn't have a BOOLEAN column type and uses TINYINT instead
50+
// DB2/LUW has a BOOLEAN column type but it is just an alias for TINYINT
4451
connector.connect(ctx.asyncAssertSuccess(conn -> {
4552
conn
4653
.preparedQuery("UPDATE basicdatatype SET test_boolean = ? WHERE id = 2")

vertx-db2-client/src/test/java/io/vertx/db2client/tck/DB2CollectorTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
package io.vertx.db2client.tck;
22

3+
import org.junit.Before;
34
import org.junit.ClassRule;
5+
import org.junit.Rule;
6+
import org.junit.rules.TestName;
47
import org.junit.runner.RunWith;
58

69
import io.vertx.db2client.junit.DB2Resource;
10+
import io.vertx.ext.unit.TestContext;
711
import io.vertx.ext.unit.junit.VertxUnitRunner;
812
import io.vertx.sqlclient.tck.CollectorTestBase;
913

1014
@RunWith(VertxUnitRunner.class)
1115
public class DB2CollectorTest extends CollectorTestBase {
1216
@ClassRule
1317
public static DB2Resource rule = DB2Resource.SHARED_INSTANCE;
18+
19+
@Rule
20+
public TestName testName = new TestName();
21+
22+
@Before
23+
public void printTestName(TestContext ctx) throws Exception {
24+
System.out.println(">>> BEGIN " + getClass().getSimpleName() + "." + testName.getMethodName());
25+
}
1426

1527
@Override
1628
protected void initConnector() {

vertx-db2-client/src/test/java/io/vertx/db2client/tck/DB2ConnectionTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,26 @@
2222
import io.vertx.db2client.junit.DB2Resource;
2323
import io.vertx.ext.unit.TestContext;
2424
import io.vertx.ext.unit.junit.VertxUnitRunner;
25+
26+
import org.junit.Before;
2527
import org.junit.ClassRule;
28+
import org.junit.Rule;
2629
import org.junit.Test;
30+
import org.junit.rules.TestName;
2731
import org.junit.runner.RunWith;
2832

2933
@RunWith(VertxUnitRunner.class)
3034
public class DB2ConnectionTest extends ConnectionTestBase {
3135
@ClassRule
3236
public static DB2Resource rule = DB2Resource.SHARED_INSTANCE;
37+
38+
@Rule
39+
public TestName testName = new TestName();
40+
41+
@Before
42+
public void printTestName(TestContext ctx) throws Exception {
43+
System.out.println(">>> BEGIN " + getClass().getSimpleName() + "." + testName.getMethodName());
44+
}
3345

3446
@Override
3547
public void setUp() throws Exception {

vertx-db2-client/src/test/java/io/vertx/db2client/tck/DB2PreparedBatchTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,24 @@
55
import io.vertx.ext.unit.junit.VertxUnitRunner;
66
import io.vertx.sqlclient.tck.PreparedBatchTestBase;
77

8+
import org.junit.Before;
89
import org.junit.ClassRule;
10+
import org.junit.Rule;
11+
import org.junit.rules.TestName;
912
import org.junit.runner.RunWith;
1013

1114
@RunWith(VertxUnitRunner.class)
1215
public class DB2PreparedBatchTest extends PreparedBatchTestBase {
1316
@ClassRule
1417
public static DB2Resource rule = DB2Resource.SHARED_INSTANCE;
18+
19+
@Rule
20+
public TestName testName = new TestName();
21+
22+
@Before
23+
public void printTestName(TestContext ctx) throws Exception {
24+
System.out.println(">>> BEGIN " + getClass().getSimpleName() + "." + testName.getMethodName());
25+
}
1526

1627
@Override
1728
protected void initConnector() {

vertx-db2-client/src/test/java/io/vertx/db2client/tck/DB2PreparedQueryCachedTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package io.vertx.db2client.tck;
22

3+
import org.junit.Before;
34
import org.junit.ClassRule;
45
import org.junit.Ignore;
6+
import org.junit.Rule;
57
import org.junit.Test;
8+
import org.junit.rules.TestName;
69
import org.junit.runner.RunWith;
710

811
import io.vertx.db2client.junit.DB2Resource;
@@ -14,6 +17,14 @@
1417
public class DB2PreparedQueryCachedTest extends PreparedQueryCachedTestBase {
1518
@ClassRule
1619
public static DB2Resource rule = DB2Resource.SHARED_INSTANCE;
20+
21+
@Rule
22+
public TestName testName = new TestName();
23+
24+
@Before
25+
public void printTestName(TestContext ctx) throws Exception {
26+
System.out.println(">>> BEGIN " + getClass().getSimpleName() + "." + testName.getMethodName());
27+
}
1728

1829
@Override
1930
protected void initConnector() {

vertx-db2-client/src/test/java/io/vertx/db2client/tck/DB2PreparedQueryTestBase.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package io.vertx.db2client.tck;
22

3+
import org.junit.Before;
34
import org.junit.ClassRule;
45
import org.junit.Ignore;
6+
import org.junit.Rule;
57
import org.junit.Test;
8+
import org.junit.rules.TestName;
69

710
import io.vertx.db2client.junit.DB2Resource;
811
import io.vertx.ext.unit.TestContext;
@@ -12,6 +15,14 @@ public abstract class DB2PreparedQueryTestBase extends PreparedQueryTestBase {
1215

1316
@ClassRule
1417
public static DB2Resource rule = DB2Resource.SHARED_INSTANCE;
18+
19+
@Rule
20+
public TestName testName = new TestName();
21+
22+
@Before
23+
public void printTestName(TestContext ctx) throws Exception {
24+
System.out.println(">>> BEGIN " + getClass().getSimpleName() + "." + testName.getMethodName());
25+
}
1526

1627
@Override
1728
protected void cleanTestTable(TestContext ctx) {

0 commit comments

Comments
 (0)