<commit_before>package org.sample.elastic.services.db;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import org.sample.elastic.services.core.ElasticSampleConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;

public class ElasticSearchTestCreateIndex {

    private ElasticSampleConfiguration esConfig;
    private ElasticSearch esClient;
    private Logger defaultLogger;
    private String indexName;

    @Before
    public void setup() throws Exception {
        defaultLogger = LoggerFactory.getLogger(ElasticSearch.class);
        esConfig = new ElasticSampleConfiguration();
        esConfig.setElasticsearchClientNodeName("javaclient");
        esConfig.setElasticsearchClientPort("10080");
        esConfig.setElasticsearchCluster("elasticsearch-local");
        esConfig.setElasticsearchHost("localhost[9300-9400]");
        esClient = new ElasticSearch(esConfig);
        esClient.start();
        indexName = "products" + new Date().getTime();
    }

    @Test
    public void testCreateIndex() throws Exception {
        boolean indexResult = esClient.createIndex(indexName,"english","product","{name:string}",defaultLogger);
        assertThat(indexResult).isEqualTo(true);
    }

    @After
    public void teardown() throws Exception {
        esClient.deleteIndex(indexName, defaultLogger);
    }<commit_msg>fixed testcase<commit_after>package org.sample.elastic.services.db;

import junit.framework.TestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import org.sample.elastic.services.core.ElasticSampleConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;

public class ElasticSearchTestCreateIndex extends TestCase {

    private ElasticSampleConfiguration esConfig;
    private ElasticSearch esClient;
    private Logger defaultLogger;
    private String indexName;

    @Before
    public void setup() throws Exception {
        defaultLogger = LoggerFactory.getLogger(ElasticSearch.class);
        esConfig = new ElasticSampleConfiguration();
        esConfig.setElasticsearchClientNodeName("javaclient");
        esConfig.setElasticsearchClientPort("10080");
        esConfig.setElasticsearchCluster("elasticsearch-local");
        esConfig.setElasticsearchHost("localhost[9300-9400]");
        esClient = new ElasticSearch(esConfig);
        esClient.start();
        indexName = "products" + new Date().getTime();
    }

    @Test
    public void testCreateIndex() throws Exception {
        boolean indexResult = esClient.createIndex(indexName,"english","product","{name:string}",defaultLogger);
        assertThat(indexResult).isEqualTo(true);
    }

    @After
    public void teardown() throws Exception {
        esClient.deleteIndex(indexName, defaultLogger);
    }
{'fraction_non_alphanumeric': 0.09786657636302065, 'fraction_numerical': 0.01015916017609211, 'mean_word_length': 4.200704225352113, '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': '1466955', 'n_tokens_mistral': 813, 'n_tokens_neox': 799, 'n_words': 155}