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 99987 Details for
Bug 231863
ScrollVerticalRuler5000Test should be dark green
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
let test fail if not enough annotations in editor
fix_scroll_assert.txt (text/plain), 3.99 KB, created by
Benno Baumgartner
on 2008-05-13 13:01:39 EDT
(
hide
)
Description:
let test fail if not enough annotations in editor
Filename:
MIME Type:
Creator:
Benno Baumgartner
Created:
2008-05-13 13:01:39 EDT
Size:
3.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.text.tests >Index: src/org/eclipse/jdt/text/tests/performance/ScrollVerticalRulerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/ScrollVerticalRulerTest.java,v >retrieving revision 1.1 >diff -u -r1.1 ScrollVerticalRulerTest.java >--- src/org/eclipse/jdt/text/tests/performance/ScrollVerticalRulerTest.java 27 Nov 2007 09:52:50 -0000 1.1 >+++ src/org/eclipse/jdt/text/tests/performance/ScrollVerticalRulerTest.java 13 May 2008 16:51:18 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007 IBM Corporation and others. >+ * Copyright (c) 2007, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -24,6 +24,7 @@ > import org.eclipse.jdt.ui.PreferenceConstants; > import org.eclipse.jface.text.Document; > import org.eclipse.jface.text.IDocument; >+import org.eclipse.jface.text.source.IAnnotationModel; > import org.eclipse.ui.editors.text.EditorsUI; > import org.eclipse.ui.internal.editors.text.EditorsPlugin; > import org.eclipse.ui.texteditor.AbstractTextEditor; >@@ -132,6 +133,29 @@ > return AbstractDocumentPerformanceTest.class.getResourceAsStream("faust1.txt"); > } > >+ /* >+ * @see org.eclipse.jdt.text.tests.performance.ScrollEditorTest#assertEditor(org.eclipse.ui.texteditor.AbstractTextEditor) >+ */ >+ protected void assertEditor(AbstractTextEditor editor) throws Exception { >+ super.assertEditor(editor); >+ >+ IAnnotationModel model= editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput()); >+ int annotationCount= getAnnotationCount(model); >+ assertTrue("Expected annotation count is: " + getNumberOfAnnotations() + " but was: " + annotationCount, annotationCount >= getNumberOfAnnotations()); >+ } >+ >+ private int getAnnotationCount(IAnnotationModel model) { >+ int result= 0; >+ >+ Iterator iterator= model.getAnnotationIterator(); >+ while (iterator.hasNext()) { >+ iterator.next(); >+ result++; >+ } >+ >+ return result; >+ } >+ > /** > * @return the number of annotations to show in the vertical ruler > */ >Index: src/org/eclipse/jdt/text/tests/performance/ScrollEditorTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/performance/ScrollEditorTest.java,v >retrieving revision 1.37 >diff -u -r1.37 ScrollEditorTest.java >--- src/org/eclipse/jdt/text/tests/performance/ScrollEditorTest.java 27 Nov 2007 09:52:50 -0000 1.37 >+++ src/org/eclipse/jdt/text/tests/performance/ScrollEditorTest.java 13 May 2008 16:51:18 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -131,6 +131,8 @@ > } > > protected void setUp(AbstractTextEditor editor) throws Exception { } >+ >+ protected void assertEditor(AbstractTextEditor editor) throws Exception { } > > protected void measure(ScrollingMode mode) throws Exception { > measure(mode, createPerformanceMeter(), getWarmUpRuns(), getMeasuredRuns()); >@@ -143,6 +145,7 @@ > setUp(editor); > StyledText text= (StyledText) editor.getAdapter(Control.class); > EditorTestHelper.joinBackgroundActivities(editor); >+ assertEditor(editor); > if (mode.isPressAndHoldCombo()) { > measureHolding(text, mode, getNullPerformanceMeter(), warmUpRuns); > measureHolding(text, mode, performanceMeter, measuredRuns);
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 231863
: 99987 |
100377
|
100378