コード例 #1
0
  @Test
  public void parseCausedBy() {
    CausedBy causedBy = lineParser.parseCausedBy(CAUSED_BY, currentLogStatement);

    assertEquals(
        new Clazz("javax.ejb.EJBTransactionRolledbackException"), causedBy.getExceptionClazz());
  }
コード例 #2
0
  @Test
  public void parseLogStatement_ERROR() {
    LogStatement log = lineParser.parseLogStatement(ERROR_LOG);

    assertNotNull(log);
    assertEquals(Level.ERROR, log.getLevel());
    // TODO finish testSimpleInfoWithException
  }
コード例 #3
0
  @Test
  public void testCausedByOnlyClass() {
    CausedBy causedBy = lineParser.parseCausedBy(CAUSED_BY_ONLY_CLASS, currentLogStatement);

    assertEquals(
        "javax.servlet.ServletException", causedBy.getExceptionClazz().getFullyQualifiedName());
    assertEquals("", causedBy.getMessage());
  }
コード例 #4
0
  @Test
  public void parseLogStatement_INFO() {
    LogStatement log = lineParser.parseLogStatement(INFO_LOG);

    assertEquals(LocalTime.of(1, 55, 16), log.getTime());
    assertEquals(Level.INFO, log.getLevel());
    assertEquals(new Clazz("com.web.seam.action.AuthenticatorImpl"), log.getClazz());
    assertEquals("Login successfull for user: [email protected]", log.getMessage());
  }
コード例 #5
0
  @Test
  public void parseCausedByWithException() {
    CausedBy causedBy = lineParser.parseCausedBy(CAUSED_BY_LONG, currentLogStatement);

    assertEquals(new Clazz("javax.faces.FacesException"), causedBy.getExceptionClazz());
    assertEquals(
        "#{facilityChooserAction.facilitySelected}: javax.ejb.EJBTransactionRolledbackException",
        causedBy.getMessage());
  }
コード例 #6
0
  @Test
  public void parseAtLine() {
    AtLine atLine = lineParser.parseAtLine(AT_LINE);

    assertNotNull(atLine);
    assertEquals(new Clazz("org.apache.catalina.core.ApplicationFilterChain"), atLine.getClazz());
    assertEquals("doFilter", atLine.getMethod());
    assertEquals("ApplicationFilterChain.java:206", atLine.getSource());
  }
コード例 #7
0
  @Test
  public void testLongLineWithDoubleRegexPattern() {
    CausedBy causedBy =
        lineParser.parseCausedBy(CAUSED_BY_WITH_DOUBLE_PATTERN, currentLogStatement);

    assertEquals("javax.el.ELException", causedBy.getExceptionClazz().getFullyQualifiedName());
    assertEquals(
        "/incl/mainmenu.xhtml @10,260 rendered=\"#{identity.loggedIn and identity.hasRole(applicationService.showRoleId('ADMIN')) eq false}\": org.jboss.seam.RequiredException: @In attribute requires non-null value: applicationService.entityManager",
        causedBy.getMessage());
  }
コード例 #8
0
 @Test
 public void testMathesMore() {
   assertTrue(lineParser.matchesMore(MORE_LINE));
 }