<commit_before>package gs.nick.tests;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import junit.framework.TestCase;

public class MySQLConnectionTest extends TestCase {

    public void testConnect() {
        String dbUrl = "jdbc:mysql://" + System.getenv("DB_HOST") + "/" + System.getenv("DB_NAME");
        String dbClass = "com.mysql.jdbc.Driver";
        String query = "SELECT  name FROM systems ORDER BY company asc;";
        String username = System.getenv("DB_USER");
        String password = System.getenv("DB_PASS");
        try {

            Class.forName(dbClass);
            Connection connection = DriverManager.getConnection(dbUrl,
                    username, password);
            Statement statement = connection.createStatement();
            ResultSet resultSet = statement.executeQuery(query);
            while (resultSet.next()) {
                String systemName = resultSet.getString(1);
                System.out.println("System name : " + systemName);
            }
            connection.close();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}<commit_msg>trying to get the connection to work in a unit test<commit_after>package gs.nick.tests;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import junit.framework.TestCase;
import org.junit.Test;

public class MySQLConnectionTest extends TestCase {

    @Test
    public void testConnect() {
        String host,name,username,password,answer;
        answer = "--fail--";
        
        // ENV
        host = System.getenv("DB_HOST");
        name = System.getenv("DB_NAME");
        username = System.getenv("DB_USER");
        password = System.getenv("DB_PASS");
        
        String query = "SELECT name FROM systems WHERE id=10;";
        String dbUrl = "jdbc:mysql://" + host + "/" + name;
        String dbClass = "com.mysql.jdbc.Driver";
        
        try {

            Class.forName(dbClass);
            Connection connection = DriverManager.getConnection(
                    dbUrl,
                    username,
                    password
            );
            Statement statement = connection.createStatement();
            ResultSet resultSet = statement.executeQuery(query);
            if (resultSet.next()) {
                answer = resultSet.getString(1);
            }
            connection.close();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        assertEquals("Dreamcast", answer);
    }
}
{'fraction_non_alphanumeric': 0.1086115992970123, 'fraction_numerical': 0.00140597539543058, 'mean_word_length': 2.1343612334801763, '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': '1884079', 'n_tokens_mistral': 743, 'n_tokens_neox': 722, 'n_words': 169}