<commit_before>
//=====================================================================
//
//File:      $RCSfile: IOMdlTestGenerics.java,v $
//Version:   $Revision: 1.8 $
//Modified:  $Date: 2013/05/13 22:51:33 $
//
//(c) Copyright 2004-2014 by Mentor Graphics Corp. All rights reserved.
//
//=====================================================================
// Licensed under the Apache License, Version 2.0 (the "License"); you may not 
// use this file except in compliance with the License.  You may obtain a copy 
// of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software 
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   See the 
// License for the specific language governing permissions and limitations under
// the License.
//=====================================================================

import java.io.FileNotFoundException;
import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.PlatformUI;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.xtuml.bp.core.Ooaofooa;
import org.xtuml.bp.core.Package_c;
import org.xtuml.bp.core.SystemModel_c;
import org.xtuml.bp.core.common.ClassQueryInterface_c;
import org.xtuml.bp.core.common.GeneralPurposeLogger;
import org.xtuml.bp.core.common.IdAssigner;
import org.xtuml.bp.core.ui.Selection;
import org.xtuml.bp.io.mdl.ExportModel;
import org.xtuml.bp.io.mdl.ImportModel;
import org.xtuml.bp.test.common.BaseTest;
import org.xtuml.bp.test.common.OrderedRunner;
import org.xtuml.bp.test.common.TestingUtilities;
import org.xtuml.bp.ui.canvas.Ooaofgraphics;
import org.xtuml.bp.utilities.ui.ProjectUtilities;

import junit.framework.TestCase;

@RunWith(OrderedRunner.class)
public class IOMdlTestGenerics extends TestCase {

	@Rule public TestName name = new TestName();

    GeneralPurposeLogger log1;  // log for core
    GeneralPurposeLogger log2;  // log for canvas

	Ooaofooa modelRoot = BaseTest.getDefaultTestInstance();
	Ooaofgraphics graphicsModelRoot = Ooaofgraphics.getInstance(modelRoot.getId());

	private static String m_system_name = "org.xtuml.bp.io.mdl.test";
	private String m_domain_name = "";
    private static String m_workspace_path = "";
    private static String m_logfile_path = "";
    static SystemModel_c m_system = SystemModel_c.SystemModelInstance(Ooaofooa.getDefaultInstance() , new ClassQueryInterface_c() {
			public boolean evaluate(Object candidate) {
				return ((SystemModel_c)candidate).getName().equals(m_system_name);
			}
		});
		;

    /**
     * Whether this test run is meant to produce the expected
     * results files, rather than actually perform the tests.
     */
    private static boolean generateResults = false;

