package tools.vitruv.applications.pcmjava.tests.pojotransformations.java2pcm;

import org.junit.Test;
import org.palladiosimulator.pcm.repository.Repository;
import org.palladiosimulator.pcm.seff.ResourceDemandingSEFF;

import tools.vitruv.applications.pcmjava.tests.util.JaMoPP2PCMTransformationTest;
import tools.vitruv.applications.pcmjava.tests.util.PCM2JaMoPPTestUtils;

public class ClassMethodMappingTransformationTest extends Java2PCMPackageMappingTransformationTest {

    @Test
    public void testAddClassMethodWithCorrespondence() throws Throwable {
        // create repo
        final Repository repo = super.addRepoContractsAndDatatypesPackage();
        this.testUserInteractor.addNextSelections(JaMoPP2PCMTransformationTest.SELECT_NOTHING_DECIDE_LATER);
        super.createPackageWithPackageInfo(repo.getEntityName(), "contracts");
        // create component implementing class
        super.addPackageAndImplementingClass(PCM2JaMoPPTestUtils.BASIC_COMPONENT_NAME);
        // create interface
        super.createInterfaceInPackageBasedOnJaMoPPPackageWithCorrespondence("contracts", PCM2JaMoPPTestUtils.INTERFACE_NAME);
        // create interface method
        super.addMethodToInterfaceWithCorrespondence(PCM2JaMoPPTestUtils.INTERFACE_NAME,
                PCM2JaMoPPTestUtils.OPERATION_SIGNATURE_1_NAME);
        // add implements/provided role
        super.addImplementsCorrespondingToOperationProvidedRoleToClass(
                PCM2JaMoPPTestUtils.BASIC_COMPONENT_NAME + "Impl", PCM2JaMoPPTestUtils.INTERFACE_NAME);

        // actual test: add class method to implementing class that overrides the interface
        final ResourceDemandingSEFF correspondingSeff = super.addClassMethodToClassThatOverridesInterfaceMethod(
                PCM2JaMoPPTestUtils.BASIC_COMPONENT_NAME + "Impl", PCM2JaMoPPTestUtils.OPERATION_SIGNATURE_1_NAME);

        // assert the correspondingSEFF
        assertCorrespondingSEFF(correspondingSeff,  PCM2JaMoPPTestUtils.OPERATION_SIGNATURE_1_NAME);
    }

}

@@ -70,17 +70,19 @@
 ava2pcm;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -100,64 +100,9 @@
 est;
-%0Aimport org.palladiosimulator.pcm.repository.Repository;
+%0D
 %0Aimp
@@ -158,17 +158,19 @@
 ingSEFF;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -243,16 +243,17 @@
 ionTest;
+%0D
 %0Aimport 
@@ -317,17 +317,19 @@
 stUtils;
-%0A
+%0D%0A%0D
 %0Apublic 
@@ -421,17 +421,19 @@
 onTest %7B
-%0A
+%0D%0A%0D
 %0A    @Te
@@ -434,16 +434,17 @@
    @Test
+%0D
 %0A    pub
@@ -509,16 +509,17 @@
 owable %7B
+%0D
 %0A       
@@ -533,24 +533,25 @@
 ate repo
+%0D
 %0A       
  final R
@@ -546,32 +546,8 @@
     
- final Repository repo =
  sup
@@ -587,16 +587,17 @@
 ckage();
+%0D
 %0A       
@@ -701,87 +701,9 @@
 ER);
-%0A        super.createPackageWithPackageInfo(repo.getEntityName(), %22contracts%22);
+%0D
 %0A   
@@ -745,16 +745,17 @@
 ng class
+%0D
 %0A       
@@ -830,24 +830,25 @@
 ONENT_NAME);
+%0D
 %0A        // 
@@ -855,32 +855,33 @@
 create interface
+%0D
 %0A        super.c
@@ -987,24 +987,25 @@
 RFACE_NAME);
+%0D
 %0A        // 
@@ -1027,16 +1027,17 @@
 e method
+%0D
 %0A       
@@ -1117,16 +1117,17 @@
 CE_NAME,
+%0D
 %0A       
@@ -1179,24 +1179,25 @@
 URE_1_NAME);
+%0D
 %0A        // 
@@ -1224,16 +1224,17 @@
 ded role
+%0D
 %0A       
@@ -1297,16 +1297,17 @@
 ToClass(
+%0D
 %0A       
@@ -1398,25 +1398,27 @@
 RFACE_NAME);
-%0A
+%0D%0A%0D
 %0A        // 
@@ -1497,16 +1497,17 @@
 nterface
+%0D
 %0A       
@@ -1611,16 +1611,17 @@
 eMethod(
+%0D
 %0A       
@@ -1728,17 +1728,19 @@
 1_NAME);
-%0A
+%0D%0A%0D
 %0A       
@@ -1771,16 +1771,17 @@
 dingSEFF
+%0D
 %0A       
@@ -1877,14 +1877,18 @@
 ME);
+%0D
 %0A    %7D
-%0A
+%0D%0A%0D
 %0A%7D
+%0D
 %0A

Remove an unnecessary package creation in Java-PCM tests.