use of com.intellij.openapi.vcs.VcsRootChecker in project intellij-community by JetBrains.
the class VcsRootPlatformTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
myProjectFixture = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getTestName(true)).getFixture();
myProjectFixture.setUp();
myProject = myProjectFixture.getProject();
myProjectRoot = myProject.getBaseDir();
cd(myProjectRoot);
Module module = doCreateRealModuleIn("foo", myProject, EmptyModuleType.getInstance());
myRootModel = ((ModuleRootManagerImpl) ModuleRootManager.getInstance(module)).getRootModel();
mkdir(myRepositoryFolderName);
myProjectRoot.refresh(false, true);
myRepository = myProjectRoot.findChild(myRepositoryFolderName);
myVcs = new MockAbstractVcs(myProject);
myVcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(myProject);
ExtensionPoint<VcsRootChecker> point = getExtensionPoint();
myExtension = new VcsRootChecker() {
@NotNull
@Override
public VcsKey getSupportedVcs() {
return myVcs.getKeyInstanceMethod();
}
@Override
public boolean isRoot(@NotNull String path) {
return new File(path, DOT_MOCK).exists();
}
@Override
public boolean isVcsDir(@NotNull String path) {
return path.toLowerCase().endsWith(DOT_MOCK);
}
};
point.registerExtension(myExtension);
myVcsManager.registerVcs(myVcs);
myVcsName = myVcs.getName();
myRepository.refresh(false, true);
}
Aggregations