Package com.google.collide.client.testing

Examples of com.google.collide.client.testing.StubIncrementalScheduler


  private StubIncrementalScheduler scheduler;

  @Override
  public void setUp() {
    document = createDocument();
    scheduler = new StubIncrementalScheduler(10, 1000);
  }
View Full Code Here


    SearchModel model = SearchModel.createWithManagerAndScheduler(mockContext,
        document,
        mockRenderer,
        mockView,
        new StubMatchManager(document),
        new StubIncrementalScheduler(10, 1000),
        createMockSelectionModel(document));
    // Almost nothing is performed here since there was no previous query
    model.setQuery("");
    model.setQuery("a");
    model.setQuery("");
View Full Code Here

    SearchModel model = SearchModel.createWithManagerAndScheduler(mockContext,
        document,
        mockRenderer,
        mockView,
        mockMatchManager,
        new StubIncrementalScheduler(10, 1000),
        createMockSelectionModel(document));
    model.setQuery("when", callback);
    assertEquals(1, mockMatchManager.getTotalMatches());

    model.setQuery("When", callback);
View Full Code Here

    SearchModel model = SearchModel.createWithManagerAndScheduler(mockContext,
        document,
        mockRenderer,
        mockView,
        mockMatchManager,
        new StubIncrementalScheduler(10, 1000),
        createMockSelectionModel(document));
    model.setQuery("when", callback);
    model.setQuery("Doug", callback);

    // verify callback is called
View Full Code Here

    SearchModel model = SearchModel.createWithManagerAndScheduler(mockContext,
        document,
        mockRenderer,
        mockView,
        mockMatchManager,
        new StubIncrementalScheduler(10, 1000),
        createMockSelectionModel(document));
    model.setQuery("Doug");

    // verify callback is called
    verify(mockRenderer, mockView, mockContext);
View Full Code Here

    assertEquals("dogwoman", document.getText(lineThree.line(), 22, 8));
  }

  public void testReplaceAll() {
    SearchTask task = new SearchTask(
        document, createMockViewport(document, 3), new StubIncrementalScheduler(50, 50));

    SearchMatchManager manager = new SearchMatchManager(document, model, document, task);
    manager.setSearchPattern(RegExp.compile("doug", "gi"));
   
    LineInfo lineSix = SearchTestsUtil.gotoLineInfo(document, 6);
View Full Code Here

  public void testReplaceAllOnlyOneMatch() {
    document = Document.createFromString("foo");
    createSelectionModel(document);

    SearchTask task =
        new SearchTask(document, createMockViewport(document, 1), new StubIncrementalScheduler(
            50, 50));

    SearchMatchManager manager = new SearchMatchManager(document, model, document, task);
    manager.setSearchPattern(RegExp.compile("foo", "gi"));
View Full Code Here

  public void testReplaceRecursive() {
    document = Document.createFromString("foo");
    createSelectionModel(document);

    SearchTask task =
        new SearchTask(document, createMockViewport(document, 1), new StubIncrementalScheduler(
            50, 50));

    SearchMatchManager manager = new SearchMatchManager(document, model, document, task);
    manager.setSearchPattern(RegExp.compile("foo", "gi"));
View Full Code Here

  public void testCollectedAnchors() {
    PathUtil filePath = new PathUtil("index.html");
    Document document = Document.createFromString(SOURCE);
    DocumentParser parser = DocumentParser.create(
        document, CodeMirror2.getParser(filePath), new StubIncrementalScheduler(50, 50));
    AnchorTagParser anchorParser = new AnchorTagParser(parser);
    parser.begin();
    JsonArray<AnchorTagParser.AnchorTag> anchorTags = anchorParser.getAnchorTags();
    assertEquals(3, anchorTags.size());
    assertAnchorTag(anchorTags.get(0), "aName1", 4, 13);
View Full Code Here

  private DynamicReferenceProvider createDynamicReferenceProvider(String path, String source) {
    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.testing.StubIncrementalScheduler

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.