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 59211 Details for
Bug 165935
Some AGR test suites need to be refactored
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.
Launch Part 2 Verification Hook Class
PlatformUIProfilingPerspectiveLaunchPart2.java (text/plain), 8.40 KB, created by
Liz Dancy
on 2007-02-16 18:21:10 EST
(
hide
)
Description:
Launch Part 2 Verification Hook Class
Filename:
MIME Type:
Creator:
Liz Dancy
Created:
2007-02-16 18:21:10 EST
Size:
8.40 KB
patch
obsolete
>package org.eclipse.hyades.use.cases.auto.profiling.logging; > >import org.eclipse.hyades.use.cases.auto.common.Logger; >import org.eclipse.hyades.use.cases.auto.common.VerifyHookUtil; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Control; >import org.eclipse.swt.widgets.Tree; >import org.eclipse.swt.widgets.TreeItem; >import org.eclipse.tptp.test.auto.gui.internal.runner.AutoGUIVerificationHook; > >/** > * Generated code for the test suite <b>Platform.UI.ProfilingPerspective.Launch.Part3</b> located at > * <i>/org.eclipse.hyades.use.cases/Gui/Profiling_and_Logging/Platform.UI.ProfilingPerspective.Launch.Part3.testsuite</i>. > */ >/* > * @author Mike Hao > */ >public class PlatformUIProfilingPerspectiveLaunchPart2 extends > AutoGUIVerificationHook { > > /** > * Constructor for PlatformUIProfilingPerspectiveLaunchPart3. An instance of this class is created to > * test a test method. > * > * @param testMethodName The test method to be tested. > * @param paramTypes The parameter types of the test method > * @param args The arguments of the test method > */ > public PlatformUIProfilingPerspectiveLaunchPart2(String testMethodName, > Class[] paramTypes, Object[] args) { > super(testMethodName, paramTypes, args); > } > > /** > * @see junit.framework.TestCase#setUp() > */ > protected void setUp() throws Exception { > } > > /** > * @see junit.framework.TestCase#tearDown() > */ > protected void tearDown() throws Exception { > Logger.getInstance().close(); > } > > > /** > * ChangeTimeAnalysisTypeOpt > * 1. Open the profile launch configuratin and create a launch configuration of type "Java Application". > * 2. Open the configuration of Execution Time analysis > * 3.Check the two options at the top, collect graphical details, and collect instance level informaiton. > * 4. Apply the changes and close the launch configuration > * 5. Re-open the launch configuration and verify that the options set were persisted. > * @throws Exception > */ > public void verifyAnalysisTypeOptions(org.eclipse.swt.widgets.Shell arg0) > throws Exception > { > Logger.getInstance().logMessage(Logger.INFO, "Entering verifyAnalysisTypeOptions"); > > /* CPU and boundary class option */ > verifyOptionState(arg0, ".*Collect method.*CPU time.*", true); > verifyOptionState(arg0,".*Collect boundar.*classes excluded.*", true); > assertNotNull(VerifyHookUtil.findControl(arg0, VerifyHookUtil.TEXT_CONTROL_TYPE, "300")); > /* Execution flow graphical and instance level option */ > verifyOptionState(arg0, ".*Show.*flow graphical.*", true); > > verifyOptionState(arg0, ".*Collect.*instance level information.*", true); > > Logger.getInstance().logMessage(Logger.INFO, "Exiting verifyAnalysisTypeOptions"); > } > > private void verifyOptionState (org.eclipse.swt.widgets.Shell wizard, String optionName, boolean state) > { > Control option = VerifyHookUtil.findControl(wizard, VerifyHookUtil.BUTTON_CONTROL_TYPE, optionName); > assertNotNull(option); > assertTrue(((Button)option).getSelection() == state); > } > > /** > * LocalAnalysisTypeChange > * 1. Open the profile launch configuration > * 2. Create two launch configurations of type "Java Application" > * 3. Select the first launch configuration and go to the configuration of its "Basic memory analysis" type. > * 4. Check the option: "Collect instance level information" > * 5. Select the second launch configuraiton and go to the configuration of its "Basic memory analysis" type. > * 6. Make sure that the option, "Collect instance level information", is not set. > * @throws Exception > */ > public void verifyInstanceLevelOptIsFalse(org.eclipse.swt.widgets.Shell arg0) > throws Exception > { > Logger.getInstance().logMessage(Logger.INFO, "Entering verifyInstanceLevelOptIsFalse"); > verifyOptionState(arg0, ".*Collect.*instance level information.*", false); > Logger.getInstance().logMessage(Logger.INFO, "Exiting verifyInstanceLevelOptIsFalse"); > } > > > /** > * Verify the classpath parsing functionality. > * <p> > * <b>Testing Steps:</b> > * <ol> > * <li>Import a java application in your workspace with a classpath that spans multiple projects and includes classes/jars that are outside the workspace. Make sure your application uses these classes.</li> > * <li>Profile this application, and ensure that it runs correctly with no classpath errors.</li> > * </ol> > * <p> > * <b>Purpose:</b> Perform the verification in step #2 > * @throws Exception > */ > public void verifyClasspath(org.eclipse.ui.IViewPart arg0) > throws Exception > { > Logger.getInstance().logMessage(Logger.INFO, "Entering verifyClasspath"); > verifyConsoleMessage(arg0, new String[] {"From ForClasspath methodA."}); > Logger.getInstance().logMessage(Logger.INFO, "Exiting verifyClasspath"); > } > > private void verifyConsoleMessage(org.eclipse.ui.IViewPart arg0, String[] keywords) > throws Exception > { > Composite consoleComposite = VerifyHookUtil.getWorkbenchPartControl(arg0); > assertNotNull (consoleComposite); > assertTrue (VerifyHookUtil.verifyControlValue(consoleComposite, VerifyHookUtil.STYLED_TEXT_CONTROL_TYPE, keywords)); > } > > /** > * Verify the <b>Run</b>-><b>Profile...</b>. > * <p> > * <b>Testing Steps:</b> > * <ol> > * <li>Select Profile from the menu: Run->Profile...</li> > * <li>Double click on Java Application.</li> > * <li>Choose a package that has been imported or created previously in Java Perspective, i.e. HelloWorld</li> > * <li>Click <b>Run</b></li> > * <li>Verify profile is run</li> > * </ol> > * <p> > * <b>Purpose:</b> Perform the verification in step #5 > * @throws Exception > */ > public void verifyProfileConsoleMsg(org.eclipse.ui.IViewPart arg0) > throws Exception > { > Logger.getInstance().logMessage(Logger.INFO, "Entering verifyRunProfile1"); > verifyConsoleMessage(arg0, new String[] {"rootMethod1 called", "childMethod1 called", "rootMethod2 called"}); > Logger.getInstance().logMessage(Logger.INFO, "Exiting verifyRunProfile1"); > } > > /** > * Verify the <b>Run</b>-><b>Profile...</b>. > * <p> > * <b>Testing Steps:</b> > * <ol> > * <li>Select Profile from the menu: Run->Profile...</li> > * <li>Double click on Java Application.</li> > * <li>Choose a package that has been imported or created previously in Java Perspective, i.e. HelloWorld</li> > * <li>Click <b>Run</b></li> > * <li>Verify profile is run</li> > * </ol> > * <p> > * <b>Purpose:</b> Perform the verification in step #5 > * @throws Exception > */ > public void verifyProfileDetails(org.eclipse.ui.IViewPart arg0) > throws Exception > { > Logger.getInstance().logMessage(Logger.INFO, "Entering verifyRunProfile2"); > > verifyViewPartTreeItem(arg0, "childMethod1() void"); > verifyViewPartTreeItem(arg0, "HelloWorld()"); > verifyViewPartTreeItem(arg0, "main(java.lang.String[]) void"); > verifyViewPartTreeItem(arg0, "rootMethod1() void"); > verifyViewPartTreeItem(arg0, "rootMethod2() void"); > > Logger.getInstance().logMessage(Logger.INFO, "Exiting verifyRunProfile2"); > } > > private void verifyViewPartTreeItem(org.eclipse.ui.IViewPart arg0, String method) > throws Exception > { > boolean found = false; > Composite executionStatisticsView = VerifyHookUtil.getWorkbenchPartControl(arg0); > assertNotNull (executionStatisticsView); > > Control[] trees = VerifyHookUtil.findAllControl(executionStatisticsView, VerifyHookUtil.TREE_CONTROL_TYPE, null); > TreeItem item = null; > > for (int i = 0; i < trees.length; i++){ > item = VerifyHookUtil.findChild((Tree)trees[i], method, true); > if(item != null){ > found = true; > break; > } > } > assertTrue(found); > } > > /** > * Verify no class found error.. > * <p> > * <b>Testing Steps:</b> > * <ol> > * <li>Click on Profile button from the tool bar.</li> > * <li>Create a new External Java Application launch configuration.</li> > * <li>Enter a non-existent class in the class name field.</li> > * <li>Click <b>Profile</b></li> > * <li>Verify that an error message is printed to the console specifying that the class could not be found, or does not exist.</li> > * </ol> > * <p> > * <b>Purpose:</b> Perform the verification in step #5 > * @throws Exception > */ > public void verifyNoClassError(org.eclipse.ui.IViewPart arg0) > throws Exception > { > Logger.getInstance().logMessage(Logger.INFO, "Entering verifyNoClassError"); > verifyConsoleMessage(arg0, new String[] {"The java class is not found"}); > Logger.getInstance().logMessage(Logger.INFO, "Exiting verifyNoClassError"); > } > > >}
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 165935
:
59208
|
59209
|
59210
| 59211 |
59268
|
59269
|
59280
|
59283