<commit_before>package edu.hku.sdb.connect;

import edu.hku.sdb.driver.SdbDriver;
import junit.framework.TestCase;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

public class ConnectionManagerTest extends TestCase {

    public void setUp() throws Exception {
        super.setUp();
        SdbDriver.main(null);
    }

    public void tearDown() throws Exception {

    }

    public void testGetConnectionService() throws Exception {
        ConnectionService connectionService = null;
        try {
            connectionService = (ConnectionService) Naming.lookup("//localhost/ConnectionService");
        } catch (NotBoundException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        assertNotNull(connectionService);
    }

    public void testGetConnection() throws Exception {
        ConnectionService connectionService = null;
        try {
            connectionService = (ConnectionService) Naming.lookup("//localhost/ConnectionService");
        } catch (NotBoundException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        assertNotNull(connectionService.getConnection());
    }
    

}<commit_msg>+ Add an testcase for createstatement remotely.<commit_after>package edu.hku.sdb.connect;

import edu.hku.sdb.driver.SdbDriver;
import junit.framework.TestCase;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

public class ConnectionManagerTest extends TestCase {

    public void setUp() throws Exception {
        super.setUp();
        SdbDriver.main(null);
    }

    public void tearDown() throws Exception {

    }

    public void testGetConnectionService() throws Exception {
        ConnectionService connectionService = null;
        try {
            connectionService = (ConnectionService) Naming.lookup("//localhost/ConnectionService");
        } catch (NotBoundException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        assertNotNull(connectionService);
    }

    public void testGetConnection() throws Exception {
        ConnectionService connectionService = null;
        try {
            connectionService = (ConnectionService) Naming.lookup("//localhost/ConnectionService");
        } catch (NotBoundException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        }

        Connection connection = connectionService.getConnection();
        assertNotNull(connection);
    }

    public void testGetStatement() throws Exception {
        ConnectionService connectionService = null;
        try {
            connectionService = (ConnectionService) Naming.lookup("//localhost/ConnectionService");
        } catch (NotBoundException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        }

        Statement statement = connectionService.getConnection().createStatement();
        assertNotNull(statement);
    }





}
{'fraction_non_alphanumeric': 0.09371584699453551, 'fraction_numerical': 0.0, 'mean_word_length': 2.58921568627451, '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': '1370657', 'n_tokens_mistral': 898, 'n_tokens_neox': 877, 'n_words': 199}