Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 186148 - [Usability] Test Log view does not open after a test execution has completed.
Summary: [Usability] Test Log view does not open after a test execution has completed.
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact:
URL:
Whiteboard: housecleaned460
Keywords:
Depends on: 230426
Blocks: 206355 231376
  Show dependency tree
 
Reported: 2007-05-09 09:28 EDT by Paul Slauenwhite CLA
Modified: 2016-05-05 11:00 EDT (History)
4 users (show)

See Also:


Attachments
org.eclipse.hyades.test.ui_defect_186148_patch.txt (7.21 KB, patch)
2007-08-20 16:13 EDT, Paul Slauenwhite CLA
no flags Details | Diff
org.eclipse.hyades.test.ui_defect_186148_patch_Part_2 (16.53 KB, patch)
2008-05-06 12:19 EDT, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2007-05-09 09:28:55 EDT
Test Log view does not open after a test execution has completed.

When the user configures a test launch configuration to create a test log (*.execution), the Test Log view should be opened on that test log after the test execution has completed.

Code snippet:

PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
				
				public void run(){
				
					//Open the Test perspective:
					try {											
						PlatformUI.getWorkbench().showPerspective("org.eclipse.hyades.ui.perspective.TestPerspective",PlatformUI.getWorkbench().getActiveWorkbenchWindow());
					} 
					catch (Exception e) {
						//Ignore since Test perspective could not be opened.
					}											

					//Open the test log view:
					try {

						IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(<test log location>));									
						IEditorDescriptor editorDescriptor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getName());
						PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(new FileEditorInput(file),editorDescriptor.getId());
					} 
					catch (Exception e) {
						//Ignore since the test log view could not be opened.
					}											
				}
			});
Comment 1 Joe Toomey CLA 2007-05-09 10:01:54 EDT
This should not be done the in execution harness, since we may not be running in the workbench at all.  This should be done by the test launch UI (and should still be surrounded by a PlatformUI.isWorkbenchRunning() call, since ASF uses launch configurations to run headless.)
Comment 2 Joe Toomey CLA 2007-05-09 10:02:39 EDT
Reassigning to Jerome.
Comment 3 Paul Slauenwhite CLA 2007-05-09 10:46:08 EDT
(In reply to comment #1)

Thanks Joe.  I intended on selecting the execution harness component:)
Comment 4 Paul Slauenwhite CLA 2007-05-10 10:12:21 EDT
Jerome, please provide a sizing.
Comment 5 Paul Slauenwhite CLA 2007-08-20 16:13:10 EDT
Also requires a preference for this similar to the 'open editor after creation' preference (see attached patch).
Comment 6 Paul Slauenwhite CLA 2007-08-20 16:13:40 EDT
Created attachment 76488 [details]
org.eclipse.hyades.test.ui_defect_186148_patch.txt

Partial patch (preference page).
Comment 7 Paul Slauenwhite CLA 2007-12-10 10:19:56 EST
Deferring to I5.
Comment 8 Paul Slauenwhite CLA 2008-01-07 11:53:16 EST
Deferring to I6.
Comment 9 Tony Wang CLA 2008-03-06 12:15:11 EST
Hi,Paul, since there is no connection for test.ui to retrieve all infomation
from test.core after test execution, so the method to open log viewer
won't work in test.core project. could you please add an extention point for
this defect? Thanks!
Comment 10 Joe Toomey CLA 2008-03-07 09:20:58 EST
I'm not positive, but I believe you can detect the completion of test log model loading (after test execution completes) by listening to the ExecutionComponent state change for the executor (which you already have a handle to.)  When the executor transitions to the IExecutionComponent.DEAD state, the model should be populated, saved & closed.

Comment 11 Paul Slauenwhite CLA 2008-03-31 12:14:09 EDT
Deferring to I7 as discussed by PMC/AG (http://wiki.eclipse.org/TPTP-AG-20080331#Test_Project).
Comment 12 Paul Slauenwhite CLA 2008-05-01 15:42:24 EDT
(In reply to comment #10)
> I'm not positive, but I believe you can detect the completion of test log model
> loading (after test execution completes) by listening to the ExecutionComponent
> state change for the executor (which you already have a handle to.)  When the
> executor transitions to the IExecutionComponent.DEAD state, the model should be
> populated, saved & closed.
> 

I'll do you one better, the org.eclipse.hyades.test.core.executionHarnessListener extension point (org.eclipse.hyades.execution.harness.provisional.ITestExecutionHarnessListener.testCompleted()) that you wrote:)
Comment 13 Paul Slauenwhite CLA 2008-05-01 21:21:11 EDT
(In reply to comment #12)

> I'll do you one better, the
> org.eclipse.hyades.test.core.executionHarnessListener extension point
> (org.eclipse.hyades.execution.harness.provisional.ITestExecutionHarnessListener.testCompleted())
> that you wrote:)
> 

Actually, since only org.eclipse.hyades.execution.harness.provisional.TestExecutionHarnessListenerNotifier.notifyLaunchCompleted(IExecutionHarnessDataProcessor, List) is called by org.eclipse.hyades.execution.harness.TestExecutionHarness.java, we will use org.eclipse.hyades.execution.harness.provisional.ITestExecutionHarnessListener.launchCompleted().
Comment 14 Joe Toomey CLA 2008-05-01 22:24:39 EDT
If I recall correctly, testComplete() is never called by the execution harness because the execution harness is done long before the test is complete.  The scope of the execution harness ends when the launch sequence is complete (i.e. the test has begun).

I'm afraid launchCompleted() is not the state you really want, either, since the launch is always complete before the test itself is complete.  The launchTest methods returns an Executor, and you can detect the test finishing by monitoring the state of the executor.
Comment 15 Paul Slauenwhite CLA 2008-05-02 00:16:12 EDT
(In reply to comment #14)
> If I recall correctly, testComplete() is never called by the execution harness
> because the execution harness is done long before the test is complete.  The
> scope of the execution harness ends when the launch sequence is complete (i.e.
> the test has begun).
> 
> I'm afraid launchCompleted() is not the state you really want, either, since
> the launch is always complete before the test itself is complete.  The
> launchTest methods returns an Executor, and you can detect the test finishing
> by monitoring the state of the executor.
> 

You are correct.  I was able to get the executor from the launch and monitor the the ExecutionComponentStateChangeEvent for the IExecutionComponent.DEAD state.  Thanks for the help.
Comment 16 Paul Slauenwhite CLA 2008-05-06 12:19:58 EDT
Created attachment 98884 [details]
org.eclipse.hyades.test.ui_defect_186148_patch_Part_2

Partial patch (launch termination hook).
Comment 17 Paul Slauenwhite CLA 2008-05-06 12:27:12 EDT
(In reply to comment #16)
> Created an attachment (id=98884) [details]
> org.eclipse.hyades.test.ui_defect_186148_patch_Part_2
> 
> Partial patch (launch termination hook).
> 

Requires defect #230426.
Comment 18 Paul Slauenwhite CLA 2008-05-21 14:23:08 EDT
Deferring to future as approved by the TPTP PMC (http://dev.eclipse.org/mhonarc/lists/tptp-pmc/msg04926.html).
Comment 19 Paul Slauenwhite CLA 2009-06-30 07:00:38 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. Since this defect is more than 2 years old, it may be no longer relevant. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this defect is resolved as WONTFIX. If this defect is still relevant and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.
Comment 20 Paul Slauenwhite CLA 2009-07-03 06:53:10 EDT
Closing.
Comment 21 Paul Slauenwhite CLA 2009-11-23 10:38:21 EST
Correcting component.