test_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecutorFactoryTest.java
test_class.identifier: PostgreSQLCommandExecutorFactoryTest
test_case.body: @Test
      public void assertNewInstance() {
          BackendConnection backendConnection = mock(BackendConnection.class);
          when(backendConnection.getSchemaName()).thenReturn("schema");
          Collection<InputOutput> inputOutputs = Arrays.asList(
              new InputOutput(PostgreSQLCommandPacketType.QUERY, PostgreSQLComQueryPacket.class, PostgreSQLComQueryExecutor.class),
              new InputOutput(PostgreSQLCommandPacketType.PARSE, PostgreSQLComParsePacket.class, PostgreSQLComParseExecutor.class),
              new InputOutput(PostgreSQLCommandPacketType.BIND, PostgreSQLComBindPacket.class, PostgreSQLComBindExecutor.class),
              new InputOutput(PostgreSQLCommandPacketType.DESCRIBE, null, PostgreSQLComDescribeExecutor.class),
              new InputOutput(PostgreSQLCommandPacketType.EXECUTE, null, PostgreSQLComExecuteExecutor.class),
              new InputOutput(PostgreSQLCommandPacketType.SYNC, null, PostgreSQLComSyncExecutor.class),
              new InputOutput(PostgreSQLCommandPacketType.TERMINATE, null, PostgreSQLComTerminationExecutor.class),
              new InputOutput(PostgreSQLCommandPacketType.CLOSE, null, PostgreSQLUnsupportedCommandExecutor.class)
          );
          for (InputOutput inputOutput : inputOutputs) {
              Class<? extends PostgreSQLCommandPacket> commandPacketClass = inputOutput.commandPacketClass;
              if (null == commandPacketClass) {
                  commandPacketClass = PostgreSQLCommandPacket.class;
              }
              CommandExecutor actual = PostgreSQLCommandExecutorFactory.newInstance(inputOutput.commandPacketType, mock(commandPacketClass), mock(BackendConnection.class));
              assertThat(actual, instanceOf(inputOutput.resultClass));
          }
      }
test_case.class_method_signature: PostgreSQLCommandExecutorFactoryTest.assertNewInstance()
test_case.full_signature: @Test public void assertNewInstance()
test_case.identifier: assertNewInstance
test_case.invocations: mock thenReturn when getSchemaName asList newInstance mock mock assertThat instanceOf
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertNewInstance()
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/PostgreSQLCommandExecutorFactory.java
focal_class.identifier: PostgreSQLCommandExecutorFactory
focal_class.class_method_signature: PostgreSQLCommandExecutorFactory.newInstance(final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection)
focal_class.full_signature: public static CommandExecutor newInstance(final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection)
focal_class.identifier: newInstance
focal_class.modifiers: public static
focal_class.parameters: (final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection)
focal_class.return: CommandExecutor
focal_class.signature: CommandExecutor newInstance(final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection)
focal_method.body: public static CommandExecutor newInstance(final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection) {
          log.debug("Execute packet type: {}, value: {}", commandPacketType, commandPacket);
          switch (commandPacketType) {
              case QUERY:
                  return new PostgreSQLComQueryExecutor((PostgreSQLComQueryPacket) commandPacket, backendConnection);
              case PARSE:
                  return new PostgreSQLComParseExecutor((PostgreSQLComParsePacket) commandPacket, backendConnection);
              case BIND:
                  return new PostgreSQLComBindExecutor((PostgreSQLComBindPacket) commandPacket, backendConnection);
              case DESCRIBE:
                  return new PostgreSQLComDescribeExecutor();
              case EXECUTE:
                  return new PostgreSQLComExecuteExecutor();
              case SYNC:
                  return new PostgreSQLComSyncExecutor();
              case TERMINATE:
                  return new PostgreSQLComTerminationExecutor();
              default:
                  return new PostgreSQLUnsupportedCommandExecutor();
          }
      }
focal_method.class_method_signature: PostgreSQLCommandExecutorFactory.newInstance(final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection)
focal_method.full_signature: public static CommandExecutor newInstance(final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection)
focal_method.identifier: newInstance
focal_method.invocations: debug
focal_method.modifiers: public static
focal_method.parameters: (final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection)
focal_method.return: CommandExecutor
focal_method.signature: CommandExecutor newInstance(final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLCommandPacket commandPacket, final BackendConnection backendConnection)