blob: f7a8aeb2d2a33e3c5bebcc700c7180e2b52f4b5d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 2012 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.ui.tests.performance.views;
import junit.framework.Test;
import org.eclipse.test.OrderedTestSuite;
import org.eclipse.test.performance.Dimension;
import org.eclipse.test.performance.Performance;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.ui.tests.performance.JdtPerformanceTestCase;
public class PackageExplorerColdPerfTest extends JdtPerformanceTestCase {
public static Test suite() {
return new OrderedTestSuite(PackageExplorerColdPerfTest.class, new String[] {
"testOpen"
});
}
public PackageExplorerColdPerfTest(String name) {
super(name);
}
@Override
public final void finishMeasurements() {
stopMeasuring();
commitMeasurements();
Performance.getDefault().assertPerformanceInAbsoluteBand(fPerformanceMeter, Dimension.ELAPSED_PROCESS, 0, 80);
}
@Override
public final void startMeasuring() {
super.startMeasuring();
}
public void testOpen() throws Exception {
IWorkbenchWindow activeWorkbenchWindow= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page= activeWorkbenchWindow.getActivePage();
page.close();
page= activeWorkbenchWindow.openPage("org.eclipse.ui.resourcePerspective", ResourcesPlugin.getWorkspace().getRoot());
joinBackgroudActivities();
MockupPackageExplorerPart.fgTest= this;
page.showView("org.eclipse.jdt.ui.tests.MockPackageExplorer");
}
}