<commit_before>package br.com.jq.syncthia.bdcreator;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import br.com.jq.syncthia.bdcreator.annotations.AnnotationsUtils;
import br.com.jq.syncthia.bdcreator.columnset.TableKey;
import br.com.jq.syncthia.bdcreator.sample.SampleTableAIPK;
import br.com.jq.syncthia.bdcreator.sample.SampleTableNameledKey;
import br.com.jq.syncthia.bdcreator.sample.SampleTableNamelessKey;
import br.com.jq.syncthia.bdcreator.table.Table;

/**
 * Unit test for simple App.
 */
public class TableKeyMetadataTest extends TestCase {
	
	/**
	 * Create the test case
	 *
	 * @param testName
	 *            name of the test case
	 */
	public TableKeyMetadataTest(String testName) {
		super(testName);
	}

	/**
	 * @return the suite of tests being tested
	 */
	public static Test suite() {
		return new TestSuite(TableKeyMetadataTest.class);
	}

	public void testAIPK() {
		Table t = new SampleTableAIPK();
		
		TableKey k = t.getPrimaryKey();
		
		assertEquals(1, k.getColumns().size());
		assertEquals(t.getColumn("PK"), k.getColumn("PK"));
		assertEquals(AnnotationsUtils.invalidString, k.getName());
		assertEquals("", t.listKeyMetadata(new StringBuilder()).toString());<commit_msg>So, the name is null after all...<commit_after>package br.com.jq.syncthia.bdcreator;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import br.com.jq.syncthia.bdcreator.columnset.TableKey;
import br.com.jq.syncthia.bdcreator.sample.SampleTableAIPK;
import br.com.jq.syncthia.bdcreator.sample.SampleTableNameledKey;
import br.com.jq.syncthia.bdcreator.sample.SampleTableNamelessKey;
import br.com.jq.syncthia.bdcreator.table.Table;

/**
 * Unit test for simple App.
 */
public class TableKeyMetadataTest extends TestCase {
	
	/**
	 * Create the test case
	 *
	 * @param testName
	 *            name of the test case
	 */
	public TableKeyMetadataTest(String testName) {
		super(testName);
	}

	/**
	 * @return the suite of tests being tested
	 */
	public static Test suite() {
		return new TestSuite(TableKeyMetadataTest.class);
	}

	public void testAIPK() {
		Table t = new SampleTableAIPK();
		
		TableKey k = t.getPrimaryKey();
		
		assertEquals(1, k.getColumns().size());
		assertEquals(t.getColumn("PK"), k.getColumn("PK"));
		assertEquals(null, k.getName());
		assertEquals("", t.listKeyMetadata(new StringBuilder()).toString());
{'fraction_non_alphanumeric': 0.1272577996715928, 'fraction_numerical': 0.0008210180623973727, 'mean_word_length': 4.476404494382022, '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': '5326270', 'n_tokens_mistral': 858, 'n_tokens_neox': 807, 'n_words': 159}