<commit_before>package ca.mcgill.mymcgill.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.junit.Test;

import android.test.AndroidTestCase;

public class ConnectionTest extends AndroidTestCase{
	
	@Test
	public static void testGetUrl() throws IOException{
		Connection conn = Connection.getInstance();
		String actual = conn.getUrl(Connection.minervaHomepage);
		
		String file = "res/raw/minerva_home.txt";
		InputStream in = conn.getClass().getClassLoader().getResourceAsStream(file);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		
		String text ="";
		StringBuilder sb = new StringBuilder();
		
		while((text = reader.readLine()) != null){
			sb.append(text);
		}
		
		String expected = sb.toString();<commit_msg>Connection test class added and unit test done<commit_after>package ca.mcgill.mymcgill.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.junit.Test;

import ca.mcgill.mymcgill.activity.LoginActivity;

import android.test.AndroidTestCase;
import android.widget.ListView;

public class ConnectionTest extends AndroidTestCase{
	
	public LoginActivity mActivityClass;
	
	protected void setUp() throws Exception {
		super.setUp();
		mActivityClass = this.getActivity();
	}
	
	@Test
	public static void testGetUrl() throws IOException{
		Connection conn = Connection.getInstance();
		String actual = conn.getUrl(Connection.minervaHomepage);
		
		String file = "res/raw/minerva_home.txt";
		InputStream in = conn.getClass().getClassLoader().getResourceAsStream(file);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		
		String text ="";
		StringBuilder sb = new StringBuilder();
		
		while((text = reader.readLine()) != null){
			sb.append(text);
		}
		
		String expected = sb.toString();
{'fraction_non_alphanumeric': 0.10858324715615306, 'fraction_numerical': 0.0, 'mean_word_length': 5.084905660377358, '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': '6100515', 'n_tokens_mistral': 606, 'n_tokens_neox': 550, 'n_words': 133}