Package co.nubetech.crux.model

Examples of co.nubetech.crux.model.Report


public class TestDashboardAction extends DBConnection {
 
  @Test
  public void testGetDashboardWhenReportsAreOnDashboard(){
    Report report1 = new Report(null,"first",null,new Dashboard(1,1));
    Report report3 = new Report(null,"third",null,new Dashboard(0,0));
   
    ArrayList<Report> reportList = new ArrayList<Report>();
    reportList.add(report1);
    reportList.add(report3);
   
View Full Code Here


        xFnStack));
  }
 
  @Test
  public void testSemiAggFnValueListAggregateFirst() throws CruxException{
    Report report = TestingUtil.getReport();
    List<Stack<CruxFunction>> fnList = report.getFunctions();
   
    byte[] value = Bytes.toBytes(new Double(54.55d));
    FunctionUtil.applyAggregateFunctions(value, fnList.get(0));
    FunctionUtil.applyAggregateFunctions(value, fnList.get(1));
    FunctionUtil.applyAggregateFunctions(value, fnList.get(2));
View Full Code Here

        xFnStack));
  }

  @Test
  public void testAggFnValueListAggregateFirst() throws CruxException{
    Report report = TestingUtil.getReportNoGroupBy();
   
    List<Stack<CruxFunction>> fnList = report.getFunctions();
   
    byte[] value = Bytes.toBytes(new Double(54.55d));
    FunctionUtil.applyAggregateFunctions(value, fnList.get(0));
    FunctionUtil.applyAggregateFunctions(value, fnList.get(1));
    FunctionUtil.applyAggregateFunctions(value, fnList.get(2));
View Full Code Here

public class TestGABatchCallback {
 
  @Test
  public void testUpdate() throws CruxException{
    Report report = TestingUtil.getReportNoGroupBy();
    GroupingAggregationBatchCallback callback = new GroupingAggregationBatchCallback(report);
   
    List<List> regionServer1 = new ArrayList<List>();
    ArrayList regionServerValues = new ArrayList();
    regionServerValues.add(1234d);
View Full Code Here

    ReportType reportType2= new ReportType(122, "ReportType2");
    ReportType reportType3 = new ReportType(123, "ReportType3");
   
    Dashboard dashboard = new Dashboard(1, 2);
   
    Report report1 = new Report(user,"Report1", reportType1, dashboard);
    Report report2 = new Report(user,"Report2", reportType2, dashboard);
    Report report3 = new Report(user,"Report3", reportType3, dashboard);
   
    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");
       
    assertEquals(viewReportListAction.getReportList().get(0).getName(), report1.getName());
    assertEquals(viewReportListAction.getReportList().get(1).getName(), report2.getName());
    assertEquals(viewReportListAction.getReportList().get(2).getName(), report3.getName());
   
    // Report view index starts with integer 1.
    assertEquals(viewReportListAction.getReportList().get(0).getIndex(), 1);
     
  }
View Full Code Here

  @Test
  public void testDisplayReportListWithEmptyReportFields(){
   
    ReportType reportType = new ReportType(121, "ReportType");
    Report report = new Report();
   
    // Setting report type is must, otherwise NUllPointerException.
    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");
   
    //ReporType is the only assigned field to report..
    assertEquals(viewReportListAction.getReportList().get(0).getReportType(), report.getReportType().getType());
   
    // Other unassigned fields return their respective default values.
    assertEquals(viewReportListAction.getReportList().get(0).getName(), null);
    assertEquals(viewReportListAction.getReportList().get(0).getId(), 0);
    assertEquals(viewReportListAction.getReportList().get(0).getIndex(), 1);
View Full Code Here

  }
 
  @Test(expected= NullPointerException.class)
  public void testDisplayReportListWithoutReportType(){
   
    Report report = new Report();
   
    // Setting report type is must, otherwise NullPointerException.
    // We are hiding the ReportType for report object
   
   
View Full Code Here

public class TestServerUtil {
 
  @Test
  public void testGetRowAlias() {
    Report report = TestingUtil.getReportWithoutAggregateFunctions();
    ReportDesign rowDesign = report.getDesigns().get(0);
   
    System.out.println("Getting alias for " + rowDesign);
    Alias rowAlias = ServerUtil.getAlias(rowDesign);
    assertEquals("rowAlias", rowAlias.getAlias());
    assertEquals("co.nubetech.crux.model.RowAlias",
View Full Code Here

  }
 

  @Test
  public void testGetColumnAlias() {
    Report report = TestingUtil.getReportWithoutAggregateFunctions();
    ReportDesign columnDesign = report.getDesigns().get(1);
   
    System.out.println("Getting alias for " + columnDesign);   
    assertEquals("alias", ServerUtil.getAlias(columnDesign).getAlias());
    assertEquals("co.nubetech.crux.model.ColumnAlias",
        ServerUtil.getAlias(columnDesign).getClass().getName());
View Full Code Here

        ServerUtil.getAlias(columnDesign).getClass().getName());
  }
 
  @Test
  public void testGetValueRow() {
    Report report = TestingUtil.getReportWithoutAggregateFunctions();
    ReportDesign rowDesign = report.getDesigns().get(0);
    RowAlias alias = rowDesign.getRowAlias();
    byte[] row = new String("abcdefgh").getBytes();
    byte[] family = new String("f").getBytes();
    byte[] q = new String("q").getBytes();
    byte[] value = new String("I am the val").getBytes();
View Full Code Here

TOP

Related Classes of co.nubetech.crux.model.Report

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.