Examples of VFile


Examples of jetbrains.communicator.core.vfs.VFile

    e.getPresentation().setEnabled(isEnabled());
  }

  boolean isEnabled() {
    VFile vFile = getVFile(myFileTree);
    return vFile != null && myIdeFacade.hasFile(vFile);
  }
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

    assertFalse(myCommand.isEnabled());

    myCommand.setUser(new MockUser());
    assertFalse(myCommand.isEnabled());

    VFile vFile = VFile.create("a path");
    myCommand.setVFile(vFile);

    myFacadeMock.expects(once()).method("hasFile").with(eq(vFile)).will(returnValue(false));
    assertFalse(myCommand.isEnabled());
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

    myFacadeMock.expects(once()).method("hasFile").with(eq(vFile)).will(returnValue(true));
    assertTrue(myCommand.isEnabled());
  }

  public void testExecute() 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 "something";
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

    myCommand.execute();
  }

  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;
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

    assertEquals("a path2", myProjectsData.getNonProjectFiles()[1].getContentPath());
  }

  public void testProjectNameInFileInfo() throws Exception {

    VFile fileInfo = VFile.create("Path");
    myProjectsData.setProjectFiles(VFile.PROJECT_NAME_ATTR, new VFile[]{fileInfo});
    assertEquals(VFile.PROJECT_NAME_ATTR, fileInfo.getProjectName());

    VFile fileInfo1 = VFile.create("Path");
    myProjectsData.addNonProjectFile(fileInfo1);
    assertNull(fileInfo1.getProjectName(), fileInfo1.getProjectName());

    VFile vFile = myProjectsData.getProjectFiles(VFile.PROJECT_NAME_ATTR)[0];
    assertEquals("Should be equal", fileInfo, vFile);
    assertEquals("Project name shoud be kept", VFile.PROJECT_NAME_ATTR, vFile.getProjectName());

    VFile vFile1 = myProjectsData.getNonProjectFiles()[0];
    assertEquals("Should be equal", fileInfo1, vFile1);
    assertNull("Project name shoud be kept", vFile1.getProjectName());
  }
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

  public void testSimplest() throws Throwable {
    _test("", VFile.create("some/path"), new CodePointer(1,2,3,4));
  }

  public void testComplexVFile() throws Throwable {
    VFile expected = VFile.create("foo/bar", "bar", false);
    expected.setContents("#$@#@#$\u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043a\u043e\u0435");
    expected.setProjectName("project");
    expected.setFQName("some FQName");
    expected.setSourcePath("some source path");

    _test("", expected, new CodePointer(1,2,3,4));
  }
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

    assertTrue("Now codePointer, file, user are selected - ready to send", myCommand.isEnabled());
  }

  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) {
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

  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);
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

    File dir = createTempDirectory();
    VirtualFile someDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(dir);

    VirtualFile file = someDir.createChildData(this, "some.file");

    VFile vFile = VFSUtil.createFileFrom(file, null);

    assertNull("Wrong content path", vFile.getContentPath());
    assertEquals("Wrong full path", file.getPath(), vFile.getFullPath());
    assertNull("Should NOT restore Virtual File NOT FROM CONTENT ROOT: ", VFSUtil.getVirtualFile(vFile));
  }
View Full Code Here

Examples of jetbrains.communicator.core.vfs.VFile

  }

  public void testInSourceRoot() throws Exception {
    VirtualFile file = mySourceRoot.createChildData(this, "some.file");

    VFile vFile = checkVFile(file, getProject(), "/src/some.file", file.getPath());
    assertEquals("Wrong src path", "/some.file", vFile.getSourcePath());

    // Change our source path:
    final VirtualFile newSrc = myContentRoot.createChildDirectory(this, "new_src");
    updateRoots(new Updater() {
      @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.