Ejemplo n.º 1
0
 @Test
 public void testDelete() {
   logView = new LogView();
   logView.open();
   assertFalse("There must be messages", logView.getErrorMessages().isEmpty());
   logView.deleteLog();
   assertTrue("There should be no messages", logView.getErrorMessages().isEmpty());
   logView.restoreLog();
   assertTrue("There should be no messages", logView.getErrorMessages().isEmpty());
 }
Ejemplo n.º 2
0
 @Test
 public void testClearAndRestore() {
   logView = new LogView();
   logView.open();
   assertFalse("There must be messages", logView.getErrorMessages().isEmpty());
   logView.clearLog();
   assertFalse("There should be messages", logView.getErrorMessages().isEmpty());
   logView.restoreLog();
   assertFalse("There should be messages", logView.getErrorMessages().isEmpty());
 }
Ejemplo n.º 3
0
  @Test
  public void getErrorMessage() {
    logView = new LogView();
    logView.open();
    List<LogMessage> messages = logView.getErrorMessages();
    assertTrue("No ERROR messages found!", !messages.isEmpty());

    // test ERROR Message no.1
    assertTrue(
        messageIsAvailable(messages, IStatus.ERROR, ERROR_ID_1, ERROR_MESSAGE_1, ERROR_STACK_1));

    // test ERROR Message no.2
    assertTrue(
        messageIsAvailable(messages, IStatus.ERROR, ERROR_ID_2, ERROR_MESSAGE_2, ERROR_STACK_2));
  }
Ejemplo n.º 4
0
  @Test
  public void getWarningMessage() {
    logView = new LogView();
    logView.open();
    List<LogMessage> messages = logView.getWarningMessages();
    assertTrue("No WARNING messages found!", !messages.isEmpty());

    // test WARNING Message no.1
    assertTrue(
        messageIsAvailable(
            messages, IStatus.WARNING, WARNING_ID_1, WARNING_MESSAGE_1, WARNING_STACK_1));

    // test WARNING Message no.2
    assertTrue(
        messageIsAvailable(
            messages, IStatus.WARNING, WARNING_ID_2, WARNING_MESSAGE_2, WARNING_STACK_2));
  }
Ejemplo n.º 5
0
  @Test
  public void getOKMessage() {
    logView = new LogView();
    logView.open();
    List<LogMessage> messages = logView.getOKMessages();
    assertTrue("No OK messages found!", !messages.isEmpty());

    // test OK Message no.1
    assertTrue(
        messageIsAvailable(
            messages,
            IStatus.OK,
            OK_ID_1,
            OK_MESSAGE_1,
            "An exception stack trace is not available."));

    // test OK Message no.2
    assertTrue(messageIsAvailable(messages, IStatus.OK, OK_ID_2, OK_MESSAGE_2, OK_STACK_2));
  }
 protected static void setupLog() {
   errorLogView = new LogView();
   errorLogView.open();
   errorLogView.deleteLog();
 }