diff --git a/.idea/modules.xml b/.idea/modules.xml index 53472c009bd0..49d1e5cf5379 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -574,12 +574,14 @@ + + diff --git a/build/launch/intellij.idea.tools.launch.iml b/build/launch/intellij.idea.tools.launch.iml index b435d73f11a5..9bf6be4e4d67 100644 --- a/build/launch/intellij.idea.tools.launch.iml +++ b/build/launch/intellij.idea.tools.launch.iml @@ -5,6 +5,7 @@ + diff --git a/build/launch/resources/intellij.idea.tools.launch.xml b/build/launch/resources/intellij.idea.tools.launch.xml new file mode 100644 index 000000000000..6fb76a66265d --- /dev/null +++ b/build/launch/resources/intellij.idea.tools.launch.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/java/java-runtime/intellij.java.rt.iml b/java/java-runtime/intellij.java.rt.iml index 0869ffe6bdd4..5ea303d9f65a 100644 --- a/java/java-runtime/intellij.java.rt.iml +++ b/java/java-runtime/intellij.java.rt.iml @@ -33,6 +33,6 @@ - + \ No newline at end of file diff --git a/java/testFramework/intellij.java.testFramework.iml b/java/testFramework/intellij.java.testFramework.iml index 9d5f01d4f28e..74cc612719f8 100644 --- a/java/testFramework/intellij.java.testFramework.iml +++ b/java/testFramework/intellij.java.testFramework.iml @@ -3,6 +3,7 @@ + @@ -10,7 +11,7 @@ - + diff --git a/java/testFramework/resources/intellij.java.testFramework.xml b/java/testFramework/resources/intellij.java.testFramework.xml new file mode 100644 index 000000000000..6fb76a66265d --- /dev/null +++ b/java/testFramework/resources/intellij.java.testFramework.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/libraries/assertj-core/intellij.libraries.assertj.core.iml b/libraries/assertj-core/intellij.libraries.assertj.core.iml new file mode 100644 index 000000000000..5df120795191 --- /dev/null +++ b/libraries/assertj-core/intellij.libraries.assertj.core.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/libraries/assertj-core/resources/intellij.libraries.assertj.core.xml b/libraries/assertj-core/resources/intellij.libraries.assertj.core.xml new file mode 100644 index 000000000000..6fb76a66265d --- /dev/null +++ b/libraries/assertj-core/resources/intellij.libraries.assertj.core.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/libraries/junit4/intellij.libraries.junit4.iml b/libraries/junit4/intellij.libraries.junit4.iml index 6c6fe4ec5559..79a614c9673c 100644 --- a/libraries/junit4/intellij.libraries.junit4.iml +++ b/libraries/junit4/intellij.libraries.junit4.iml @@ -1,12 +1,12 @@ - + - + \ No newline at end of file diff --git a/libraries/kotlin-test/intellij.libraries.kotlinTest.iml b/libraries/kotlin-test/intellij.libraries.kotlinTest.iml new file mode 100644 index 000000000000..813b70cbcbce --- /dev/null +++ b/libraries/kotlin-test/intellij.libraries.kotlinTest.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/libraries/kotlin-test/resources/intellij.libraries.kotlinTest.xml b/libraries/kotlin-test/resources/intellij.libraries.kotlinTest.xml new file mode 100644 index 000000000000..6fb76a66265d --- /dev/null +++ b/libraries/kotlin-test/resources/intellij.libraries.kotlinTest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/platform/remote-driver/test-sdk/intellij.driver.sdk.iml b/platform/remote-driver/test-sdk/intellij.driver.sdk.iml index 53436f8b4d36..aebb523827fd 100644 --- a/platform/remote-driver/test-sdk/intellij.driver.sdk.iml +++ b/platform/remote-driver/test-sdk/intellij.driver.sdk.iml @@ -25,6 +25,7 @@ + diff --git a/platform/remote-driver/test-sdk/resources/intellij.driver.sdk.xml b/platform/remote-driver/test-sdk/resources/intellij.driver.sdk.xml new file mode 100644 index 000000000000..6fb76a66265d --- /dev/null +++ b/platform/remote-driver/test-sdk/resources/intellij.driver.sdk.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/platform/remoteDev-util/modelGenerated/DistributedTestModel.Generated.kt b/platform/remoteDev-util/modelGenerated/DistributedTestModel.Generated.kt index 07491181df90..27c4448568bc 100644 --- a/platform/remoteDev-util/modelGenerated/DistributedTestModel.Generated.kt +++ b/platform/remoteDev-util/modelGenerated/DistributedTestModel.Generated.kt @@ -58,7 +58,7 @@ class DistributedTestModel private constructor( private val __RdTestSessionNullableSerializer = RdTestSession.nullable() - const val serializationHash = -5949507648312297742L + const val serializationHash = -521719455547022632L } override val serializersOwner: ISerializersOwner get() = DistributedTestModel @@ -438,9 +438,8 @@ class RdTestSession private constructor( private val _sendException: RdSignal, private val _exitApp: RdSignal, private val _showNotification: RdSignal, - private val _closeProject: RdCall, private val _forceLeaveAllModals: RdCall, - private val _closeProjectIfOpened: RdCall, + private val _closeAllOpenedProjects: RdCall, private val _runNextAction: RdCall, private val _runNextActionGetComponentData: RdCall, private val _requestFocus: RdCall, @@ -470,9 +469,8 @@ class RdTestSession private constructor( val _sendException = RdSignal.read(ctx, buffer, RdTestSessionException) val _exitApp = RdSignal.read(ctx, buffer, FrameworkMarshallers.Void) val _showNotification = RdSignal.read(ctx, buffer, FrameworkMarshallers.String) - val _closeProject = RdCall.read(ctx, buffer, FrameworkMarshallers.Void, FrameworkMarshallers.Bool) val _forceLeaveAllModals = RdCall.read(ctx, buffer, FrameworkMarshallers.Bool, FrameworkMarshallers.Void) - val _closeProjectIfOpened = RdCall.read(ctx, buffer, FrameworkMarshallers.Void, FrameworkMarshallers.Bool) + val _closeAllOpenedProjects = RdCall.read(ctx, buffer, FrameworkMarshallers.Void, FrameworkMarshallers.Bool) val _runNextAction = RdCall.read(ctx, buffer, RdTestActionParameters, __StringNullableSerializer) val _runNextActionGetComponentData = RdCall.read(ctx, buffer, RdTestActionParameters, RdTestComponentData) val _requestFocus = RdCall.read(ctx, buffer, FrameworkMarshallers.Bool, FrameworkMarshallers.Bool) @@ -483,7 +481,7 @@ class RdTestSession private constructor( val _isResponding = RdCall.read(ctx, buffer, FrameworkMarshallers.Void, FrameworkMarshallers.Bool) val _projectsAreInitialised = RdCall.read(ctx, buffer, FrameworkMarshallers.Void, FrameworkMarshallers.Bool) val _getProductCodeAndVersion = RdCall.read(ctx, buffer, FrameworkMarshallers.Void, RdProductInfo) - return RdTestSession(agentInfo, testClassName, testMethodName, traceCategories, debugCategories, _ready, _sendException, _exitApp, _showNotification, _closeProject, _forceLeaveAllModals, _closeProjectIfOpened, _runNextAction, _runNextActionGetComponentData, _requestFocus, _isFocused, _visibleFrameNames, _projectsNames, _makeScreenshot, _isResponding, _projectsAreInitialised, _getProductCodeAndVersion).withId(_id) + return RdTestSession(agentInfo, testClassName, testMethodName, traceCategories, debugCategories, _ready, _sendException, _exitApp, _showNotification, _forceLeaveAllModals, _closeAllOpenedProjects, _runNextAction, _runNextActionGetComponentData, _requestFocus, _isFocused, _visibleFrameNames, _projectsNames, _makeScreenshot, _isResponding, _projectsAreInitialised, _getProductCodeAndVersion).withId(_id) } override fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: RdTestSession) { @@ -497,9 +495,8 @@ class RdTestSession private constructor( RdSignal.write(ctx, buffer, value._sendException) RdSignal.write(ctx, buffer, value._exitApp) RdSignal.write(ctx, buffer, value._showNotification) - RdCall.write(ctx, buffer, value._closeProject) RdCall.write(ctx, buffer, value._forceLeaveAllModals) - RdCall.write(ctx, buffer, value._closeProjectIfOpened) + RdCall.write(ctx, buffer, value._closeAllOpenedProjects) RdCall.write(ctx, buffer, value._runNextAction) RdCall.write(ctx, buffer, value._runNextActionGetComponentData) RdCall.write(ctx, buffer, value._requestFocus) @@ -522,9 +519,8 @@ class RdTestSession private constructor( val sendException: IAsyncSignal get() = _sendException val exitApp: IAsyncSignal get() = _exitApp val showNotification: ISignal get() = _showNotification - val closeProject: RdCall get() = _closeProject val forceLeaveAllModals: RdCall get() = _forceLeaveAllModals - val closeProjectIfOpened: RdCall get() = _closeProjectIfOpened + val closeAllOpenedProjects: RdCall get() = _closeAllOpenedProjects val runNextAction: RdCall get() = _runNextAction val runNextActionGetComponentData: RdCall get() = _runNextActionGetComponentData val requestFocus: RdCall get() = _requestFocus @@ -544,9 +540,8 @@ class RdTestSession private constructor( init { _sendException.async = true _exitApp.async = true - _closeProject.async = true _forceLeaveAllModals.async = true - _closeProjectIfOpened.async = true + _closeAllOpenedProjects.async = true _runNextAction.async = true _runNextActionGetComponentData.async = true _requestFocus.async = true @@ -564,9 +559,8 @@ class RdTestSession private constructor( bindableChildren.add("sendException" to _sendException) bindableChildren.add("exitApp" to _exitApp) bindableChildren.add("showNotification" to _showNotification) - bindableChildren.add("closeProject" to _closeProject) bindableChildren.add("forceLeaveAllModals" to _forceLeaveAllModals) - bindableChildren.add("closeProjectIfOpened" to _closeProjectIfOpened) + bindableChildren.add("closeAllOpenedProjects" to _closeAllOpenedProjects) bindableChildren.add("runNextAction" to _runNextAction) bindableChildren.add("runNextActionGetComponentData" to _runNextActionGetComponentData) bindableChildren.add("requestFocus" to _requestFocus) @@ -596,7 +590,6 @@ class RdTestSession private constructor( RdSignal(RdTestSessionException), RdSignal(FrameworkMarshallers.Void), RdSignal(FrameworkMarshallers.String), - RdCall(FrameworkMarshallers.Void, FrameworkMarshallers.Bool), RdCall(FrameworkMarshallers.Bool, FrameworkMarshallers.Void), RdCall(FrameworkMarshallers.Void, FrameworkMarshallers.Bool), RdCall(RdTestActionParameters, __StringNullableSerializer), @@ -626,9 +619,8 @@ class RdTestSession private constructor( print("sendException = "); _sendException.print(printer); println() print("exitApp = "); _exitApp.print(printer); println() print("showNotification = "); _showNotification.print(printer); println() - print("closeProject = "); _closeProject.print(printer); println() print("forceLeaveAllModals = "); _forceLeaveAllModals.print(printer); println() - print("closeProjectIfOpened = "); _closeProjectIfOpened.print(printer); println() + print("closeAllOpenedProjects = "); _closeAllOpenedProjects.print(printer); println() print("runNextAction = "); _runNextAction.print(printer); println() print("runNextActionGetComponentData = "); _runNextActionGetComponentData.print(printer); println() print("requestFocus = "); _requestFocus.print(printer); println() @@ -654,9 +646,8 @@ class RdTestSession private constructor( _sendException.deepClonePolymorphic(), _exitApp.deepClonePolymorphic(), _showNotification.deepClonePolymorphic(), - _closeProject.deepClonePolymorphic(), _forceLeaveAllModals.deepClonePolymorphic(), - _closeProjectIfOpened.deepClonePolymorphic(), + _closeAllOpenedProjects.deepClonePolymorphic(), _runNextAction.deepClonePolymorphic(), _runNextActionGetComponentData.deepClonePolymorphic(), _requestFocus.deepClonePolymorphic(), diff --git a/platform/remoteDev-util/modelSources/DistributedTestModel.kt b/platform/remoteDev-util/modelSources/DistributedTestModel.kt index 802a4deb4d99..b00f468d0336 100644 --- a/platform/remoteDev-util/modelSources/DistributedTestModel.kt +++ b/platform/remoteDev-util/modelSources/DistributedTestModel.kt @@ -71,9 +71,8 @@ object DistributedTestModel : Ext(TestRoot) { signal("sendException", RdTestSessionException).async signal("exitApp", void).async signal("showNotification", string) - call("closeProject", void, bool).async call("forceLeaveAllModals", bool, void).async - call("closeProjectIfOpened", void, bool).async + call("closeAllOpenedProjects", void, bool).async call("runNextAction", RdTestActionParameters, string.nullable).async call("runNextActionGetComponentData", RdTestActionParameters, RdTestComponentData).async call("requestFocus", bool, bool).async diff --git a/platform/remoteDev-util/src/com/intellij/remoteDev/tests/DistributedTestsAgentConstants.kt b/platform/remoteDev-util/src/com/intellij/remoteDev/tests/DistributedTestsAgentConstants.kt index fc8d76f7c5ed..8556bfbf2961 100644 --- a/platform/remoteDev-util/src/com/intellij/remoteDev/tests/DistributedTestsAgentConstants.kt +++ b/platform/remoteDev-util/src/com/intellij/remoteDev/tests/DistributedTestsAgentConstants.kt @@ -8,4 +8,5 @@ object DistributedTestsAgentConstants { const val protocolHostPropertyName = "RDCT_TESTING_HOST" const val protocolPortPropertyName = "RDCT_TESTING_PORT" const val threadDumpFileSubstring = "threadDump" + const val sourcePathProperty = "idea.sources.path" } \ No newline at end of file diff --git a/platform/remoteDev-util/src/com/intellij/remoteDev/tests/impl/DistributedTestHost.kt b/platform/remoteDev-util/src/com/intellij/remoteDev/tests/impl/DistributedTestHost.kt index 61ab5f51358e..95226a0f80b9 100644 --- a/platform/remoteDev-util/src/com/intellij/remoteDev/tests/impl/DistributedTestHost.kt +++ b/platform/remoteDev-util/src/com/intellij/remoteDev/tests/impl/DistributedTestHost.kt @@ -16,7 +16,6 @@ import com.intellij.notification.NotificationType import com.intellij.openapi.application.* import com.intellij.openapi.application.impl.LaterInvocator import com.intellij.openapi.diagnostic.Logger -import com.intellij.openapi.extensions.PluginId import com.intellij.openapi.project.Project import com.intellij.openapi.project.ex.ProjectManagerEx import com.intellij.openapi.rd.util.adviseSuspend @@ -70,6 +69,10 @@ open class DistributedTestHost(coroutineScope: CoroutineScope) { fun getDistributedTestPort(): Int? = System.getProperty(DistributedTestsAgentConstants.protocolPortPropertyName)?.toIntOrNull() + val sourcesRootFolder: File by lazy { + System.getProperty(DistributedTestsAgentConstants.sourcePathProperty, PathManager.getHomePath()).let(::File) + } + /** * ID of the plugin which contains test code. * Currently, only test code of the client part is put to a separate plugin. @@ -156,16 +159,13 @@ open class DistributedTestHost(coroutineScope: CoroutineScope) { } // Create test class - val testPlugin = PluginManagerCore.getPlugin(PluginId.getId(TEST_PLUGIN_ID)) - val classLoader = if (testPlugin != null) { - LOG.info("Test class will be loaded from '${testPlugin.pluginId}' plugin") - testPlugin.pluginClassLoader - } - else { - LOG.info("Test class will be loaded by the core classloader.") - javaClass.classLoader - } - val testClass = Class.forName(session.testClassName, true, classLoader) + val testPluginId = System.getProperty("distributed.test.module", TEST_PLUGIN_ID) + val testPlugin = PluginManagerCore.getPluginSet().findEnabledModule(testPluginId) + ?: error("Test plugin '$testPluginId' is not found") + + LOG.info("Test class will be loaded from '${testPlugin.pluginId}' plugin") + + val testClass = Class.forName(session.testClassName, true, testPlugin.pluginClassLoader) val testClassObject = testClass.kotlin.createInstance() as DistributedTestPlayer // Tell test we are running it inside an agent @@ -303,7 +303,7 @@ open class DistributedTestHost(coroutineScope: CoroutineScope) { leaveAllModals(throwErrorIfModal) } - session.closeProjectIfOpened.setSuspend(sessionBgtDispatcher) { _, _ -> + session.closeAllOpenedProjects.setSuspend(sessionBgtDispatcher) { _, _ -> try { leaveAllModals(throwErrorIfModal = true) @@ -315,7 +315,7 @@ open class DistributedTestHost(coroutineScope: CoroutineScope) { } } catch (ce: CancellationException) { - LOG.info("closeProjectIfOpened was cancelled", ce) + LOG.info("closeAllOpenedProjects was cancelled", ce) throw ce } diff --git a/platform/testFramework/core/intellij.platform.testFramework.core.iml b/platform/testFramework/core/intellij.platform.testFramework.core.iml index 175164803eeb..babd248f55fb 100644 --- a/platform/testFramework/core/intellij.platform.testFramework.core.iml +++ b/platform/testFramework/core/intellij.platform.testFramework.core.iml @@ -12,8 +12,8 @@ + - diff --git a/platform/testFramework/intellij.platform.testFramework.iml b/platform/testFramework/intellij.platform.testFramework.iml index 898cf7ddd16f..19b70ddda7be 100644 --- a/platform/testFramework/intellij.platform.testFramework.iml +++ b/platform/testFramework/intellij.platform.testFramework.iml @@ -17,7 +17,7 @@ - + diff --git a/platform/testFramework/resources/intellij.platform.testFramework.xml b/platform/testFramework/resources/intellij.platform.testFramework.xml index 89f1bafc3dc7..878102ec7d3e 100644 --- a/platform/testFramework/resources/intellij.platform.testFramework.xml +++ b/platform/testFramework/resources/intellij.platform.testFramework.xml @@ -3,12 +3,6 @@ + - - - - - \ No newline at end of file diff --git a/plugins/junit/plugin-content.yaml b/plugins/junit/plugin-content.yaml index c871e41589c6..ffcf4d31af29 100644 --- a/plugins/junit/plugin-content.yaml +++ b/plugins/junit/plugin-content.yaml @@ -2,6 +2,12 @@ modules: - name: intellij.junit.rt - name: lib/junit.jar + projectLibraries: + - name: JUnit4 + files: + - name: $MAVEN_REPOSITORY$/junit/junit/4/junit-4.jar + - name: $MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1/hamcrest-core-1.jar + reason: <- intellij.junit modules: - name: intellij.junit - name: lib/junit5-rt.jar diff --git a/tools/intellij.tools.ide.util.common/resources/intellij.tools.ide.util.common.xml b/tools/intellij.tools.ide.util.common/resources/intellij.tools.ide.util.common.xml new file mode 100644 index 000000000000..6fb76a66265d --- /dev/null +++ b/tools/intellij.tools.ide.util.common/resources/intellij.tools.ide.util.common.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file