aggregator-manager/src/test/java/org/arrowhead/wp5/agg/junit/TestIntegrated.java
public void testReturnOfNonAggregatedFlexOffers() throws AggregationException
	{
		p = new FOAggParameters();		
		p.getConstraintPair().startAfterToleranceType = ConstraintType.acSet;
		p.getConstraintPair().startAfterTolerance = 1;
		p.getConstraintPair().startBeforeToleranceType = ConstraintType.acSet;
		p.getConstraintPair().startBeforeTolerance = 1;		
		p.getConstraintAggregate().valueMin = 0;
		p.getConstraintAggregate().valueMax = 15;
		p.getConstraintAggregate().aggConstraint = ConstraintAggregateType.acTotalEnMax;		
		
		IAggregation agg = new FOAggregation();
		Collection<FlexOffer> list = new ArrayList<FlexOffer>();
		
		for(int i=0; i<500; i++)
		{
			FlexOffer f = new FlexOffer();			
			UtilsFoDummies.FlexOffer_SetDim1(f, i*0.01);			
			if (f.getTotalEnergyConstraint() == null)
				f.setTotalEnergyConstraint(new FlexOfferConstraint(0,0));
			f.getTotalEnergyConstraint().setUpper(20); // Aggregation will fail as 20>15
			list.add(f);
		}
		
		int cnt1 = agg.Aggregate(p, list).size();
		assertEquals("Non-aggregated flex-offers were not added to the aggregation output!", 500, cnt1);
	}
/*
	 * 2013-03-07  Tests the returning of non-aggregated flex-offers
	 */
2013-03-07  Tests the returning of non-aggregated flex-offers
2013 - 03 - 07 Tests the returning of non - aggregated flex - offers
public void testReturnOfNonAggregatedFlexOffers() throws AggregationException
	{
		p = new FOAggParameters();		
		p.getConstraintPair().startAfterToleranceType = ConstraintType.acSet;
		p.getConstraintPair().startAfterTolerance = 1;
		p.getConstraintPair().startBeforeToleranceType = ConstraintType.acSet;
		p.getConstraintPair().startBeforeTolerance = 1;		
		p.getConstraintAggregate().valueMin = 0;
		p.getConstraintAggregate().valueMax = 15;
		p.getConstraintAggregate().aggConstraint = ConstraintAggregateType.acTotalEnMax;		
		IAggregation agg = new FOAggregation();
		Collection<FlexOffer> list = new ArrayList<FlexOffer>();
		for(int i=0; i<500; i++)
		{
			FlexOffer f = new FlexOffer();			
			UtilsFoDummies.FlexOffer_SetDim1(f, i*0.01);			
			if (f.getTotalEnergyConstraint() == null)
				f.setTotalEnergyConstraint(new FlexOfferConstraint(0,0));
			f.getTotalEnergyConstraint().setUpper(20); 
			list.add(f);
		}
		int cnt1 = agg.Aggregate(p, list).size();
		assertEquals("Non-aggregated flex-offers were not added to the aggregation output!", 500, cnt1);
	}
public void testReturnOfNonAggregatedFlexOffers ( ) throws AggregationException { p = new FOAggParameters ( ) ; p . getConstraintPair ( ) . startAfterToleranceType = ConstraintType . acSet ; p . getConstraintPair ( ) . startAfterTolerance = 1 ; p . getConstraintPair ( ) . startBeforeToleranceType = ConstraintType . acSet ; p . getConstraintPair ( ) . startBeforeTolerance = 1 ; p . getConstraintAggregate ( ) . valueMin = 0 ; p . getConstraintAggregate ( ) . valueMax = 15 ; p . getConstraintAggregate ( ) . aggConstraint = ConstraintAggregateType . acTotalEnMax ; IAggregation agg = new FOAggregation ( ) ; Collection < FlexOffer > list = new ArrayList < FlexOffer > ( ) ; for ( int i = 0 ; i < 500 ; i ++ ) { FlexOffer f = new FlexOffer ( ) ; UtilsFoDummies . FlexOffer_SetDim1 ( f , i * 0.01 ) ; if ( f . getTotalEnergyConstraint ( ) == null ) f . setTotalEnergyConstraint ( new FlexOfferConstraint ( 0 , 0 ) ) ; f . getTotalEnergyConstraint ( ) . setUpper ( 20 ) ; list . add ( f ) ; } int cnt1 = agg . Aggregate ( p , list ) . size ( ) ; assertEquals ( "Non-aggregated flex-offers were not added to the aggregation output!" , 500 , cnt1 ) ; }
2013-03-07  Tests the returning of non-aggregated flex-offers
2013 - 03 - 07 Tests the returning of non - aggregated flex - offers
// Aggregation will fail as 20>15