}
public void testWeight(){
//Test1:
BenchmarkGoal nop1 = handler.getBenchmarkGoal(this.sGoalID);
assertEquals(-1,nop1.getWeight());
//Test2:
try {
nop1.setWeight(BenchmarkGoal.WEIGHT_MEDIUM);
} catch (InvalidInputException e) {
assertEquals(true,false);
}
assertEquals(BenchmarkGoal.WEIGHT_MEDIUM,nop1.getWeight());
try {
nop1.setWeight(BenchmarkGoal.WEIGHT_MINIMUM);
} catch (InvalidInputException e) {
assertEquals(true,false);
}
assertEquals(BenchmarkGoal.WEIGHT_MINIMUM,nop1.getWeight());
//Test3: got a new instance?
BenchmarkGoal nop2 = handler.getBenchmarkGoal(this.sGoalID);
assertEquals(-1,nop2.getWeight());
//Test4: invalid value
BenchmarkGoal nop3 = handler.getBenchmarkGoal(this.sGoalID);
try {
nop3.setWeight(15);
assertEquals(true,false);
} catch (InvalidInputException e) {
assertEquals(true,true);
}
assertEquals(-1,nop3.getWeight());
}