<commit_before>/*
 * ****************************************************************************
 *   Copyright 2010 University of California Santa Cruz                       *
 *                                                                            *
 *   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 edu.ucsc.dbtune.core.metadata.extraction;

import edu.ucsc.dbtune.core.DatabaseConnection;
import edu.ucsc.dbtune.core.metadata.Catalog;
import edu.ucsc.dbtune.core.metadata.Table;
import edu.ucsc.dbtune.core.metadata.Column;
import edu.ucsc.dbtune.core.metadata.Index;
import edu.ucsc.dbtune.util.SQLScriptExecuter;

import java.util.Properties;
import java.util.List;

import org.junit.Test;
import org.junit.BeforeClass;
import org.junit.AfterClass;

import static edu.ucsc.dbtune.core.JdbcDatabaseConnectionManager.DATABASE;
import static edu.ucsc.dbtune.core.JdbcDatabaseConnectionManager.DRIVER;
import static edu.ucsc.dbtune.core.JdbcDatabaseConnectionManager.URL;
import static edu.ucsc.dbtune.core.JdbcDatabaseConnectionManager.USERNAME;
import static edu.ucsc.dbtune.core.JdbcDatabaseConnectionManager.PASSWORD;
import static edu.ucsc.dbtune.core.JdbcDatabaseConnectionManager.makeDatabaseConnectionManager;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/**
 * Test for the metadata extraction package.
 * <p>
 * The test assumes that a database has been configured in the <code>build.properties</code> file.  
 * Depending on the value for the <code>test.dbms.url</code> property, the test instantiates and 
 * calls the appropriate JDBCExtractorTest implementation.
 * <p>
 * Also, the file <code>movies.sql</code> in folder <code>test.dbms.script.folder</code> is expected 
 * to exist and contain the DBMS-dependant SQL statements that create and load the Movies database.  
 * <p>
 * Lastly, properties <code>test.dbms.username</code> and <code>test.dbms.password</code> are used 
 * to create new connections to the database, so they must also be provided.
 * <p>
 * The test fails entirely if the above two conditions aren't met.
 *
 * @author <EMAIL> (<NAME>)
 */
public class MetaDataExtractorTest
{
    private static DatabaseConnection   con;
    private static GenericJDBCExtractor extractor;
    private static Catalog              catalog;<commit_msg>fixed some imports on this class<commit_after>/*
 * ****************************************************************************
 *   Copyright 2010 University of California Santa Cruz                       *
 *                                                                            *
 *   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 edu.ucsc.dbtune.core.metadata.extraction;

import edu.ucsc.dbtune.core.DatabaseConnection;
import edu.ucsc.dbtune.core.metadata.Catalog;
import edu.ucsc.dbtune.core.metadata.Column;
import edu.ucsc.dbtune.core.metadata.Index;
import edu.ucsc.dbtune.core.metadata.Table;
import edu.ucsc.dbtune.util.SQLScriptExecuter;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.util.List;
import java.util.Properties;

import static edu.ucsc.dbtune.core.JdbcConnectionManager.*;
import static org.junit.Assert.*;

/**
 * Test for the metadata extraction package.
 * <p>
 * The test assumes that a database has been configured in the <code>build.properties</code> file.  
 * Depending on the value for the <code>test.dbms.url</code> property, the test instantiates and 
 * calls the appropriate JDBCExtractorTest implementation.
 * <p>
 * Also, the file <code>movies.sql</code> in folder <code>test.dbms.script.folder</code> is expected 
 * to exist and contain the DBMS-dependant SQL statements that create and load the Movies database.  
 * <p>
 * Lastly, properties <code>test.dbms.username</code> and <code>test.dbms.password</code> are used 
 * to create new connections to the database, so they must also be provided.
 * <p>
 * The test fails entirely if the above two conditions aren't met.
 *
 * @author <EMAIL> (<NAME>)
 */
public class MetaDataExtractorTest
{
    private static DatabaseConnection   con;
    private static GenericJDBCExtractor extractor;
    private static Catalog              catalog;
{'fraction_non_alphanumeric': 0.1272965879265092, 'fraction_numerical': 0.0026246719160104987, 'mean_word_length': 2.484, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3318085', 'n_tokens_mistral': 1542, 'n_tokens_neox': 1495, 'n_words': 483}