BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
assertEquals("Hello World", reader.readLine());
Stats stats = component.getStats();
Statistic[] stts = stats.getStatistics();
Statistic aStts;
String[] sttsNames = stats.getStatisticNames();
for (int i = 0; i < sttsNames.length; i++) {
// check that the names match the getter methods
String sttsName = sttsNames[i];
assertFalse(sttsName.equals(stts[i].getName()));
try {
stats.getClass().getMethod("get" + sttsName, new Class[0]);
} catch (NoSuchMethodException e) {
continue; // ignore this statistics for now, JSR77.6.10.1.1
}
aStts = stats.getStatistic(sttsName);
assertTrue("startTime was not set for " + sttsName, aStts.getStartTime() != 0);
assertTrue("lastSampleTime was not set for " + sttsName, aStts.getLastSampleTime() != 0);
/*System.out.println(" lastSampleTime = " + aStts.getLastSampleTime() +
" startTime = " + aStts.getStartTime());
System.out.println(aStts);*/
}
if (k == n-2) component.resetStats(); // test reset