Esempio n. 1
0
  @Test
  public void testErrorLog() throws IOException {
    String test = null;
    try {
      test.toString();
    } catch (Exception ex) {
      Debugger.logMessage(ex);
      String loggedMessage = "";
      FileReader reader = new FileReader(Debugger.getLogFilename());
      loggedMessage = reader.readFile();

      boolean containsExceptionInfo = loggedMessage.contains("null");
      assertTrue("Failure: the logged message did not contain \"null\"..", containsExceptionInfo);
    }
  }
Esempio n. 2
0
 @Test(expected = IllegalArgumentException.class)
 public void testNullLogArg() {
   Debugger.logMessage(null);
 }