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

Implement functionality to navigate from test method to validation file and back #21

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

kevin-keul
Copy link
Collaborator

See issue #18

@pfhartma
Copy link
Member

pfhartma commented Jun 17, 2024

Update: test works on the current version (9c16526) of the branch

On my system, the tests do not run successfully. (It works for the master branch though)

$ java -version
openjdk version "17.0.4" 2022-07-19
./gradlew test

failing tests:

UnknownClass. executionError
ValidationFileAutomaticRenamerTest. testRenameClass_renamesAllValidationFiles
ValidationFileAutomaticRenamerTest. testRenameClass_withDirectoryJoiningStrategy_renamesOnlyApplicableValidationFiles
ValidationFileAutomaticRenamerTest. testRenameMethod_renamesAllValidationFiles
ValidationFileAutomaticRenamerTest. testRenameMethod_withDirectoryJoiningStrategy_renamesOnlyApplicableValidationFiles
com.intellij.testFramework.TestLoggerFactory$TestLoggerAssertionError: Memory leak detected: 'newDisposable' of class com.intellij.openapi.util.Disposer$1 is registered in Disposer but wasn't disposed.
Register it with a proper parentDisposable or ensure that it's always disposed by direct Disposer.dispose call.
See https://jetbrains.org/intellij/sdk/docs/basics/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

	at com.intellij.testFramework.TestLoggerFactory$TestLogger.error(TestLoggerFactory.java:400)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:236)
...
Caused by: java.lang.RuntimeException: Memory leak detected: 'newDisposable' of class com.intellij.openapi.util.Disposer$1 is registered in Disposer but wasn't disposed.
Register it with a proper parentDisposable or ensure that it's always disposed by direct Disposer.dispose call.
See https://jetbrains.org/intellij/sdk/docs/basics/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

	at com.intellij.openapi.util.ObjectNode.assertNoChildren(ObjectNode.java:44)

And:

java.lang.NullPointerException: null cannot be cast to non-null type com.intellij.ide.impl.HeadlessDataManager
	at com.intellij.testFramework.TestApplicationManager$Companion.getDataManager(TestApplicationManager.kt:55)
	at com.intellij.testFramework.TestApplicationManager$Companion.access$getDataManager(TestApplicationManager.kt:47)
	at com.intellij.testFramework.TestApplicationManager.setDataProvider(TestApplicationManager.kt:214)
	at com.intellij.testFramework.HeavyPlatformTestCase.initApplication(HeavyPlatformTestCase.java:175)
	at com.intellij.testFramework.HeavyPlatformTestCase.setUp(HeavyPlatformTestCase.java:221)
	at com.intellij.testFramework.HeavyPlatformTestCase.lambda$runBareImpl$23(HeavyPlatformTestCase.java:551)
	at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$1(EdtTestUtil.java:40)

@kevin-keul
Copy link
Collaborator Author

kevin-keul commented Jun 17, 2024

About #21 (comment) above:

On my system, the tests do not run successfully. (It works for the master branch though)

$ java -version
openjdk version "17.0.4" 2022-07-19
./gradlew test

failing tests:

...

This is actually two separate problems.

  1. Concerning NullPointerException: The ValidationFileAutomaticRenamerTest uses HeavyPlatformTestCase, which is not working together with the new Abstract Test setup introduced in a future PR and already in parts cherry-picked in bb1950a. This is fixed by using the new AbstractValidationFilePluginTest instead of HeavyPlatformTestCase in 24618e4.

  2. Concerning Memory leak detected: By introducing the new AbstractValidationFilePluginTest, an additional check for memory leaks in the tests is performed, which wasn't there before (due to using annotation @TestApplication). While the new tests don't have memory leaks, the already existing ones actually do. When running gradle task for tests, all tests are executed and the Memory leaks in existing tests (which appear because of a missing disposing step) become visible. They are fixed in f14aced.

Copy link
Member

@pfhartma pfhartma left a comment

Choose a reason for hiding this comment

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

I have no experience with Intellij pugin development, but looks good, as far as I can tell. 🙂

@kevin-keul kevin-keul force-pushed the feature/validation-file-references branch from 9c16526 to 0e00d66 Compare June 21, 2024 14:52
@kevin-keul kevin-keul merged commit 4e79a1a into master Jun 21, 2024
1 check passed
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