test_class.declarator: payload
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private MySQLPacketPayload payload;
test_class.type: MySQLPacketPayload
test_class.var_name: payload
test_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/text/MySQLTextResultSetRowPacketTest.java
test_class.identifier: MySQLTextResultSetRowPacketTest
test_case.body: @Test
      public void assertWrite() {
          long now = System.currentTimeMillis();
          Timestamp timestamp = new Timestamp(now);
          MySQLTextResultSetRowPacket actual = new MySQLTextResultSetRowPacket(1, Arrays.asList(null, "value", BigDecimal.ONE, new byte[] {}, timestamp));
          actual.write(payload);
          verify(payload).writeInt1(0xfb);
          verify(payload).writeStringLenenc("value");
          verify(payload).writeStringLenenc("1");
          if (0 == timestamp.getNanos()) {
              verify(payload).writeStringLenenc(timestamp.toString().split("\\.")[0]);
          } else {
              verify(payload).writeStringLenenc(timestamp.toString());
          }
      }
test_case.class_method_signature: MySQLTextResultSetRowPacketTest.assertWrite()
test_case.full_signature: @Test public void assertWrite()
test_case.identifier: assertWrite
test_case.invocations: currentTimeMillis asList write writeInt1 verify writeStringLenenc verify writeStringLenenc verify getNanos writeStringLenenc verify split toString writeStringLenenc verify toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertWrite()
focal_class.declarator: NULL = 0xfb
focal_class.modifier: private static final
focal_class.original_string: private static final int NULL = 0xfb;
focal_class.type: int
focal_class.var_name: NULL
focal_class.declarator: sequenceId
focal_class.modifier: private final
focal_class.original_string: private final int sequenceId;
focal_class.type: int
focal_class.var_name: sequenceId
focal_class.declarator: data
focal_class.modifier: private final
focal_class.original_string: private final List<Object> data;
focal_class.type: List<Object>
focal_class.var_name: data
focal_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/text/MySQLTextResultSetRowPacket.java
focal_class.identifier: MySQLTextResultSetRowPacket
focal_class.interfaces: implements MySQLPacket
focal_class.class_method_signature: MySQLTextResultSetRowPacket.MySQLTextResultSetRowPacket(final MySQLPacketPayload payload, final int columnCount)
focal_class.full_signature: public  MySQLTextResultSetRowPacket(final MySQLPacketPayload payload, final int columnCount)
focal_class.identifier: MySQLTextResultSetRowPacket
focal_class.modifiers: public
focal_class.parameters: (final MySQLPacketPayload payload, final int columnCount)
focal_class.signature:  MySQLTextResultSetRowPacket(final MySQLPacketPayload payload, final int columnCount)
focal_class.class_method_signature: MySQLTextResultSetRowPacket.write(final MySQLPacketPayload payload)
focal_class.full_signature: @Override public void write(final MySQLPacketPayload payload)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: void
focal_class.signature: void write(final MySQLPacketPayload payload)
focal_method.body: @Override
      public void write(final MySQLPacketPayload payload) {
          for (Object each : data) {
              if (null == each) {
                  payload.writeInt1(NULL);
              } else {
                  if (each instanceof byte[]) {
                      payload.writeBytesLenenc((byte[]) each);
                  } else if ((each instanceof Timestamp) && (0 == ((Timestamp) each).getNanos())) {
                      payload.writeStringLenenc(each.toString().split("\\.")[0]);
                  } else if (each instanceof BigDecimal) {
                      payload.writeStringLenenc(((BigDecimal) each).toPlainString());
                  } else if (each instanceof Boolean) {
                      payload.writeBytesLenenc((Boolean) each ? new byte[]{1} : new byte[]{0});
                  } else {
                      payload.writeStringLenenc(each.toString());
                  }
              }
          }
      }
focal_method.class_method_signature: MySQLTextResultSetRowPacket.write(final MySQLPacketPayload payload)
focal_method.full_signature: @Override public void write(final MySQLPacketPayload payload)
focal_method.identifier: write
focal_method.invocations: writeInt1 writeBytesLenenc getNanos writeStringLenenc split toString writeStringLenenc toPlainString writeBytesLenenc writeStringLenenc toString
focal_method.modifiers: @Override public
focal_method.parameters: (final MySQLPacketPayload payload)
focal_method.return: void
focal_method.signature: void write(final MySQLPacketPayload payload)