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/binary/execute/protocol/MySQLDateBinaryProtocolValueTest.java
test_class.identifier: MySQLDateBinaryProtocolValueTest
test_case.body: @Test
      public void assertReadWithElevenBytes() throws SQLException {
          when(payload.readInt1()).thenReturn(11, 12, 31, 10, 59, 0);
          when(payload.readInt2()).thenReturn(2018);
          when(payload.readInt4()).thenReturn(500);
          Calendar actual = Calendar.getInstance();
          actual.setTimeInMillis(((Timestamp) new MySQLDateBinaryProtocolValue().read(payload)).getTime());
          assertThat(actual.get(Calendar.YEAR), is(2018));
          assertThat(actual.get(Calendar.MONTH), is(Calendar.DECEMBER));
          assertThat(actual.get(Calendar.DAY_OF_MONTH), is(31));
          assertThat(actual.get(Calendar.HOUR_OF_DAY), is(10));
          assertThat(actual.get(Calendar.MINUTE), is(59));
          assertThat(actual.get(Calendar.SECOND), is(0));
      }
test_case.class_method_signature: MySQLDateBinaryProtocolValueTest.assertReadWithElevenBytes()
test_case.full_signature: @Test public void assertReadWithElevenBytes()
test_case.identifier: assertReadWithElevenBytes
test_case.invocations: thenReturn when readInt1 thenReturn when readInt2 thenReturn when readInt4 getInstance setTimeInMillis getTime read assertThat get is assertThat get is assertThat get is assertThat get is assertThat get is assertThat get is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertReadWithElevenBytes()
focal_class.file: shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/binary/execute/protocol/MySQLDateBinaryProtocolValue.java
focal_class.identifier: MySQLDateBinaryProtocolValue
focal_class.interfaces: implements MySQLBinaryProtocolValue
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.read(final MySQLPacketPayload payload)
focal_class.full_signature: @Override public Object read(final MySQLPacketPayload payload)
focal_class.identifier: read
focal_class.modifiers: @Override public
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: Object
focal_class.signature: Object read(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.getTimestampForDate(final MySQLPacketPayload payload)
focal_class.full_signature: @SuppressWarnings("MagicConstant") private Timestamp getTimestampForDate(final MySQLPacketPayload payload)
focal_class.identifier: getTimestampForDate
focal_class.modifiers: @SuppressWarnings("MagicConstant") private
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: Timestamp
focal_class.signature: Timestamp getTimestampForDate(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.getTimestampForDatetime(final MySQLPacketPayload payload)
focal_class.full_signature: @SuppressWarnings("MagicConstant") private Timestamp getTimestampForDatetime(final MySQLPacketPayload payload)
focal_class.identifier: getTimestampForDatetime
focal_class.modifiers: @SuppressWarnings("MagicConstant") private
focal_class.parameters: (final MySQLPacketPayload payload)
focal_class.return: Timestamp
focal_class.signature: Timestamp getTimestampForDatetime(final MySQLPacketPayload payload)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.write(final MySQLPacketPayload payload, final Object value)
focal_class.full_signature: @Override public void write(final MySQLPacketPayload payload, final Object value)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (final MySQLPacketPayload payload, final Object value)
focal_class.return: void
focal_class.signature: void write(final MySQLPacketPayload payload, final Object value)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.writeDate(final MySQLPacketPayload payload, final int year, final int month, final int dayOfMonth)
focal_class.full_signature: private void writeDate(final MySQLPacketPayload payload, final int year, final int month, final int dayOfMonth)
focal_class.identifier: writeDate
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload, final int year, final int month, final int dayOfMonth)
focal_class.return: void
focal_class.signature: void writeDate(final MySQLPacketPayload payload, final int year, final int month, final int dayOfMonth)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.writeTime(final MySQLPacketPayload payload, final int hourOfDay, final int minutes, final int seconds)
focal_class.full_signature: private void writeTime(final MySQLPacketPayload payload, final int hourOfDay, final int minutes, final int seconds)
focal_class.identifier: writeTime
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload, final int hourOfDay, final int minutes, final int seconds)
focal_class.return: void
focal_class.signature: void writeTime(final MySQLPacketPayload payload, final int hourOfDay, final int minutes, final int seconds)
focal_class.class_method_signature: MySQLDateBinaryProtocolValue.writeNanos(final MySQLPacketPayload payload, final int nanos)
focal_class.full_signature: private void writeNanos(final MySQLPacketPayload payload, final int nanos)
focal_class.identifier: writeNanos
focal_class.modifiers: private
focal_class.parameters: (final MySQLPacketPayload payload, final int nanos)
focal_class.return: void
focal_class.signature: void writeNanos(final MySQLPacketPayload payload, final int nanos)
focal_method.body: @Override
      public Object read(final MySQLPacketPayload payload) throws SQLException {
          int length = payload.readInt1();
          switch (length) {
              case 0:
                  throw new SQLFeatureNotSupportedException("Can not support date format if year, month, day is absent.");
              case 4:
                  return getTimestampForDate(payload);
              case 7:
                  return getTimestampForDatetime(payload);
              case 11:
                  Timestamp result = getTimestampForDatetime(payload);
                  result.setNanos(payload.readInt4());
                  return result;
              default:
                  throw new IllegalArgumentException(String.format("Wrong length '%d' of MYSQL_TYPE_TIME", length));
          }
      }
focal_method.class_method_signature: MySQLDateBinaryProtocolValue.read(final MySQLPacketPayload payload)
focal_method.full_signature: @Override public Object read(final MySQLPacketPayload payload)
focal_method.identifier: read
focal_method.invocations: readInt1 getTimestampForDate getTimestampForDatetime getTimestampForDatetime setNanos readInt4 format
focal_method.modifiers: @Override public
focal_method.parameters: (final MySQLPacketPayload payload)
focal_method.return: Object
focal_method.signature: Object read(final MySQLPacketPayload payload)