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 16040 Details for
Bug 79182
NPE while invoking code assist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
CU in which the NPE occured
JavaMoveLineTest.java (text/plain), 3.33 KB, created by
Christof Marti
on 2004-11-22 09:08:33 EST
(
hide
)
Description:
CU in which the NPE occured
Filename:
MIME Type:
Creator:
Christof Marti
Created:
2004-11-22 09:08:33 EST
Size:
3.33 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2000, 2004 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Common Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/cpl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ > >package org.eclipse.jdt.text.tests.performance; > >import junit.framework.Test; >import junit.framework.TestSuite; > >import org.eclipse.swt.widgets.Event; > >import org.eclipse.test.performance.PerformanceMeter; > >import org.eclipse.jface.action.IAction; > >import org.eclipse.ui.texteditor.AbstractTextEditor; >import org.eclipse.ui.texteditor.ITextEditorActionConstants; > >/** > * Measures the time to move a line within a large file in the Java editor. > * > * @since 3.1 > */ >public class JavaMoveLineTest extends TextPerformanceTestCase { > > private static final Class THIS= JavaMoveLineTest.class; > > private static final String FILE= PerformanceTestSetup.STYLED_TEXT; > > private static final int WARM_UP_RUNS= 3; > > private static final int MEASURED_RUNS= 3; > > private static final int LINE= 10; > > private static final int DISTANCE= 400; > > private AbstractTextEditor fEditor; > > public static Test suite() { > return new PerformanceTestSetup(new TestSuite(THIS)); > } > > protected void setUp() throws Exception { > super.setUp(); > fEditor= (AbstractTextEditor) EditorTestHelper.openInEditor(ResourceTestHelper.findFile(FILE), true); > EditorTestHelper.joinBackgroundActivities(fEditor); > setWarmUpRuns(WARM_UP_RUNS); > setMeasuredRuns(MEASURED_RUNS); > } > > protected void tearDown() throws Exception { > super.tearDown(); > EditorTestHelper.closeAllEditors(); > } > > /** > * Measures the time to move a line within a large file. > * > * @throws Exception > */ > public void test() throws Exception { > measureMoveLine(getNullPerformanceMeter(), getWarmUpRuns()); > measureMoveLine(createPerformanceMeter(), getMeasuredRuns()); > commitAllMeasurements(); > assertAllPerformance(); > } > > private void measureMoveLine(PerformanceMeter performanceMeter, int runs) throws Exception { > IAction moveLineDown= fEditor.getAction(ITextEditorActionConstants.MOVE_LINE_DOWN); > IAction expandAll= fEditor.getAction("FoldingExpandAll"); > int offset= EditorTestHelper.getDocument(fEditor).getLineOffset(LINE); > Event event= new Event( > for (int i= 0; i < runs; i++) { > /* > * Avoid bug 68697: [projection] folding + move lines down/up can corrupt source > * see https://bugs.eclipse.org/bugs/show_bug.cgi?id=68697 > */ > runAction(expandAll); > > fEditor.selectAndReveal(offset, 0); > performanceMeter.start(); > for (int j= 0; j < DISTANCE; j++) > runActionWithEvent(moveLineDown, event); > performanceMeter.stop(); > EditorTestHelper.revertEditor(fEditor, true); > EditorTestHelper.joinBackgroundActivities(fEditor); > } > } > > private void runAction(IAction action) { > action.run(); > EditorTestHelper.runEventQueue(); > } > > private void runActionWithEvent(IAction action, Event event) { > action.runWithEvent(event); > EditorTestHelper.runEventQueue(); > } >}
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 Raw
Actions:
View
Attachments on
bug 79182
: 16040