use of jetbrains.communicator.core.vfs.VFile in project intellij-plugins by JetBrains.
the class GetVFileContentsProvider method doProcess.
protected void doProcess(Element request, Element response) {
VFile from = VFile.createFrom(request);
myIdeFacade.fillFileContents(from);
from.saveTo(response);
}
use of jetbrains.communicator.core.vfs.VFile in project intellij-plugins by JetBrains.
the class SendCodePointerCommandTest method testExecute_Cancel.
public void testExecute_Cancel() throws Exception {
final boolean[] sent = new boolean[1];
MockUser user = new MockUser() {
@Override
public void sendCodeIntervalPointer(VFile file, CodePointer pointer, String comment, EventBroadcaster eventBroadcaster) {
sent[0] = true;
}
};
myCommand.setCodePointer(new CodePointer(0, 0));
myCommand.setVFile(VFile.create("a path"));
myCommand.setUser(user);
myFacadeMock.expects(once()).method("getMessage").will(returnValue(null));
myCommand.execute();
assertFalse("Should call sendCodeIntervalPointer", sent[0]);
}
use of jetbrains.communicator.core.vfs.VFile in project intellij-plugins by JetBrains.
the class SendCodePointerCommandTest method testExecute_WithMessage.
public void testExecute_WithMessage() throws Exception {
final CodePointer codePointerToSend = new CodePointer(0, 0);
final VFile fileToSend = VFile.create("a path");
final boolean[] sent = new boolean[1];
MockUser user = new MockUser() {
@Override
public void sendCodeIntervalPointer(VFile file, CodePointer pointer, String comment, EventBroadcaster eventBroadcaster) {
sent[0] = true;
assertSame(fileToSend, file);
assertSame(codePointerToSend, pointer);
assertEquals("some message", comment);
}
};
myCommand.setCodePointer(codePointerToSend);
myCommand.setVFile(fileToSend);
myCommand.setUser(user);
myFacadeMock.expects(once()).method("getMessage").will(returnValue("some message"));
myFacadeMock.expects(once()).method("fillFileContents").with(eq(fileToSend));
myCommand.execute();
assertTrue("Should call sendCodeIntervalPointer", sent[0]);
}
use of jetbrains.communicator.core.vfs.VFile in project intellij-plugins by JetBrains.
the class SendCodePointerCommandTest method testExecute_LocalMessage.
public void testExecute_LocalMessage() throws Exception {
addEventListener();
final CodePointer codePointerToSend = new CodePointer(0, 0);
final VFile fileToSend = VFile.create("a path");
User user = UserImpl.create("user", MockTransport.NAME);
myCommand.setCodePointer(codePointerToSend);
myCommand.setVFile(fileToSend);
myCommand.setUser(user);
myFacadeMock.expects(once()).method("getMessage").will(returnValue("some message"));
myFacadeMock.expects(once()).method("fillFileContents").with(eq(fileToSend));
myCommand.execute();
verifySendMessageLocalEvent(user, "some message");
assertSame(fileToSend, ((SendCodePointerEvent) myEvents.get(0)).getFile());
assertSame(codePointerToSend, ((SendCodePointerEvent) myEvents.get(0)).getCodePointer());
}
use of jetbrains.communicator.core.vfs.VFile in project intellij-plugins by JetBrains.
the class ShowDiffCommandTest method testExecute_NoContent.
public void testExecute_NoContent() throws Exception {
final VFile vFile = VFile.create("a file");
MockUser user = new MockUser() {
@Override
public String getVFile(VFile file, IDEFacade ideFacade) {
assertSame(vFile, file);
return null;
}
};
myCommand.setUser(user);
myCommand.setVFile(vFile);
myCommand.execute();
}
Aggregations