blob: 71a73ad7f7a6daa67086f84aa92e2eb484caceb9 [file] [log] [blame]
/*******************************************************************************
* 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
* http://www.eclipse.org/legal/epl-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.jdt.core.IJavaElement;
import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.ui.texteditor.AbstractTextEditor;
/**
* @since 3.1
*/
public class ActivateJavaEditorTest extends ActivateEditorTest {
private static final Class THIS= ActivateJavaEditorTest.class;
private static final String SHORT_NAME= "Activate " + ActivateEditorTest.getNumberOfEditors() + " Java editors";
public static Test suite() {
return new PerformanceTestSetup(new TestSuite(THIS));
}
protected String getEditorId() {
return EditorTestHelper.COMPILATION_UNIT_EDITOR_ID;
}
public void testActivateEditor() {
setShortName(SHORT_NAME);
super.testActivateEditor();
}
/*
* @see org.eclipse.jdt.text.tests.performance.ActivateEditorTest#waitUntilReady()
* @since 3.4
*/
protected void waitUntilReady(AbstractTextEditor editor) {
IJavaElement cu= EditorUtility.getEditorInputJavaElement(editor, false);
ASTProvider.getASTProvider().getAST(cu, ASTProvider.WAIT_ACTIVE_ONLY, null);
}
}