run startup activities in tests

This commit is contained in:
Alexey Kudravtsev
2014-09-19 13:11:23 +04:00
parent 575e8cd21c
commit 2aa42c15d5
6 changed files with 34 additions and 7 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.PsiTestUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import java.util.Collection;
@@ -56,6 +57,8 @@ public class OrderEntryTest extends DaemonAnalyzerTestCase {
myProject = ProjectManagerEx.getInstanceEx().loadProject(projectFile.getPath());
ProjectManagerEx.getInstanceEx().openTestProject(myProject);
UIUtil.dispatchAllInvocationEvents(); // startup activities
ModuleManagerImpl mm = (ModuleManagerImpl)ModuleManager.getInstance(myProject);
mm.projectOpened();
setUpJdk();
@@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.navigation;
import com.intellij.JavaTestUtil;
@@ -16,6 +31,7 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.CommonProcessors;
import com.intellij.util.ui.UIUtil;
import java.util.Arrays;
import java.util.Collection;
@@ -44,6 +60,7 @@ public class GotoImplementationTest extends CodeInsightTestCase {
simulateProjectOpen();
ProjectManagerEx.getInstanceEx().openTestProject(myProject);
UIUtil.dispatchAllInvocationEvents(); // startup activities
}
@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ import com.intellij.testFramework.PsiTestUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.Processor;
import com.intellij.util.indexing.FileBasedIndex;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import java.io.File;
@@ -180,6 +181,8 @@ public class UpdateCacheTest extends PsiTestCase{
setUpModule();
setUpJdk();
ProjectManagerEx.getInstanceEx().openTestProject(myProject);
UIUtil.dispatchAllInvocationEvents(); // startup activities
runStartupActivities();
PsiTestUtil.addSourceContentToRoots(getModule(), content);