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 98849 Details for
Bug 228747
Regression, URL Test Does Not Get Generated
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.
[patch]
Patch.
Defect_228747_patch.txt (text/plain), 15.10 KB, created by
Paul Slauenwhite
on 2008-05-06 10:54:30 EDT
(
hide
)
Description:
Patch.
Filename:
MIME Type:
Creator:
Paul Slauenwhite
Created:
2008-05-06 10:54:30 EDT
Size:
15.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.test.core >Index: src/org/eclipse/hyades/internal/execution/recorder/local/RecorderClient.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.core/src/org/eclipse/hyades/internal/execution/recorder/local/RecorderClient.java,v >retrieving revision 1.35 >diff -u -r1.35 RecorderClient.java >--- src/org/eclipse/hyades/internal/execution/recorder/local/RecorderClient.java 18 Apr 2008 20:14:12 -0000 1.35 >+++ src/org/eclipse/hyades/internal/execution/recorder/local/RecorderClient.java 6 May 2008 14:54:04 -0000 >@@ -66,7 +66,13 @@ > * This object is responsible for initiating the recorder session. It constructs > * all necessary object, create a Agent Controller Session, and initiates. It also stay in scope > * with sub-classes to shut down all machinery after the recording is complete. >- * @author Ernest Jessee >+ * <p/> >+ * >+ * >+ * @author Ernest Jessee >+ * @author Paul E. Slauenwhite >+ * @version May 6, 2008 >+ * @since April 22, 2005 > */ > public class RecorderClient > { >@@ -144,19 +150,25 @@ > * Recorder deployment directory > */ > public final String RECORDER_DESTINATION_PATH="Recorder_Deploy"; >- /** >- * This thread object is started by the RecorderClient and waits for a complete message to come from the Agent Controller >- * upon receiving this message, the scripts are generated if a script generator was specified. >- * @author Ernest Jessee >- */ > > /** > * JAR containing the recorder framework > */ > private final String RECORDER_JAR_NAME = "hexrecr.jar"; > >- private class FinishCleanupAndGenTestThread extends Thread >- { >+ /** >+ * This thread object is started by the RecorderClient and waits for a complete >+ * message to come from the Agent Controller upon receiving this message, the >+ * scripts are generated if a script generator was specified. >+ * <p/> >+ * >+ * >+ * @author Ernest Jessee >+ * @author Paul E. Slauenwhite >+ * @version May 6, 2008 >+ * @since April 22, 2005 >+ */ >+ private class FinishCleanupAndGenTestThread extends Thread { > > /** > * the constructor >@@ -172,58 +184,64 @@ > public void run() > { > >- //wait for the dataProcessor to get a complete call >- while(!dataProcessorHelper.isRecordingComplete()) >- { >- delay(200); >- } >- if (helper != null) >- helper.preStopRecording(); >- try { >- stopApplication(); >- } catch (Exception e) {} >- if (helper != null) >- helper.postStopRecording(); >- //since we have the completion notification, we'll de-activate this recorder >- theRecorder.setActive(false); >- >- //and tell the user that the recorder is done. >- RecorderFactory.getInstance().controlMessage(theRecorder, IRecorderListenerFullFeedback.VIEW_MESSAGE, >- TestCorePluginResourceBundle.RecorderClient_RECORDING_COMPLETE_MESSAGE); >- >- //now we need tdo seeif the user wants to generate the suite. If he does, there will be a scriptgenID in the recorder object. >- //if he does not, the scriptgenid wil be -1. >- >- >- // First, write all Unwritten "CLOSE" mdd >- >- //if we don't have a -1, then we'll kick off scriptgen >- if(!theRecorder.getScriptgenID().equalsIgnoreCase("-1")) //$NON-NLS-1$ >- { >- //Testgen will cause TestHttp to be initialized. >- //if we testgen in a worker thread, when TestHttp is initialized, it will have no >- //concept of the current display (which it needs to load images) >- //Thus, we'll run this asynchronously in the UI thread >- } >- updateViewStatus(TestCorePluginResourceBundle.RecorderClient_STATUS_STOPPED); >- // bugzilla 139992 . check state of session before releasing it. >- // bugzilla 144444. Put session.release() back in mdd 06/01/2006 >- session.release(); >- >- //notify appropriate listeners to start test gen. >+ try { >+ >+ //wait for the dataProcessor to get a complete call >+ while(!dataProcessorHelper.isRecordingComplete()) >+ { >+ delay(200); >+ } >+ if (helper != null) >+ helper.preStopRecording(); >+ try { >+ stopApplication(); >+ } catch (Exception e) {} >+ if (helper != null) >+ helper.postStopRecording(); >+ //since we have the completion notification, we'll de-activate this recorder >+ theRecorder.setActive(false); >+ >+ //and tell the user that the recorder is done. >+ RecorderFactory.getInstance().controlMessage(theRecorder, IRecorderListenerFullFeedback.VIEW_MESSAGE, >+ TestCorePluginResourceBundle.RecorderClient_RECORDING_COMPLETE_MESSAGE); >+ >+ //now we need tdo seeif the user wants to generate the suite. If he does, there will be a scriptgenID in the recorder object. >+ //if he does not, the scriptgenid wil be -1. > >- Object[] objs = RecorderFactory.getInstance().getListenersForRecorder(theRecorder); >- for (int i = 0; i < objs.length; i++) >- { >- if (objs[i] instanceof MasterRecorderListener) >- { >- ((MasterRecorderListener)objs[i]).startTestGen(); >- break; //only start test gen once. >- } >+ >+ // First, write all Unwritten "CLOSE" mdd >+ >+ //if we don't have a -1, then we'll kick off scriptgen >+ if(!theRecorder.getScriptgenID().equalsIgnoreCase("-1")) //$NON-NLS-1$ >+ { >+ //Testgen will cause TestHttp to be initialized. >+ //if we testgen in a worker thread, when TestHttp is initialized, it will have no >+ //concept of the current display (which it needs to load images) >+ //Thus, we'll run this asynchronously in the UI thread >+ } >+ updateViewStatus(TestCorePluginResourceBundle.RecorderClient_STATUS_STOPPED); >+ // bugzilla 139992 . check state of session before releasing it. >+ // bugzilla 144444. Put session.release() back in mdd 06/01/2006 >+ session.release(); >+ >+ //notify appropriate listeners to start test gen. >+ >+ Object[] objs = RecorderFactory.getInstance().getListenersForRecorder(theRecorder); >+ for (int i = 0; i < objs.length; i++) >+ { >+ if (objs[i] instanceof MasterRecorderListener) >+ { >+ ((MasterRecorderListener)objs[i]).startTestGen(); >+ break; //only start test gen once. >+ } >+ } >+ >+ if (helper != null) >+ helper.cleanup(); >+ } >+ catch (Exception e) { >+ TestCorePlugin.getDefault().logError(e); > } >- >- if (helper != null) >- helper.cleanup(); > } > > private void delay(int miliseconds) >#P org.eclipse.hyades.test.ui >Index: src-recorder/org/eclipse/hyades/internal/execution/recorder/ui/views/RecorderControlView.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src-recorder/org/eclipse/hyades/internal/execution/recorder/ui/views/RecorderControlView.java,v >retrieving revision 1.16 >diff -u -r1.16 RecorderControlView.java >--- src-recorder/org/eclipse/hyades/internal/execution/recorder/ui/views/RecorderControlView.java 10 Apr 2008 01:49:43 -0000 1.16 >+++ src-recorder/org/eclipse/hyades/internal/execution/recorder/ui/views/RecorderControlView.java 6 May 2008 14:54:05 -0000 >@@ -12,7 +12,6 @@ > package org.eclipse.hyades.internal.execution.recorder.ui.views; > > import org.eclipse.core.resources.IResourceStatus; >-import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.Status; > import org.eclipse.hyades.execution.recorder.IRecorderListenerFullFeedback; > import org.eclipse.hyades.internal.execution.recorder.ui.CopyAction; >@@ -22,7 +21,6 @@ > import org.eclipse.hyades.test.core.testgen.ITestgenListener; > import org.eclipse.hyades.test.ui.UiPlugin; > import org.eclipse.hyades.test.ui.internal.resources.UiPluginResourceBundle; >-import org.eclipse.hyades.test.ui.internal.util.TestUIUtilities; > import org.eclipse.jface.action.GroupMarker; > import org.eclipse.jface.action.ToolBarManager; > import org.eclipse.jface.dialogs.ErrorDialog; >@@ -46,20 +44,20 @@ > import org.eclipse.swt.widgets.Menu; > import org.eclipse.swt.widgets.MenuItem; > import org.eclipse.swt.widgets.Text; >-import org.eclipse.ui.IWorkbenchPage; >-import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.IWorkbenchPartSite; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.actions.ActionFactory; > import org.eclipse.ui.part.ViewPart; > > /** > * Recorder Control View for receiving feedback and controlling recorders during recording. >+ * <p/> > * > * > * @author Ernest Jessee > * @author Paul E. Slauenwhite > * @author Paul Klicnik >- * @version April 9, 2008 >+ * @version May 6, 2008 > * @since February 1, 2005 > */ > public class RecorderControlView extends ViewPart implements ITestgenListener, IRecorderListenerFullFeedback >@@ -80,9 +78,9 @@ > private List statusList; > > /** >- * the default instance >+ * Singleton instance of the Recorder Control View. > */ >- public static RecorderControlView instance=null; >+ public static RecorderControlView instance = null; > > /** > * Setup the clipboard >@@ -94,7 +92,6 @@ > */ > private CopyAction copyAction = null; > >- > /** > * the view's ID > */ >@@ -207,15 +204,6 @@ > copyAction.setEnabled( statusLines.length == 0 ? false : true ); > } > } >- >- /** >- * method for acquiring the active IWorkbenchWindow >- * @return IWorkbenchWindow >- */ >- public static IWorkbenchWindow getActiveWorkbenchWindow() >- { >- return PlatformUI.getWorkbench().getActiveWorkbenchWindow(); >- } > > /** > * method which resets the contents of the Recorder Control View >@@ -227,47 +215,44 @@ > } > > /** >- * returns the default instance of the recorder Control View. Also changes the current perspective to the Test Perspective and creates >- * the recorder control view if it has not previously been created. >- * @return RecorderControlView >- */ >- public static RecorderControlView getInstance() >- { >- >- //Attempt to open the Test Perspective: >- TestUIUtilities.openTestPerspective(); >- >- IWorkbenchWindow window = getActiveWorkbenchWindow(); >+ * Resolves the singleton instance of the Recorder Control View. >+ * <p/> >+ * When the singleton instance is instantiated, the Recorder Control View >+ * is opened (if closed) and given focus in the active page of the active >+ * workbench window. >+ * <p/> >+ * The Recorder Control View is given focus on subsequent calls after the >+ * singleton instance has been instantiated. >+ * <p/> >+ * >+ * @return The singleton instance of the Recorder Control View. >+ */ >+ public static RecorderControlView getInstance(){ >+ >+ if(instance == null){ >+ >+ Display.getDefault().syncExec(new Runnable() { >+ >+ public void run() { >+ >+ try{ >+ instance = ((RecorderControlView)(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ID))); >+ } >+ catch(Exception e){ > >- try >- { >- IWorkbenchPage page = window.getActivePage(); >+ UiPlugin.logError(e); > >- if(instance == null){ >- instance = ((RecorderControlView)(page.showView(ID))); >- } >- else{ >- page.showView(ID); >- } >+ ErrorDialog.openError(Display.getDefault().getActiveShell(), >+ UiPluginResourceBundle.W_ERROR, >+ UiPluginResourceBundle.RecorderControlView_UNABLE_TO_CREATE_RECORDER_CONTROL_VIEW_ERROR_MSG, >+ new Status(Status.WARNING, UiPlugin.PLUGIN_ID, IResourceStatus.INTERNAL_ERROR, e.toString(), null)); >+ } >+ } >+ }); > } >- catch(Exception e) >- { >- String msg = UiPluginResourceBundle.RecorderControlView_UNABLE_TO_CREATE_RECORDER_CONTROL_VIEW_ERROR_MSG; >- >- Status err = new Status(Status.WARNING, ResourcesPlugin.PI_RESOURCES, IResourceStatus.INTERNAL_ERROR, e.toString(), null ); >- >- ErrorDialog.openError(window.getShell(), >- msg, >- "", // no special message //$NON-NLS-1$ >- err); >- >- UiPlugin.logError(e); >- } > >- return instance; >+ return instance; > } >- >- > > /** > * asynchronously adds a message to the status box >@@ -287,15 +272,27 @@ > */ > public void addMessage(final String message, boolean bSync) > { >- Runnable a = >- new Runnable() >- { >- public void run() >- { >+ Runnable a = new Runnable(){ >+ >+ public void run(){ >+ >+ if(!statusList.isDisposed()){ >+ >+ //Attempt to activate the singleton instance of the Recorder Control View: >+ if(instance != null){ >+ >+ IWorkbenchPartSite workbenchPartSite = instance.getSite(); >+ >+ if(workbenchPartSite != null){ >+ workbenchPartSite.getPage().activate(instance); >+ } >+ } >+ > statusList.add(message); > statusList.setSelection(statusList.getItems().length-1); > } >- }; >+ } >+ }; > if (bSync) > Display.getDefault().syncExec(a); > else >@@ -309,19 +306,17 @@ > */ > public void setKBytesReceived(final int receivedKBytes) > { >- Display.getDefault().asyncExec >- ( >- new Runnable() >- { >- public void run() >- { >+ Display.getDefault().asyncExec(new Runnable(){ >+ >+ public void run(){ >+ >+ if(!kBytesReceived.isDisposed()){ > kBytesReceived.setText(String.valueOf(receivedKBytes)); > } > } >- >- ); >- >+ }); > } >+ > /** > * Sets text of the status text field > * @param status >@@ -392,13 +387,15 @@ > * @see org.eclipse.hyades.internal.execution.recorder.IRecorderListener#updateStatus(java.lang.String) > */ > public void updateStatus(final String str) { >- if (Display.getDefault() != null) >- { >- Display.getDefault().asyncExec(new Runnable() { >- public void run() { >- recStatus.setText(str); >- } >- }); >- } >+ >+ Display.getDefault().asyncExec(new Runnable() { >+ >+ public void run() { >+ >+ if(!recStatus.isDisposed()){ >+ recStatus.setText(str); >+ } >+ } >+ }); > } > } >Index: src/org/eclipse/hyades/test/ui/internal/resources/messages.properties >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src/org/eclipse/hyades/test/ui/internal/resources/messages.properties,v >retrieving revision 1.28 >diff -u -r1.28 messages.properties >--- src/org/eclipse/hyades/test/ui/internal/resources/messages.properties 30 Apr 2008 18:10:33 -0000 1.28 >+++ src/org/eclipse/hyades/test/ui/internal/resources/messages.properties 6 May 2008 14:54:05 -0000 >@@ -298,7 +298,7 @@ > RecorderUIUtility_INCORRECT_LAYOUT_MESSAGE_FORMAT_STRING=IWAT3036E Parent Composite does not have correct layout assigned ({0}) > StopRecordingAction_STOP_RECORDING_BUTTON_TOOLTIP=Stop Recording > RecorderControlView_KBYTES_RECEIVED_CONTROL_LABEL=KBytes Recorded: >-RecorderControlView_UNABLE_TO_CREATE_RECORDER_CONTROL_VIEW_ERROR_MSG=IWAT3037E Unable to create recorder control view >+RecorderControlView_UNABLE_TO_CREATE_RECORDER_CONTROL_VIEW_ERROR_MSG=IWAT3037E Unable to create the Recorder Control View. > RecorderControlView_STATUS_LABEL=Recorder Status: > > #############################################################################################################
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 228747
: 98849