Skip to content

Commit

Permalink
DTO to EMF converters (c.d.)
Browse files Browse the repository at this point in the history
 - Fix for issue with custom `java.util.Map$Entry`, used when creating
`EMap`

 - Fix for issue with `org.gecko.emf.converter` used as package name in
integration tests

Signed-off-by: Michael H. Siemaszko <mhs@into.software>
  • Loading branch information
ideas-into-software committed May 26, 2024
1 parent c25e1c2 commit b968eac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions org.gecko.emf.converter.tests/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Bundle-Version: 1.0.0.SNAPSHOT

-buildpath: \
org.gecko.emf.converter;version=snapshot,\
org.gecko.emf.converter.model;version=snapshot,\
org.osgi.dto,\
org.osgi.util.converter;version=latest,\
org.osgi.util.function;version=latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@ExtendWith(BundleContextExtension.class)
@ExtendWith(ServiceExtension.class)
public class DTOToEObjectConverterTest {
private static final String PACKAGE_NAME = "org.gecko.emf.converter";
private static final String PACKAGE_NAME = "dto_to_eobject_converter_test";
private static final String NS_URI = "http://gecko.org/test/model/converter/1.0";
private static final String NS_PREFIX = "tests";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
@ExtendWith(BundleContextExtension.class)
@ExtendWith(ServiceExtension.class)
public class DTOToEPackageConverterTest {
private static final String PACKAGE_NAME = "org.gecko.emf.converter";
private static final String PACKAGE_NAME = "dto_to_epackage_converter_test";
private static final String NS_URI = "http://gecko.org/test/model/converter/1.0";
private static final String NS_PREFIX = "tests";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,16 +298,16 @@ private static void createEMap(EcoreFactory eFactory, EPackage ePackage, EClass
mapEntryEClass.setInstanceClassName("java.util.Map$Entry");

// key
EReference dynamicMapEntryKeyEReference = eFactory.createEReference();
dynamicMapEntryKeyEReference.setName("key");
dynamicMapEntryKeyEReference.setEType(getEClassifierForJavaType(eFactory, ePackage, mapKeyActualType));
mapEntryEClass.getEStructuralFeatures().add(dynamicMapEntryKeyEReference);
EAttribute dynamicMapEntryKeyEAttribute = eFactory.createEAttribute();
dynamicMapEntryKeyEAttribute.setName("key");
dynamicMapEntryKeyEAttribute.setEType(getEClassifierForJavaType(eFactory, ePackage, mapKeyActualType));
mapEntryEClass.getEStructuralFeatures().add(dynamicMapEntryKeyEAttribute);

// value
EReference dynamicMapEntryValueEReference = eFactory.createEReference();
dynamicMapEntryValueEReference.setName("value");
dynamicMapEntryValueEReference.setEType(getEClassifierForJavaType(eFactory, ePackage, mapValueActualType));
mapEntryEClass.getEStructuralFeatures().add(dynamicMapEntryValueEReference);
EAttribute dynamicMapEntryValueEAttribute = eFactory.createEAttribute();
dynamicMapEntryValueEAttribute.setName("value");
dynamicMapEntryValueEAttribute.setEType(getEClassifierForJavaType(eFactory, ePackage, mapValueActualType));
mapEntryEClass.getEStructuralFeatures().add(dynamicMapEntryValueEAttribute);

ePackage.getEClassifiers().add(mapEntryEClass);

Expand Down

0 comments on commit b968eac

Please sign in to comment.