Пример #1
0
  public void testWithQuery() throws Exception {
    WhatIfEngineInstance ei = getWhatifengineiEngineInstance(getCatalogue());
    SpagoBIPivotModel pivotModel = (SpagoBIPivotModel) ei.getPivotModel();

    SpagoBICellSetWrapper cellSetWrapper = (SpagoBICellSetWrapper) pivotModel.getCellSet();
    SpagoBICellWrapper cellWrapper = (SpagoBICellWrapper) cellSetWrapper.getCell(0);

    cellWrapper.getMembers()[1].setProperty(WhatIfConstants.MEMBER_PROPERTY_LEAF, null);

    EqualPartitioningOnLeafsAllocationAlgorithm ae =
        new EqualPartitioningOnLeafsAllocationAlgorithm(ei);

    Long leafs = ae.getDataManager().getLeafs(cellWrapper.getMembers());

    System.out.println(leafs);
  }
  public void testPersistTransofrmationsEqualPartitioningOnLeafsAllocationAlgorithmTestCase()
      throws Exception {

    long dateA = System.currentTimeMillis();

    WhatIfEngineInstance ei = getWhatifengineiEngineInstance(getCatalogue());
    EqualPartitioningOnLeafsAllocationAlgorithm al =
        new EqualPartitioningOnLeafsAllocationAlgorithm(ei);
    al.initAlgorithm();
    Double ration = persistTransformations(ei, al);

    long dateB = System.currentTimeMillis();

    System.out.println(
        "Time taken from EqualPartitioningOnLeafsAllocationAlgorithmTestCase is "
            + (dateB - dateA));
    System.out.println("Ratio is " + ration);

    assertTrue(ration < accurancy);
  }