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 179783 Details for
Bug 317849
A SashForm replacement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to fix failing tests
patch(317849-Tests) (text/plain), 4.07 KB, created by
Eric Moffatt
on 2010-09-28 15:35:35 EDT
(
hide
)
Description:
Patch to fix failing tests
Filename:
MIME Type:
Creator:
Eric Moffatt
Created:
2010-09-28 15:35:35 EDT
Size:
4.07 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.e4.ui.tests >Index: src/org/eclipse/e4/ui/tests/workbench/MPartSashContainerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/MPartSashContainerTest.java,v >retrieving revision 1.5 >diff -u -r1.5 MPartSashContainerTest.java >--- src/org/eclipse/e4/ui/tests/workbench/MPartSashContainerTest.java 4 Jun 2010 20:22:21 -0000 1.5 >+++ src/org/eclipse/e4/ui/tests/workbench/MPartSashContainerTest.java 28 Sep 2010 19:33:56 -0000 >@@ -23,8 +23,6 @@ > import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; > import org.eclipse.e4.ui.model.application.ui.basic.MWindow; > import org.eclipse.e4.ui.model.application.ui.basic.impl.BasicFactoryImpl; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.custom.SashForm; > > public class MPartSashContainerTest extends TestCase { > protected IEclipseContext appContext; >@@ -75,18 +73,5 @@ > > Object widget = partSashContainer.getWidget(); > assertNotNull(widget); >- assertTrue(widget instanceof SashForm); >- >- SashForm sashForm = (SashForm) widget; >- assertEquals(SWT.HORIZONTAL, sashForm.getOrientation()); >- >- partSashContainer.setHorizontal(false); >- assertEquals(SWT.VERTICAL, sashForm.getOrientation()); >- >- partSashContainer.setHorizontal(true); >- assertEquals(SWT.HORIZONTAL, sashForm.getOrientation()); >- >- partSashContainer.setHorizontal(true); >- assertEquals(SWT.HORIZONTAL, sashForm.getOrientation()); > } > } >Index: src/org/eclipse/e4/ui/tests/workbench/MSashTest.java >=================================================================== >RCS file: /cvsroot/eclipse/e4/org.eclipse.e4.ui/tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/MSashTest.java,v >retrieving revision 1.16 >diff -u -r1.16 MSashTest.java >--- src/org/eclipse/e4/ui/tests/workbench/MSashTest.java 4 Jun 2010 20:22:21 -0000 1.16 >+++ src/org/eclipse/e4/ui/tests/workbench/MSashTest.java 28 Sep 2010 19:33:56 -0000 >@@ -23,8 +23,6 @@ > import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; > import org.eclipse.e4.ui.model.application.ui.basic.MWindow; > import org.eclipse.e4.ui.model.application.ui.basic.impl.BasicFactoryImpl; >-import org.eclipse.swt.custom.SashForm; >-import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.swt.widgets.Widget; > >@@ -122,50 +120,6 @@ > assertTrue("Part1 data is not an integer", cdVal1 != -1); > > assertTrue("Values should be equal", cdVal0 == cdVal1); >- >- testWeights(sash, 50, 50); >- } >- >- private void testWeights(MPartSashContainer sf, double w1, double w2) { >- double baseRatio = w1 / w2; >- >- MPart part0 = (MPart) sf.getChildren().get(0); >- MPart part1 = (MPart) sf.getChildren().get(1); >- >- int cdVal0 = -1; >- try { >- cdVal0 = Integer.parseInt(part0.getContainerData()); >- } catch (NumberFormatException e) { >- } >- assertTrue("Part0 data is not an integer", cdVal0 != -1); >- >- int cdVal1 = -1; >- try { >- cdVal1 = Integer.parseInt(part1.getContainerData()); >- } catch (NumberFormatException e) { >- } >- assertTrue("Part1 data is not an integer", cdVal1 != -1); >- >- // test the model >- checkRatio("MSashForm", cdVal0, cdVal1, baseRatio); >- >- // test the SashForm >- SashForm sfw = (SashForm) sf.getWidget(); >- int[] sfwWghts = sfw.getWeights(); >- checkRatio("SWT SashForm", sfwWghts[0], sfwWghts[1], baseRatio); >- >- // Test the controls (assume vertical for now) >- Composite c1 = (Composite) sfw.getChildren()[0]; >- Composite c2 = (Composite) sfw.getChildren()[1]; >- checkRatio("Control Bounds", c1.getSize().y, c2.getSize().y, baseRatio); >- } >- >- private void checkRatio(String label, int num, int div, double baseRatio) { >- double ratio = (double) num / (double) div; >- >- double TOLERANCE = 0.1; >- boolean withinTolerance = Math.abs(ratio - baseRatio) < TOLERANCE; >- assertTrue("Ratio mismatch on" + label + "weights", withinTolerance); > } > > private MWindow createSashWithNViews(int n) {
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 317849
:
172629
|
176553
|
179782
|
179783
|
179786
|
179870