use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class ViewFilesCommandTest method testExecute_NoInformation.
public void testExecute_NoInformation() throws Exception {
final ProjectsData projectsData = new ProjectsData();
MockUser mockUser = new MockUser("user", null) {
@Override
public ProjectsData getProjectsData(IDEFacade ideFacade) {
return projectsData;
}
};
mockUser.setOnline(true);
myMockUserListComponent.setSelectedNodes(new User[] { mockUser });
myFacadeMock.expects(once()).method("showMessage");
myCommand.execute();
}
use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class ProjectsDataTest method testSerializeDeserialize.
public void testSerializeDeserialize() throws Exception {
myProjectsData.setProjectFiles("project1", new VFile[] { VFile.create("a path") });
myProjectsData.setProjectFiles("project2", new VFile[0]);
ProjectsData userStatus1 = new ProjectsData(myProjectsData.serialize());
assertEquals(2, userStatus1.getProjects().length);
assertEquals(1, userStatus1.getProjectFiles("project1").length);
}
use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class IDEAFacade method getProjectsData.
@Override
public ProjectsData getProjectsData() {
final ProjectsData result = new ProjectsData();
ApplicationManager.getApplication().runReadAction(() -> {
try {
new ProjectsDataFiller(result).fillProjectsData();
} catch (Throwable e) {
LOG.info(e, e);
}
});
return result;
}
use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class ViewFilesCommandTest method testExecute_WithInformation.
public void testExecute_WithInformation() throws Exception {
final ProjectsData projectsData = new ProjectsData();
projectsData.addNonProjectFile(VFile.create("a path"));
MockUser mockUser = new MockUser("user", null) {
@Override
public ProjectsData getProjectsData(IDEFacade ideFacade) {
return projectsData;
}
};
mockUser.setOnline(true);
myMockUserListComponent.setSelectedNodes(new User[] { mockUser });
myFacadeMock.expects(once()).method("showUserFiles").with(eq(mockUser), eq(projectsData));
myCommand.execute();
}
use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class AbstractTransportTestCase method testGetUserStatus.
public void testGetUserStatus() throws Exception {
User someone = createAnotherOnlineUser();
myUserModel.addUser(mySelf);
myUserModel.addUser(someone);
mySelf.setCanAccessMyFiles(true, myUserModel);
someone.setCanAccessMyFiles(true, myUserModel);
ProjectsData projectsData = someone.getProjectsData(myIdeFacade);
assertSame("No self status yet", ProjectsData.NULL, projectsData);
myIdeFacade.setReturnedProjects(new String[] { "project1" });
assert mySelf.isOnline();
ProjectsData status = mySelf.getProjectsData(myIdeFacade);
assertNotSame("Real status is expected", ProjectsData.NULL, status);
assertEquals("A project is expected in the status", 1, status.getProjects().length);
assertEquals("Wrong project returned", "project1", status.getProjects()[0]);
}
Aggregations