Package org.waveprotocol.wave.client.scheduler.testing

Examples of org.waveprotocol.wave.client.scheduler.testing.FakeTimerService


        return null;
      }
    });
    EditorTestingUtil.setupTestEnvironment();

    FakeTimerService timerService = new FakeTimerService();
    PainterRegistryImpl paintRegistry = new PainterRegistryImpl(
            AnnotationPaint.SPREAD_FULL_TAGNAME, AnnotationPaint.BOUNDARY_FULL_TAGNAME,
            new AnnotationPainter(timerService));

    Registries registries =
        new RegistriesImpl(Editor.ROOT_HANDLER_REGISTRY,
            Editor.ROOT_ANNOTATION_REGISTRY, paintRegistry);

    StyleAnnotationHandler.register(registries);

    Editor editor = Editors.create();
    editor.init(registries, KeyBindingRegistry.NONE, EditorSettings.DEFAULT);

    // Now the actual test

    ContentSerialisationUtil.setContentString(editor, "<body><line/>abc</body>");
    CMutableDocument doc = editor.getDocument();
    doc.setAnnotation(3, 4, "style/color", "red");

    editor.getContent().debugCheckHealthy2();
    timerService.tick(1000);
    ContentView fullDoc = ((EditorImpl) editor).getContent().getFullContentView();
    assertNotNull(
        DocHelper.getElementWithTagName(fullDoc, AnnotationPaint.SPREAD_FULL_TAGNAME));
    doc.setAnnotation(3, 4, "style/color", null);
    timerService.tick(1000);
    assertNull(DocHelper.getElementWithTagName(fullDoc, AnnotationPaint.SPREAD_FULL_TAGNAME));

    doc.setAnnotation(3, 5, "style/color", "red");
    editor.removeContentAndUnrender();
    editor.reset();
    timerService.tick(1000);
    assertNull(DocHelper.getElementWithTagName(fullDoc, AnnotationPaint.SPREAD_FULL_TAGNAME));

  }
View Full Code Here


    ModelAsViewProvider views = renderer;
    rendering = renderer.render(wave);

    // Keep it live.
    ReplyManager replyHandler = new ReplyManager(views);
    timer = new FakeTimerService();
    LiveConversationViewRenderer.create(
        timer, wave, views, populator, replyHandler, readMonitor, profiles, supplement).init();
  }
View Full Code Here

    FocusedContentRange selection = new FocusedContentRange(start, end);
    ContentRange range = selection.asOrderedRange(true);
    FakeEditorInteractor interactor = setupFakeEditorInteractor(selection);
    FakeEditorEventsSubHandler subHandler = new FakeEditorEventsSubHandler();
    FakeRouter router = new FakeRouter();
    EditorEventHandler handler = new EditorEventHandler(new FakeTimerService(),
        interactor, subHandler, router, cancelNonWhitelistedCombos, true);

    subHandler.call(FakeEditorEventsSubHandler.HANDLE_COMMAND).nOf(1).withArgs(editorEvent)
        .returns(false);
    subHandler.call(FakeEditorEventsSubHandler.HANDLE_BLOCK_LEVEL_COMMANDS).nOf(1).withArgs(
View Full Code Here

  private ToppingUpPool<Object> target;

  @Override
  protected void setUp() {
    factory = new MockFactory();
    timer = new FakeTimerService();
    target = new ToppingUpPool<Object>(timer, factory, RESERVE_SIZE);
  }
View Full Code Here

  @Override
  protected void setUp() {
    MockitoAnnotations.initMocks(this);
    blip = mockBlip();
    timer = new FakeTimerService();

    doReturn(Collections.singleton(root)).when(wave).getWavelets();
    target = new LocalSupplementedWaveImpl(timer, wave, supplement);
    target.init();
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.scheduler.testing.FakeTimerService

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.