Examples of MockMessage


Examples of jetbrains.communicator.mock.MockMessage

  }

  public void testClearHistory() throws Exception {
    assertTrue(myDispatcher.isHistoryEmpty());

    MockMessage message = new MockMessage();
    myDispatcher.sendNow(myUser, message);
    myDispatcher.clearHistory();

    assertEquals(0, myDispatcher.getHistory(myUser, null).length);
  }
View Full Code Here

Examples of jetbrains.communicator.mock.MockMessage

    assertEquals(0, myDispatcher.getHistory(myUser, null).length);
  }

  public void testHistoryPersistence() throws Exception {
    // Test Saving history message:
    MockMessage message = new MockMessage(new Date(), "some text \u0420\u041f \u0422\u0425\u0423\u0423\u041b\u0419");
    myDispatcher.sendNow(myUser, message);

    Thread.sleep(SAVE_WAIT_TIMEOUT);

    LocalMessageDispatcherImpl localMessageDispatcher = createLocalMessageDispatcher();
View Full Code Here

Examples of jetbrains.communicator.mock.MockMessage

    assertEquals("some text \u0420\u041f \u0422\u0425\u0423\u0423\u041b\u0419",
                 ((MockMessage) localMessageDispatcher.getHistory(myUser, null)[0]).getMessage());
  }

  public void testHistoryPersistence_SortLoadedHistory() throws Exception {
    myDispatcher.sendNow(myUser, new MockMessage(yesterday(), "someText"));

    MockMessage message = new MockMessage();
    myDispatcher.sendNow(myUser, message);

    Thread.sleep(SAVE_WAIT_TIMEOUT);

    LocalMessageDispatcherImpl localMessageDispatcher = createLocalMessageDispatcher();
View Full Code Here

Examples of jetbrains.communicator.mock.MockMessage

    disposeOnTearDown(localMessageDispatcher);
    return localMessageDispatcher;
  }

  public void testHistoryInSeveralFiles() throws Exception {
    myDispatcher.sendNow(myUser, new MockMessage(new Date()));
    myDispatcher.sendNow(myUser, new MockMessage(yesterday()));

    Thread.sleep(SAVE_WAIT_TIMEOUT);
    assertEquals(2, new File(myIdeFacade.getCacheDir(), "history").listFiles().length);

    LocalMessageDispatcherImpl localMessageDispatcher = createLocalMessageDispatcher();
View Full Code Here

Examples of jetbrains.communicator.mock.MockMessage

    try {
      logger.setLevel(Level.WARN);

      for (int i = 0; i < 1000; i ++) {
        Date date = new Date(System.currentTimeMillis() + i * 1000L * 3600L);
        myDispatcher.sendNow(myUser, new MockMessage(date));
      }
      Thread.sleep(SAVE_WAIT_TIMEOUT*2);


      WatchDog watchDog = new WatchDog("Load history");
View Full Code Here

Examples of jetbrains.communicator.mock.MockMessage

      logger.setLevel(oldLevel);
    }
  }

  public void testClearHistory_Persistence() throws Exception {
    myDispatcher.sendNow(myUser, new MockMessage(new Date()));
    Thread.sleep(SAVE_WAIT_TIMEOUT);

    assertFalse(myDispatcher.isHistoryEmpty());

    myDispatcher.clearHistory();
    Thread.sleep(SAVE_WAIT_TIMEOUT);
    assertEquals("History should be deleted", 0, new File(myIdeFacade.getCacheDir(), "history").listFiles().length);

    myDispatcher.sendNow(myUser, new MockMessage(new Date()));
    myDispatcher.clearHistory();
    Thread.sleep(SAVE_WAIT_TIMEOUT);
    assertEquals("History should be deleted", 0, new File(myIdeFacade.getCacheDir(), "history").listFiles().length);

    assertEquals(0, myDispatcher.getHistory(myUser, null).length);
View Full Code Here

Examples of org.apache.cayenne.remote.MockMessage

                new BootstrapMessage()));
    }

    public void testUnknownMessage() {
        try {
            DispatchHelper.dispatch(new MockDataChannel(), new MockMessage());
            fail("Unknown message must have failed");
        }
        catch (CayenneRuntimeException e) {
            // expected
        }
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.