Plugin Testing - how to compile and run Project inside a heavy test?

Answered

So, my plugin uses a custom ProgramRunner and I'd like to write a test for it. To do that, I created a testData directory with a sample project. Now I'd like to load that project, compile it and run it(inside the test). To do that, I've tried extending AbstractTestFrameworkIntegrationTest (from what I've seen, JUnit4 tests use this class). Now, AbstractTestFrameworkIntegrationTest extends HeavyPlatformTestCase, so this means I will write heavy tests, which is fine but I still couldn't manage to put it all together and run my custom runner. 

Or is there any other way to execute the project with my ProgramRunner inside a test? It doesn't matter if it is a heavy or light test.

3 comments
Comment actions Permalink

Please specify what exactly do you want to test regarding your ProgramRunner

0
Comment actions Permalink

My ProgramRunner attaches a Java agent to the running application and this agent creates a file after extracting some information from the running app. I'd like to verify the contents of the file in my test. So I could add a simple test which attaches my agent to the running app without using my ProgramRunner at all, but I'd like to verify if the whole flow is working correctly because my ProgramRunner attaches the agent during runtime and not load time.

0
Comment actions Permalink

Sorry for delay.

Please take a look at com.intellij.execution.ExecutionTestCase // com.intellij.run.ExecutionManagerTest#checkRunConfiguration

0

Please sign in to leave a comment.