Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 117202 Details for
Bug 254458
Patch for eswt junit test to adapt to different platforms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch file for eSWT expanded junit test
Patch of expanded.test.txt (text/plain), 10.23 KB, created by
Sam Lo
on 2008-11-06 10:08:34 EST
(
hide
)
Description:
Patch file for eSWT expanded junit test
Filename:
MIME Type:
Creator:
Sam Lo
Created:
2008-11-06 10:08:34 EST
Size:
10.23 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ercp.swt.expanded.tests >Index: src/org/eclipse/ercp/swt/expanded/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.ercp/org.eclipse.ercp.swt.expanded.tests/src/org/eclipse/ercp/swt/expanded/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java,v >retrieving revision 1.7 >diff -u -r1.7 Test_org_eclipse_swt_graphics_ImageLoader.java >--- src/org/eclipse/ercp/swt/expanded/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java 28 Nov 2005 22:14:33 -0000 1.7 >+++ src/org/eclipse/ercp/swt/expanded/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java 6 Nov 2008 10:04:07 -0000 >@@ -20,6 +20,7 @@ > import org.eclipse.ercp.swt.core.tests.junit.SwtTestCase; > import org.eclipse.swt.*; > import org.eclipse.swt.graphics.*; >+import org.eclipse.swt.internal.Platform; > > /** > * Automated Test Suite for class org.eclipse.swt.graphics.ImageLoader >@@ -70,11 +71,15 @@ > String fileName = SwtTestCase.imageFilenames[0]; > for (int i=0; i<numFormats; i++) { > String format = SwtTestCase.imageFormats[i]; >- stream = SwtTestCase.class.getResourceAsStream(fileName + "." + format); >- loader.load(stream); >- try { >- stream.close(); >- } catch (IOException e) {} >+ //Win32 does not support ImageLoader load jpg/png as inputstream >+ boolean isPlatformWin32 = Platform.isWin32(); >+ if (!(isPlatformWin32&&(format=="jpg"|format=="png"))){ >+ stream = SwtTestCase.class.getResourceAsStream(fileName + "." + format); >+ loader.load(stream); >+ try { >+ stream.close(); >+ } catch (IOException e) {} >+ } > } > } finally { > try { >@@ -149,17 +154,21 @@ > String filename = SwtTestCase.imageFilenames[0]; > // must use jpg since save is not implemented yet in png format > String filetype = "jpg"; >- inStream = SwtTestCase.class.getResourceAsStream(filename + "." + filetype); >- loader.load(inStream); >- try { >- inStream.close(); >- } catch (IOException e) {} >- for (int i = 0; i < imageFormats.length; i++) { >- if (imageFormats[i].equals(filetype)) { >- // save using the appropriate format >- loader.save(outStream, SWT.IMAGE_JPEG); >- break; >- } >+ inStream = SwtTestCase.class.getResourceAsStream(filename + "." + filetype); >+ //eSWT does not support png and jpg as outputStream saving in Win32, WinCE and WindowMobile. >+ boolean isPlatformWin32WinCEWM = Platform.isWin32()|Platform.isWinCE()|Platform.isWindowMobile()|Platform.isSmartPhone(); >+ if (!isPlatformWin32WinCEWM){ >+ loader.load(inStream); >+ try { >+ inStream.close(); >+ } catch (IOException e) {} >+ for (int i = 0; i < imageFormats.length; i++) { >+ if (imageFormats[i].equals(filetype)) { >+ // save using the appropriate format >+ loader.save(outStream, SWT.IMAGE_JPEG); >+ break; >+ } >+ } > } > } > } finally { >@@ -179,30 +188,47 @@ > } catch (IllegalArgumentException e) { > } > for (int i=0; i<imageFormats.length; i++) { >- for (int j=0; j<SwtTestCase.imageFilenames.length; j++) { >- filename = SwtTestCase.imageFilenames[j]; >- String filetype = imageFormats[i]; >- InputStream inStream = SwtTestCase.class.getResourceAsStream(filename + "." + filetype); >- loader.load(inStream); >- try { >+ boolean isPlatformWin32 = Platform.isWin32(); >+ boolean isPlatformWinCE5 = Platform.isWinCE(); >+// Win32 does not support ImageLoader load jpg/png as inputstream >+ if (!(isPlatformWin32&&(imageFormats[i]=="jpg"|imageFormats[i]=="png"))){ >+ for (int j=0; j<SwtTestCase.imageFilenames.length; j++) { >+ filename = SwtTestCase.imageFilenames[j]; >+ String filetype = imageFormats[i]; >+ InputStream inStream = SwtTestCase.class.getResourceAsStream(filename + "." + filetype); >+ loader.load(inStream); >+ try { > inStream.close(); >- } catch (IOException e) {} >- File imageFile = new File(filename + "saved."+filetype); >- imageFile.delete(); >- loader.save(imageFile.getName(), imageTypes[i]); >- assertTrue("image not saved " + filetype, imageFile.exists()); >- } >+ } catch (IOException e) {} >+ File imageFile = new File(filename + "saved."+filetype); >+ imageFile.delete(); >+ //WinCE5 does not support ImageLoader save gif/png >+ if (!(isPlatformWinCE5&&(imageFormats[i]=="gif"|imageFormats[i]=="png"))){ >+ loader.save(imageFile.getName(), imageTypes[i]); >+ assertTrue("image not saved " + filetype, imageFile.exists()); >+ } >+ } >+ } >+ } >+ //Win32 does not support ImageLoader load jpg/png as inputstream >+ boolean isPlatformWin32 = Platform.isWin32(); >+ boolean isPlatformWinCE5 = Platform.isWinCE(); >+ if(!isPlatformWin32){ >+ filename = "transparent.png"; >+ InputStream inStream = SwtTestCase.class.getResourceAsStream(filename); >+ loader.load(inStream); >+ try { >+ inStream.close(); >+ } catch (IOException e) {} >+ File imageFile = new File("transparentsaved.png"); >+ imageFile.delete(); >+ >+ //WinCE5 does not support ImageLoader save gif/png >+ if (!isPlatformWinCE5){ >+ loader.save(imageFile.getName(), SWT.IMAGE_PNG); >+ assertTrue("transparent png image not saved ", imageFile.exists()); >+ } >+ // j2se and j2me(cdc) can load from a filename but, j2me(cldc) throws an exception > } >- filename = "transparent.png"; >- InputStream inStream = SwtTestCase.class.getResourceAsStream(filename); >- loader.load(inStream); >- try { >- inStream.close(); >- } catch (IOException e) {} >- File imageFile = new File("transparentsaved.png"); >- imageFile.delete(); >- loader.save(imageFile.getName(), SWT.IMAGE_PNG); >- assertTrue("transparent png image not saved ", imageFile.exists()); >- // j2se and j2me(cdc) can load from a filename but, j2me(cldc) throws an exception > } > } >Index: .classpath >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.ercp/org.eclipse.ercp.swt.expanded.tests/.classpath,v >retrieving revision 1.7 >diff -u -r1.7 .classpath >--- .classpath 4 Nov 2005 20:33:42 -0000 1.7 >+++ .classpath 6 Nov 2008 10:04:07 -0000 >@@ -1,12 +1,10 @@ > <?xml version="1.0" encoding="UTF-8"?> > <classpath> > <classpathentry kind="src" path="src"/> >- <classpathentry kind="var" path="JUNIT_HOME/junit.jar"/> >- <classpathentry sourcepath="IVEHOME/lib/charconv-src.zip" kind="var" path="IVEHOME/lib/charconv.zip"/> >- <classpathentry sourcepath="IVEHOME/lib/jclFoundation10/source/source.zip" kind="var" path="IVEHOME/lib/jclFoundation10/classes.zip"/> >- <classpathentry sourcepath="IVEHOME/lib/jclFoundation10/source/locale-src.zip" kind="var" path="IVEHOME/lib/jclFoundation10/locale.zip"/> > <classpathentry kind="src" path="/org.eclipse.ercp.swt.core.tests"/> > <classpathentry kind="src" path="/org.eclipse.ercp.swt.expanded.win"/> > <classpathentry kind="src" path="/org.eclipse.ercp.swt.core.win"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> > <classpathentry kind="output" path="bin"/> > </classpath> >Index: folderOpensaved.gif >=================================================================== >RCS file: folderOpensaved.gif >diff -N folderOpensaved.gif >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ folderOpensaved.gif 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1 @@ >+GIF89a?????????@@?@??@??ÀÀ??????????????ÀÜÀ¦Êð?¨÷??çïï÷ïç÷ÞççïïÆÖÖç?ÎÖÖÎÆÖµÎç½ÎÖÆÆÎÖÖ¥½ÎÆÆÞ½ÆƽÞçÞs¥½Ö½Æ¥µÆÖÎsµ?Æ¥Æï?Îï9µ?¥µ¥½c÷Öç1¥?¥½cïµ{?µ¥?ï½)ÖÖ)ï9???¥µ?ZÞÎÆ)???¥c?)?c{¥Þ¥!µÆ)RÎ?sÎ!Bç1?Z¥R?kÞ1{?ï{!?!½!Æ)¥¥9k?k??Zk{ïc!?!Æ)k??!?Zs{¥??J?1Z?ïR!?Jcs?)1?Bµ{!?1ck{Z?Zs{Îcksc?{{JZk{??{?{{BZks¥k!ÎRs?B????J?{kkJc?kµµZR?JZsckB?µJk{ksJZk??cZJJRk{c!B?!?!?!??c?R{s1?cc?RZcZ9Zc9JRZcc)!?BRZ1?)?ZZ9??cZ)BJZ!??ck)??R{ZRsRR11??{J9?)k9??cZ9BJ99RBkBJ19s99J)Z9?cJBB1)JB!?!?JR19J11R??19B11J)1RBB!??{!k9BZ11B)1J1c)1B119c)BB))B19))19c!!cZ)R11Rs{B1)1!!!9J!,fH?? X?áÀ!&ø B?2TèÀ¢G?<tpñã?"3j\?J?¢|?#I?,Li³¤O?mâü?§P?Qe??N£Jê°ªÕ« ; >Index: targetsaved.gif >=================================================================== >RCS file: targetsaved.gif >diff -N targetsaved.gif >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ targetsaved.gif 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+GIF89a???ÀÀÀÀ?ÀÀÀÀÀÀÜÀ¤È?????????@??@@ðÈ????@??@@??? ¤???????????H?A?*\h???B\HÀÀD?'ØÈñb?Cv|?áÈ?ÄxäF? >+(\±¥? >+Q?Àr&O?]öTùs¡Î?3? >+1é½?QJIuêÆ?+n¬Êuj??Rh?c6ýùqi£>?«Ög?+áÒ,97a]g? ¯]Àr'6??E?J|/ ; >Index: foldersaved.gif >=================================================================== >RCS file: foldersaved.gif >diff -N foldersaved.gif >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ foldersaved.gif 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1 @@ >+GIF89a?????????@@?@??@??ÀÀ??????????????ÀÜÀ¦Êðàà??????????*U??$*$U$????I*IUI?ªIÕI?m*mUm?ªmÕm??*?U??????*?U??ª¶Õ¶??*?U??ªÛÕÛ?*?U???U*UUU?U?U?U?U$U*$UU$U?U?U?U?UIU*IUUIU?UªIUÕIU?UmU*mUUmU?UªmUÕmU?UU*UUU?U?U?U?U¶U*¶UU¶U?Uª¶UÕ¶U?UÛU*ÛUUÛU?UªÛUÕÛU?U?*?U??U?U?U?U?ªU?ªªªÕ??$?$ªU$?$ªª$ªÕ$?$?I?IªUI?IªªIªÕI?I?m?mªUm?mªªmªÕm?m?ª*ªUª?ªªª??ª¶ª*¶ªU¶ª?ªª¶ªÕ¶?¶ªÛª*ÛªUÛª?ªªÛªÕÛ?Ûª?*?U??ªª????*????$?$?$?$?$?$?$?I?I?I?I?I?I?I?m?m?m?m?m?m?m??*?U????????*?U????Õ¶???*?U????ÕÛ??*?U????èèèÑÑѺºº¢¢¢?ttt,_H??X?¡Â >???2$HÑ¡?:Àx?H?If)¢?'[:HY2æÇ?1Ú¤SâN?u²ü¨±¨Æ?(]?©Ç§P?;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 254458
:
117201
| 117202 |
117204
|
118556
|
118557
|
118558
|
118559
|
118560