void () { myFixture.configureByText(FileTypes.PLAIN_TEXT, "hello,<caret>world"); @SuppressWarnings("rawtypes") ExtensionPoint<RunConfigurationProducer> ep = RunConfigurationProducer.EP_NAME.getPoint(); ep.registerExtension(new FakeRunConfigurationProducer("hello_") { @Override public boolean isPreferredConfiguration(ConfigurationFromContext self, ConfigurationFromContext other) { return true; } }, getTestRootDisposable()); ep.registerExtension(new FakeRunConfigurationProducer("world_") { @Override public boolean isPreferredConfiguration(ConfigurationFromContext self, ConfigurationFromContext other) { return true; } }, getTestRootDisposable()); List<RunnerAndConfigurationSettings> configs = getConfigurationsFromContext(); Assert.assertEquals(2, configs.size()); RunnerAndConfigurationSettings configuration = configs.get(0); assertEquals("hello_", configuration.getName()); addConfiguration(configuration); DataContext context = createDataContext(); AnActionEvent event = TestActionEvent.createTestEvent(context); new RunNewConfigurationContextAction(DefaultRunExecutor.getRunExecutorInstance()).fullUpdate(event); assertTrue(event.getPresentation().isEnabledAndVisible()); assertEquals("Run 'world_'", event.getPresentation().getText()); RunnerAndConfigurationSettings configuration1 = configs.get(1); assertEquals("world_", configuration1.getName()); addConfiguration(configuration1); DataContext context1 = createDataContext(); AnActionEvent event1 = TestActionEvent.createTestEvent(context1); new RunNewConfigurationContextAction(DefaultRunExecutor.getRunExecutorInstance()).fullUpdate(event1); assertTrue(event1.getPresentation().isEnabledAndVisible()); assertEquals("Run 'world_'", event1.getPresentation().getText()); }