Package com.google.gwt.debugpanel.common

Examples of com.google.gwt.debugpanel.common.StatisticsEvent


  public static boolean enabled() {
    return dispatcher.enabled();
  }

  public static void sendTimingInfo(String method, int sequence, String type) {
    StatisticsEvent event = dispatcher.newEvent("kiyaa", String.valueOf(sequence), Utils.currentTimeMillis(), type);
    dispatcher.setExtraParameter(event, "method", method);
    dispatcher.dispatch(event);
  }
View Full Code Here


        method);
  }

  public static void addException(Throwable t) {
    double now = Utils.currentTimeMillis();
    StatisticsEvent event = dispatcher.newEvent("error", "error", now, "error");
    dispatcher.setExtraParameter(event, "error", exceptionSerializer.serialize(t));
    dispatcher.dispatch(event);
  }
View Full Code Here

    root = model.getRoot();
    model.addDebugStatisticsModelListener(listener);
  }

  public void testThatHandlersAreCalledInSequence() {
    final StatisticsEvent event = mockery.mock(StatisticsEvent.class);
    final Sequence seq = mockery.sequence("handlers");
    mockery.checking(new Expectations() {{
      allowing(handler1).handle(model, event); will(returnValue(false)); inSequence(seq);
      allowing(handler2).handle(model, event); will(returnValue(false)); inSequence(seq);
      allowing(handler3).handle(model, event); will(returnValue(false)); inSequence(seq);
View Full Code Here

    model.onStatisticsEvent(event);
    mockery.assertIsSatisfied();
  }

  public void testThatIfNoHandlerAnswersWithANodeNothingHappens() {
    final StatisticsEvent event = mockery.mock(StatisticsEvent.class);
    mockery.checking(new Expectations() {{
      allowing(handler1).handle(model, event); will(returnValue(false));
      allowing(handler2).handle(model, event); will(returnValue(false));
      allowing(handler3).handle(model, event); will(returnValue(false));
    }});
View Full Code Here

    assertEquals(0, root.getChildCount());
    mockery.assertIsSatisfied();
  }

  public void testThatIfEarlierHandlerReturnsANodeLaterHandlersAreNotInvoked() {
    final StatisticsEvent event = mockery.mock(StatisticsEvent.class);
    mockery.checking(new Expectations() {{
      oneOf(handler1).handle(model, event); will(returnValue(true));
    }});

    model.onStatisticsEvent(event);
View Full Code Here

  public void testModelIsInitiallyEmpty() {
    assertEquals(0, model.getExceptionEventCount());
  }

  public void testNonErrorSubSystemEventsAreIgnored() {
    final StatisticsEvent event = mockery.mock(StatisticsEvent.class);
    mockery.checking(new Expectations() {{
      oneOf(event).getSubSystem(); will(returnValue("system"));
    }});

    model.onStatisticsEvent(event);
View Full Code Here

    mockery.assertIsSatisfied();
  }

  public void testNonErrorEventGroupEventsAreIgnored() {
    final StatisticsEvent event = mockery.mock(StatisticsEvent.class);
    mockery.checking(new Expectations() {{
      oneOf(event).getSubSystem(); will(returnValue("error"));
      oneOf(event).getEventGroupKey(); will(returnValue("group"));
    }});
View Full Code Here

    mockery.assertIsSatisfied();
  }

  public void testNonErrorTypeEventsAreIgnored() {
    final StatisticsEvent event = mockery.mock(StatisticsEvent.class);
    mockery.checking(new Expectations() {{
      oneOf(event).getSubSystem(); will(returnValue("error"));
      oneOf(event).getEventGroupKey(); will(returnValue("error"));
      oneOf(event).getExtraParameter("type"); will(returnValue("type"));
    }});
View Full Code Here

    mockery.assertIsSatisfied();
  }

  public void testEventsWithEmptyDataAreIgnored() {
    final StatisticsEvent event = mockery.mock(StatisticsEvent.class);
    mockery.checking(new Expectations() {{
      oneOf(event).getSubSystem(); will(returnValue("error"));
      oneOf(event).getEventGroupKey(); will(returnValue("error"));
      oneOf(event).getExtraParameter("type"); will(returnValue("error"));
      oneOf(event).getExtraParameter("error"); will(returnValue(null));
View Full Code Here

    mockery.assertIsSatisfied();
  }

  public void testNonJavaSrciptObjectsAreIgnored() {
    final StatisticsEvent event = mockery.mock(StatisticsEvent.class);
    mockery.checking(new Expectations() {{
      oneOf(event).getSubSystem(); will(returnValue("error"));
      oneOf(event).getEventGroupKey(); will(returnValue("error"));
      oneOf(event).getExtraParameter("type"); will(returnValue("error"));
      oneOf(event).getExtraParameter("error"); will(returnValue("aString"));
View Full Code Here

TOP

Related Classes of com.google.gwt.debugpanel.common.StatisticsEvent

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.