1

I want to get a list of test plans and test suites for a project using TFS java sdk.

how can I do this?

I tried to query it like a workItem but it does not work because its not a workItem

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
mosaad
  • 2,276
  • 5
  • 27
  • 49
  • Test plans live outside of Team Explorer, and inside Test Manager. They still use a different API, even in the Managed Client Object Model. The equivalent Managed API works like this: http://stackoverflow.com/a/21748502/736079 Maybe it provides any pointers. – jessehouwing Apr 24 '14 at 14:47
  • I saw this before but the problem is that these methods are not in the java sdk. If you could you provide an example it would be great – mosaad Apr 24 '14 at 15:06
  • What do you want to do with the list, just to list them or do you want to do changes to them? For just listing them, it would be possible to use a SQL select statement to get the information, which should be acceptable, but changing data directly in the database is not supported by Microsoft! – MikeR Apr 24 '14 at 15:19
  • I need both, Where should i call the sql query for selecting from? – mosaad Apr 24 '14 at 15:24

1 Answers1

2

Looking at the java docs, the Test Suite/Plan/Results API isn't exposed using the Java SDK. Makes sense, since Test Manager functionality isn't available in Eclipse either.

To read some of the Test related information, you can use the TFS_Warehouse database which is supported as a data source for queries. You won't find all the test result fields, but you can get quite a bit of information on tests from these tables. But no Suite/Plan information as far as I can tell from this diagram:

enter image description here Source: http://msdn.microsoft.com/en-us/library/ee620637.aspx

Querying the tfs_{collection} database directly isn't supported and is strongly discouraged by Microsoft.

Which kind of results in the only possible solution: Build a custom webservice using .NET and call that from your Java project if you want to be able to do this.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • It is quite strange that one can read/edit/create Test Cases, but can not do much with a Test Plan/Test suite which just contains a group of test cases. However you are probably right since I can not find a way to access Test Plans and Test suites – mosaad Apr 24 '14 at 16:12
  • 1
    Test Cases are work items in 2013 and older, but Test Suites and Test Plans are not. This is why they can't be customized and why they do not share the same API. This has always been the case. The product team has talked about the possibility of moving over the other test artifacts to a more common API. As to when, if and how there is no news. See also: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2715653-allow-us-to-query-work-item-hierarchy-based-on-add – jessehouwing Apr 24 '14 at 18:24
  • So in conclusion it is not possible. Thanks for your help. – mosaad Apr 25 '14 at 07:19