use of com.intellij.openapi.vcs.changes.committed.MockAbstractVcs in project intellij-community by JetBrains.
the class VcsRepositoryManagerTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
cd(myProjectRoot);
myVcs = new MockAbstractVcs(myProject);
myProjectLevelVcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(myProject);
myProjectLevelVcsManager.registerVcs(myVcs);
READY_TO_READ = new CountDownLatch(1);
CONTINUE_MODIFY = new CountDownLatch(1);
myMockCreator = createMockRepositoryCreator();
ExtensionPoint<VcsRepositoryCreator> point = getExtensionPoint();
point.registerExtension(myMockCreator);
myGlobalRepositoryManager = new VcsRepositoryManager(myProject, myProjectLevelVcsManager);
myGlobalRepositoryManager.initComponent();
}
use of com.intellij.openapi.vcs.changes.committed.MockAbstractVcs in project intellij-community by JetBrains.
the class LocalChangesUnderRootsTest method testChangesInTwoGitRoots.
public void testChangesInTwoGitRoots() {
AllVcsesI myVcses = AllVcses.getInstance(myProject);
myVcses.registerManually(new MockAbstractVcs(myProject, "Mock"));
List<VirtualFile> roots = createRootStructure(Pair.create(myBaseDir.getPath(), "Mock"), Pair.create("community", "Mock"));
Change changeBeforeCommunity = createChangeForPath("a.txt");
Change changeAfterCommunity = createChangeForPath("readme.txt");
Change changeInCommunity = createChangeForPath("community/com.txt");
myChangeListManager.addChanges(changeBeforeCommunity, changeAfterCommunity, changeInCommunity);
Map<VirtualFile, Collection<Change>> expected = new HashMap<>();
expected.put(roots.get(0), Arrays.asList(changeBeforeCommunity, changeAfterCommunity));
expected.put(roots.get(1), Collections.singletonList(changeInCommunity));
Map<VirtualFile, Collection<Change>> changesUnderRoots = myLocalChangesUnderRoots.getChangesUnderRoots(roots);
assertEqualMaps(expected, changesUnderRoots);
}
use of com.intellij.openapi.vcs.changes.committed.MockAbstractVcs 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);
}
use of com.intellij.openapi.vcs.changes.committed.MockAbstractVcs in project intellij-community by JetBrains.
the class TaskVcsTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
myVcs = new MockAbstractVcs(getProject());
myChangeProvider = new MyMockChangeProvider();
myVcs.setChangeProvider(myChangeProvider);
AllVcses.getInstance(getProject()).registerManually(myVcs);
myChangeListManager = (ChangeListManagerImpl) ChangeListManager.getInstance(getProject());
myTaskManager = (TaskManagerImpl) TaskManager.getManager(getProject());
ProjectLevelVcsManager.getInstance(getProject()).setDirectoryMapping("", myVcs.getName());
ProjectLevelVcsManager.getInstance(getProject()).hasActiveVcss();
myRepository = new TestRepository();
myRepository.setTasks(new Task() {
@NotNull
@Override
public String getId() {
return "TEST-001";
}
@NotNull
@Override
public String getSummary() {
return "Summary";
}
@Override
public String getDescription() {
return null;
}
@NotNull
@Override
public Comment[] getComments() {
return Comment.EMPTY_ARRAY;
}
@NotNull
@Override
public Icon getIcon() {
return TasksIcons.Unknown;
}
@NotNull
@Override
public TaskType getType() {
return TaskType.BUG;
}
@Override
public Date getUpdated() {
return null;
}
@Override
public Date getCreated() {
return null;
}
@Override
public boolean isClosed() {
return false;
}
@Override
public boolean isIssue() {
return true;
}
@Override
public String getIssueUrl() {
return null;
}
@Override
public TaskRepository getRepository() {
return myRepository;
}
});
myTaskManager.setRepositories(Collections.singletonList(myRepository));
}
Aggregations