use of com.intellij.testFramework.fixtures.IdeaTestFixtureFactory in project intellij-community by JetBrains.
the class HighlightingTestBase method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
final IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
myTestFixture = createFixture(factory);
myTestFixture.setTestDataPath(getTestDataBasePath() + getTestDataPath());
Class<? extends LocalInspectionTool>[] inspectionClasses = new DefaultInspectionProvider().getInspectionClasses();
if (getName().contains("Inspection")) {
inspectionClasses = ArrayUtil.mergeArrays(inspectionClasses, ApplicationLoader.getInspectionClasses());
}
myTestFixture.setUp();
myTestFixture.enableInspections(inspectionClasses);
new WriteAction() {
@Override
protected void run(@NotNull Result result) throws Throwable {
ResourceUtil.copyFiles(HighlightingTestBase.this);
init();
}
}.execute().throwException();
}
use of com.intellij.testFramework.fixtures.IdeaTestFixtureFactory in project ideavim by JetBrains.
the class VimTestCase method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
final IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
final LightProjectDescriptor projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR;
final TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor);
final IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();
myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture, new LightTempDirTestFixtureImpl(true));
myFixture.setUp();
myFixture.setTestDataPath(getTestDataPath());
KeyHandler.getInstance().fullReset(myFixture.getEditor());
Options.getInstance().resetAllOptions();
VimPlugin.getKey().resetKeyMappings();
}
use of com.intellij.testFramework.fixtures.IdeaTestFixtureFactory in project intellij-community by JetBrains.
the class TestBase method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
final IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
final IdeaProjectTestFixture fixture = factory.createLightFixtureBuilder().getFixture();
myFixture = factory.createCodeInsightFixture(fixture);
myFixture.setTestDataPath(getTestDataPath());
myFixture.setUp();
}
use of com.intellij.testFramework.fixtures.IdeaTestFixtureFactory in project intellij-community by JetBrains.
the class SvnTestCase method setUp.
@Before
public void setUp() throws Exception {
System.out.println("Native client for status: " + isUseNativeAcceleration());
String property = System.getProperty("svn.test.data.directory");
if (!StringUtil.isEmpty(property)) {
myTestDataDir = property;
}
UIUtil.invokeAndWaitIfNeeded((Runnable) () -> {
try {
final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
myTempDirFixture = fixtureFactory.createTempDirTestFixture();
myTempDirFixture.setUp();
myRepoRoot = new File(myTempDirFixture.getTempDirPath(), "svnroot");
assert myRepoRoot.mkdir() || myRepoRoot.isDirectory() : myRepoRoot;
myPluginRoot = new File(PluginPathManager.getPluginHomePath("svn4idea"));
if (!myPluginRoot.isDirectory()) {
Class aClass = SvnTestCase.class;
String rootPath = PathManager.getResourceRoot(aClass, "/" + aClass.getName().replace('.', '/') + ".class");
myPluginRoot = new File(rootPath).getParentFile().getParentFile().getParentFile();
}
File svnBinDir = new File(myPluginRoot, getTestDataDir() + "/svn/bin");
File svnExecutable = null;
if (SystemInfo.isWindows) {
svnExecutable = new File(svnBinDir, "windows/svn.exe");
} else if (SystemInfo.isLinux) {
svnExecutable = new File(svnBinDir, "linux/svn");
} else if (SystemInfo.isMac) {
svnExecutable = new File(svnBinDir, "mac/svn");
}
assertTrue("No Subversion executable was found: " + svnExecutable + ", " + SystemInfo.OS_NAME, svnExecutable != null && svnExecutable.canExecute());
myClientBinaryPath = svnExecutable.getParentFile();
myRunner = SystemInfo.isMac ? createClientRunner(Collections.singletonMap("DYLD_LIBRARY_PATH", myClientBinaryPath.getPath())) : createClientRunner();
ZipUtil.extract(new File(myPluginRoot, getTestDataDir() + "/svn/newrepo.zip"), myRepoRoot, null);
myWcRoot = new File(myTempDirFixture.getTempDirPath(), myWcRootName);
assert myWcRoot.mkdir() || myWcRoot.isDirectory() : myWcRoot;
myRepoUrl = (SystemInfo.isWindows ? "file:///" : "file://") + FileUtil.toSystemIndependentName(myRepoRoot.getPath());
verify(runSvn("co", myRepoUrl, myWcRoot.getPath()));
initProject(myWcRoot, SvnTestCase.this.getTestName());
activateVCS(SvnVcs.VCS_NAME);
myGate = new MockChangeListManagerGate(ChangeListManager.getInstance(myProject));
((StartupManagerImpl) StartupManager.getInstance(myProject)).runPostStartupActivities();
refreshSvnMappingsSynchronously();
} catch (Exception e) {
throw new RuntimeException(e);
}
});
// there should be kind-a waiting for after change list manager finds all changes and runs inner refresh of copies in the above method
if (myInitChangeListManager) {
ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
}
}
use of com.intellij.testFramework.fixtures.IdeaTestFixtureFactory in project intellij-community by JetBrains.
the class RestFixtureTestCase method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder(getProjectDescriptor());
final IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();
myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture, new LightTempDirTestFixtureImpl(true));
myFixture.setUp();
myFixture.setTestDataPath(getTestDataPath());
}
Aggregations