<commit_before>/**
 * 
 */
package edu.kit.ipd.sdq.kamp4aps.propagation.aPS.tests;

import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;

import edu.kit.ipd.sdq.kamp4aps.core.changepropagation.*;
import edu.kit.ipd.sdq.kamp4aps.core.APSArchitectureVersion;
import edu.kit.ipd.sdq.kamp4aps.core.APSArchitectureVersion.ArchitectureVersionParams;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Iterator;

import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;

import edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.ChangePropagationDueToHardwareChange;
import edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.KAMP4aPSModificationmarksFactory;
import edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.ModifyEntity;
import edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.impl.KAMP4aPSModificationmarksFactoryImpl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.Plant;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.apsPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.ComponentRepository.Component;
import edu.kit.ipd.sdq.kamp4aps.model.basic.Entity;

class PropagationTest {

	private final String currentPath = Paths.get("").toAbsolutePath().toString();
	private final String pathToModels = "\\src\\edu\\kit\\ipd\\sdq\\kamp4aps\\propagation\\aPS\\tests\\";
	private final String modelName = "My.aps";
	private final String seedName = "ModificationSeed";
	private final String expectedModificationsName = "ExpectedModifications";

	@Test
	void testExampleOne() {
		testChangePropagationOnModel("Model_1\\");
	}
	
	@Test
	void testExampleTwo() {
		testChangePropagationOnModel("Model_2\\");
	}
	
	@Test
	void testExampleThree() {
		testChangePropagationOnModel("Model_3\\");
	}
	
	
	
	private void testChangePropagationOnModel(String model) {
		String seed = loadSeed(model);
		String[] expectedModifications = loadExpectedModifications(model);
		
		Resource resource =  loadResources(getResourcePath(model, modelName));
		Plant plant = (Plant) resource.getContents().get(0);<commit_msg>Pfadsymbol Slash statt Backslash<commit_after>/**
 * 
 */
package edu.kit.ipd.sdq.kamp4aps.propagation.aPS.tests;

import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;

import edu.kit.ipd.sdq.kamp4aps.core.changepropagation.*;
import edu.kit.ipd.sdq.kamp4aps.core.APSArchitectureVersion;
import edu.kit.ipd.sdq.kamp4aps.core.APSArchitectureVersion.ArchitectureVersionParams;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Iterator;

import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;

import edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.ChangePropagationDueToHardwareChange;
import edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.KAMP4aPSModificationmarksFactory;
import edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.ModifyEntity;
import edu.kit.ipd.sdq.kamp4aps.model.KAMP4aPSModificationmarks.impl.KAMP4aPSModificationmarksFactoryImpl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.Plant;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.apsPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.ComponentRepository.Component;
import edu.kit.ipd.sdq.kamp4aps.model.basic.Entity;

class PropagationTest {

	private final String currentPath = Paths.get("").toAbsolutePath().toString();
	private final String pathToModels = "/src/edu/kit/ipd/sdq/kamp4aps/propagation/aPS/tests/";
	private final String modelName = "My.aps";
	private final String seedName = "ModificationSeed";
	private final String expectedModificationsName = "ExpectedModifications";

	@Test
	void testExampleOne() {
		testChangePropagationOnModel("Model_1\\");
	}
	
	@Test
	void testExampleTwo() {
		testChangePropagationOnModel("Model_2\\");
	}
	
	@Test
	void testExampleThree() {
		testChangePropagationOnModel("Model_3\\");
	}
	
	
	
	private void testChangePropagationOnModel(String model) {
		String seed = loadSeed(model);
		String[] expectedModifications = loadExpectedModifications(model);
		
		Resource resource =  loadResources(getResourcePath(model, modelName));
		Plant plant = (Plant) resource.getContents().get(0);
{'fraction_non_alphanumeric': 0.11851851851851852, 'fraction_numerical': 0.008736942070275403, 'mean_word_length': 5.87467362924282, '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': '6005869', 'n_tokens_mistral': 1852, 'n_tokens_neox': 1834, 'n_words': 248}