	public IOMdlTestGenerics() {
		super(null);
		// they all start with "test_"
//		m_domain_name = arg0.substring(5, arg0.length());
	
	}
	@Before
	public void setUp() throws Exception {
		String methodName = name.getMethodName();
		m_domain_name = methodName.substring(5, methodName.length());
		PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
		while(PlatformUI.getWorkbench().getDisplay().readAndDispatch());
		super.setUp();
        IdAssigner.setSeedOfAllInstances(methodName.hashCode(), true);
        if (m_workspace_path == null || m_workspace_path.equals(""))
        {
            m_workspace_path = System.getProperty("WORKSPACE_PATH");
        }
        if (m_logfile_path == null || m_logfile_path.equals(""))
        {
            m_logfile_path = System.getProperty("LOGFILE_PATH"); //$NON-NLS-1$
        }
        assertNotNull( m_workspace_path );
        assertNotNull( m_logfile_path );
		if ( log1 == null )
			log1 = new GeneralPurposeLogger();
		else
			log1.clear();
		Ooaofooa.log = log1;

		if ( log2 == null )
			log2 = new GeneralPurposeLogger();
		else
			log2.clear();
		Ooaofgraphics.log = log2;		<commit_msg>job #8442 - making sure we export graphics made the actual results much closer to the expected results.<commit_after>
//=====================================================================
//
//File:      $RCSfile: IOMdlTestGenerics.java,v $
//Version:   $Revision: 1.8 $
//Modified:  $Date: 2013/05/13 22:51:33 $
//
//(c) Copyright 2004-2014 by Mentor Graphics Corp. All rights reserved.
//
//=====================================================================
// Licensed under the Apache License, Version 2.0 (the "License"); you may not 
// use this file except in compliance with the License.  You may obtain a copy 
// of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software 
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   See the 
// License for the specific language governing permissions and limitations under
// the License.
//=====================================================================

import java.io.FileNotFoundException;
import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.PlatformUI;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.xtuml.bp.core.CorePlugin;
import org.xtuml.bp.core.Ooaofooa;
import org.xtuml.bp.core.Package_c;
import org.xtuml.bp.core.SystemModel_c;
import org.xtuml.bp.core.common.BridgePointPreferencesStore;
import org.xtuml.bp.core.common.ClassQueryInterface_c;
import org.xtuml.bp.core.common.GeneralPurposeLogger;
import org.xtuml.bp.core.common.IdAssigner;
import org.xtuml.bp.core.ui.Selection;
import org.xtuml.bp.io.mdl.ExportModel;
import org.xtuml.bp.io.mdl.ImportModel;
import org.xtuml.bp.test.common.BaseTest;
import org.xtuml.bp.test.common.OrderedRunner;
import org.xtuml.bp.test.common.TestingUtilities;
import org.xtuml.bp.ui.canvas.Ooaofgraphics;
import org.xtuml.bp.utilities.ui.ProjectUtilities;

import junit.framework.TestCase;

@RunWith(OrderedRunner.class)
public class IOMdlTestGenerics extends TestCase {

	@Rule public TestName name = new TestName();

    GeneralPurposeLogger log1;  // log for core
    GeneralPurposeLogger log2;  // log for canvas

	Ooaofooa modelRoot = BaseTest.getDefaultTestInstance();
	Ooaofgraphics graphicsModelRoot = Ooaofgraphics.getInstance(modelRoot.getId());

	private static String m_system_name = "org.xtuml.bp.io.mdl.test";
	private String m_domain_name = "";
    private static String m_workspace_path = "";
    private static String m_logfile_path = "";
    static SystemModel_c m_system = SystemModel_c.SystemModelInstance(Ooaofooa.getDefaultInstance() , new ClassQueryInterface_c() {
			public boolean evaluate(Object candidate) {
				return ((SystemModel_c)candidate).getName().equals(m_system_name);
			}
		});
		;

    /**
     * Whether this test run is meant to produce the expected
     * results files, rather than actually perform the tests.
     */
    private static boolean generateResults = false;

	public IOMdlTestGenerics() {
		super(null);
		// they all start with "test_"
//		m_domain_name = arg0.substring(5, arg0.length());
		
		// Change default for the parse on resource change preference to
		// "always"
		IPreferenceStore store = CorePlugin.getDefault().getPreferenceStore();
		store.setValue(BridgePointPreferencesStore.EXPORT_GRAPHICS, "always"); //$NON-NLS-1$
	}
	@Before
	public void setUp() throws Exception {
		String methodName = name.getMethodName();
		m_domain_name = methodName.substring(5, methodName.length());
		PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
		while(PlatformUI.getWorkbench().getDisplay().readAndDispatch());
		super.setUp();
        IdAssigner.setSeedOfAllInstances(methodName.hashCode(), true);
        if (m_workspace_path == null || m_workspace_path.equals(""))
        {
            m_workspace_path = System.getProperty("WORKSPACE_PATH");
        }
        if (m_logfile_path == null || m_logfile_path.equals(""))
        {
            m_logfile_path = System.getProperty("LOGFILE_PATH"); //$NON-NLS-1$
        }
        assertNotNull( m_workspace_path );
        assertNotNull( m_logfile_path );
		if ( log1 == null )
			log1 = new GeneralPurposeLogger();
		else
			log1.clear();
		Ooaofooa.log = log1;

		if ( log2 == null )
			log2 = new GeneralPurposeLogger();
		else
			log2.clear();
		Ooaofgraphics.log = log2;		
{'fraction_non_alphanumeric': 0.15462239583333334, 'fraction_numerical': 0.009874131944444444, 'mean_word_length': 4.248861047835991, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6537435', 'n_tokens_mistral': 2948, 'n_tokens_neox': 2795, 'n_words': 641}