You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/04/13 13:55:04 UTC
[shardingsphere] branch master updated: Refactor
PostgreSQLIdentifierPacket (#10078)
This is an automated email from the ASF dual-hosted git repository.
panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 7bfc288 Refactor PostgreSQLIdentifierPacket (#10078)
7bfc288 is described below
commit 7bfc288fbe10baf38500285456c4cb66d6da46ff
Author: Liang Zhang <te...@163.com>
AuthorDate: Tue Apr 13 21:54:27 2021 +0800
Refactor PostgreSQLIdentifierPacket (#10078)
---
.../protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java | 2 +-
.../packet/command/PostgreSQLCommandPacketFactory.java | 2 +-
.../packet/command/admin/PostgreSQLUnsupportedCommandPacket.java | 3 ++-
.../packet/command/query/PostgreSQLRowDescriptionPacket.java | 5 +++--
.../query/binary/bind/PostgreSQLBinaryResultSetRowPacket.java | 9 +++++----
.../command/query/binary/bind/PostgreSQLBindCompletePacket.java | 5 +++--
.../command/query/binary/bind/PostgreSQLComBindPacket.java | 5 +++--
.../query/binary/describe/PostgreSQLComDescribePacket.java | 5 +++--
.../command/query/binary/execute/PostgreSQLComExecutePacket.java | 5 +++--
.../command/query/binary/parse/PostgreSQLComParsePacket.java | 5 +++--
.../query/binary/parse/PostgreSQLParseCompletePacket.java | 5 +++--
.../command/query/binary/sync/PostgreSQLComSyncPacket.java | 5 +++--
.../packet/command/query/text/PostgreSQLComQueryPacket.java | 5 +++--
.../packet/command/query/text/PostgreSQLDataRowPacket.java | 5 +++--
.../packet/generic/PostgreSQLComTerminationPacket.java | 5 +++--
.../packet/generic/PostgreSQLCommandCompletePacket.java | 5 +++--
.../postgresql/packet/generic/PostgreSQLErrorResponsePacket.java | 5 +++--
.../postgresql/packet/generic/PostgreSQLReadyForQueryPacket.java | 5 +++--
.../handshake/PostgreSQLAuthenticationMD5PasswordPacket.java | 5 +++--
.../packet/handshake/PostgreSQLAuthenticationOKPacket.java | 5 +++--
.../packet/handshake/PostgreSQLParameterStatusPacket.java | 5 +++--
.../packet/handshake/PostgreSQLPasswordMessagePacket.java | 5 +++--
.../postgresql/packet/identifier/PostgreSQLIdentifierPacket.java | 2 +-
.../postgresql/codec/PostgreSQLPacketCodecEngineTest.java | 2 +-
.../command/admin/PostgreSQLUnsupportedCommandPacketTest.java | 6 +++---
.../packet/command/query/PostgreSQLRowDescriptionPacketTest.java | 2 +-
.../binary/bind/PostgreSQLBinaryResultSetRowPacketTest.java | 2 +-
.../query/binary/bind/PostgreSQLBindCompletePacketTest.java | 2 +-
.../command/query/binary/bind/PostgreSQLComBindPacketTest.java | 2 +-
.../query/binary/describe/PostgreSQLComDescribePacketTest.java | 3 ++-
.../query/binary/execute/PostgreSQLComExecutePacketTest.java | 3 ++-
.../command/query/binary/parse/PostgreSQLComParsePacketTest.java | 3 ++-
.../query/binary/parse/PostgreSQLParseCompletePacketTest.java | 3 ++-
.../command/query/binary/sync/PostgreSQLComSyncPacketTest.java | 3 ++-
.../packet/command/query/text/PostgreSQLComQueryPacketTest.java | 3 ++-
.../generic/PostgreSQLAuthenticationMD5PasswordPacketTest.java | 2 +-
.../packet/generic/PostgreSQLAuthenticationOKPacketTest.java | 2 +-
.../packet/generic/PostgreSQLComTerminationPacketTest.java | 2 +-
.../packet/generic/PostgreSQLCommandCompletePacketTest.java | 4 ++--
.../packet/generic/PostgreSQLParameterStatusPacketTest.java | 2 +-
.../packet/generic/PostgreSQLPasswordMessagePacketTest.java | 2 +-
.../packet/generic/PostgreSQLReadyForQueryPacketTest.java | 2 +-
42 files changed, 92 insertions(+), 66 deletions(-)
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
index f90d4ed..da0c70e 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
@@ -73,7 +73,7 @@ public final class PostgreSQLPacketCodecEngine implements DatabasePacketCodecEng
postgreSQLErrorResponsePacket.write(payload);
} finally {
if (message instanceof PostgreSQLIdentifierPacket) {
- out.writeByte(((PostgreSQLIdentifierPacket) message).getIdentifier());
+ out.writeByte(((PostgreSQLIdentifierPacket) message).getIdentifier().getValue());
out.writeInt(payload.getByteBuf().readableBytes() + PAYLOAD_LENGTH);
}
out.writeBytes(payload.getByteBuf());
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/PostgreSQLCommandPacketFactory.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/PostgreSQLCommandPacketFactory.java
index d8d9ced..cd3d451 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/PostgreSQLCommandPacketFactory.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/PostgreSQLCommandPacketFactory.java
@@ -60,7 +60,7 @@ public final class PostgreSQLCommandPacketFactory {
case TERMINATE:
return new PostgreSQLComTerminationPacket(payload);
default:
- return new PostgreSQLUnsupportedCommandPacket(commandPacketType.getValue());
+ return new PostgreSQLUnsupportedCommandPacket(commandPacketType);
}
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/admin/PostgreSQLUnsupportedCommandPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/admin/PostgreSQLUnsupportedCommandPacket.java
index abeb837..5141e6a6 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/admin/PostgreSQLUnsupportedCommandPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/admin/PostgreSQLUnsupportedCommandPacket.java
@@ -20,6 +20,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.command.admin;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
/**
@@ -29,7 +30,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacket
public final class PostgreSQLUnsupportedCommandPacket extends PostgreSQLCommandPacket {
@Getter
- private final char identifier;
+ private final PostgreSQLIdentifierTag identifier;
@Override
public void write(final PostgreSQLPacketPayload payload) {
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLRowDescriptionPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLRowDescriptionPacket.java
index 1619bb3..4f9025c 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLRowDescriptionPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLRowDescriptionPacket.java
@@ -20,6 +20,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -51,7 +52,7 @@ public final class PostgreSQLRowDescriptionPacket implements PostgreSQLIdentifie
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.ROW_DESCRIPTION.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.ROW_DESCRIPTION;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBinaryResultSetRowPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBinaryResultSetRowPacket.java
index 37bdd56..6f96cde 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBinaryResultSetRowPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBinaryResultSetRowPacket.java
@@ -20,10 +20,11 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bi
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.db.protocol.binary.BinaryCell;
import org.apache.shardingsphere.db.protocol.binary.BinaryRow;
-import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
-import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.bind.protocol.PostgreSQLBinaryProtocolValue;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.bind.protocol.PostgreSQLBinaryProtocolValueFactory;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
/**
@@ -50,7 +51,7 @@ public final class PostgreSQLBinaryResultSetRowPacket implements PostgreSQLIdent
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.DATA_ROW.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.DATA_ROW;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBindCompletePacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBindCompletePacket.java
index 9cb7961..b65ede0 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBindCompletePacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBindCompletePacket.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.bind;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -31,7 +32,7 @@ public final class PostgreSQLBindCompletePacket implements PostgreSQLIdentifierP
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.BIND_COMPLETE.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.BIND_COMPLETE;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacket.java
index e9fb993..a93f386 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacket.java
@@ -25,6 +25,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bin
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementParameterType;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.bind.protocol.PostgreSQLBinaryProtocolValue;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.bind.protocol.PostgreSQLBinaryProtocolValueFactory;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
import java.util.ArrayList;
@@ -83,7 +84,7 @@ public final class PostgreSQLComBindPacket extends PostgreSQLCommandPacket {
}
@Override
- public char getIdentifier() {
- return PostgreSQLCommandPacketType.BIND_COMMAND.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLCommandPacketType.BIND_COMMAND;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/describe/PostgreSQLComDescribePacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/describe/PostgreSQLComDescribePacket.java
index b75b70d..0c54ed3 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/describe/PostgreSQLComDescribePacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/describe/PostgreSQLComDescribePacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bi
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
/**
@@ -37,7 +38,7 @@ public final class PostgreSQLComDescribePacket extends PostgreSQLCommandPacket {
}
@Override
- public char getIdentifier() {
- return PostgreSQLCommandPacketType.DESCRIBE_COMMAND.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLCommandPacketType.DESCRIBE_COMMAND;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/execute/PostgreSQLComExecutePacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/execute/PostgreSQLComExecutePacket.java
index 0831ef6..c4469c2 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/execute/PostgreSQLComExecutePacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/execute/PostgreSQLComExecutePacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bi
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
/**
@@ -37,7 +38,7 @@ public final class PostgreSQLComExecutePacket extends PostgreSQLCommandPacket {
}
@Override
- public char getIdentifier() {
- return PostgreSQLCommandPacketType.EXECUTE_COMMAND.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLCommandPacketType.EXECUTE_COMMAND;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLComParsePacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLComParsePacket.java
index 94102dd..8d31ce1 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLComParsePacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLComParsePacket.java
@@ -22,6 +22,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLBinar
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementParameterType;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
import java.util.ArrayList;
@@ -65,7 +66,7 @@ public final class PostgreSQLComParsePacket extends PostgreSQLCommandPacket {
}
@Override
- public char getIdentifier() {
- return PostgreSQLCommandPacketType.PARSE_COMMAND.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLCommandPacketType.PARSE_COMMAND;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLParseCompletePacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLParseCompletePacket.java
index 0559e4f..8eb1c1f 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLParseCompletePacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLParseCompletePacket.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -31,7 +32,7 @@ public final class PostgreSQLParseCompletePacket implements PostgreSQLIdentifier
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.PARSE_COMPLETE.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.PARSE_COMPLETE;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/sync/PostgreSQLComSyncPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/sync/PostgreSQLComSyncPacket.java
index c78c095..a6d804c 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/sync/PostgreSQLComSyncPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/sync/PostgreSQLComSyncPacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bi
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
/**
@@ -35,7 +36,7 @@ public final class PostgreSQLComSyncPacket extends PostgreSQLCommandPacket {
}
@Override
- public char getIdentifier() {
- return PostgreSQLCommandPacketType.SYNC_COMMAND.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLCommandPacketType.SYNC_COMMAND;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLComQueryPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLComQueryPacket.java
index e8133d8..fac46dc 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLComQueryPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLComQueryPacket.java
@@ -20,6 +20,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.te
import lombok.Getter;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
/**
@@ -40,7 +41,7 @@ public final class PostgreSQLComQueryPacket extends PostgreSQLCommandPacket {
}
@Override
- public char getIdentifier() {
- return PostgreSQLCommandPacketType.SIMPLE_QUERY.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLCommandPacketType.SIMPLE_QUERY;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLDataRowPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLDataRowPacket.java
index cc8e4c2..42d47b9 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLDataRowPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLDataRowPacket.java
@@ -21,6 +21,7 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -69,7 +70,7 @@ public final class PostgreSQLDataRowPacket implements PostgreSQLIdentifierPacket
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.DATA_ROW.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.DATA_ROW;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLComTerminationPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLComTerminationPacket.java
index 87dc6a6..999e932 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLComTerminationPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLComTerminationPacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.generic;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
/**
@@ -35,7 +36,7 @@ public final class PostgreSQLComTerminationPacket extends PostgreSQLCommandPacke
}
@Override
- public char getIdentifier() {
- return PostgreSQLCommandPacketType.TERMINATE.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLCommandPacketType.TERMINATE;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLCommandCompletePacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLCommandCompletePacket.java
index 260cd08..5ec9943 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLCommandCompletePacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLCommandCompletePacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.generic;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -43,7 +44,7 @@ public final class PostgreSQLCommandCompletePacket implements PostgreSQLIdentifi
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.COMMAND_COMPLETE.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.COMMAND_COMPLETE;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLErrorResponsePacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLErrorResponsePacket.java
index aa1207d..bf8f8ad 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLErrorResponsePacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLErrorResponsePacket.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.generic;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -90,7 +91,7 @@ public final class PostgreSQLErrorResponsePacket implements PostgreSQLIdentifier
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.ERROR_RESPONSE.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.ERROR_RESPONSE;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLReadyForQueryPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLReadyForQueryPacket.java
index 426e3ac..f6c980c 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLReadyForQueryPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLReadyForQueryPacket.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.generic;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -34,7 +35,7 @@ public final class PostgreSQLReadyForQueryPacket implements PostgreSQLIdentifier
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.READY_FOR_QUERY.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.READY_FOR_QUERY;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationMD5PasswordPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationMD5PasswordPacket.java
index 6b49b2b..6b23684 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationMD5PasswordPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationMD5PasswordPacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.handshake;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -39,7 +40,7 @@ public final class PostgreSQLAuthenticationMD5PasswordPacket implements PostgreS
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationOKPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationOKPacket.java
index fa167b3..5219466 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationOKPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationOKPacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.handshake;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -36,7 +37,7 @@ public final class PostgreSQLAuthenticationOKPacket implements PostgreSQLIdentif
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLParameterStatusPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLParameterStatusPacket.java
index 5e99615..b62699f 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLParameterStatusPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLParameterStatusPacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.handshake;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -39,7 +40,7 @@ public final class PostgreSQLParameterStatusPacket implements PostgreSQLIdentifi
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.PARAMETER_STATUS.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.PARAMETER_STATUS;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLPasswordMessagePacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLPasswordMessagePacket.java
index 9323c7d..5fbd6c6 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLPasswordMessagePacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLPasswordMessagePacket.java
@@ -19,6 +19,7 @@ package org.apache.shardingsphere.db.protocol.postgresql.packet.handshake;
import lombok.Getter;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierPacket;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLIdentifierTag;
import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
@@ -40,7 +41,7 @@ public final class PostgreSQLPasswordMessagePacket implements PostgreSQLIdentifi
}
@Override
- public char getIdentifier() {
- return PostgreSQLMessagePacketType.PASSWORD_MESSAGE.getValue();
+ public PostgreSQLIdentifierTag getIdentifier() {
+ return PostgreSQLMessagePacketType.PASSWORD_MESSAGE;
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/identifier/PostgreSQLIdentifierPacket.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/identifier/PostgreSQLIdentifierPacket.java
index cde3a0c..3f316b9 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/identifier/PostgreSQLIdentifierPacket.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/identifier/PostgreSQLIdentifierPacket.java
@@ -29,5 +29,5 @@ public interface PostgreSQLIdentifierPacket extends PostgreSQLPacket {
*
* @return identifier
*/
- char getIdentifier();
+ PostgreSQLIdentifierTag getIdentifier();
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngineTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngineTest.java
index 549b57a..8b27440 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngineTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngineTest.java
@@ -84,7 +84,7 @@ public final class PostgreSQLPacketCodecEngineTest {
when(byteBufAllocator.buffer()).thenReturn(payloadByteBuf);
when(payloadByteBuf.readableBytes()).thenReturn(50);
PostgreSQLIdentifierPacket actualMessage = mock(PostgreSQLIdentifierPacket.class);
- when(actualMessage.getIdentifier()).thenReturn(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue());
+ when(actualMessage.getIdentifier()).thenReturn(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST);
new PostgreSQLPacketCodecEngine().encode(context, actualMessage, byteBuf);
verify(actualMessage).write(ArgumentMatchers.any());
verify(byteBuf).writeByte(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue());
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/admin/PostgreSQLUnsupportedCommandPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/admin/PostgreSQLUnsupportedCommandPacketTest.java
index df5bf80..515023c 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/admin/PostgreSQLUnsupportedCommandPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/admin/PostgreSQLUnsupportedCommandPacketTest.java
@@ -36,14 +36,14 @@ public final class PostgreSQLUnsupportedCommandPacketTest {
@Test
public void assertWrite() {
- PostgreSQLUnsupportedCommandPacket rowPacket = new PostgreSQLUnsupportedCommandPacket(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue());
+ PostgreSQLUnsupportedCommandPacket rowPacket = new PostgreSQLUnsupportedCommandPacket(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST);
rowPacket.write(new PostgreSQLPacketPayload(byteBuf));
assertThat(byteBuf.writerIndex(), is(0));
}
@Test
public void assertGetMessageType() {
- PostgreSQLUnsupportedCommandPacket rowPacket = new PostgreSQLUnsupportedCommandPacket(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue());
- assertThat(rowPacket.getIdentifier(), is(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue()));
+ PostgreSQLUnsupportedCommandPacket rowPacket = new PostgreSQLUnsupportedCommandPacket(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST);
+ assertThat(rowPacket.getIdentifier(), is(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLRowDescriptionPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLRowDescriptionPacketTest.java
index ae7f902..8b594f3 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLRowDescriptionPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/PostgreSQLRowDescriptionPacketTest.java
@@ -56,6 +56,6 @@ public final class PostgreSQLRowDescriptionPacketTest {
@Test
public void getMessageType() {
PostgreSQLRowDescriptionPacket packet = new PostgreSQLRowDescriptionPacket(0, Collections.emptyList());
- assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.ROW_DESCRIPTION.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.ROW_DESCRIPTION));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBinaryResultSetRowPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBinaryResultSetRowPacketTest.java
index af2a0bc..0265d6a 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBinaryResultSetRowPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBinaryResultSetRowPacketTest.java
@@ -67,6 +67,6 @@ public final class PostgreSQLBinaryResultSetRowPacketTest {
@Test
public void assertGetMessageType() {
PostgreSQLBinaryResultSetRowPacket rowPacket = new PostgreSQLBinaryResultSetRowPacket(mock(BinaryRow.class));
- assertThat(rowPacket.getIdentifier(), is(PostgreSQLMessagePacketType.DATA_ROW.getValue()));
+ assertThat(rowPacket.getIdentifier(), is(PostgreSQLMessagePacketType.DATA_ROW));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBindCompletePacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBindCompletePacketTest.java
index a0f59e3..678c274 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBindCompletePacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLBindCompletePacketTest.java
@@ -47,6 +47,6 @@ public final class PostgreSQLBindCompletePacketTest {
@Test
public void assertGetMessageType() {
PostgreSQLBindCompletePacket rowPacket = new PostgreSQLBindCompletePacket();
- assertThat(rowPacket.getIdentifier(), is(PostgreSQLMessagePacketType.BIND_COMPLETE.getValue()));
+ assertThat(rowPacket.getIdentifier(), is(PostgreSQLMessagePacketType.BIND_COMPLETE));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacketTest.java
index 8d84efe..ed6f992 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/bind/PostgreSQLComBindPacketTest.java
@@ -76,6 +76,6 @@ public final class PostgreSQLComBindPacketTest {
@Test
public void getMessageType() {
PostgreSQLComBindPacket bindPacket = new PostgreSQLComBindPacket(payload, 1);
- assertThat(bindPacket.getIdentifier(), is(PostgreSQLCommandPacketType.BIND_COMMAND.getValue()));
+ assertThat(bindPacket.getIdentifier(), is(PostgreSQLCommandPacketType.BIND_COMMAND));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/describe/PostgreSQLComDescribePacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/describe/PostgreSQLComDescribePacketTest.java
index aeda908..52ca338 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/describe/PostgreSQLComDescribePacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/describe/PostgreSQLComDescribePacketTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.describe;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,7 +38,7 @@ public final class PostgreSQLComDescribePacketTest {
public void assertNewInstance() {
PostgreSQLComDescribePacket actual = new PostgreSQLComDescribePacket(payload);
actual.write(payload);
- assertThat(actual.getIdentifier(), is('D'));
+ assertThat(actual.getIdentifier(), is(PostgreSQLCommandPacketType.DESCRIBE_COMMAND));
verify(payload).readInt4();
verify(payload).readInt1();
verify(payload).readStringNul();
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/execute/PostgreSQLComExecutePacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/execute/PostgreSQLComExecutePacketTest.java
index 2b4f96b..95e9db8 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/execute/PostgreSQLComExecutePacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/execute/PostgreSQLComExecutePacketTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.execute;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -40,6 +41,6 @@ public final class PostgreSQLComExecutePacketTest {
verify(payload, atLeast(2)).readInt4();
verify(payload).readStringNul();
actual.write(payload);
- assertThat(actual.getIdentifier(), is('E'));
+ assertThat(actual.getIdentifier(), is(PostgreSQLCommandPacketType.EXECUTE_COMMAND));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLComParsePacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLComParsePacketTest.java
index b9cdc68..a395fae 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLComParsePacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLComParsePacketTest.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse;
import org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLBinaryColumnType;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.PostgreSQLBinaryStatementParameterType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
import org.junit.Test;
@@ -46,7 +47,7 @@ public final class PostgreSQLComParsePacketTest {
when(payload.readStringNul()).thenReturn("sql");
PostgreSQLComParsePacket actual = new PostgreSQLComParsePacket(payload);
actual.write(payload);
- assertThat(actual.getIdentifier(), is('P'));
+ assertThat(actual.getIdentifier(), is(PostgreSQLCommandPacketType.PARSE_COMMAND));
assertThat(actual.getSql(), is("sql"));
assertThat(actual.getStatementId(), is("sql"));
List<PostgreSQLBinaryStatementParameterType> types = actual.getBinaryStatementParameterTypes();
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLParseCompletePacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLParseCompletePacketTest.java
index fb29192..9d88aee 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLParseCompletePacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/parse/PostgreSQLParseCompletePacketTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.PostgreSQLMessagePacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
import org.junit.Test;
@@ -30,6 +31,6 @@ public final class PostgreSQLParseCompletePacketTest {
public void assertNewInstance() {
PostgreSQLParseCompletePacket actual = new PostgreSQLParseCompletePacket();
actual.write(mock(PostgreSQLPacketPayload.class));
- assertThat(actual.getIdentifier(), is('1'));
+ assertThat(actual.getIdentifier(), is(PostgreSQLMessagePacketType.PARSE_COMPLETE));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/sync/PostgreSQLComSyncPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/sync/PostgreSQLComSyncPacketTest.java
index 8c11509..571b101 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/sync/PostgreSQLComSyncPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/binary/sync/PostgreSQLComSyncPacketTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.sync;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -38,6 +39,6 @@ public final class PostgreSQLComSyncPacketTest {
PostgreSQLComSyncPacket actual = new PostgreSQLComSyncPacket(payload);
actual.write(payload);
verify(payload).readInt4();
- assertThat(actual.getIdentifier(), is('S'));
+ assertThat(actual.getIdentifier(), is(PostgreSQLCommandPacketType.SYNC_COMMAND));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLComQueryPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLComQueryPacketTest.java
index 57bd307..ea84173 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLComQueryPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/command/query/text/PostgreSQLComQueryPacketTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.text;
+import org.apache.shardingsphere.db.protocol.postgresql.packet.command.PostgreSQLCommandPacketType;
import org.apache.shardingsphere.db.protocol.postgresql.payload.PostgreSQLPacketPayload;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -41,6 +42,6 @@ public final class PostgreSQLComQueryPacketTest {
actual.write(payload);
verify(payload).readInt4();
assertThat(actual.getSql(), is("sql"));
- assertThat(actual.getIdentifier(), is('Q'));
+ assertThat(actual.getIdentifier(), is(PostgreSQLCommandPacketType.SIMPLE_QUERY));
}
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLAuthenticationMD5PasswordPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLAuthenticationMD5PasswordPacketTest.java
index 111a14f..5942cba 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLAuthenticationMD5PasswordPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLAuthenticationMD5PasswordPacketTest.java
@@ -36,7 +36,7 @@ public final class PostgreSQLAuthenticationMD5PasswordPacketTest {
ByteBuf byteBuf = ByteBufTestUtils.createByteBuf(expectedLength);
PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(byteBuf);
PostgreSQLAuthenticationMD5PasswordPacket packet = new PostgreSQLAuthenticationMD5PasswordPacket(md5Salt);
- assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST));
packet.write(payload);
assertThat(byteBuf.writerIndex(), is(expectedLength));
assertThat(byteBuf.readInt(), is(5));
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLAuthenticationOKPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLAuthenticationOKPacketTest.java
index 0b785b0..5fb0c88 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLAuthenticationOKPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLAuthenticationOKPacketTest.java
@@ -43,7 +43,7 @@ public final class PostgreSQLAuthenticationOKPacketTest {
ByteBuf byteBuf = ByteBufTestUtils.createByteBuf(4);
PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(byteBuf);
PostgreSQLAuthenticationOKPacket packet = new PostgreSQLAuthenticationOKPacket(isSuccess);
- assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.AUTHENTICATION_REQUEST));
packet.write(payload);
assertThat(byteBuf.writerIndex(), is(4));
assertThat(byteBuf.readInt(), is(isSuccess ? 0 : 1));
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLComTerminationPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLComTerminationPacketTest.java
index fd51ae8..9d459a8 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLComTerminationPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLComTerminationPacketTest.java
@@ -34,7 +34,7 @@ public final class PostgreSQLComTerminationPacketTest {
byteBuf.writeInt(1);
PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(byteBuf);
PostgreSQLComTerminationPacket packet = new PostgreSQLComTerminationPacket(payload);
- assertThat(packet.getIdentifier(), is(PostgreSQLCommandPacketType.TERMINATE.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLCommandPacketType.TERMINATE));
assertThat(byteBuf.readerIndex(), is(4));
packet.write(payload);
assertThat(byteBuf.writerIndex(), is(4));
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLCommandCompletePacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLCommandCompletePacketTest.java
index 4e75c5b..1514c1d 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLCommandCompletePacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLCommandCompletePacketTest.java
@@ -35,7 +35,7 @@ public final class PostgreSQLCommandCompletePacketTest {
int expectedStringLength = expectedString.length();
PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(ByteBufTestUtils.createByteBuf(expectedStringLength + 1));
PostgreSQLCommandCompletePacket packet = new PostgreSQLCommandCompletePacket(sqlCommand, rowCount);
- assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.COMMAND_COMPLETE.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.COMMAND_COMPLETE));
packet.write(payload);
assertThat(payload.readStringNul(), is(expectedString));
}
@@ -48,7 +48,7 @@ public final class PostgreSQLCommandCompletePacketTest {
int expectedStringLength = expectedString.length();
PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(ByteBufTestUtils.createByteBuf(expectedStringLength + 1));
PostgreSQLCommandCompletePacket packet = new PostgreSQLCommandCompletePacket(sqlCommand, rowCount);
- assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.COMMAND_COMPLETE.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.COMMAND_COMPLETE));
packet.write(payload);
assertThat(payload.readStringNul(), is(expectedString));
}
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLParameterStatusPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLParameterStatusPacketTest.java
index 0f19f6d..bed39ff 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLParameterStatusPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLParameterStatusPacketTest.java
@@ -37,7 +37,7 @@ public final class PostgreSQLParameterStatusPacketTest {
ByteBuf byteBuf = ByteBufTestUtils.createByteBuf(expectedLength);
PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(byteBuf);
PostgreSQLParameterStatusPacket packet = new PostgreSQLParameterStatusPacket(key, value);
- assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.PARAMETER_STATUS.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.PARAMETER_STATUS));
packet.write(payload);
assertThat(byteBuf.writerIndex(), is(expectedLength));
assertThat(payload.readStringNul(), is(key));
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLPasswordMessagePacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLPasswordMessagePacketTest.java
index 5197fdc..86d1306 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLPasswordMessagePacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLPasswordMessagePacketTest.java
@@ -38,7 +38,7 @@ public final class PostgreSQLPasswordMessagePacketTest {
payload.writeInt4(expectedLength);
payload.writeStringNul(md5Digest);
PostgreSQLPasswordMessagePacket packet = new PostgreSQLPasswordMessagePacket(payload);
- assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.PASSWORD_MESSAGE.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.PASSWORD_MESSAGE));
assertThat(packet.getMd5Digest(), is(md5Digest));
packet.write(payload);
assertThat(byteBuf.writerIndex(), is(expectedLength));
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLReadyForQueryPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLReadyForQueryPacketTest.java
index 2c56f9c..db4845a 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLReadyForQueryPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/test/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLReadyForQueryPacketTest.java
@@ -33,7 +33,7 @@ public final class PostgreSQLReadyForQueryPacketTest {
ByteBuf byteBuf = ByteBufTestUtils.createByteBuf(1);
PostgreSQLPacketPayload payload = new PostgreSQLPacketPayload(byteBuf);
PostgreSQLReadyForQueryPacket packet = new PostgreSQLReadyForQueryPacket();
- assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.READY_FOR_QUERY.getValue()));
+ assertThat(packet.getIdentifier(), is(PostgreSQLMessagePacketType.READY_FOR_QUERY));
packet.write(payload);
assertThat(byteBuf.writerIndex(), is(1));
assertThat(byteBuf.readByte(), is((byte) 'I'));