@Test public void testFilterParameterDrillDownParameterArray() { DrillDownParameter[] drillDownParameters = { drillDownParameterSolution, drillDownParameterPath, drillDownParameterName }; PentahoRemoteDrillDownController remoteDrillDownControllerSpy = spy( new PentahoRemoteDrillDownController() ); doReturn( pathWrapper ).when( remoteDrillDownControllerSpy ).getPentahoPathWrapper(); DrillDownParameter[] result = remoteDrillDownControllerSpy.filterParameter( drillDownParameters ); assertNotNull( result ); assertEquals( result.length, 0 ); doReturn( "testSolution" ).when( pathWrapper ).getSolution(); doReturn( "path:in:solution" ).when( pathWrapper ).getPath(); doReturn( "filename" ).when( pathWrapper ).getName(); doReturn( "solution" ).when( drillDownParameterSolution ).getName(); doReturn( "path" ).when( drillDownParameterPath ).getName(); doReturn( "name" ).when( drillDownParameterName ).getName(); result = remoteDrillDownControllerSpy.filterParameter( drillDownParameters ); assertNotNull( result ); assertEquals( result.length, 3 ); }
protected DrillDownParameter[] filterParameter( final DrillDownParameter[] parameter ) { final PentahoPathModel pentahoPathWrapper = getPentahoPathWrapper(); final ArrayList<DrillDownParameter> list = new ArrayList<DrillDownParameter>(); boolean solutionAdded = false; boolean pathAdded = false; boolean nameAdded = false; for ( int i = 0; i < parameter.length; i++ ) { final DrillDownParameter drillDownParameter = parameter[ i ]; if ( "solution".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); solutionAdded = true; } else if ( "path".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); pathAdded = true; } else if ( "name".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); nameAdded = true; } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { assert true; } else { list.add( drillDownParameter ); } } if ( nameAdded == false ) { list.add( 0, new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); } if ( pathAdded == false ) { list.add( 0, new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); } if ( solutionAdded == false ) { list.add( 0, new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); } return super.filterParameter( list.toArray( new DrillDownParameter[ list.size() ] ) ); }
PentahoRemoteDrillDownController extends PentahoDrillDownController { protected DrillDownParameter[] filterParameter( final DrillDownParameter[] parameter ) { final PentahoPathModel pentahoPathWrapper = getPentahoPathWrapper(); final ArrayList<DrillDownParameter> list = new ArrayList<DrillDownParameter>(); boolean solutionAdded = false; boolean pathAdded = false; boolean nameAdded = false; for ( int i = 0; i < parameter.length; i++ ) { final DrillDownParameter drillDownParameter = parameter[ i ]; if ( "solution".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); solutionAdded = true; } else if ( "path".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); pathAdded = true; } else if ( "name".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); nameAdded = true; } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { assert true; } else { list.add( drillDownParameter ); } } if ( nameAdded == false ) { list.add( 0, new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); } if ( pathAdded == false ) { list.add( 0, new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); } if ( solutionAdded == false ) { list.add( 0, new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); } return super.filterParameter( list.toArray( new DrillDownParameter[ list.size() ] ) ); } }
PentahoRemoteDrillDownController extends PentahoDrillDownController { protected DrillDownParameter[] filterParameter( final DrillDownParameter[] parameter ) { final PentahoPathModel pentahoPathWrapper = getPentahoPathWrapper(); final ArrayList<DrillDownParameter> list = new ArrayList<DrillDownParameter>(); boolean solutionAdded = false; boolean pathAdded = false; boolean nameAdded = false; for ( int i = 0; i < parameter.length; i++ ) { final DrillDownParameter drillDownParameter = parameter[ i ]; if ( "solution".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); solutionAdded = true; } else if ( "path".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); pathAdded = true; } else if ( "name".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); nameAdded = true; } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { assert true; } else { list.add( drillDownParameter ); } } if ( nameAdded == false ) { list.add( 0, new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); } if ( pathAdded == false ) { list.add( 0, new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); } if ( solutionAdded == false ) { list.add( 0, new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); } return super.filterParameter( list.toArray( new DrillDownParameter[ list.size() ] ) ); } PentahoRemoteDrillDownController(); }
PentahoRemoteDrillDownController extends PentahoDrillDownController { protected DrillDownParameter[] filterParameter( final DrillDownParameter[] parameter ) { final PentahoPathModel pentahoPathWrapper = getPentahoPathWrapper(); final ArrayList<DrillDownParameter> list = new ArrayList<DrillDownParameter>(); boolean solutionAdded = false; boolean pathAdded = false; boolean nameAdded = false; for ( int i = 0; i < parameter.length; i++ ) { final DrillDownParameter drillDownParameter = parameter[ i ]; if ( "solution".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); solutionAdded = true; } else if ( "path".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); pathAdded = true; } else if ( "name".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); nameAdded = true; } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { assert true; } else { list.add( drillDownParameter ); } } if ( nameAdded == false ) { list.add( 0, new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); } if ( pathAdded == false ) { list.add( 0, new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); } if ( solutionAdded == false ) { list.add( 0, new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); } return super.filterParameter( list.toArray( new DrillDownParameter[ list.size() ] ) ); } PentahoRemoteDrillDownController();  }
PentahoRemoteDrillDownController extends PentahoDrillDownController { protected DrillDownParameter[] filterParameter( final DrillDownParameter[] parameter ) { final PentahoPathModel pentahoPathWrapper = getPentahoPathWrapper(); final ArrayList<DrillDownParameter> list = new ArrayList<DrillDownParameter>(); boolean solutionAdded = false; boolean pathAdded = false; boolean nameAdded = false; for ( int i = 0; i < parameter.length; i++ ) { final DrillDownParameter drillDownParameter = parameter[ i ]; if ( "solution".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); solutionAdded = true; } else if ( "path".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); pathAdded = true; } else if ( "name".equals( drillDownParameter.getName() ) ) { list.add( new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); nameAdded = true; } else if ( "::pentaho-path".equals( drillDownParameter.getName() ) ) { assert true; } else { list.add( drillDownParameter ); } } if ( nameAdded == false ) { list.add( 0, new DrillDownParameter( "name", FormulaUtil.quoteString( pentahoPathWrapper.getName() ) ) ); } if ( pathAdded == false ) { list.add( 0, new DrillDownParameter( "path", FormulaUtil.quoteString( pentahoPathWrapper.getPath() ) ) ); } if ( solutionAdded == false ) { list.add( 0, new DrillDownParameter( "solution", FormulaUtil.quoteString( pentahoPathWrapper.getSolution() ) ) ); } return super.filterParameter( list.toArray( new DrillDownParameter[ list.size() ] ) ); } PentahoRemoteDrillDownController();   }