Lines 70-76
Link Here
|
70 |
public static String[] transparentImageFilenames = new String[] {"transparent.png"}; |
70 |
public static String[] transparentImageFilenames = new String[] {"transparent.png"}; |
71 |
|
71 |
|
72 |
// specify reparentable platforms |
72 |
// specify reparentable platforms |
73 |
public static String[] reparentablePlatforms = new String[] {"win32", "gtk", "winCE", "wm2003"}; |
73 |
public static String[] reparentablePlatforms = new String[] {"win32", "gtk", "winCE", "wm2003", "winCE5", "WM5Pro", "WM6Pro", "SP2003", "WM5Std", "WM6Std"}; |
74 |
|
74 |
|
75 |
public static ResourceBundle optionalTests; |
75 |
public static ResourceBundle optionalTests; |
76 |
public static ResourceBundle configurationParms; |
76 |
public static ResourceBundle configurationParms; |
Lines 91-96
Link Here
|
91 |
pkgId = pkgId.substring(0,index); |
91 |
pkgId = pkgId.substring(0,index); |
92 |
|
92 |
|
93 |
String platform = SWT.getPlatform(); |
93 |
String platform = SWT.getPlatform(); |
|
|
94 |
System.out.println("Platform is " + platform); |
94 |
String platformWithoutSpaces = new String(); |
95 |
String platformWithoutSpaces = new String(); |
95 |
for (int i = 0; i < platform.length(); i++) { |
96 |
for (int i = 0; i < platform.length(); i++) { |
96 |
if (platform.charAt(i) != ' ') { |
97 |
if (platform.charAt(i) != ' ') { |
Lines 305-316
Link Here
|
305 |
} |
306 |
} |
306 |
|
307 |
|
307 |
// copied exactly from junit.framework.TestCase so that it can be called from here even though private |
308 |
// copied exactly from junit.framework.TestCase so that it can be called from here even though private |
308 |
static private void failNotEquals(String message, Object expected, Object actual) { |
309 |
//static private void failNotEquals(String message, Object expected, Object actual) { |
309 |
String formatted= ""; |
310 |
// String formatted= ""; |
310 |
if (message != null) |
311 |
// if (message != null) |
311 |
formatted= message+" "; |
312 |
// formatted= message+" "; |
312 |
fail(formatted+"expected:<"+expected+"> but was:<"+actual+">"); |
313 |
// fail(formatted+"expected:<"+expected+"> but was:<"+actual+">"); |
313 |
} |
314 |
//} |
314 |
protected boolean isReparentablePlatform() { |
315 |
protected boolean isReparentablePlatform() { |
315 |
String platform = SWT.getPlatform(); |
316 |
String platform = SWT.getPlatform(); |
316 |
for (int i=0; i<reparentablePlatforms.length; i++) { |
317 |
for (int i=0; i<reparentablePlatforms.length; i++) { |
Lines 335-340
Link Here
|
335 |
setUp(); |
336 |
setUp(); |
336 |
runTest(); |
337 |
runTest(); |
337 |
} catch (org.eclipse.swt.SWTError e) { |
338 |
} catch (org.eclipse.swt.SWTError e) { |
|
|
339 |
System.out.println("SWTerror"); |
338 |
if (e.code == org.eclipse.swt.SWT.ERROR_NOT_IMPLEMENTED) { |
340 |
if (e.code == org.eclipse.swt.SWT.ERROR_NOT_IMPLEMENTED) { |
339 |
warnUnimplAPI(""); |
341 |
warnUnimplAPI(""); |
340 |
} else { |
342 |
} else { |
Lines 343-362
Link Here
|
343 |
} catch (AssertionFailedError e1) { |
345 |
} catch (AssertionFailedError e1) { |
344 |
try { |
346 |
try { |
345 |
String failure = this.getClass().getName()+">>"+getName(); |
347 |
String failure = this.getClass().getName()+">>"+getName(); |
|
|
348 |
//if optionalTests is null, that means this failure is not ignored in original suite, thus directly |
349 |
//throws the AssertionFailedError |
346 |
if (optionalTests != null) { |
350 |
if (optionalTests != null) { |
347 |
optionalTests.getString(failure); |
351 |
//if optionalTests is not null, it will check whether this corresponding test case is ignored in |
|
|
352 |
//original suite. if yes, it will print out the corresponding message. if not, it will throws |
353 |
//AssertionFailedError |
354 |
if (optionalTests.getString(failure).equalsIgnoreCase("y")){ |
355 |
System.out.println(failure+" >> "+e1.getMessage()+">> failure >> is ignored in original suite"); |
356 |
}else{ |
357 |
throw(e1); |
358 |
} |
348 |
} else { |
359 |
} else { |
349 |
throw(e1); |
360 |
throw(e1); |
350 |
} |
361 |
} |
351 |
} catch (MissingResourceException e2) { |
362 |
} catch (MissingResourceException e2) { |
352 |
throw(e1); |
363 |
throw(e1); |
353 |
} |
364 |
} |
354 |
} finally { |
365 |
//Runtime Exception and Error will cause junit test producing errors |
|
|
366 |
} catch (Throwable e) { |
367 |
try { |
368 |
String err = this.getClass().getName()+">>"+getName(); |
369 |
//if optionalTests is null, that means this error is not ignored in original suite, thus directly |
370 |
//throws the Exception |
371 |
if (optionalTests != null) { |
372 |
//if optionalTests is not null, it will check whether this corresponding test case is ignored in |
373 |
//original suite. if yes, it will print out the corresponding message. if not, it will throws |
374 |
//Exception |
375 |
if(optionalTests.getString(err).equalsIgnoreCase("y")){ |
376 |
System.out.println(err+" >> "+e.getMessage()+">> error >> is ignored in original suite"); |
377 |
}else{ |
378 |
throw(e); |
379 |
} |
380 |
} else { |
381 |
throw(e); |
382 |
} |
383 |
}catch (MissingResourceException e2) { |
384 |
throw(e); |
385 |
} |
386 |
}finally { |
355 |
tearDown(); |
387 |
tearDown(); |
356 |
Display d = Display.getCurrent(); |
388 |
Display d = Display.getCurrent(); |
357 |
if (d!=null) { |
389 |
if (d!=null) { |
358 |
d.dispose(); |
390 |
d.dispose(); |
359 |
} |
391 |
} |
360 |
} |
392 |
} |
361 |
}; |
|
|
362 |
} |
393 |
} |
|
|
394 |
} |