Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PcmUmlClassTests View-Based #274

Merged
merged 13 commits into from
Sep 27, 2023
Merged

Conversation

h4uges
Copy link
Contributor

@h4uges h4uges commented Jul 20, 2023

Get rid of tests that are based on LegacyPcmUmlClassApplicationTest and use instead PcmUmlClassApplicationTest which is a ViewBasedVitruvApplicationTest

  • Open: Adapt UuidResolverImpl to handle Primitive Types correctly (needs own PR)

h4uges and others added 3 commits July 20, 2023 16:39
- Open: fix tests to handle primitive types correctly (currently disabled)
- Open: fix MediaStoreRepositoryCreationTest
- LegacyPcmUmlClassApplicationTest and Helper are still required in transitive change tests
@TomWerm
Copy link
Member

TomWerm commented Aug 1, 2023

Thank you very much for your contribution. I added some minor comments which we should discuss. For this PR to be merged, I think we have to first fix the primitive type issues. I will try to free some time to work on that.

h4uges and others added 6 commits August 14, 2023 09:54
…ryCreation

- simplification: removal of roundtrip tests and stepwise insertion of the UML-Metamodel

reasons for this step are:
- tests have been disabled for a long time
- stepwise insertion isn't the target state
- stepwise insertion heavily depends on details of the reaction which results in high complexity and high maintenance effort
@h4uges
Copy link
Contributor Author

h4uges commented Sep 21, 2023

Some test cases only work with a adaption of the UuidResolverImpl, to handle Primitive Types. Which has to be done in a separate PR.
It is not clear which influences this changes has to other test projects and use cases.

Adaption in the UuidResolverImpl:

private Uuid getUuidForReadOnlyEObject(EObject eObject) {
		String relativePath = EcoreUtil.getRelativeURIFragmentPath(eObject.eResource().getContents().get(0), eObject);
		
		if(relativePath.equals("")) {
			return new Uuid(URI.createURI(eObject.eResource().getURI().toString()).toString());
		}
		
		return new Uuid(URI.createURI(eObject.eResource().getURI() + "#//" + relativePath).toString());
}

The ObjectResolutionUtil.getHierarchicUriFragment could be useful to develop a more general solution for this problem.

h4uges and others added 4 commits September 25, 2023 09:53
- PcmUmlClassHelper.mapPrimitiveTypes returns now only one PrimitiveType instead of a set of matching Types. UML Primitive Types are used if available, the JAVA PrimitiveTypes are only used if no matching type is existent
- goal: make clear which PrimitiveType is used by the reaction (and avoid indeterminism)
- adapted some tests
There is a 1:n relation between PCM and UML PrimitiveDataTypes.
The correspondences of the prefered mapping from PCM to UML is stored with tag DATATYPE__TYPE.
In case a not prefered UML Datatype is used anyway in the UML model, the tag DATATYPE__TYPE__ALTERNATIVE stores also correspondences between not prefered UML datatypes and corresponding PCM datatypes.

- adapted productive and test code to handle this mapping
@h4uges h4uges marked this pull request as ready for review September 27, 2023 15:20
@h4uges h4uges requested a review from a team as a code owner September 27, 2023 15:20
@TomWerm TomWerm merged commit 9236024 into vitruv-tools:main Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants