use of jetbrains.communicator.core.vfs.CodePointer in project intellij-plugins by JetBrains.
the class TestUtil method testSendCodePointer_Functional.
public static void testSendCodePointer_Functional(BaseTestCase testCase, User self) {
final String[] log = new String[] { "" };
testCase.getBroadcaster().addListener(new IDEtalkAdapter() {
@Override
public void afterChange(IDEtalkEvent event) {
event.accept(new EventVisitor() {
@Override
public void visitCodePointerEvent(CodePointerEvent event) {
log[0] += event.getRemoteUser() + ' ';
log[0] += event.getComment();
log[0] += event.getCodePointer().toString();
log[0] += event.getFile().toString();
}
});
}
});
testCase.markLastListenerForCleanup();
log[0] = "";
CodePointer pointer = new CodePointer(0, 1);
VFile file = VFile.create("path");
self.sendCodeIntervalPointer(file, pointer, "comment���< && 53", testCase.getBroadcaster());
new WaitFor(2000) {
@Override
protected boolean condition() {
return log[0].length() > 0;
}
};
Assert.assertEquals("Code Pointer expected", self.getName() + " comment���< && 53" + pointer + file, log[0]);
}
use of jetbrains.communicator.core.vfs.CodePointer in project intellij-plugins by JetBrains.
the class IDEAFacadeTest method testCreateLocalMessage_OutgoingCodePointer.
public void testCreateLocalMessage_OutgoingCodePointer() throws Exception {
SendCodePointerEvent event = new SendCodePointerEvent("message", VFile.create("a path"), new CodePointer(3, 4), myUser);
LocalMessage outgoingEvent = myFacade.createLocalMessageForOutgoingEvent(event);
assertTrue(outgoingEvent instanceof OutgoingCodePointerLocalMessage);
}
use of jetbrains.communicator.core.vfs.CodePointer in project intellij-plugins by JetBrains.
the class CodePointerXmlMessageTest method testComplexVFile.
public void testComplexVFile() throws Throwable {
VFile expected = VFile.create("foo/bar", "bar", false);
expected.setContents("#$@#@#$что-то такое");
expected.setProjectName("project");
expected.setFQName("some FQName");
expected.setSourcePath("some source path");
_test("", expected, new CodePointer(1, 2, 3, 4));
}
use of jetbrains.communicator.core.vfs.CodePointer in project intellij-plugins by JetBrains.
the class SendCodePointerAction method prepareCommand.
protected void prepareCommand(FileCommand command, Editor editor, MutablePicoContainer container) {
CodePointer codePointer = ActionUtil.getCodePointer(editor);
((SendCodePointerCommand) command).setCodePointer(codePointer);
}
use of jetbrains.communicator.core.vfs.CodePointer in project intellij-plugins by JetBrains.
the class SendToAction method doActionCommand.
protected void doActionCommand(final User user, final VirtualFile file, final Editor editor) {
VFile vFile = VFSUtil.createFileFrom(file, editor.getProject());
if (vFile == null) {
LOG.info("Unable to send code pointer for " + file);
return;
}
CodePointer codePointer = ActionUtil.getCodePointer(editor);
SendCodePointerCommand command = Pico.getCommandManager().getCommand(SendCodePointerCommand.class, BaseAction.getContainer(editor.getProject()));
command.setCodePointer(codePointer);
command.setVFile(vFile);
command.setUser(user);
command.execute();
}
Aggregations