use of com.intellij.idea.IdeaTestApplication in project intellij-community by JetBrains.
the class JUnitRerunFailedTestsTest method testMultipleClassesInOneFile.
public void testMultipleClassesInOneFile() throws Exception {
myFixture.configureByText("a.java", "public class Test1 {<caret>} public class Test2 {}");
final IdeaTestApplication testApplication = IdeaTestApplication.getInstance();
try {
testApplication.setDataProvider(new TestDataProvider(myFixture.getProject()) {
@Override
public Object getData(@NonNls String dataId) {
if (CommonDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) {
return new VirtualFile[] { myFixture.getFile().getVirtualFile() };
}
return super.getData(dataId);
}
});
final PsiElement psiElement = myFixture.getFile().findElementAt(getEditor().getCaretModel().getOffset());
final PatternConfigurationProducer configurationProducer = RunConfigurationProducer.getInstance(PatternConfigurationProducer.class);
assertFalse(configurationProducer.isMultipleElementsSelected(new ConfigurationContext(psiElement)));
} finally {
testApplication.setDataProvider(null);
}
}
use of com.intellij.idea.IdeaTestApplication in project intellij-community by JetBrains.
the class LightIdeaTestFixtureImpl method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
IdeaTestApplication application = LightPlatformTestCase.initApplication();
LightPlatformTestCase.doSetup(myProjectDescriptor, LocalInspectionTool.EMPTY_ARRAY, getTestRootDisposable());
InjectedLanguageManagerImpl.pushInjectors(getProject());
myOldCodeStyleSettings = getCurrentCodeStyleSettings().clone();
myOldCodeStyleSettings.getIndentOptions(StdFileTypes.JAVA);
application.setDataProvider(new TestDataProvider(getProject()));
}
use of com.intellij.idea.IdeaTestApplication in project android by JetBrains.
the class AsyncValidatorTest method setUp.
@Before
public void setUp() throws Exception {
// This should happen on some other thread - it will become the AWT event queue thread.
ThreadPoolExecutor executor = ConcurrencyUtil.newSingleThreadExecutor("async validator test");
Future<IdeaTestApplication> application = executor.submit((Callable<IdeaTestApplication>) IdeaTestApplication::getInstance);
// Wait for the application instantiation
application.get();
}
Aggregations