<commit_before>/*
 *      Copyright (C) 2012-2015 DataStax Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
package com.datastax.driver.core;

import com.datastax.driver.core.exceptions.InvalidQueryException;
import com.google.common.base.Function;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.Collection;
import java.util.concurrent.*;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

public class AsyncQueryTest extends CCMTestsSupport {

    Logger logger = LoggerFactory.getLogger(AsyncQueryTest.class);

    @DataProvider(name = "keyspace")
    public static Object[][] keyspace() {
        return new Object[][]{{"asyncquerytest"}, {"\"AsyncQueryTest\""}};
    }

    @Override
    public void onTestContextInitialized() {
        for (Object[] objects : keyspace()) {
            String keyspace = (String) objects[0];
            execute(
                    String.format("create keyspace %s WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}", keyspace),
                    String.format("create table %s.foo(k int, v int, primary key (k, v))", keyspace));
            for (int v = 0; v < 100; v++)
                execute(String.format("insert into %s.foo (k, v) values (1, %d)", keyspace, v));<commit_msg>Small tweak to AsyncQueryTest for existing tests<commit_after>/*
 *      Copyright (C) 2012-2015 DataStax Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
package com.datastax.driver.core;

import com.datastax.driver.core.exceptions.InvalidQueryException;
import com.google.common.base.Function;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.Collection;
import java.util.concurrent.*;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

public class AsyncQueryTest extends CCMTestsSupport {

    Logger logger = LoggerFactory.getLogger(AsyncQueryTest.class);

    @DataProvider(name = "keyspace")
    public static Object[][] keyspace() {
        return new Object[][]{{"asyncquerytest"}, {"\"AsyncQueryTest\""}};
    }

    @Override
    public void onTestContextInitialized() {
        for (Object[] objects : keyspace()) {
            String keyspace = (String) objects[0];
            execute(
                    String.format("create keyspace %s WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}", keyspace),
                    String.format("create table %s.foo(k int, v int, primary key (k, v))", keyspace));
            for (int v = 1; v <= 100; v++)
                execute(String.format("insert into %s.foo (k, v) values (1, %d)", keyspace, v));
{'fraction_non_alphanumeric': 0.1130215497478221, 'fraction_numerical': 0.009628610729023384, 'mean_word_length': 3.568586387434555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6890436', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1214, 'n_words': 383}