<commit_before>package org.flymine.sql.logging;

import junit.framework.*;
import java.sql.*;
import javax.sql.*;
import java.io.IOException;

public class DatabaseWriterTest extends TestCase
{
    DataSource source;
    Connection con;
    DatabaseWriter writer;

    public DatabaseWriterTest(String arg1) {
        super(arg1);
    }

    protected void setUp() throws Exception {
        // Get a connection from the pool
        org.postgresql.jdbc3.Jdbc3PoolingDataSource source = new org.postgresql.jdbc3.Jdbc3PoolingDataSource();
        source.setServerName("galadriel.flymine.org");
        source.setDatabaseName("test");
        source.setUser("andy");
        source.setPassword("<PASSWORD>");
        source.setMaxConnections(1);
        con = source.getConnection();

        writer = new DatabaseWriter(con, "table1");
    }

    protected void tearDown() throws Exception {
        // return con to pool
        con.close();
    }
<commit_msg>Uses ConnectionFactory to obtain a connection to a named database<commit_after>package org.flymine.sql.logging;

import junit.framework.*;
import java.sql.*;
import javax.sql.*;
import java.io.IOException;
import org.flymine.sql.ConnectionFactory;

public class DatabaseWriterTest extends TestCase
{
    Connection con;
    DatabaseWriter writer;

    public DatabaseWriterTest(String arg1) {
        super(arg1);
    }

    protected void setUp() throws Exception {
        con = ConnectionFactory.getConnection("db.unittest");
        writer = new DatabaseWriter(con, "table1");
    }

    protected void tearDown() throws Exception {
        // return con to pool
        con.close();
    }

{'fraction_non_alphanumeric': 0.10157194679564692, 'fraction_numerical': 0.006650544135429262, 'mean_word_length': 3.106699751861042, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5396673', 'n_tokens_mistral': 456, 'n_tokens_neox': 445, 'n_words': 116}