Package co.nubetech.crux.dao

Examples of co.nubetech.crux.dao.ReportDAO


  @Test
  public void testGetDashboardWhenNoReportsAreOnDashboard(){
   
    ArrayList<Report> reportList = new ArrayList<Report>();
   
    ReportDAO reportDAO = mock(ReportDAO.class);
    when(reportDAO.findDashboardReports()).thenReturn(reportList);
   
    DashBoardAction dashboardAction = new DashBoardAction();
    dashboardAction.setReportDAO(reportDAO);
    String result = dashboardAction.getDashBoard();
    ArrayList<Report> fetchedReportList = dashboardAction.getReportListForDashBoard();
View Full Code Here


  }
 
  @Test
  public void testGetDashboardWhenNoReports(){
       
    ReportDAO reportDAO = mock(ReportDAO.class);
    when(reportDAO.findAll()).thenReturn(new ArrayList<Report>());
   
    DashBoardAction dashboardAction = new DashBoardAction();
    dashboardAction.setReportDAO(reportDAO);
    String result = dashboardAction.getDashBoard();
    ArrayList<Report> fetchedReportList = dashboardAction.getReportListForDashBoard();
View Full Code Here

    List<Report> reportList = new ArrayList<Report>();
    reportList.add(report1);
    reportList.add(report2);
    reportList.add(report3);
   
    ReportDAO mockedReportDAO = mock(ReportDAO.class);
    ViewReportListAction viewReportListAction = new ViewReportListAction();
    viewReportListAction.setReportDAO(mockedReportDAO);
    when(mockedReportDAO.findAll()).thenReturn(reportList);
   
    String successString = viewReportListAction.displayReportList();
   
    assertEquals(successString, "success");
       
View Full Code Here

    report.setReportType(reportType);
   
    List<Report> reportList = new ArrayList<Report>();
    reportList.add(report);
   
    ReportDAO mockedReportDAO = mock(ReportDAO.class);
    ViewReportListAction viewReportListAction = new ViewReportListAction();
    viewReportListAction.setReportDAO(mockedReportDAO);
    when(mockedReportDAO.findAll()).thenReturn(reportList);
   
    String successString = viewReportListAction.displayReportList();
   
    assertEquals(successString, "success");
   
View Full Code Here

   
   
    List<Report> reportList = new ArrayList<Report>();
    reportList.add(report);
   
    ReportDAO mockedReportDAO = mock(ReportDAO.class);
    ViewReportListAction viewReportListAction = new ViewReportListAction();
    viewReportListAction.setReportDAO(mockedReportDAO);
    when(mockedReportDAO.findAll()).thenReturn(reportList);
   
    // with this, report.getReportType().getType() is called in ReportView(index, report)
    // which NullPointerException as there is no ReportType for report object.
    String successString = viewReportListAction.displayReportList();
   
View Full Code Here

    mappingList.add(mapping3);
   
    // Nothing in the report list in this test.
    List<Report> reportList = new ArrayList<Report>();
   
    ReportDAO mockedReportDAO = mock(ReportDAO.class);
    ViewReportListAction viewReportListAction = new ViewReportListAction();
    viewReportListAction.setReportDAO(mockedReportDAO);
   
    when(mockedReportDAO.findAll()).thenReturn(reportList);
   
   
    MappingDAO mockedMappingDAO = mock(MappingDAO.class);
    viewReportListAction.setMappingDAO(mockedMappingDAO);
   
View Full Code Here

TOP

Related Classes of co.nubetech.crux.dao.ReportDAO

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.