|
|
|
Re: Dirty editor causes failing SWTBot test to block on 'Save changes?'dialog [message #507977 is a reply to message #507897] |
Fri, 15 January 2010 11:45 |
Petar Petrov Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Hello Robert,
Sometimes saving the edited file is not desired. For this reason we use the
following code in our set up method:
SaveableHelper.testSetAutomatedResponse(1);
This will cause the editor to close without asking for saving the file and
without actually saving it. Keep in mind that this is an internal class,
so may change in the future.
Thanks!
Petar P
> Many thanks!
>
> On 1/14/10 8:28 PM, Ketan Padegaonkar wrote:
>
>> The normal way to do this is to add a cleanup method in *all* test
>> classes that cleanup :)
>>
>> @AfterClass public static cleanup(){
>> resetWorkbench();
>> }
>> For an implementation of resetWorkbench() see [1]
>>
>> -- Ketan
>>
>> [1] -
>> http://github.com/ketan/swtbot/blob/b1359050430337018242a3ab 77cd3461b
>> 2210e5f/org.eclipse.swtbot.eclipse.dsl/src/org/eclipse/swtbo t/eclipse
>> /dsl/DefaultWorkbench.java#L89
>> On 1/14/10 3:08 PM, Robert M. Fuhrer wrote:
>>
>>> Hi there,
>>>
>>> I've got a test that exercises a JDT source editor. If the test
>>> fails at a point when an editor is "dirty" (has unsaved changes),
>>> then the test hangs indefinitely at the standard 'dirty dialog':
>>>
>>> MyTest.java has been modified. Save changes?
>>> No Cancel Yes
>>> Ok, it may not be indefinite, but much longer than the nominal
>>> timeout and longer than my patience allows. :-)
>>>
>>> This is obviously undesirable, since it the failing test would
>>> prevent the rest of the test suite from proceeding.
>>>
>>> Has anyone seen this? Is there anything I can do to prevent or work
>>> around this?
>>>
> --------------------------------
> Robert M. Fuhrer
> Research Staff Member
> Programming Technologies Dept.
> IBM T.J. Watson Research Center
> IDE Meta-tooling Platform Project Lead (http://www.eclipse.org/imp)
> X10: Productive High-Performance Parallel Programming
> (http://x10.sf.net)
>
|
|
|
Powered by
FUDForum. Page generated in 0.04510 seconds