<commit_before>package org.opennms.netmgt.model;

import junit.framework.TestCase;

import org.opennms.netmgt.model.OnmsIpInterface.CollectionType;

public class OnmsIpInterfaceTest extends TestCase {

	public void testCollectionTypeGetNull () {
		CollectionType collectionType = CollectionType.get(null);
		
		assertSame("The expected value is N for a null", CollectionType.NO_COLLECT, collectionType);
		
	}

	public void testCollectionTypeGetSpaces () {
		CollectionType collectionType = CollectionType.get("   ");
		
		assertSame("The expected valus is N for all spaces", CollectionType.NO_COLLECT, collectionType);
	}
	
	public void testCollectionTypeGetTwoChars () {
		
		try {
			CollectionType collectionType = CollectionType.get(" MN  ");
			fail("Expected to catch an exception here");
		} catch (IllegalArgumentException e) {
		}
	}

}<commit_msg>Test for b00g 1654.  Basically one of the issnmpprimary values being retrieved from ipinterface is null.  I am unsure where we should deal with this.  In the get? Should we constrain the table? Somewhere this is being written as a null, so that needs to be fixed too.<commit_after>package org.opennms.netmgt.model;

import junit.framework.TestCase;

import org.opennms.netmgt.model.OnmsIpInterface.CollectionType;

public class OnmsIpInterfaceTest extends TestCase {

	public void testCollectionTypeGetNull () {
		CollectionType collectionType = CollectionType.get(null);
		
		assertSame("The expected value is N for a null", CollectionType.NO_COLLECT, collectionType);
		
	}

	public void testCollectionTypeGetSpaces () {
		CollectionType collectionType = CollectionType.get("   ");
		
		assertSame("The expected valus is N for all spaces", CollectionType.NO_COLLECT, collectionType);
	}
	
	public void testCollectionTypeGetTwoChars () {
		
		try {
			@SuppressWarnings("unused")
			CollectionType collectionType = CollectionType.get(" MN  ");
			fail("Expected to catch an exception here");
		} catch (IllegalArgumentException e) {
		}
	}

	public void testCollectionTypeGetZ () {
		
		try {
			@SuppressWarnings("unused")
			CollectionType collectionType = CollectionType.get("Z");
			fail("Expected to catch an exception here");
		} catch (IllegalArgumentException e) {
		}
	}
	
	public void testCollectionTypeComparison () {
		CollectionType left = new CollectionType('N');
		CollectionType right = null;
		try {
			left.isLessThan(right);
			fail("Expected to catch an exception here");
		} catch (NullPointerException e) {
		}
	}
}
{'fraction_non_alphanumeric': 0.08733974358974358, 'fraction_numerical': 0.002403846153846154, 'mean_word_length': 4.649321266968326, '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': '3405734', 'n_tokens_mistral': 779, 'n_tokens_neox': 690, 'n_words': 206}