Package com.google.collide.client.workspace

Examples of com.google.collide.client.workspace.FileTreeModel


  public void testNoMatches() {
    FileNameSearch indexer = TreeWalkFileNameSearchImpl.create();
   
    // Setup the file tree model with the simple tree (a list of hello files)
    FileTreeModel model = getFileTree(buildSimpleTree());
    indexer.setFileTreeModel(model);

    // Verify no matches
    JsonArray<PathUtil> results = indexer.getMatches(regex("nothello"), 5);
    assertEquals(0, results.size());
View Full Code Here


  public void testMaxResults() {
    FileNameSearch indexer = TreeWalkFileNameSearchImpl.create();
   
    // Setup the file tree model with the simple tree (a list of hello files)
    FileTreeModel model = getFileTree(buildSimpleTree());
    indexer.setFileTreeModel(model);
   
    // Verify no matches
    JsonArray<PathUtil> results = indexer.getMatches(regex("hello"), 2);
    assertEquals(2, results.size());
View Full Code Here

  public void testCorrectMatchesFound() {
    FileNameSearch indexer = TreeWalkFileNameSearchImpl.create();

    // Setup the file tree model with the simple tree (a list of hello files)
    FileTreeModel model = getFileTree(buildComplexTree());
    indexer.setFileTreeModel(model);
   
    // Verify correct matches
    JsonArray<PathUtil> results = indexer.getMatches(regex("world"), 2);
    assertEquals(2, results.size());
View Full Code Here

  public void testSameFileNames() {
    FileNameSearch indexer = TreeWalkFileNameSearchImpl.create();

    // Setup the file tree model with the simple tree (a list of hello files)
    FileTreeModel model = getFileTree(buildComplexTree());
    indexer.setFileTreeModel(model);

    // Verify that two results are returned from two different directories
    JsonArray<PathUtil> results = indexer.getMatches(regex("hello"), 2);
    assertEquals(2, results.size());
View Full Code Here

 
  public void testFindFilesRelativeToPath() {
    FileNameSearch indexer = TreeWalkFileNameSearchImpl.create();

    // Setup the file tree model with the simple tree (a list of hello files)
    FileTreeModel model = getFileTree(buildComplexTree());
    indexer.setFileTreeModel(model);

    // Verify that two results are returned from two different directories
    JsonArray<PathUtil> results =
        indexer.getMatchesRelativeToPath(new PathUtil("/src"), regex("hello"), 2);
View Full Code Here

   
    JsonArray<PathUtil> results = indexer.getMatches(regex("haha"), 4);
    assertEquals(0, results.size());
   
    // Crap file tree so we can test no crashing
    FileTreeModel model = new FileTreeModel(new MockOutgoingController());
    indexer.setFileTreeModel(model);
   
    results = indexer.getMatches(regex("haha"), 4);
    assertEquals(0, results.size());
  }
View Full Code Here

   * Creates a file tree model given a directory structure
   */
  private FileTreeModel getFileTree(DirInfo dir) {
    FileTreeNode root = FileTreeNode.transform(dir);

    FileTreeModel model = new FileTreeModel(new MockOutgoingController());
    model.replaceNode(PathUtil.WORKSPACE_ROOT, root, "1");
    return model;
  }
View Full Code Here

    PathUtil filePath = new PathUtil(path);
    document = Document.createFromString(source);
    parser = DocumentParser.create(
        document, CodeMirror2.getParser(filePath), new StubIncrementalScheduler(50, 50));
    FileTreeNode root = FileTreeNode.transform(buildSimpleTree());
    FileTreeModel model = new FileTreeModel(new MockOutgoingController());
    model.replaceNode(PathUtil.WORKSPACE_ROOT, root, "1");
    return new DynamicReferenceProvider(path, new DeferringLineParser(parser), model, null);
  }
View Full Code Here

TOP

Related Classes of com.google.collide.client.workspace.FileTreeModel

Copyright © 2018 www.massapicom. 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.