Community
Participate
Working Groups
Build ID: 3.4 M7 In 2.4M7 I am having invalid tests generated when using Maps. Here is a sample ecore that demonstrates the issue: <?xml version="1.0" encoding="UTF-8"?> <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="abc" nsURI="http://www.example.com/abc" nsPrefix="abc"> <eClassifiers xsi:type="ecore:EClass" name="A"> <eStructuralFeatures xsi:type="ecore:EReference" name="B" upperBound="-1" eType="#//StringToStringMapEntry" containment="true"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="StringToStringMapEntry" instanceClassName="java.util.Map$Entry"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="key" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> </eClassifiers> </ecore:EPackage> When I create an EMF model from that and generate the model and the tests, I get StringToStringMapEntryTest.java created that calls AbcFactory.eINSTANCE.createStringToStringMapEntry() which does not exist.
Created attachment 100571 [details] Fix to create a map entry properly. I suppose the alternative is to not generate a test case for a map entry class...
The fix is committed to CVS.
Marking it fixed...
Kenn, This affects UML2's compiled templates.
Fix available in HEAD: 2.4.0RC1 (S200805201049).