<commit_before>/**
 * Copyright (c) 2010 IBM Corporation
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *
 * $Id$
 */
package org.openhealthtools.mdht.uml.cda.cdt.operations;

import static org.junit.Assert.fail;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.ecore.EObject;
import org.junit.Test;
import org.openhealthtools.mdht.uml.cda.ccd.operations.CCDValidationTest.CodeCCDValidationTest;
import org.openhealthtools.mdht.uml.cda.ccd.operations.CCDValidationTest.EffectiveTimeCCDValidationTest;
import org.openhealthtools.mdht.uml.cda.ccd.operations.CCDValidationTest.TitleCCDValidationTest;
import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory;
import org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints;
import org.openhealthtools.mdht.uml.cda.operations.ClinicalDocumentOperationsTest;
import org.openhealthtools.mdht.uml.hl7.datatypes.ST;

/**
 * This class
 */
@SuppressWarnings("nls")
public class GeneralHeaderConstraintsOperationsTest extends
		ClinicalDocumentOperationsTest {

	@SuppressWarnings("hiding")
	protected static final String TEMPLATE_ID = "2.16.840.1.113883.10.20.3";

	@SuppressWarnings("hiding")
	protected static final String CODE = "unspecified";
	@SuppressWarnings("hiding")
	protected static final String CODE_SYSTEM = "unspecified";

	private static final CDATestCase TEST_CASE_ARRAY[] = {
			// Template ID
			// -------------------------------------------------------------
			new TemplateIDValidationTest(TEMPLATE_ID) {

				@Override
				protected boolean validate(final EObject objectToTest,
						final BasicDiagnostic diagnostician,
						final Map<Object, Object> map) {
					return GeneralHeaderConstraintsOperations
							.validateGeneralHeaderConstraintsTemplateId(
									(GeneralHeaderConstraints) objectToTest,
									diagnostician, map);
				}

			},

			// Code
			// -------------------------------------------------------------
			new CodeCCDValidationTest(CODE, CODE_SYSTEM) {
				@Override
				protected boolean validate(final EObject objectToTest,
						final BasicDiagnostic diagnostician,
						final Map<Object, Object> map) {
					return GeneralHeaderConstraintsOperations
							.validateGeneralHeaderConstraintsCode(
									(GeneralHeaderConstraints) objectToTest,
									diagnostician, map);
				}
			},

			// EffectiveTime
			// -------------------------------------------------------------
			new EffectiveTimeCCDValidationTest() {
				@Override
				protected boolean validate(final EObject objectToTest,
						final BasicDiagnostic diagnostician,
						final Map<Object, Object> map) {
					return GeneralHeaderConstraintsOperations
							.validateGeneralHeaderConstraintsEffectiveTime(
									(GeneralHeaderConstraints) objectToTest,
									diagnostician, map);
				}
			},

			// Title
			// -------------------------------------------------------------
			new TitleCCDValidationTest() {

				@Override
				protected boolean validate(final EObject objectToTest,
						final BasicDiagnostic diagnostician,
						final Map<Object, Object> map) {
					return GeneralHeaderConstraintsOperations
							.validateGeneralHeaderConstraintsTitle(
									(GeneralHeaderConstraints) objectToTest,
									diagnostician, map);
				}

				/**
				 * @see org.openhealthtools.mdht.uml.cda.ccd.operations.CCDValidationTest.TitleCCDValidationTest#getValueToSet()
				 */
				@Override
				protected Object getValueToSet() {
					final ST title = (ST) super.getValueToSet();
					title.addText("not specified");
					return title;
				}
			} }; // TEST_CASE_ARRAY

	@Override
	protected List<CDATestCase> getTestCases() {
		// Return a new List because the one returned by Arrays.asList is
		// unmodifiable so a sub-class can't append their test cases.
		final List<CDATestCase> retValue = super.getTestCases();
		retValue.addAll(Arrays.asList(TEST_CASE_ARRAY));
		return retValue;
	}

	/**
	 * @see org.openhealthtools.mdht.uml.cda.operations.MutualExclusionValidationTest#getObjectToTest()
	 */
	@Override
	protected EObject getObjectToTest() {
		return CDTFactory.eINSTANCE.createGeneralHeaderConstraints();
	}

	/**
	 * Test method for
	 * {@link org.openhealthtools.mdht.uml.cda.cdt.operations.GeneralHeaderConstraintsOperations#validateGeneralHeaderConstraintsTypeIdExtension(org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)}
	 * .<commit_msg>added commented out test stub<commit_after>/**
 * Copyright (c) 2010 IBM Corporation
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *
 * $Id$
 */
package org.openhealthtools.mdht.uml.cda.cdt.operations;

import static org.junit.Assert.fail;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.ecore.EObject;
import org.junit.Test;
import org.openhealthtools.mdht.uml.cda.ccd.operations.CCDValidationTest.CodeCCDValidationTest;
import org.openhealthtools.mdht.uml.cda.ccd.operations.CCDValidationTest.EffectiveTimeCCDValidationTest;
import org.openhealthtools.mdht.uml.cda.ccd.operations.CCDValidationTest.TitleCCDValidationTest;
import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory;
import org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints;
import org.openhealthtools.mdht.uml.cda.operations.ClinicalDocumentOperationsTest;
import org.openhealthtools.mdht.uml.hl7.datatypes.ST;

/**
 * This class
 */
@SuppressWarnings("nls")
public class GeneralHeaderConstraintsOperationsTest extends
		ClinicalDocumentOperationsTest {

	@SuppressWarnings("hiding")
	protected static final String TEMPLATE_ID = "2.16.840.1.113883.10.20.3";

	@SuppressWarnings("hiding")
	protected static final String CODE = "unspecified";
	@SuppressWarnings("hiding")
	protected static final String CODE_SYSTEM = "unspecified";

	private static final CDATestCase TEST_CASE_ARRAY[] = {
			// Template ID
			// -------------------------------------------------------------
			new TemplateIDValidationTest(TEMPLATE_ID) {

				@Override
				protected boolean validate(final EObject objectToTest,
						final BasicDiagnostic diagnostician,
						final Map<Object, Object> map) {
					return GeneralHeaderConstraintsOperations
							.validateGeneralHeaderConstraintsTemplateId(
									(GeneralHeaderConstraints) objectToTest,
									diagnostician, map);
				}

			},

			// Code
			// -------------------------------------------------------------
			new CodeCCDValidationTest(CODE, CODE_SYSTEM) {
				@Override
				protected boolean validate(final EObject objectToTest,
						final BasicDiagnostic diagnostician,
						final Map<Object, Object> map) {
					return GeneralHeaderConstraintsOperations
							.validateGeneralHeaderConstraintsCode(
									(GeneralHeaderConstraints) objectToTest,
									diagnostician, map);
				}
			},

			// EffectiveTime
			// -------------------------------------------------------------
			new EffectiveTimeCCDValidationTest() {
				@Override
				protected boolean validate(final EObject objectToTest,
						final BasicDiagnostic diagnostician,
						final Map<Object, Object> map) {
					return GeneralHeaderConstraintsOperations
							.validateGeneralHeaderConstraintsEffectiveTime(
									(GeneralHeaderConstraints) objectToTest,
									diagnostician, map);
				}
			},

			// Title
			// -------------------------------------------------------------
			new TitleCCDValidationTest() {

				@Override
				protected boolean validate(final EObject objectToTest,
						final BasicDiagnostic diagnostician,
						final Map<Object, Object> map) {
					return GeneralHeaderConstraintsOperations
							.validateGeneralHeaderConstraintsTitle(
									(GeneralHeaderConstraints) objectToTest,
									diagnostician, map);
				}

				/**
				 * @see org.openhealthtools.mdht.uml.cda.ccd.operations.CCDValidationTest.TitleCCDValidationTest#getValueToSet()
				 */
				@Override
				protected Object getValueToSet() {
					final ST title = (ST) super.getValueToSet();
					title.addText("not specified");
					return title;
				}
			}
//			,
//
//			// ID
//			// -------------------------------------------------------------
//			new IDCCDValidationTest() {
//				@Override
//				protected boolean validate(final EObject objectToTest,
//						final BasicDiagnostic diagnostician,
//						final Map<Object, Object> map) {
//					return GeneralHeaderConstraintsOperations
//							.validateGeneralHeaderConstraintsId(
//									(GeneralHeaderConstraints) objectToTest,
//									diagnostician, map);
//				}
//			} 
			}; // TEST_CASE_ARRAY

	@Override
	protected List<CDATestCase> getTestCases() {
		// Return a new List because the one returned by Arrays.asList is
		// unmodifiable so a sub-class can't append their test cases.
		final List<CDATestCase> retValue = super.getTestCases();
		retValue.addAll(Arrays.asList(TEST_CASE_ARRAY));
		return retValue;
	}

	/**
	 * @see org.openhealthtools.mdht.uml.cda.operations.MutualExclusionValidationTest#getObjectToTest()
	 */
	@Override
	protected EObject getObjectToTest() {
		return CDTFactory.eINSTANCE.createGeneralHeaderConstraints();
	}

	/**
	 * Test method for
	 * {@link org.openhealthtools.mdht.uml.cda.cdt.operations.GeneralHeaderConstraintsOperations#validateGeneralHeaderConstraintsTypeIdExtension(org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)}
	 * .
{'fraction_non_alphanumeric': 0.14272935095914918, 'fraction_numerical': 0.0053672597157340225, 'mean_word_length': 3.0769854132901133, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '6726973', 'n_tokens_mistral': 3390, 'n_tokens_neox': 2839, 'n_words': 557}