<commit_before>package org.jcouchdb.util;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.log4j.Logger;
import org.jcouchdb.db.LocalDatabaseTestCase;
import org.jcouchdb.document.DesignDocument;
import org.junit.Test;


public class CouchDBUpdaterTestCase
{
    private static Logger log = Logger.getLogger(CouchDBUpdaterTestCase.class);

    @Test

    public void thatDesignDocumentReadingWorks() throws IOException
    {
        CouchDBUpdater couchDBUpdater = new CouchDBUpdater();
        couchDBUpdater.setDesignDocumentDir(new File("test/org/jcouchdb/util/test-views/"));
        couchDBUpdater.setDatabase(LocalDatabaseTestCase.createDatabaseForTest());


        List<DesignDocument> docs = couchDBUpdater.updateDesignDocuments();

        log.info(docs);

        assertThat(docs,is(notNullValue()));
        assertThat(docs.size(), is(2));
        assertThat(docs.get(0).getId(),is("_design/view1"));
        assertThat(docs.get(1).getId(),is("_design/view2/sub"));


    }

}
<commit_msg>don't regard order of documents<commit_after>package org.jcouchdb.util;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.log4j.Logger;
import org.jcouchdb.db.LocalDatabaseTestCase;
import org.jcouchdb.document.DesignDocument;
import org.junit.Test;


public class CouchDBUpdaterTestCase
{
    private static Logger log = Logger.getLogger(CouchDBUpdaterTestCase.class);

    @Test

    public void thatDesignDocumentReadingWorks() throws IOException
    {
        CouchDBUpdater couchDBUpdater = new CouchDBUpdater();
        couchDBUpdater.setDesignDocumentDir(new File("test/org/jcouchdb/util/test-views/"));
        couchDBUpdater.setDatabase(LocalDatabaseTestCase.createDatabaseForTest());


        List<DesignDocument> docs = couchDBUpdater.updateDesignDocuments();

        log.info(docs);

        assertThat(docs,is(notNullValue()));
        assertThat(docs.size(), is(2));
        
        assertThat(docs.get(0).getId(),anyOf( is("_design/view1"), is("_design/view2/sub")));
        assertThat(docs.get(1).getId(),anyOf( is("_design/view1"), is("_design/view2/sub")));
    }
}

{'fraction_non_alphanumeric': 0.11976047904191617, 'fraction_numerical': 0.005588822355289421, 'mean_word_length': 4.471615720524017, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5707702', 'n_tokens_mistral': 789, 'n_tokens_neox': 789, 'n_words': 121}