Skip to content

New test for the correct naming of concrete type version classes#1791

Open
michaelze wants to merge 1 commit intoeclipse-scout:releases/25.2from
michaelze:features/michaelze/add-test-for-type-version-class-naming
Open

New test for the correct naming of concrete type version classes#1791
michaelze wants to merge 1 commit intoeclipse-scout:releases/25.2from
michaelze:features/michaelze/add-test-for-type-version-class-naming

Conversation

@michaelze
Copy link
Copy Markdown
Contributor

When creating a new NamespaceVersion from a type version class name, the name of the class (up until the first underscore) is converted to the namespace id with the first letter being transformed to lower case (the rest of the classname is left as-is). As all namespace ids only consist of lowercase letters, this assumes that the type version class name only consists of lowercase letters (except the first one). When this assumption is not true, problems arise when trying to resolve namespaces by the created NamespaceVersion as the contained namespace id (with incorrect casing) does not match any known namespace id. The problems that can arise are hard to debug because there's no hint at the wrong casing, every class seems to be present and have the right name. This is why we chose to contribute a test case that checks for the correct naming of ITypeVersion implementations. In addition, a test was added to the AbstractDataObjectTestCompletenessTest as a reminder to add the mentioned test class.

@eclipse-scout-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@michaelze michaelze force-pushed the features/michaelze/add-test-for-type-version-class-naming branch from d910651 to 265bd71 Compare November 3, 2025 15:11
@rogersteblerbsi rogersteblerbsi self-requested a review November 3, 2025 15:19
String actualNamespaceIdString = matcher.group(1);
String expectedNamespaceIdString = StringUtility.uppercaseFirst(actualNamespaceIdString.toLowerCase());

return !actualNamespaceIdString.equals(expectedNamespaceIdString);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will we do with all the Fixture Type Versions that we have in Scout? For example DataObjectFixture_1_0_0 will be invalid. Rename them all? Or just exclude them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a good point which also raises the question why they do have a "wrong" name in the first place.
While developing this change I found it increasingly strange, that the rule we are testing for is not enforced more strictly in the code (e.g. when constructing a NamespaceVersion object).
On the other hand: why are we selectively converting only the first letter to lower case and not the whole namespace part of the type version class name?

What are your thoughts on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we use these names for the Fixture Type Versions that don't match the naming pattern. Maybe @paolobazzi or @LukasHuser know more about this topic?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those names are a (legacy) shortcut choosen to simplify tests (and using differtent namespaces we did not have to deal with duplicated type names).
Those namespace could be adjusted/fixed (+ check for duplicated type names)

@michaelze michaelze force-pushed the features/michaelze/add-test-for-type-version-class-naming branch from 265bd71 to 0d48275 Compare November 11, 2025 09:15
String actualNamespaceIdString = matcher.group(1);
String expectedNamespaceIdString = StringUtility.uppercaseFirst(actualNamespaceIdString.toLowerCase());

return !actualNamespaceIdString.equals(expectedNamespaceIdString);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we use these names for the Fixture Type Versions that don't match the naming pattern. Maybe @paolobazzi or @LukasHuser know more about this topic?

@michaelze michaelze force-pushed the features/michaelze/add-test-for-type-version-class-naming branch 2 times, most recently from 3b1509f to e517e78 Compare December 12, 2025 08:06
When creating a new NamespaceVersion from a type version class name, the
name of the class (up until the first underscore) is converted to the
namespace id with the first letter being transformed to lower case (the
rest of the classname is left as-is). As all namespace ids only consist
of lowercase letters, this assumes that the type version class name only
consists of lowercase letters (except the first one). When this
assumption is not true, problems arise when trying to resolve namespaces
by the created NamespaceVersion as the contained namespace id (with
incorrect casing) does not match any known namespace id. The problems
that can arise are hard to debug because there's no hint at the wrong
casing, every class seems to be present and have the right name.
This is why we chose to contribute a test case that checks for the
correct naming of ITypeVersion implementations. In addition, a test was
added to the AbstractDataObjectTestCompletenessTest as a reminder to add
the mentioned test class.

437982
@michaelze michaelze force-pushed the features/michaelze/add-test-for-type-version-class-naming branch from e517e78 to 90984bb Compare December 16, 2025 06:10
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.

4 participants