}
public TestReport runImpl() throws Exception {
SelfContainedSVGOnLoadTest t
= new SelfContainedSVGOnLoadTest(svgURL);
TestReport tr = t.run();
if(tr.hasPassed()){
return reportError(ERROR_UNEXPECTED_TEST_RESULT);
}
if(tr.getErrorCode() != expectedErrorCode){
TestReport r = reportError(ERROR_UNEXPECTED_ERROR_CODE);
r.addDescriptionEntry(ENTRY_ERROR_CODE, tr.getErrorCode());
r.addDescriptionEntry(ENTRY_EXPECTED_ERROR_CODE,
expectedErrorCode);
return r;
}
// Check that there is a description entry
TestReport.Entry[] desc = tr.getDescription();
int nDesc = 0, enDesc = 0;
if (desc != null){
nDesc = desc.length;
}
if (expectedEntryCodes != null){
enDesc = expectedEntryCodes.length;
}
if (nDesc != enDesc){
TestReport r = reportError(ERROR_UNEXPECTED_NUMBER_OF_DESCRIPTION_ENTRIES);
r.addDescriptionEntry(ENTRY_NUMBER_OF_DESCRIPTION,
"" + nDesc);
r.addDescriptionEntry(ENTRY_EXPECTED_NUMBER_OF_DESCRIPTION,
"" + enDesc);
return r;
}
if (nDesc > 0){
Vector veDesc = new Vector();
for(int i=0; i<nDesc; i++){
veDesc.add(expectedEntryCodes[i]);
}
for(int i=0; i<nDesc; i++){
String key = desc[i].getKey();
if (key == null || !veDesc.contains(key)){
TestReport r = reportError(ERROR_UNEXPECTED_DESCRIPTION_ENTRY);
if (key != null){
r.addDescriptionEntry(ENTRY_KEY, key);
r.addDescriptionEntry(ENTRY_EXPECTED_KEY,
SelfContainedSVGOnLoadTest.ENTRY_KEY_NUMBER_OF_TEST_RESULT_ELEMENTS);
}
return r;
}
}