<commit_before>package py4j;

import static org.junit.Assert.assertEquals;

import java.io.BufferedReader;
import java.io.BufferedWriter;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ProxyTest {

	private GatewayServer gServer;
	private PythonClient pClient;

	@Before
	public void setup() {
		GatewayServer.turnLoggingOn();
		gServer = new GatewayServer(new InterfaceEntry());
		pClient = new PythonClient();
		gServer.start();
		pClient.startProxy();
		try {
			Thread.sleep(250);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@After
	public void teardown() {
		gServer.shutdown();
		pClient.stopProxy();
		try {
			Thread.sleep(250);
		} catch (Exception e) {
			e.printStackTrace();
		}
		GatewayServer.turnLoggingOff();
	}
	
	@Test
	public void testSayHello() {
		String message = "c\nt\nsayHello\npp123;py4j.IHello\ne\n";
		pClient.nextProxyReturnMessage = "ysHello World";
		pClient.sendMesage(message);
		assertEquals("p123\nhello\ne\n", pClient.lastProxyMessage);
		assertEquals("ysHello World", pClient.lastReturnMessage);
	}

}

interface IHello {

	public String hello();

}

class InterfaceEntry {

	public String sayHello(IHello obj) {
		return obj.hello();
	}
<commit_msg>Added todo related to #12<commit_after>package py4j;

import static org.junit.Assert.assertEquals;

import java.io.BufferedReader;
import java.io.BufferedWriter;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ProxyTest {

	private GatewayServer gServer;
	private PythonClient pClient;

	@Before
	public void setup() {
		GatewayServer.turnLoggingOn();
		gServer = new GatewayServer(new InterfaceEntry());
		pClient = new PythonClient();
		gServer.start();
		pClient.startProxy();
		try {
			Thread.sleep(250);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@After
	public void teardown() {
		gServer.shutdown();
		pClient.stopProxy();
		try {
			Thread.sleep(250);
		} catch (Exception e) {
			e.printStackTrace();
		}
		GatewayServer.turnLoggingOff();
	}
	
	@Test
	public void testSayHello() {
		String message = "c\nt\nsayHello\npp123;py4j.IHello\ne\n";
		pClient.nextProxyReturnMessage = "ysHello World";
		pClient.sendMesage(message);
		assertEquals("p123\nhello\ne\n", pClient.lastProxyMessage);
		assertEquals("ysHello World", pClient.lastReturnMessage);
		
		// TODO
		// 1- Convert String with \n (currently not converted!!!)
		// 2- Test with errors
		// 3- Test with parameters (e.g., hello(String, int, Object already in gateway)
	}

}

interface IHello {

	public String hello();

}

class InterfaceEntry {

	public String sayHello(IHello obj) {
		return obj.hello();
	}

{'fraction_non_alphanumeric': 0.12556053811659193, 'fraction_numerical': 0.01233183856502242, 'mean_word_length': 4.187984496124031, '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': '2628781', 'n_tokens_mistral': 996, 'n_tokens_neox': 887, 'n_words': 200}