<commit_before>package org.jcouchdb.db;

import static org.easymock.EasyMock.contains;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.jcouchdb.document.Attachment;
import org.jcouchdb.document.BaseDocument;
import org.jcouchdb.document.DesignDocument;
import org.jcouchdb.document.Document;
import org.jcouchdb.document.DocumentInfo;
import org.jcouchdb.document.ValueAndDocumentRow;
import org.jcouchdb.document.ValueRow;
import org.jcouchdb.document.View;
import org.jcouchdb.document.ViewAndDocumentsResult;
import org.jcouchdb.document.ViewResult;
import org.jcouchdb.exception.DataAccessException;
import org.jcouchdb.exception.NotFoundException;
import org.jcouchdb.exception.UpdateConflictException;
import org.jcouchdb.exception.DocumentValidationException;
import org.junit.Test;
import org.svenson.JSON;

/**
 * Runs tests against a real couchdb database running on localhost
 *
 * @author shelmberger
 */
public class LocalDatabaseTestCase
{
    private JSON jsonGenerator = new JSON();

    private final static String COUCHDB_HOST = "localhost";

    private final static int COUCHDB_PORT = Server.DEFAULT_PORT;

    private static final String TESTDB_NAME = "jcouchdb_test";

    private static final String MY_FOO_DOC_ID = "myFoo/DocId";

    private static final String BY_VALUE_FUNCTION = "function(doc) { if (doc.type == 'foo') { emit(doc.value,doc); }  }";

    private static final String COMPLEX_KEY_FUNCTION = "function(doc) { if (doc.type == 'foo') { emit([1,{\"value\":doc.value}],doc); }  }";

    protected static Logger log = Logger.getLogger(LocalDatabaseTestCase.class);

    public static Database createDatabaseForTest()
    {<commit_msg>add missing import. Fixes Issue #21.<commit_after>package org.jcouchdb.db;

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

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.jcouchdb.document.Attachment;
import org.jcouchdb.document.BaseDocument;
import org.jcouchdb.document.DesignDocument;
import org.jcouchdb.document.Document;
import org.jcouchdb.document.DocumentInfo;
import org.jcouchdb.document.ValueAndDocumentRow;
import org.jcouchdb.document.ValueRow;
import org.jcouchdb.document.View;
import org.jcouchdb.document.ViewAndDocumentsResult;
import org.jcouchdb.document.ViewResult;
import org.jcouchdb.exception.DataAccessException;
import org.jcouchdb.exception.DocumentValidationException;
import org.jcouchdb.exception.NotFoundException;
import org.jcouchdb.exception.UpdateConflictException;
import org.junit.Ignore;
import org.junit.Test;
import org.svenson.JSON;

/**
 * Runs tests against a real couchdb database running on localhost
 *
 * @author shelmberger
 */
public class LocalDatabaseTestCase
{
    private JSON jsonGenerator = new JSON();

    private final static String COUCHDB_HOST = "localhost";

    private final static int COUCHDB_PORT = Server.DEFAULT_PORT;

    private static final String TESTDB_NAME = "jcouchdb_test";

    private static final String MY_FOO_DOC_ID = "myFoo/DocId";

    private static final String BY_VALUE_FUNCTION = "function(doc) { if (doc.type == 'foo') { emit(doc.value,doc); }  }";

    private static final String COMPLEX_KEY_FUNCTION = "function(doc) { if (doc.type == 'foo') { emit([1,{\"value\":doc.value}],doc); }  }";

    protected static Logger log = Logger.getLogger(LocalDatabaseTestCase.class);

    public static Database createDatabaseForTest()
    {
{'fraction_non_alphanumeric': 0.10031347962382445, 'fraction_numerical': 0.0013434841021047917, 'mean_word_length': 5.6079881656804735, 'pattern_counts': {'":': 2, '<': 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': '4662039', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1333, 'n_words': 301}