<commit_before>package de.tblsoft.solr.pipeline.test;

import de.tblsoft.solr.pipeline.bean.Filter;
import org.junit.Assert;
import org.junit.Test;

/**
 * Created by tblsoft on 29.04.16.
 */
public class BeanTest {

    @Test
    public void testFilterBean() {
        testBean(new Filter());
    }

    void testBean(Object bean) {
        Assert.assertFalse(bean.toString().contains("@"));
    }
}<commit_msg>add bean tests for Document<commit_after>package de.tblsoft.solr.pipeline.test;

import de.tblsoft.solr.pipeline.bean.Document;
import de.tblsoft.solr.pipeline.bean.DocumentBuilder;
import de.tblsoft.solr.pipeline.bean.Filter;
import org.junit.Assert;
import org.junit.Test;

/**
 * Created by tblsoft on 29.04.16.
 */
public class BeanTest {

    @Test
    public void testFilterBean() {
        testBean(new Filter());
    }

    @Test
    public void testDocumentBean() {
        testBean(DocumentBuilder.document().create());
    }


    @Test
    public void testDeleteFieldInDocument() {
        Document document = DocumentBuilder.document().field("foo","bar").field("john", "doe").create();
        document.deleteField("foo");
        Assert.assertNull(document.getField("foo"));
        Assert.assertEquals("doe", document.getFieldValue("john"));
        Assert.assertEquals(1, document.getFields().size());

    }

    void testBean(Object bean) {
        Assert.assertFalse(bean.toString().contains("@"));
    }
}
{'fraction_non_alphanumeric': 0.1454418928322895, 'fraction_numerical': 0.009046624913013222, 'mean_word_length': 3.397553516819572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7147873', 'n_tokens_mistral': 451, 'n_tokens_neox': 433, 'n_words': 79}