Package br.com.procempa.modus.entity

Examples of br.com.procempa.modus.entity.ExceptionLog


        .search(
            "FROM ExceptionLog WHERE timestamp >= :dataInicio AND timestamp <= :dataFim",
            params);

    for (Persistent persistent : list) {
      ExceptionLog excecao = (ExceptionLog) persistent;
      RelatorioExcecaoVO excecaoVO = new RelatorioExcecaoVO();
      excecaoVO.setUsuario(excecao.getUserName());
      excecaoVO.setTelecentro(excecao.getTelecentro());
      excecaoVO.setExcecao(excecao.getException());
      excecaoVO.setData(excecao.getTimestamp().getTime());
      excecaoVO.setMensagem(excecao.getMessage());
      excecoes.add(excecaoVO);
    }
    return excecoes;
  }
View Full Code Here


      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException ne) {
      ne.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(ne,
          "Falha na obten��o do PersistentAccess.");
      throw new PersistException(log);
    } catch (SearchException se) {
      se.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(se,
          "Falha na busca de usu�rio");
      throw new PersistException(log);
    } catch (Exception e) {
      if (e instanceof ValidationException) {
        throw (ValidationException) e;
      }
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na persist�ncia de Usu�rio.");
      throw new PersistException(log);
    }

    return usuario;
View Full Code Here

    this.pa = PersistentAccessFactory.getInstance();
    exceptionLog = createExceptionLog();
  }
 
  public void testInsertExceptionLog() throws Exception {
    ExceptionLog e = (ExceptionLog) pa.persist(exceptionLog);
   
    assertEquals(e.getContextMessage(),exceptionLog.getContextMessage());
    assertTrue(e.getId() != "" && e.getId() != null);
  }
View Full Code Here

    assertEquals(e.getContextMessage(),exceptionLog.getContextMessage());
    assertTrue(e.getId() != "" && e.getId() != null);
  }
   
    public void testFindExceptionLog() throws Exception {
      ExceptionLog e = (ExceptionLog) pa.find(ExceptionLog.class,exceptionLog.getId());
   
    assertEquals(e.getStatus(),exceptionLog.getStatus());
    assertEquals(e.getException(),exceptionLog.getException());
    }
View Full Code Here

    assertEquals(e.getStatus(),exceptionLog.getStatus());
    assertEquals(e.getException(),exceptionLog.getException());
    }
   
  public void testRemoveExceptionLog() throws Exception {
    ExceptionLog e = (ExceptionLog) pa.find(ExceptionLog.class, exceptionLog.getId());
    e.setStatus(Status.EXCLUIDO);
    e = (ExceptionLog) pa.persist(e);

    assertNotSame(e.getStatus(), exceptionLog.getStatus());
  }
View Full Code Here

    private ExceptionLog createExceptionLog() throws Exception {
    if(pa == null) {
      setUp();
    }

    ExceptionLog e = new ExceptionLog();
    e.setException("NullPointerException");
    e.setMessage("Objeto n�o inicializado");
    e.setStackTrace("Texto do trace");
    e.setUserDescription("Tentei salvar o registro e me deu esta tela! De novo...");
    e.setUser("Jo�o da Silva");
    e.setTelecentro("Cibernarium");
    e.setContextMessage("Mensagem de contexto");

    return e;
  }
View Full Code Here

    this.pa = PersistentAccessFactory.getInstance();
    exceptionLog = createExceptionLog();
  }
 
  public void testInsertExceptionLog() throws Exception {
    ExceptionLog e = (ExceptionLog) pa.persist(exceptionLog);
   
    assertEquals(e.getContextMessage(),exceptionLog.getContextMessage());
    assertTrue(e.getId() != -1 && e.getId() != null);
  }
View Full Code Here

    assertEquals(e.getContextMessage(),exceptionLog.getContextMessage());
    assertTrue(e.getId() != -1 && e.getId() != null);
  }
   
    public void testFindExceptionLog() throws Exception {
      ExceptionLog e = (ExceptionLog) pa.find(ExceptionLog.class,new Long(1));
   
  //  assertEquals(e.getStatus(),exceptionLog.getStatus());
    assertEquals(e.getException(),exceptionLog.getException());
    }
View Full Code Here

  //  assertEquals(e.getStatus(),exceptionLog.getStatus());
    assertEquals(e.getException(),exceptionLog.getException());
    }
   
  public void testRemoveExceptionLog() throws Exception {
    ExceptionLog e = (ExceptionLog) pa.find(ExceptionLog.class, exceptionLog.getId());
    pa.remove(e);

  //  assertNotSame(e.getStatus(), exceptionLog.getStatus());
  }
View Full Code Here

    private ExceptionLog createExceptionLog() throws Exception {
    if(pa == null) {
      setUp();
    }

    ExceptionLog e = new ExceptionLog();
    e.setException("NullPointerException");
    e.setMessage("Objeto n�o inicializado");
    e.setStackTrace("Texto do trace");
    e.setUserDescription("Tentei salvar o registro e me deu esta tela! De novo...");
    e.setUserName("Jo�o da Silva");
    e.setTelecentro("Cibernarium");
    e.setContextMessage("Mensagem de contexto");

    return e;
  }
View Full Code Here

TOP

Related Classes of br.com.procempa.modus.entity.ExceptionLog

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.