<commit_before>package de.cooperateproject.eabridge.transformation.tests;

import static org.junit.Assert.fail;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.ecore.resource.Resource;
import org.junit.BeforeClass;

import de.cooperateproject.eabridge.eaobjectmodel.EaobjectmodelPackage;
import de.cooperateproject.eabridge.transformation.Activator;
import de.cooperateproject.eabridge.transformation.tests.util.EAModelComparisonFactory;
import de.cooperateproject.modeling.transformation.tests.commons.PlainTransformationTestBase;
import de.cooperateproject.modeling.transformation.tests.commons.QVTOTransformationRunning;
import de.cooperateproject.modeling.transformation.tests.commons.TransformationTestBase;
import de.cooperateproject.modeling.transformation.tests.commons.utils.ModelComparisonFactory;

public abstract class EATransformationTestBase extends PlainTransformationTestBase implements QVTOTransformationRunning {
	
    protected final String resourcePluginId;
    protected final List<String> sourceFileExtensions;
    protected final List<String> targetFileExtensions;

    protected EATransformationTestBase(final List<String> sourceFileExtensions,
            final List<String> targetFileExtensions, final String resourcePluginId) {
                this.sourceFileExtensions = sourceFileExtensions;
                this.targetFileExtensions = targetFileExtensions;
                this.resourcePluginId = resourcePluginId;   
    }
    
    @BeforeClass
    public static void initialize() throws Exception { 
        EaobjectmodelPackage.eINSTANCE.eClass();
        TransformationTestBase.initialize(delegate -> {
            delegate.registerPlatformUris(Activator.PLUGIN_ID, Activator.class);
            delegate.registerPlatformUris(TestEnvironmentConstants.TEST_PLUGIN_ID, TestEnvironmentConstants.class);
            delegate.registerQVTOResolutionURIs(createPlatformURI(Activator.PLUGIN_ID).appendSegment("transforms"));
            TransformationTestBase.initEnvironment(delegate);
        });
    }
    
    @Override
    protected ModelComparisonFactory getModelComparisonFactory() {
        return new EAModelComparisonFactory();
    }
	
	/*protected static Comparison compareModelsIgnoringIdentifiers(Notifier actual, Notifier expected) {
		Collection<IWeightProvider> weightProviders = new HashSet<>();
		weightProviders.add(new PapyrusWeightProvider());
		weightProviders.add(new EAWeightProvider());
		
		Registry weightProviderRegistry = WeightProviderDescriptorRegistryImpl.createStandaloneInstance();
		weightProviderRegistry.put(CombiningWeightProvider.class.getName(), CombiningWeightProvider.getDescriptorDatatypes(weightProviders));
		weightProviderRegistry.put(CombiningWeightProvider.class.getName() + "2", CombiningWeightProvider.getDescriptor(PapyrusWeightProvider.PAPYRUS_PATTERN, weightProviders));
		weightProviderRegistry.put(CombiningWeightProvider.class.getName() + "3", CombiningWeightProvider.getDescriptor(EAWeightProvider.EA_PATTERN, weightProviders));<commit_msg>Removed unnecessary initialization fo platform uris<commit_after>package de.cooperateproject.eabridge.transformation.tests;

import static org.junit.Assert.fail;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.ecore.resource.Resource;
import org.junit.BeforeClass;

import de.cooperateproject.eabridge.eaobjectmodel.EaobjectmodelPackage;
import de.cooperateproject.eabridge.transformation.Activator;
import de.cooperateproject.eabridge.transformation.tests.util.EAModelComparisonFactory;
import de.cooperateproject.modeling.transformation.tests.commons.PlainTransformationTestBase;
import de.cooperateproject.modeling.transformation.tests.commons.QVTOTransformationRunning;
import de.cooperateproject.modeling.transformation.tests.commons.TransformationTestBase;
import de.cooperateproject.modeling.transformation.tests.commons.utils.ModelComparisonFactory;

public abstract class EATransformationTestBase extends PlainTransformationTestBase implements QVTOTransformationRunning {
	
    protected final String resourcePluginId;
    protected final List<String> sourceFileExtensions;
    protected final List<String> targetFileExtensions;

    protected EATransformationTestBase(final List<String> sourceFileExtensions,
            final List<String> targetFileExtensions, final String resourcePluginId) {
                this.sourceFileExtensions = sourceFileExtensions;
                this.targetFileExtensions = targetFileExtensions;
                this.resourcePluginId = resourcePluginId;   
    }
    
    @BeforeClass
    public static void initialize() throws Exception { 
        EaobjectmodelPackage.eINSTANCE.eClass();
        TransformationTestBase.initialize(delegate -> {
            delegate.registerPlatformUris(Activator.PLUGIN_ID, Activator.class);
            delegate.registerPlatformUris(TestEnvironmentConstants.TEST_PLUGIN_ID, TestEnvironmentConstants.class);
            delegate.registerQVTOResolutionURIs(createPlatformURI(Activator.PLUGIN_ID).appendSegment("transforms"));
        });
    }
    
    @Override
    protected ModelComparisonFactory getModelComparisonFactory() {
        return new EAModelComparisonFactory();
    }
	
	/*protected static Comparison compareModelsIgnoringIdentifiers(Notifier actual, Notifier expected) {
		Collection<IWeightProvider> weightProviders = new HashSet<>();
		weightProviders.add(new PapyrusWeightProvider());
		weightProviders.add(new EAWeightProvider());
		
		Registry weightProviderRegistry = WeightProviderDescriptorRegistryImpl.createStandaloneInstance();
		weightProviderRegistry.put(CombiningWeightProvider.class.getName(), CombiningWeightProvider.getDescriptorDatatypes(weightProviders));
		weightProviderRegistry.put(CombiningWeightProvider.class.getName() + "2", CombiningWeightProvider.getDescriptor(PapyrusWeightProvider.PAPYRUS_PATTERN, weightProviders));
		weightProviderRegistry.put(CombiningWeightProvider.class.getName() + "3", CombiningWeightProvider.getDescriptor(EAWeightProvider.EA_PATTERN, weightProviders));
{'fraction_non_alphanumeric': 0.07657945118059988, 'fraction_numerical': 0.0006381620931716656, 'mean_word_length': 5.87390350877193, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '5331890', 'n_tokens_mistral': 1630, 'n_tokens_neox': 1573, 'n_words': 241}