Skip to content

Conversation

@bhufmann
Copy link
Contributor

@bhufmann bhufmann commented Oct 8, 2025

What it does

Use generated TSP java client in all existing unit tests. The generated Java TSP client is introduced by PR #228.

  • Use APIs classes to issue back-end queries
  • Use returned TSP Java client models for verification
  • Keep implementation of some adversarial tests because it allows for out-of-spec input query parameters (e.g. invalid UUID string). Also, it allows for code re-use (see RestServerTests#executePostErrorTests) which would have cause a lot copied code to do the same calls but with different input and output classes and apis.

Note: Multiple issues have been indentified and some have been already fixed.

Note: Fix for #236 is needed to properly test the SeriesModels queries of tests GenericXYDataProviderServiceTest, XyDataProviderServiceTest and SeriesModelSerializerTest. In this PR those tests ignore parsing errors (see FIXMEs)

How to test

Successful CI run. Make sure that all unit tests are executed successfully.

Follow-ups

Add more test cases to validate more TSP models returned during queries.

Review checklist

  • As an author, I have thoroughly tested my changes and carefully followed the instructions in this template

/**
* XY API
*/
private static XyApi sfxyApi = new XyApi(sfApiClient);
Copy link
Contributor

Choose a reason for hiding this comment

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

sfXyApi? and should be static final?

return Long.valueOf(callstackOptional.get().getId()).intValue(); // TODO
// ID
// is
// long
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix wrapping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I actually replaced by a FIXME with link to the issue tracker: // FIXME eclipse-cdt-cloud/trace-server-protocol#140. I've done in both the xy and timegraph tests.

The following issues were identified and need fixes.

eclipse-tracecompass-incubator#235
eclipse-tracecompass-incubator#213
eclipse-tracecompass-incubator#236
eclipse-cdt-cloud/trace-server-protocol#140

There is a workaround for eclipse-tracecompass-incubator#236 implemented that ignores the issue, but
needs to be fixed to test the xy series models.

Signed-off-by: Bernd Hufmann <[email protected]>
Disable MapperFeature.ALLOW_COERCION_OF_SCALARS so that
StateValue.deserialize() only tries to deserialize the received
type and not the others, which would cause a parse exception.

Signed-off-by: Bernd Hufmann <[email protected]>
After all tests having been migrated the class can be renamed
to the original name.

Signed-off-by: Bernd Hufmann <[email protected]>
They have been replaced by the generated TSP java client in
plugin: org.eclipse.tracecompass.incubator.tsp.client.core

Signed-off-by: Bernd Hufmann <[email protected]>
@bhufmann bhufmann merged commit 88b0297 into eclipse-tracecompass-incubator:master Oct 16, 2025
2 checks passed
@bhufmann bhufmann deleted the java-gen-tests branch October 16, 2025 14:13
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.

2 participants