<commit_before>package gov.nih.nci.cagrid.discovery.client;

import gov.nih.nci.cagrid.metadata.common.PointOfContact;
import junit.framework.TestCase;


public class DiscoveryClientUtilsTestCase extends TestCase {

	private PointOfContact nullPOC;
	private PointOfContact emptyPOC;
	private PointOfContact voidPOC;
	private PointOfContact emailPOC;
	private PointOfContact fullPOC;


	protected void setUp() throws Exception {
		super.setUp();
		nullPOC = null;
		emptyPOC = new PointOfContact();
		voidPOC = new PointOfContact("", "", "", "", "", "");
		emailPOC = new PointOfContact("", "emailV", "", "", "", "");
		fullPOC = new PointOfContact("affiliationV", "emailV", "firstNameV", "lastNameV", "phoneNumberV", "roleV");
	}


	public void testPredicateUtilNulls() {
		assertEquals("", DiscoveryClient.addNonNullPredicate("foo", "", false));
		assertEquals("", DiscoveryClient.addNonNullPredicate("foo", "  ", false));
		assertEquals("", DiscoveryClient.addNonNullPredicate("foo", "", true));
		assertEquals("", DiscoveryClient.addNonNullPredicate("foo", " ", true));
	}


	public void testPredicateUtil() {
		assertEquals(" and foo/text()='bar'", DiscoveryClient.addNonNullPredicate("foo", "bar", false));
		assertEquals(" and @foo='bar'", DiscoveryClient.addNonNullPredicate("foo", "bar", true));
	}


	public void testBuildPOCPredicateNulls() {
		assertEquals("*", DiscoveryClient.buildPOCPredicate(nullPOC));
		assertEquals("*", DiscoveryClient.buildPOCPredicate(emptyPOC));
		assertEquals("*", DiscoveryClient.buildPOCPredicate(voidPOC));
	}


	public void testBuildPOCPredicate() {
		assertTrue(DiscoveryClient.buildPOCPredicate(emailPOC).contains("email/text()='emailV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("affiliation/text()='affiliationV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("email/text()='emailV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("firstName/text()='firstNameV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("lastName/text()='lastNameV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("phoneNumber/text()='phoneNumberV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("role/text()='roleV'"));
	}


	public static void main(String[] args) {
		junit.textui.TestRunner.run(DiscoveryClientUtilsTestCase.class);
	}
}<commit_msg>*** empty log message ***<commit_after>package gov.nih.nci.cagrid.discovery.client;

import gov.nih.nci.cagrid.metadata.common.PointOfContact;
import junit.framework.TestCase;


public class DiscoveryClientUtilsTestCase extends TestCase {

	private PointOfContact nullPOC;
	private PointOfContact emptyPOC;
	private PointOfContact voidPOC;
	private PointOfContact emailPOC;
	private PointOfContact fullPOC;


	protected void setUp() throws Exception {
		super.setUp();
		nullPOC = null;
		emptyPOC = new PointOfContact();
		voidPOC = new PointOfContact("", "", "", "", "", "");
		emailPOC = new PointOfContact("", "emailV", "", "", "", "");
		fullPOC = new PointOfContact("affiliationV", "emailV", "firstNameV", "lastNameV", "phoneNumberV", "roleV");
	}


	public void testPredicateUtilNulls() {
		assertEquals("", DiscoveryClient.addNonNullPredicate("foo", "", false));
		assertEquals("", DiscoveryClient.addNonNullPredicate("foo", "  ", false));
		assertEquals("", DiscoveryClient.addNonNullPredicate("foo", "", true));
		assertEquals("", DiscoveryClient.addNonNullPredicate("foo", " ", true));
	}


	public void testPredicateUtil() {
		assertEquals(" and foo/text()='bar'", DiscoveryClient.addNonNullPredicate("foo", "bar", false));
		assertEquals(" and @foo='bar'", DiscoveryClient.addNonNullPredicate("foo", "bar", true));
	}


	public void testBuildPOCPredicateNulls() {
		assertEquals("true()", DiscoveryClient.buildPOCPredicate(nullPOC));
		assertEquals("true()", DiscoveryClient.buildPOCPredicate(emptyPOC));
		assertEquals("true()", DiscoveryClient.buildPOCPredicate(voidPOC));
	}


	public void testBuildPOCPredicate() {
		assertTrue(DiscoveryClient.buildPOCPredicate(emailPOC).contains("@email='emailV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("@affiliation='affiliationV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("@email='emailV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("@firstName='firstNameV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("@lastName='lastNameV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("@phoneNumber='phoneNumberV'"));
		assertTrue(DiscoveryClient.buildPOCPredicate(fullPOC).contains("@role='roleV'"));
	}


	public static void main(String[] args) {
		junit.textui.TestRunner.run(DiscoveryClientUtilsTestCase.class);
	}
}
{'fraction_non_alphanumeric': 0.1579386605466305, 'fraction_numerical': 0.0, 'mean_word_length': 7.9440298507462686, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3234871', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1476, 'n_words': 218}