Clear Woskspace in Workspace Context does not clear it in Resource Navigator [message #1695133] |
Tue, 12 May 2015 04:38  |
Eclipse User |
|
|
|
Hi,
Whenever I launch my AUT using RCPTT application, it creates a directory just outside my RCPTT workspace as aut-<AUT_Name>, which it uses as workspace for AUT. I can use Clear Workspace option in Workspace context to remove everything inside this directory. Consider I have a resource created using my application inside this workspace, it deletes it whenever I do a clear workspace. But the problem I face is, it is not getting removed from the GUI, but only from the backend aut-<AUT_Name> directory.
Consider this scenario. I have a test case which need to open my application, create a resource in the resource navigator, which is created as a tree in my Resource Navigator tab of my application and also it is saved as a directory in my aut-<AUT_NAME>. Then I use a Verification to check if this tree information is valid in the way I created.
Hence whenever I want to replay this test, I need an empty workspace which means both Resource Navigator and aut-<AUT_Name> should not contain any information about my resource. I can use an the Clear Workspace option in Workspace context to remove the data in aut-<AUT_Name>. But it doesn't remove the data in Resource Navigator. However when I restart the application after I run my context to clear workspace, the Resource Navigator will be empty.
The problem is, Context runs only after the AUT gets launched. Hence the Clear Workspace runs only after RCPTT launches my AUT. Clear Context properly removes the content from aut-<AUT_Name> directory but it does not unlink the information from Resource Navigator. In my ECL Script, I will try to create a new resource of the same name, which will fail because in the Resource Navigator the resource already exist. It is deleted only inside aut-<AUT_Name> and not here.
This issue comes only when I try to create a test using RCPTT standalone application. Using TestRunner and Maven this issue does not appear. So, when I create a test, how can I overcome this difficulty? How can I delete the information in Resource navigator, it they exist before running my SCL Script? Kindly let me know.
Thank you
Jeevan
|
|
|
|
Re: Clear Woskspace in Workspace Context does not clear it in Resource Navigator [message #1695253 is a reply to message #1695246] |
Wed, 13 May 2015 02:02   |
Eclipse User |
|
|
|
Hi Olga,
Reset Perspective did not help me. After Empty Workspace Context, I did a reset perspective, if the tree is in expanded mode, it shrinks into normal view even if the context is not in the workspace directory.
I do not have a rest or a restart option in my application.
I tried to create a ECL Script Context and tried, which also did not help much. I tried to make a if condition to find it the tree exist, and if exist we can delete the tree in Resource Navigator. The following is the code which I tried to write, but when the resource "abc" is not there, the code crashes in "get-item abc" in the "if" condition.
if [get-view "Resource Navigator" | get-tree | get-item abc | get-property caption | equals abc ] {
get-view "Resource Navigator" | get-tree | select "abc/ip1/dsresource" | get-menu Delete | click
with [get-window -class DeleteResourceDialog] {
get-button "Do you want to remove the physical files from the disk?" | check
get-button OK | click
}
}
Could you please help me in writing this test case? How can I frame this if condition?
Is it possible to create a new fresh workspace everytime when we run a test list?
You said that maven and testrunner creates a new aut-<AUT_Name> every time. If it runs in a new workspace, then everything will be new and it will be already empty. Then what is the point of having an option called "Empty Workspace"?
Thank you
Jeevan
[Updated on: Wed, 13 May 2015 04:51] by Moderator
|
|
|
|
|
Re: Clear Woskspace in Workspace Context does not clear it in Resource Navigator [message #1695761 is a reply to message #1695408] |
Tue, 19 May 2015 01:37  |
Eclipse User |
|
|
|
Hi,
The Code works. Thank you.
When a context runs, let us say we do a "Clear Workspace", how does that work? Apart from deleting those files from workspace directory, what other features does it include? How does the Context internally function with regarding Object deletion in Project manager? What are the internal Eclipse API calls it does? Similarly the Import function in Context, what are the internal API calls they use?
The ECL code you gave brings the GUI and does it as a ECL Script Context. How can I do the same by calling the Java method? Can I use a invoke call? I have the following,
WorkspaceManager wrkmgr;
// initialize wrkmgr
wrkmgr.deleteResource(resId, true) // where resId is of datatype QResourceID
How can I pass resId into invoke method? Can I use something similar to
get-eclipse-window | get-object | invoke com.abc.qti.qsip.core.ABCWorkspaceManager.WorkspaceManager.deleteResource "abc.ipname-resource" true //where "abc.ipname-resource" is resID object which I have to see how to pass.
Thank you
Jeevan
[Updated on: Wed, 20 May 2015 06:58] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04032 seconds