test_class.declarator: selectStatementContext
test_class.modifier: private
test_class.original_string: private SelectStatementContext selectStatementContext;
test_class.type: SelectStatementContext
test_class.var_name: selectStatementContext
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
test_class.identifier: OrderByStreamMergedResultTest
test_case.body: @Test
      public void assertNextForSomeResultSetsEmpty() throws SQLException {
          List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
          for (int i = 0; i < 3; i++) {
              when(queryResults.get(i).getColumnName(1)).thenReturn("col1");
              when(queryResults.get(i).getColumnName(2)).thenReturn("col2");
          }
          ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
          when(queryResults.get(0).next()).thenReturn(true, false);
          when(queryResults.get(0).getValue(1, Object.class)).thenReturn("2");
          when(queryResults.get(2).next()).thenReturn(true, true, false);
          when(queryResults.get(2).getValue(1, Object.class)).thenReturn("1", "1", "3", "3");
          MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, createSchemaMetaData());
          assertTrue(actual.next());
          assertThat(actual.getValue(1, Object.class).toString(), is("1"));
          assertTrue(actual.next());
          assertThat(actual.getValue(1, Object.class).toString(), is("2"));
          assertTrue(actual.next());
          assertThat(actual.getValue(1, Object.class).toString(), is("3"));
          assertFalse(actual.next());
      }
test_case.class_method_signature: OrderByStreamMergedResultTest.assertNextForSomeResultSetsEmpty()
test_case.full_signature: @Test public void assertNextForSomeResultSetsEmpty()
test_case.identifier: assertNextForSomeResultSetsEmpty
test_case.invocations: asList mock mock mock thenReturn when getColumnName get thenReturn when getColumnName get getActualDatabaseType thenReturn when next get thenReturn when getValue get thenReturn when next get thenReturn when getValue get merge createSchemaMetaData assertTrue next assertThat toString getValue is assertTrue next assertThat toString getValue is assertTrue next assertThat toString getValue is assertFalse next
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertNextForSomeResultSetsEmpty()
focal_class.declarator: orderByItems
focal_class.modifier: private final
focal_class.original_string: private final Collection<OrderByItem> orderByItems;
focal_class.type: Collection<OrderByItem>
focal_class.var_name: orderByItems
focal_class.declarator: orderByValuesQueue
focal_class.modifier: @Getter(AccessLevel.PROTECTED)
      private final
focal_class.original_string: @Getter(AccessLevel.PROTECTED)
      private final Queue<OrderByValue> orderByValuesQueue;
focal_class.type: Queue<OrderByValue>
focal_class.var_name: orderByValuesQueue
focal_class.declarator: isFirstNext
focal_class.modifier: @Getter(AccessLevel.PROTECTED)
      private
focal_class.original_string: @Getter(AccessLevel.PROTECTED)
      private boolean isFirstNext;
focal_class.type: boolean
focal_class.var_name: isFirstNext
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResult.java
focal_class.identifier: OrderByStreamMergedResult
focal_class.class_method_signature: OrderByStreamMergedResult.OrderByStreamMergedResult(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final SchemaMetaData schemaMetaData)
focal_class.full_signature: public  OrderByStreamMergedResult(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final SchemaMetaData schemaMetaData)
focal_class.identifier: OrderByStreamMergedResult
focal_class.modifiers: public
focal_class.parameters: (final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final SchemaMetaData schemaMetaData)
focal_class.signature:  OrderByStreamMergedResult(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final SchemaMetaData schemaMetaData)
focal_class.class_method_signature: OrderByStreamMergedResult.orderResultSetsToQueue(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final SchemaMetaData schemaMetaData)
focal_class.full_signature: private void orderResultSetsToQueue(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final SchemaMetaData schemaMetaData)
focal_class.identifier: orderResultSetsToQueue
focal_class.modifiers: private
focal_class.parameters: (final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final SchemaMetaData schemaMetaData)
focal_class.return: void
focal_class.signature: void orderResultSetsToQueue(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final SchemaMetaData schemaMetaData)
focal_class.class_method_signature: OrderByStreamMergedResult.next()
focal_class.full_signature: @Override public boolean next()
focal_class.identifier: next
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean next()
focal_class.superclass: extends StreamMergedResult
focal_method.body: @Override
      public boolean next() throws SQLException {
          if (orderByValuesQueue.isEmpty()) {
              return false;
          }
          if (isFirstNext) {
              isFirstNext = false;
              return true;
          }
          OrderByValue firstOrderByValue = orderByValuesQueue.poll();
          if (firstOrderByValue.next()) {
              orderByValuesQueue.offer(firstOrderByValue);
          }
          if (orderByValuesQueue.isEmpty()) {
              return false;
          }
          setCurrentQueryResult(orderByValuesQueue.peek().getQueryResult());
          return true;
      }
focal_method.class_method_signature: OrderByStreamMergedResult.next()
focal_method.full_signature: @Override public boolean next()
focal_method.identifier: next
focal_method.invocations: isEmpty poll next offer isEmpty setCurrentQueryResult getQueryResult peek
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: boolean
focal_method.signature: boolean next()