<commit_before>package voyager.quickstart.location.earthquake;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.common.SolrInputDocument;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Matchers;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

import voyager.api.domain.model.entry.DexField;
import voyager.jobs.JobSubmitterList;

public class EarthquakesLocationTest {
  
  @Test
  public void testReadIndex() throws Exception {
    JobSubmitterList jobs = new JobSubmitterList();
    SolrClient solr = Mockito.mock(SolrClient.class);
    final List<SolrInputDocument> values = new ArrayList<>();
    Mockito.when(solr.add(Matchers.any(SolrInputDocument.class))).then(new Answer<Void>() {
      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        values.add( (SolrInputDocument)invocation.getArguments()[0] );
        return null;
      }
    });
    
    EarthquakesLocation loc = new EarthquakesLocation();
    loc.setURI(new URI("http://nothing/")); // not used
    EarthquakesRunner runner = new EarthquakesRunner(loc, solr, jobs) {
      @Override
      protected InputStream openStream(URI uri) throws IOException
      {
        return EarthquakesLocationTest.class.getResourceAsStream("all_day.atom");
      }
    };
    
    runner.run();
    Assert.assertEquals(210, values.size());
    
    // make sure everything has a "pointDD" field
    for(SolrInputDocument doc : values) {
      Assert.assertNotNull(doc.getFieldValue(DexField.POINT_DD.name));
    }
  }
}<commit_msg>Replace POINT_DD with GEO<commit_after>package voyager.quickstart.location.earthquake;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.common.SolrInputDocument;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Matchers;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

import voyager.api.domain.model.entry.DexField;
import voyager.jobs.JobSubmitterList;

public class EarthquakesLocationTest {

  @Test
  public void testReadIndex() throws Exception {
    JobSubmitterList jobs = new JobSubmitterList();
    SolrClient solr = Mockito.mock(SolrClient.class);
    final List<SolrInputDocument> values = new ArrayList<>();
    Mockito.when(solr.add(Matchers.any(SolrInputDocument.class))).then(new Answer<Void>() {
      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        values.add( (SolrInputDocument)invocation.getArguments()[0] );
        return null;
      }
    });
    
    EarthquakesLocation loc = new EarthquakesLocation();
    loc.setURI(new URI("http://nothing/")); // not used
    EarthquakesRunner runner = new EarthquakesRunner(loc, solr, jobs) {
      @Override
      protected InputStream openStream(URI uri) throws IOException
      {
        return EarthquakesLocationTest.class.getResourceAsStream("all_day.atom");
      }
    };
    
    runner.run();
    Assert.assertEquals(210, values.size());
    
    // make sure everything has a "pointDD" field
    for(SolrInputDocument doc : values) {
      Assert.assertNotNull(doc.getFieldValue(DexField.GEO.name));
    }
  }
}
{'fraction_non_alphanumeric': 0.1095657110417258, 'fraction_numerical': 0.0022707919386886176, 'mean_word_length': 4.01994301994302, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7253324', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1071, 'n_words': 209}