WindowTester changes user.dir

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

WindowTester changes user.dir

Postby a.bitsche » Tue Jul 24, 2007 5:15 am

If i run a program under eclipse the default user.dir is the absolute path to the project-folder. Including the project-folder itself.
When i run a UITestCase the user.dir is switched to the eclipse installation-path.

Is there a solution, workaround available as this is a huge problem for my tests.
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Postby Phil Quitslund » Tue Jul 24, 2007 2:07 pm

I'm not seeing this... but then I may be missing your point.

For instance, if I execute the following test:


Code: Select all

import junit.extensions.UITestCaseSWT;

public class UserDirSpike extends UITestCaseSWT {

   public void testSpike() {
      System.out.println((System.getProperty("user.dir")));
   }

}



I see the path to the test plugin directory:


C:\dev\eclipse\workspaces\ws\wt.support.hacks


Is this the desired effect?

Describe your situation further and I'll be happy to dig deeper.


-phil
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby a.bitsche » Wed Jul 25, 2007 2:20 am

My workspace is 'D:\jsrc\GuiTest' and the project is named 'DMan'. I create a new Class to detect the 'user.dir'.
The 'user.dir' is 'D:\jsrc\GuiTest\DMan' as expected and wanted.

If i start a UITestCaseSWT and request the 'user.dir' the returned path is 'C:\Programme\eclipse3.2'.

That's the reason why i think you, should mean the windowtester, changes the user.dir.
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Postby Phil Quitslund » Wed Jul 25, 2007 8:30 am

Hmmmm.....

What happens when you run a standard PDE JUnit test?

For instance:

Code: Select all
public class UserDirSpike extends TestCase /* standard JUnit */ {

   public void testSpike() {
      System.out.println((System.getProperty("user.dir")));
   }

}


Does this produce what you expect?
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby a.bitsche » Wed Jul 25, 2007 11:36 pm

Yes, it does.
a.bitsche
 
Posts: 31
Joined: Tue Aug 22, 2006 2:53 am
Location: Austria

Postby Phil Quitslund » Thu Jul 26, 2007 8:07 am

Strange... It looks like we'll need to do some digging.

To track our effort better, could you send a bug report to:

wintest-support@instantiations.com

Thanks and sorry for the inconvenience!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest