<commit_before>/*
 * Copyright (C) 2013  <NAME>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as
 *  published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package c5db.client;

import com.dyuproject.protostuff.ByteString;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Test;

import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

public class TestInOrderScan extends Populator {
  private static ByteString tableName =
      ByteString.copyFrom(Bytes.toBytes("tableName"));

  byte[] cf = Bytes.toBytes("cf");

  public TestInOrderScan() throws IOException, InterruptedException {
    super();
    }

  @Test
  public void testInOrderScan() throws IOException, InterruptedException, TimeoutException, ExecutionException {
    String[] args = {Integer.toString(getRegionServerPort())};
    main(args);

    C5Table table = new C5Table(tableName, getRegionServerPort());

    Result result = null;
    ResultScanner scanner;

    scanner = table.getScanner(cf);
    byte[] previousRow = {};
    int counter = 0;
    do {
      if (result != null) {
        previousRow = result.getRow();
      }
      result = scanner.next();

      try {
        if (Bytes.compareTo(result.getRow(), previousRow) < 1) {
          System.out.println(counter);
          System.exit(1);
        }
      } catch (NullPointerException e){
        e.toString();
      }

    } while (result != null);
    table.close();
  }
}<commit_msg>C5-79. Cleanup TestInOrderScan test to fix build.<commit_after>/*
 * Copyright (C) 2013  <NAME>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as
 *  published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package c5db.client;

import c5db.MiniClusterBase;
import com.dyuproject.protostuff.ByteString;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Test;

import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;

import static junit.framework.TestCase.assertFalse;

public class TestInOrderScan extends MiniClusterBase {
  private static ByteString tableName = ByteString.copyFrom(Bytes.toBytes("tableName"));

  byte[] cf = Bytes.toBytes("cf");

  public TestInOrderScan() throws IOException, InterruptedException {
    super();
  }

  @Test
  public void testInOrderScan() throws IOException, InterruptedException, TimeoutException, ExecutionException {
    C5Table table = new C5Table(tableName, getRegionServerPort());

    Result result = null;
    ResultScanner scanner;

    scanner = table.getScanner(cf);
    byte[] previousRow = {};
    do {
      if (result != null) {
        previousRow = result.getRow();
      }
      result = scanner.next();
      if (result != null) assertFalse(Bytes.compareTo(result.getRow(), previousRow) < 1);
    } while (result != null);
    table.close();
  }
}
{'fraction_non_alphanumeric': 0.09770522829429856, 'fraction_numerical': 0.0056777856635912, 'mean_word_length': 3.6666666666666665, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6035220', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1182, 'n_words': 393}