<commit_before>package wikipedia;

import org.junit.Test;
import org.xml.sax.InputSource;
import wikipedia.schemas.PageMetadata;
import wikipedia.schemas.RevisionContent;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertEquals;

/**
 * wikipedia.Wiki2AvroXmlParserTest
 */
public class Wiki2AvroXmlParserTest {
  @Test
  public void test1() throws Wiki2AvroException {
    String testFile = "/test1.xml";
    List<PageMetadata> pages = new ArrayList<>();
    List<RevisionContent> revisions = new ArrayList<>();
    runTest(testFile, pages, revisions);
    assertEquals(2, pages.size());
    assertEquals(6, revisions.size());
  }

  private void runTest(String testFile, List<PageMetadata> pages, List<RevisionContent> revisions)
      throws Wiki2AvroException {
    InputStream inputStream = this.getClass().getResourceAsStream(testFile);
    InputStreamReader inputStreamReader = new InputStreamReader(inputStream);<commit_msg>Revert page filtering by namespace.<commit_after>package wikipedia;

import org.junit.Test;
import org.xml.sax.InputSource;
import wikipedia.schemas.PageMetadata;
import wikipedia.schemas.RevisionContent;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertEquals;

/**
 * wikipedia.Wiki2AvroXmlParserTest
 */
public class Wiki2AvroXmlParserTest {
  @Test
  public void test1() throws Wiki2AvroException {
    String testFile = "/test1.xml";
    List<PageMetadata> pages = new ArrayList<>();
    List<RevisionContent> revisions = new ArrayList<>();
    runTest(testFile, pages, revisions);
    assertEquals(3, pages.size());
    assertEquals(7, revisions.size());
  }

  private void runTest(String testFile, List<PageMetadata> pages, List<RevisionContent> revisions)
      throws Wiki2AvroException {
    InputStream inputStream = this.getClass().getResourceAsStream(testFile);
    InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
{'fraction_non_alphanumeric': 0.10382775119617225, 'fraction_numerical': 0.007655502392344498, 'mean_word_length': 5.453703703703703, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1686772', 'n_tokens_mistral': 624, 'n_tokens_neox': 578, 'n_words': 135}