<commit_before>package nl.topicus.mssql2monetdb.test;

import static org.junit.Assert.*;
import nl.topicus.mssql2monetdb.CopyTable;

import org.junit.Assert;
import org.junit.Test;

public class CopyTableTest {

	@Test
	public void testGenerateCountQuery() {
		CopyTable table = new CopyTable();
		
		// test standard count query based on table from name
		table.setFromName("test");
		Assert.assertEquals(table.generateCountQuery(), "SELECT COUNT(*) FROM [test]");
		
		table.setFromName(null);
		
		// test a custom count query
		String customCountQuery = "SELECT COUNT(*) FROM myQuery WHERE bla = 'something'";
		table.setFromCountQuery(customCountQuery);		
		Assert.assertEquals(table.generateCountQuery(), customCountQuery);	
	}
	
	@Test
	public void testGenerateSelectQuery () {
		CopyTable table = new CopyTable();
		
		// test standard select all query
		table.setFromName("test");
		Assert.assertEquals(table.generateSelectQuery(), "SELECT * FROM [test]");
		
		// test custom columns select query
		table.setFromColumns("col1, col2");
		Assert.assertEquals(table.generateSelectQuery(), "SELECT col1, col2 FROM [test]");
		
		table.setFromName(null);
		table.setFromColumns(null);
		
		// test custom select query
		String query = "SELECT col1, col2 FROM myQuery WHERE bla = 'something'";
		table.setFromQuery(query);
		Assert.assertEquals(table.generateSelectQuery(), query);
	}

}<commit_msg>Small improvement in unit test<commit_after>package nl.topicus.mssql2monetdb.test;

import nl.topicus.mssql2monetdb.CopyTable;

import org.junit.Assert;
import org.junit.Test;

public class CopyTableTest {

	@Test
	public void testGenerateCountQuery() {
		CopyTable table = new CopyTable();
		
		// test standard count query based on table from name
		table.setFromName("test");
		Assert.assertEquals(table.generateCountQuery(), "SELECT COUNT(*) FROM [test]");
		
		table.setFromName(null);
		
		// test a custom count query
		table.setFromCountQuery("SELECT COUNT(*) FROM myQuery WHERE bla = 'something'");		
		Assert.assertEquals(table.generateCountQuery(), "SELECT COUNT(*) FROM myQuery WHERE bla = 'something'");	
	}
	
	@Test
	public void testGenerateSelectQuery () {
		CopyTable table = new CopyTable();
		
		// test standard select all query
		table.setFromName("test");
		Assert.assertEquals(table.generateSelectQuery(), "SELECT * FROM [test]");
		
		// test custom columns select query
		table.setFromColumns("col1, col2");
		Assert.assertEquals(table.generateSelectQuery(), "SELECT col1, col2 FROM [test]");
		
		table.setFromName(null);
		table.setFromColumns(null);
		
		// test custom select query
		table.setFromQuery("SELECT col1, col2 FROM myQuery WHERE bla = 'something'");
		Assert.assertEquals(table.generateSelectQuery(), "SELECT col1, col2 FROM myQuery WHERE bla = 'something'");
	}

}
{'fraction_non_alphanumeric': 0.12001424501424501, 'fraction_numerical': 0.00641025641025641, 'mean_word_length': 4.709349593495935, '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': '6815266', 'n_tokens_mistral': 917, 'n_tokens_neox': 822, 'n_words': 218}