7576777879808182838485
public void testClearAll() { Statistics stat = new Statistics(); for (int i = 0; i < 5; i++) { stat.clearAll(); assertClean(stat); } List<Double> list = new ArrayList<Double>(); list.add((double) 0);
8788899091929394959697
list.add((double) 2); stat.setValues(list); assertCorrect(list, stat); for (int i = 0; i < 5; i++) { stat.clearAll(); assertClean(stat); } } /**
109110111112113114115116117118119
double d = Math.random(); stat.addValue(d); v.add(d); } assertCorrect(v, stat); stat.clearAll(); assertCorrect(new Vector<Double>(), stat); } } /**
132133134135136137138139140141142
double d = Math.random(); stat.addValue(d); v.add(d); } Assert.assertEquals(v, stat.getValues()); stat.clearAll(); Assert.assertEquals(new Vector(), stat.getValues()); } Vector<Double> v = new Vector<Double>(); stat.setValues(v);
157158159160161162163164165166167
Double d = Math.random(); stat.addValue(d); v.add(d); assertCorrect(v, stat); } stat.clearAll(); } try { stat.addValue(null); Assert.fail("IllegalArgumentException expected but not thrown");
184185186187188189190191192193194
double d = Math.random(); stat.addValue(d); v.add(d); assertCorrect(v, stat); } stat.clearAll(); } } /** * Tests the <code>setValues</code> method.