DatabaseDriverManager.getInstance returns null in test environment



I recently tried to tidy up my plugin dependencies. I added the current version for the com.intellij.database plugin in my build.gradle.kts


Before the plugin build was left out.

This caused my tests to fail because DatabaseDriverManager.getInstance() started to return null in test environment. My production code is still working.

Here is a minimal code snippet to reproduce my issue:

final class SomeTest extends BasePlatformTestCase {
protected void setUp() throws Exception {

public void testSomething() {

Reverting the build.gradle.kts back to


seems to fix the issue but I'm not sure which version is installed then and if the same error will occure just at a later date.

Could you please tell me if this is intended behavior, a bug, or if I did something wrong?

Thanks in advance!

Comment actions Permalink

Hi Nico,

Please check if this plugin is bundled with the IDE you have configured in the intellij extension (intellij.type / intellij.version values). To verify if plugin is bundled, you can check it in the used IDE directory, e.g. /Users/<user_home>/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2022.1/c91a19824ffcb28872ecd2761c83b250f703ff21/ideaIC-2022.1/plugins or in the local installation if you use this approach.

If it is bundled, then you shouldn't specify the version explicitly as the plugin is already in the IDE directory.

If the plugin is not bundled, then make sure it is available and actually downloaded during the tests (check it in the test sandbox directory).

For more details check the "plugins" description in Gradle IntelliJ Plugin doc:

Comment actions Permalink

Hey Karol Lewandowski,

thanks for your feedback!

I'm targeting IntelliJ Ultimate for compiling / testing. The plugin is made to be used in PHPStorm, WebStorm and IntellijJ Ultimate.

Checking the plugins directory I can find "DatabaseTools" it includes a database-plugin.jar, so I think this means that it is bundles.

Following your explainationand the linked documentation, that the version should be specified only for not bundled plugins I come to the following result:

intellij {

Could you please confirm, that this is right? With this setup the tests run successfully.

One more little question. If I do only reference classes of "phpstorm-docker" in my plugin code, do I need to add Docker and phpstorm-remote-interpreter, which are sub dependencies, too?


Comment actions Permalink

Hi Nico,

Yes, regarding the database plugin it is bundled and doesn't require a version as it doesn't have to be downloaded. The setup is correct now.

Regarding the sub dependencies, you should include them in the setup as well, as they all are separate artifacts.

Comment actions Permalink

Okay, thank you very much, Karol Lewandowski!


Please sign in to leave a comment.