* (non-Javadoc)
* @see org.jasen.interfaces.JasenPlugin#test(org.jasen.core.Jasen, javax.mail.internet.MimeMessage, org.jasen.interfaces.JasenMessage, org.jasen.interfaces.ParserData, org.jasen.interfaces.ReceivedHeaderParser)
*/
public JasenTestResult test(Jasen engine, MimeMessage rawMessage, JasenMessage parsedMessage, ParserData data, ReceivedHeaderParser parser) throws JasenException {
// Get the count
PointTestResult result = new PointTestResult();
result.setMin(min);
result.setMax(max);
result.setThreshold(threshold);
int count = 0;
if(data instanceof StandardParserData) {
StandardParserData spData = (StandardParserData)data;
if(spData.getSrcPortCount() > 0 && spData.getPorts() != null) {
String port = null;
// Check against the list of known ports...
for (int i = 0; i < spData.getPorts().size(); i++)
{
port = (String)spData.getPorts().get(i);
if(Arrays.binarySearch(knownPorts, port) <= -1) {
// not a known port
count++;
}
}
}
}
result.setPoints(count);
return result;
}