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

Changing maven compiler plugin config. Updating UICore singleton. #517

Merged
merged 8 commits into from
Feb 25, 2024

Conversation

mriss
Copy link
Contributor

@mriss mriss commented Feb 23, 2024

@mriss mriss changed the title Changing maven compiler plugin following maven compiler plugin specs Changing maven compiler plugin following maven compiler plugin specs. Feb 23, 2024
@mriss mriss closed this Feb 23, 2024
@mriss mriss reopened this Feb 23, 2024
@mriss mriss changed the title Changing maven compiler plugin following maven compiler plugin specs. Changing maven compiler plugin config. Updating UICore singleton. Feb 23, 2024
@mriss
Copy link
Contributor Author

mriss commented Feb 23, 2024

UICore is instantiating singleton inline at the class init code. That make dificult to run tests/integration tests using headless approach in CI/CD environments, sinde UICore uses UI initialization inside the constructor. The inline initialization is making difficult to mock UICore class. Using GuiUtils calls is not enought, since it returns UICore. Thus, we need to mock GuiUtils static method to return a UICore mock, avoiding to enter inside UICore details during headless tests.

@nroduit nroduit self-requested a review February 25, 2024 09:21
@nroduit
Copy link
Owner

nroduit commented Feb 25, 2024

This singleton pattern is not thread-safe (really required by Weasis). See https://www.geeksforgeeks.org/java-singleton-design-pattern-practices-examples/

@nroduit nroduit merged commit 39103f5 into nroduit:master Feb 25, 2024
@nroduit
Copy link
Owner

nroduit commented Feb 25, 2024

I published a fix to be thread-safe. Let me know if it helps for mocking.

mriss added a commit to animatinetpacs/Weasis that referenced this pull request Feb 26, 2024
mriss added a commit to animatinetpacs/Weasis that referenced this pull request Feb 26, 2024
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