Commit c731016c authored by Marco Konersmann's avatar Marco Konersmann

Adds protocols to test elements and more process components

parent bf68a6a2
......@@ -68,14 +68,13 @@
<import plugin="org.eclipse.emf.ecore.xmi" version="2.11.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.gmf.runtime.notation" version="1.8.0" match="greaterOrEqual"/>
<import plugin="com.google.guava"/>
<import plugin="mechanisms"/>
<import plugin="org.codeling.lang.cocome.metamodel" version="1.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt.ui"/>
<import plugin="org.eclipse.ui.ide" version="3.9.1" match="greaterOrEqual"/>
<import plugin="org.eclipse.jface.text"/>
<import plugin="org.eclipse.ui.editors"/>
<import plugin="de.tub.tfs.muvitor" version="1.0.0" match="greaterOrEqual"/>
<import plugin="mechanisms" version="1.0.0" match="greaterOrEqual"/>
<import plugin="org.codeling.mechanisms" version="1.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.uml2.uml" version="5.3.0" match="greaterOrEqual"/>
<import plugin="org.codeling.lang.jee.metamodel" version="1.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.osgi" version="3.12.0" match="greaterOrEqual"/>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="org.codeling.target" sequenceNumber="34">
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="org.codeling.target" sequenceNumber="34">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.platform.ide" version="4.5.2.M20160212-1500"/>
......@@ -32,6 +31,10 @@
<unit id="org.modelversioning.emfprofile.feature.feature.group" version="1.0.0.201612051406"/>
<repository location="http://www.s3.uni-due.de/pub/p2/codeling/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.xwt.feature.feature.group" version="1.3.1.I20171018-2059"/>
<repository location="http://download.eclipse.org/releases/oxygen"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
</target>
</target>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="org.codeling.target" sequenceNumber="44">
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="org.codeling.target" sequenceNumber="44">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.egit.feature.group" version="4.8.0.201706111038-r"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="2.13.0.v20170609-0928"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.13.1.v20170928-1405"/>
<unit id="org.eclipse.gmf.feature.group" version="1.11.0.201706061437"/>
<unit id="org.eclipse.m2e.feature.feature.group" version="1.8.2.20171007-0217"/>
<unit id="org.eclipse.m2e.wtp.feature.feature.group" version="1.3.3.20170823-1905"/>
<unit id="org.eclipse.papyrus.sdk.feature.feature.group" version="3.1.0.201709130748"/>
<unit id="org.eclipse.pde.feature.group" version="3.13.1.v20171009-0537"/>
<unit id="org.eclipse.egit.feature.group"/>
<unit id="org.eclipse.emf.sdk.feature.group"/>
<unit id="org.eclipse.equinox.sdk.feature.group"/>
<unit id="org.eclipse.gmf.feature.group"/>
<unit id="org.eclipse.m2e.feature.feature.group"/>
<unit id="org.eclipse.m2e.wtp.feature.feature.group"/>
<unit id="org.eclipse.papyrus.sdk.feature.feature.group"/>
<unit id="org.eclipse.pde.feature.group"/>
<repository location="http://download.eclipse.org/releases/oxygen"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="de.tub.tfs.henshin.editor.feature.feature.group" version="1.0.0"/>
<unit id="de.tub.tfs.henshin.tgg.feature.feature.group" version="1.0.0"/>
<unit id="de.tub.tfs.muvitor.feature.feature.group" version="1.0.0"/>
<unit id="org.modelversioning.emfprofile.feature.feature.group" version="1.0.0.201612051406"/>
<repository location="http://www.s3.uni-due.de/pub/p2/codeling/"/>
<unit id="de.tub.tfs.henshin.editor.feature.feature.group"/>
<unit id="de.tub.tfs.henshin.tgg.feature.feature.group"/>
<unit id="de.tub.tfs.muvitor.feature.feature.group"/>
<unit id="org.modelversioning.emfprofile.feature.feature.group"/>
<repository location="https://codeling.de/dependencies/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.palladiosimulator.editors.gmf.feature.feature.group" version="4.0.0.201511051149"/>
<unit id="org.palladiosimulator.pcm.feature.feature.group" version="4.0.0.201511051136"/>
<unit id="org.palladiosimulator.editors.gmf.feature.feature.group"/>
<unit id="org.palladiosimulator.pcm.feature.feature.group"/>
<repository location="https://sdqweb.ipd.kit.edu/eclipse/palladiosimulator/releases/1.0.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.emf.henshin.sdk.feature.group" version="1.4.0.201611301400"/>
<unit id="org.eclipse.emf.henshin.sdk.feature.group"/>
<repository location="http://download.eclipse.org/modeling/emft/henshin/updates/1.4.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.antlr.runtime" version="4.3.0.v201502022030"/>
<unit id="org.apache.batik.css" version="1.7.0.v201011041433"/>
<unit id="org.apache.batik.util" version="1.7.0.v201011041433"/>
<unit id="org.apache.batik.util.gui" version="1.7.0.v200903091627"/>
<unit id="org.apache.commons.io" version="2.2.0.v201405211200"/>
<unit id="org.antlr.runtime"/>
<unit id="org.apache.batik.css"/>
<unit id="org.apache.batik.util"/>
<unit id="org.apache.batik.util.gui"/>
<unit id="org.apache.commons.io"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20170919201930/repository"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.xtend.sdk.feature.group" version="2.13.0.v20171013-1050"/>
<unit id="org.eclipse.xtend.sdk.feature.group"/>
<repository location="http://download.eclipse.org/modeling/tmf/xtext/updates/composite/milestones/"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
</target>
</target>
\ No newline at end of file
package org.codeling.lang.base.java;
import java.util.LinkedHashMap;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragmentRoot;
/**
* A cache for speeding up element searches in JDT.
*/
public class ASTCache {
private static ASTCache instance;
public static ASTCache instance() {
if (instance == null)
instance = new ASTCache();
return instance;
}
private int requests = 0;
private int hits = 0;
private ASTCache() {
}
public float getHitRatio() {
if (requests == 0)
return 0f;
return (float)hits / (float)requests;
}
LinkedHashMap<IJavaElement, IPackageFragmentRoot> packageFragmentRoots = new LinkedHashMap<>();
public IPackageFragmentRoot getPackageFragmentRoot(IJavaElement element) {
requests++;
IPackageFragmentRoot result = packageFragmentRoots.get(element);
if(result != null)
hits++;
return result;
}
public void addPackageFragmentRoot(IJavaElement element, IPackageFragmentRoot fragmentRoot) {
packageFragmentRoots.put(element, fragmentRoot);
}
}
......@@ -825,13 +825,22 @@ public class ASTUtils {
result.add((IPackageFragment) pf);
return result;
}
public static IPackageFragmentRoot getPackageFragmentRoot(IJavaElement element) {
if(element instanceof IPackageFragmentRoot)
if (element instanceof IPackageFragmentRoot)
return (IPackageFragmentRoot) element;
if(element.getParent()==null)
throw new IllegalArgumentException("Element has no package fragment root. "+element.getPath().toString());
return getPackageFragmentRoot(element.getParent());
if (element.getParent() == null)
throw new IllegalArgumentException("Element has no package fragment root. " + element.getPath().toString());
ASTCache cache = ASTCache.instance();
IPackageFragmentRoot cached = cache.getPackageFragmentRoot(element);
if (cached != null)
return cached;
IPackageFragmentRoot result = getPackageFragmentRoot(element.getParent());
if (cache != null)
cache.addPackageFragmentRoot(element, result);
return result;
}
public static List<IPackageFragment> getDirectChildPackageFragmentsOf(IPackageFragment parent)
......
......@@ -446,6 +446,22 @@
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_fhZQ0EykEemgq5GM9Ri4pw" id="(0.5,0.5)"/>
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_fhZQ0UykEemgq5GM9Ri4pw" id="(0.5,0.5)"/>
</edges>
<edges xmi:type="notation:Edge" xmi:id="_guakwE7tEemgq5GM9Ri4pw" type="4001" element="_gt3yNk7tEemgq5GM9Ri4pw" source="_JffAEEu4EemGNZlSjzZDUw" target="_AqJWEEvDEem1yc4qjMuGvw">
<children xmi:type="notation:Node" xmi:id="_gubL0E7tEemgq5GM9Ri4pw" type="6001">
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_gubL0U7tEemgq5GM9Ri4pw" y="-10"/>
</children>
<children xmi:type="notation:Node" xmi:id="_gubL0k7tEemgq5GM9Ri4pw" type="6002">
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_gubL007tEemgq5GM9Ri4pw" y="10"/>
</children>
<children xmi:type="notation:Node" xmi:id="_gubL1E7tEemgq5GM9Ri4pw" type="6003">
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_gubL1U7tEemgq5GM9Ri4pw" y="10"/>
</children>
<styles xmi:type="notation:ConnectorStyle" xmi:id="_guakwU7tEemgq5GM9Ri4pw" routing="Rectilinear"/>
<styles xmi:type="notation:FontStyle" xmi:id="_guakwk7tEemgq5GM9Ri4pw" fontColor="7490599" fontName="Ubuntu" fontHeight="8"/>
<bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_guakw07tEemgq5GM9Ri4pw" points="[0, 0, 247, 184]$[-124, 0, 123, 184]$[-124, -184, 123, 0]$[-247, -184, 0, 0]"/>
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_guby4E7tEemgq5GM9Ri4pw" id="(0.0,0.4146341463414634)"/>
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_guby4U7tEemgq5GM9Ri4pw" id="(1.0,0.5)"/>
</edges>
</data>
</ownedAnnotationEntries>
<ownedDiagramElements xmi:type="diagram:DNodeList" uid="_tX31IEu3EemGNZlSjzZDUw" name="PreProcessor" tooltipText="" outgoingEdges="_XY4_5ku4EemGNZlSjzZDUw" width="12" height="10">
......@@ -548,7 +564,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
</ownedDiagramElements>
<ownedDiagramElements xmi:type="diagram:DNodeList" uid="_JfK3AEu4EemGNZlSjzZDUw" name="TestElement" tooltipText="" outgoingEdges="_OaZa4Eu4EemGNZlSjzZDUw _ThURZku4EemGNZlSjzZDUw" incomingEdges="_YA6pQku4EemGNZlSjzZDUw _YUxZUEu4EemGNZlSjzZDUw _Yk5gBku4EemGNZlSjzZDUw _rUKmE0u5EemQEINz6GDYJQ" width="12" height="10">
<ownedDiagramElements xmi:type="diagram:DNodeList" uid="_JfK3AEu4EemGNZlSjzZDUw" name="TestElement" tooltipText="" outgoingEdges="_OaZa4Eu4EemGNZlSjzZDUw _ThURZku4EemGNZlSjzZDUw _gt3yNk7tEemgq5GM9Ri4pw" incomingEdges="_YA6pQku4EemGNZlSjzZDUw _YUxZUEu4EemGNZlSjzZDUw _Yk5gBku4EemGNZlSjzZDUw _rUKmE0u5EemQEINz6GDYJQ" width="12" height="10">
<target xmi:type="ecore:EClass" href="jmeter.ecore#//TestElement"/>
<semanticElements xmi:type="ecore:EClass" href="jmeter.ecore#//TestElement"/>
<arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
......@@ -786,7 +802,7 @@
</ownedStyle>
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
</ownedDiagramElements>
<ownedDiagramElements xmi:type="diagram:DNodeList" uid="_ApbkYEvDEem1yc4qjMuGvw" name="Protocol" tooltipText="" outgoingEdges="_Aa6L5kyiEemgq5GM9Ri4pw" incomingEdges="_vKSa4EvsEemgq5GM9Ri4pw _fhR8FkykEemgq5GM9Ri4pw" width="12" height="10">
<ownedDiagramElements xmi:type="diagram:DNodeList" uid="_ApbkYEvDEem1yc4qjMuGvw" name="Protocol" tooltipText="" outgoingEdges="_Aa6L5kyiEemgq5GM9Ri4pw" incomingEdges="_vKSa4EvsEemgq5GM9Ri4pw _fhR8FkykEemgq5GM9Ri4pw _gt3yNk7tEemgq5GM9Ri4pw" width="12" height="10">
<target xmi:type="ecore:EClass" href="jmeter.ecore#//Protocol"/>
<semanticElements xmi:type="ecore:EClass" href="jmeter.ecore#//Protocol"/>
<ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_ApdZkEvDEem1yc4qjMuGvw" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
......@@ -833,6 +849,20 @@
</ownedStyle>
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
</ownedDiagramElements>
<ownedDiagramElements xmi:type="diagram:DEdge" uid="_gt3yNk7tEemgq5GM9Ri4pw" name="[0..1] proto" sourceNode="_JfK3AEu4EemGNZlSjzZDUw" targetNode="_ApbkYEvDEem1yc4qjMuGvw">
<target xmi:type="ecore:EReference" href="jmeter.ecore#//TestElement/proto"/>
<semanticElements xmi:type="ecore:EReference" href="jmeter.ecore#//TestElement/proto"/>
<ownedStyle xmi:type="diagram:EdgeStyle" uid="_gt4ZQE7tEemgq5GM9Ri4pw" routingStyle="manhattan" strokeColor="0,0,0">
<description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']/@style"/>
<centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_gt4ZQk7tEemgq5GM9Ri4pw" showIcon="false">
<customFeatures>labelSize</customFeatures>
</centerLabelStyle>
<endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_gt4ZQU7tEemgq5GM9Ri4pw" showIcon="false" labelColor="39,76,114">
<customFeatures>labelSize</customFeatures>
</endLabelStyle>
</ownedStyle>
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
</ownedDiagramElements>
<description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
<filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_qTgsQEu3EemGNZlSjzZDUw"/>
<activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/>
......
......@@ -17,6 +17,7 @@
<eClassifiers xsi:type="ecore:EClass" name="TestElement" abstract="true" eSuperTypes="#//Named">
<eStructuralFeatures xsi:type="ecore:EReference" name="operation" upperBound="-1"
eType="#//Operation" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="proto" eType="#//Protocol"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Operation" eSuperTypes="#//Named"/>
<eClassifiers xsi:type="ecore:EClass" name="Named" abstract="true">
......
......@@ -25,6 +25,7 @@
</genClasses>
<genClasses ecoreClass="jmeter.ecore#//TestElement">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference jmeter.ecore#//TestElement/operation"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference jmeter.ecore#//TestElement/proto"/>
</genClasses>
<genClasses ecoreClass="jmeter.ecore#//Operation"/>
<genClasses image="false" ecoreClass="jmeter.ecore#//Named">
......
......@@ -286,6 +286,15 @@ public interface JmeterPackage extends EPackage {
*/
int TEST_ELEMENT__OPERATION = NAMED_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Proto</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int TEST_ELEMENT__PROTO = NAMED_FEATURE_COUNT + 1;
/**
* The number of structural features of the '<em>Test Element</em>' class.
* <!-- begin-user-doc -->
......@@ -293,7 +302,7 @@ public interface JmeterPackage extends EPackage {
* @generated
* @ordered
*/
int TEST_ELEMENT_FEATURE_COUNT = NAMED_FEATURE_COUNT + 1;
int TEST_ELEMENT_FEATURE_COUNT = NAMED_FEATURE_COUNT + 2;
/**
* The number of operations of the '<em>Test Element</em>' class.
......@@ -332,6 +341,15 @@ public interface JmeterPackage extends EPackage {
*/
int SAMPLER__OPERATION = TEST_ELEMENT__OPERATION;
/**
* The feature id for the '<em><b>Proto</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SAMPLER__PROTO = TEST_ELEMENT__PROTO;
/**
* The number of structural features of the '<em>Sampler</em>' class.
* <!-- begin-user-doc -->
......@@ -378,6 +396,15 @@ public interface JmeterPackage extends EPackage {
*/
int CONTROLLER__OPERATION = TEST_ELEMENT__OPERATION;
/**
* The feature id for the '<em><b>Proto</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CONTROLLER__PROTO = TEST_ELEMENT__PROTO;
/**
* The number of structural features of the '<em>Controller</em>' class.
* <!-- begin-user-doc -->
......@@ -424,6 +451,15 @@ public interface JmeterPackage extends EPackage {
*/
int ASSERTION__OPERATION = TEST_ELEMENT__OPERATION;
/**
* The feature id for the '<em><b>Proto</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int ASSERTION__PROTO = TEST_ELEMENT__PROTO;
/**
* The number of structural features of the '<em>Assertion</em>' class.
* <!-- begin-user-doc -->
......@@ -869,6 +905,17 @@ public interface JmeterPackage extends EPackage {
*/
EReference getTestElement_Operation();
/**
* Returns the meta object for the reference '{@link org.codeling.lang.jmeter.metamodel.jmeter.TestElement#getProto <em>Proto</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Proto</em>'.
* @see org.codeling.lang.jmeter.metamodel.jmeter.TestElement#getProto()
* @see #getTestElement()
* @generated
*/
EReference getTestElement_Proto();
/**
* Returns the meta object for class '{@link org.codeling.lang.jmeter.metamodel.jmeter.Operation <em>Operation</em>}'.
* <!-- begin-user-doc -->
......@@ -1100,6 +1147,14 @@ public interface JmeterPackage extends EPackage {
*/
EReference TEST_ELEMENT__OPERATION = eINSTANCE.getTestElement_Operation();
/**
* The meta object literal for the '<em><b>Proto</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference TEST_ELEMENT__PROTO = eINSTANCE.getTestElement_Proto();
/**
* The meta object literal for the '{@link org.codeling.lang.jmeter.metamodel.jmeter.impl.OperationImpl <em>Operation</em>}' class.
* <!-- begin-user-doc -->
......
......@@ -14,6 +14,7 @@ import org.eclipse.emf.common.util.EList;
* </p>
* <ul>
* <li>{@link org.codeling.lang.jmeter.metamodel.jmeter.TestElement#getOperation <em>Operation</em>}</li>
* <li>{@link org.codeling.lang.jmeter.metamodel.jmeter.TestElement#getProto <em>Proto</em>}</li>
* </ul>
*
* @see org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage#getTestElement()
......@@ -37,4 +38,30 @@ public interface TestElement extends Named {
*/
EList<Operation> getOperation();
/**
* Returns the value of the '<em><b>Proto</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Proto</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Proto</em>' reference.
* @see #setProto(Protocol)
* @see org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage#getTestElement_Proto()
* @model
* @generated
*/
Protocol getProto();
/**
* Sets the value of the '{@link org.codeling.lang.jmeter.metamodel.jmeter.TestElement#getProto <em>Proto</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Proto</em>' reference.
* @see #getProto()
* @generated
*/
void setProto(Protocol value);
} // TestElement
......@@ -324,6 +324,16 @@ public class JmeterPackageImpl extends EPackageImpl implements JmeterPackage {
return (EReference) testElementEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EReference getTestElement_Proto() {
return (EReference) testElementEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -456,6 +466,7 @@ public class JmeterPackageImpl extends EPackageImpl implements JmeterPackage {
testElementEClass = createEClass(TEST_ELEMENT);
createEReference(testElementEClass, TEST_ELEMENT__OPERATION);
createEReference(testElementEClass, TEST_ELEMENT__PROTO);
operationEClass = createEClass(OPERATION);
......@@ -550,6 +561,9 @@ public class JmeterPackageImpl extends EPackageImpl implements JmeterPackage {
initEReference(getTestElement_Operation(), this.getOperation(), null, "operation", null, 0, -1,
TestElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getTestElement_Proto(), this.getProtocol(), null, "proto", null, 0, 1, TestElement.class,
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(operationEClass, Operation.class, "Operation", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
......
......@@ -6,8 +6,10 @@ import java.util.Collection;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.metamodel.jmeter.Operation;
import org.codeling.lang.jmeter.metamodel.jmeter.Protocol;
import org.codeling.lang.jmeter.metamodel.jmeter.TestElement;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
......@@ -15,6 +17,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
......@@ -27,6 +30,7 @@ import org.eclipse.emf.ecore.util.InternalEList;
* </p>
* <ul>
* <li>{@link org.codeling.lang.jmeter.metamodel.jmeter.impl.TestElementImpl#getOperation <em>Operation</em>}</li>
* <li>{@link org.codeling.lang.jmeter.metamodel.jmeter.impl.TestElementImpl#getProto <em>Proto</em>}</li>
* </ul>
*
* @generated
......@@ -42,6 +46,16 @@ public abstract class TestElementImpl extends NamedImpl implements TestElement {
*/
protected EList<Operation> operation;
/**
* The cached value of the '{@link #getProto() <em>Proto</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProto()
* @generated
* @ordered
*/
protected Protocol proto;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -75,6 +89,47 @@ public abstract class TestElementImpl extends NamedImpl implements TestElement {
return operation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Protocol getProto() {
if (proto != null && proto.eIsProxy()) {
InternalEObject oldProto = (InternalEObject) proto;
proto = (Protocol) eResolveProxy(oldProto);
if (proto != oldProto) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, JmeterPackage.TEST_ELEMENT__PROTO,
oldProto, proto));
}
}
return proto;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Protocol basicGetProto() {
return proto;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setProto(Protocol newProto) {
Protocol oldProto = proto;
proto = newProto;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, JmeterPackage.TEST_ELEMENT__PROTO, oldProto, proto));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -99,6 +154,10 @@ public abstract class TestElementImpl extends NamedImpl implements TestElement {
switch (featureID) {
case JmeterPackage.TEST_ELEMENT__OPERATION:
return getOperation();
case JmeterPackage.TEST_ELEMENT__PROTO:
if (resolve)
return getProto();
return basicGetProto();
}
return super.eGet(featureID, resolve, coreType);
}
......@@ -116,6 +175,9 @@ public abstract class TestElementImpl extends NamedImpl implements TestElement {
getOperation().clear();
getOperation().addAll((Collection<? extends Operation>) newValue);
return;
case JmeterPackage.TEST_ELEMENT__PROTO:
setProto((Protocol) newValue);
return;
}
super.eSet(featureID, newValue);
}
......@@ -131,6 +193,9 @@ public abstract class TestElementImpl extends NamedImpl implements TestElement {
case JmeterPackage.TEST_ELEMENT__OPERATION:
getOperation().clear();
return;
case JmeterPackage.TEST_ELEMENT__PROTO:
setProto((Protocol) null);
return;
}
super.eUnset(featureID);
}
......@@ -145,6 +210,8 @@ public abstract class TestElementImpl extends NamedImpl implements TestElement {
switch (featureID) {
case JmeterPackage.TEST_ELEMENT__OPERATION:
return operation != null && !operation.isEmpty();
case JmeterPackage.TEST_ELEMENT__PROTO:
return proto != null;
}
return super.eIsSet(featureID);
}
......
......@@ -5,6 +5,7 @@ import java.util.List;
import org.codeling.lang.base.java.transformation.AbstractModelCodeTransformation;
import org.codeling.lang.jmeter.metamodel.jmeter.Assertion;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.transformation.testelement_feature.ProtoTransformation;
import org.codeling.mechanisms.transformations.classes.MarkerInterfaceTransformation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
......@@ -20,6 +21,7 @@ public class AssertionTransformation extends MarkerInterfaceTransformation<Asser
@Override
public void doCreateCrossReferencesTransformations(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
result.add(new ProtoTransformation<Assertion>(this));
}
@Override
......
......@@ -3,15 +3,17 @@ package org.codeling.lang.jmeter.transformation;
import java.util.List;
import org.codeling.lang.base.java.transformation.AbstractModelCodeTransformation;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.metamodel.jmeter.Compiler;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.transformation.processcomponent_feature.ProtoTransformation;
import org.codeling.mechanisms.transformations.ClassMechanismTransformation;
import org.codeling.utils.CodelingException;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IType;
public class CompilerTransformation extends ClassMechanismTransformation<Compiler, IJavaElement> {
public class CompilerTransformation extends ClassMechanismTransformation<Compiler, IType> {
public CompilerTransformation(AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement> parentTransformation) {
super(parentTransformation, JmeterPackage.eINSTANCE.getCompiler());
......@@ -20,6 +22,7 @@ public class CompilerTransformation extends ClassMechanismTransformation<Compile
@Override
public void doCreateCrossReferencesTransformations(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
result.add(new ProtoTransformation<Compiler>(this));
}
@Override
......
......@@ -6,6 +6,7 @@ import org.codeling.lang.base.java.ASTUtils;
import org.codeling.lang.base.java.transformation.AbstractModelCodeTransformation;
import org.codeling.lang.jmeter.metamodel.jmeter.Controller;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.transformation.testelement_feature.ProtoTransformation;
import org.codeling.mechanisms.transformations.classes.MarkerInterfaceTransformation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
......@@ -22,6 +23,7 @@ public class ControllerTransformation extends MarkerInterfaceTransformation<Cont
@Override
public void doCreateCrossReferencesTransformations(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
result.add(new ProtoTransformation<Controller>(this));
}
@Override
......
......@@ -5,6 +5,7 @@ import java.util.List;
import org.codeling.lang.base.java.transformation.AbstractModelCodeTransformation;
import org.codeling.lang.jmeter.metamodel.jmeter.EventListener;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.transformation.processcomponent_feature.ProtoTransformation;
import org.codeling.mechanisms.transformations.classes.MarkerInterfaceTransformation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
......@@ -19,6 +20,7 @@ public class EventListenerTransformation extends MarkerInterfaceTransformation<E
@Override
public void doCreateCrossReferencesTransformations(
List<AbstractModelCodeTransformation<? extends EObject, ? extends IJavaElement>> result) {
result.add(new ProtoTransformation<EventListener>(this));
}
@Override
......
......@@ -5,6 +5,7 @@ import java.util.List;
import org.codeling.lang.base.java.transformation.AbstractModelCodeTransformation;
import org.codeling.lang.jmeter.metamodel.jmeter.JmeterPackage;
import org.codeling.lang.jmeter.metamodel.jmeter.PostProcessor;
import org.codeling.lang.jmeter.transformation.processcomponent_feature.ProtoTransformation;
import org.codeling.mechanisms.transformations.classes.MarkerInterfaceTransformation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.core.IJavaElement;
......@@ -20,6 +21,7 @@ public class PostProcessorTransformation extends MarkerInterfaceTransformation<P
@Override