testcase.getSuccessor() always null. - Klaros Test Management - Forum - Klaros-Testmanagement
testcase.getSuccessor() always null.
Fabian Tietz, geändert vor 10 Jahren.
testcase.getSuccessor() always null.
Youngling Beiträge: 9 Beitrittsdatum: 09.08.13 Neueste Beiträge
Hi,
it seems testcase.getSuccessor always returns null with the Version 3.8.2 - Build 66 (2013-09-12 13:26:53)
I think this was working before, with the older build we previously tested.
StringBuffer query = new StringBuffer();
query.append("select tc from KlarosTestCase tc");
List<KlarosTestCase> alltc = context.executeQuery(query.toString());
alltc=alltc.findAll { ((it.name == "TC00004") &&(it.getSuccessor()==null)) };
alltc still contains a list of all revisions for this Testcase.
Regards,
Fabian.
it seems testcase.getSuccessor always returns null with the Version 3.8.2 - Build 66 (2013-09-12 13:26:53)
I think this was working before, with the older build we previously tested.
StringBuffer query = new StringBuffer();
query.append("select tc from KlarosTestCase tc");
List<KlarosTestCase> alltc = context.executeQuery(query.toString());
alltc=alltc.findAll { ((it.name == "TC00004") &&(it.getSuccessor()==null)) };
alltc still contains a list of all revisions for this Testcase.
Regards,
Fabian.
![thumbnail](/image/xuser_portrait,qimg_id=693610,aimg_id_token=fMoa9c30fC1li9DQ8ak,P2BQQ8ZQzA,P3D,at=1714929091176.pagespeed.ic.cLVQevgJHa.jpg)
Torsten Stolpmann, geändert vor 10 Jahren.
RE: testcase.getSuccessor() always null.
Jedi Council Member Beiträge: 756 Beitrittsdatum: 12.02.09 Neueste Beiträge
Hi Fabian,
your query will indeed return a list of all test case revisions in all projects. I see no reasons why this behavior should have changed for 3.8.2.
It is probably a good idea to use a where clause like shown below:
select tc from KlarosTestCase tc where tc.configuration.name='P0001' and tc.successor is null
Hope this helps.
Regards,
Torsten
your query will indeed return a list of all test case revisions in all projects. I see no reasons why this behavior should have changed for 3.8.2.
It is probably a good idea to use a where clause like shown below:
select tc from KlarosTestCase tc where tc.configuration.name='P0001' and tc.successor is null
Hope this helps.
Regards,
Torsten
Fabian Tietz, geändert vor 10 Jahren.
RE: testcase.getSuccessor() always null.
Youngling Beiträge: 9 Beitrittsdatum: 09.08.13 Neueste Beiträge
OK, i wasn't aware of the fact, that the query executes on all projects, not on the selected one.
Is there a way to get the currently active Project from a groovy script?
The query below still returns 428 Testcases, the total number shown on the projects page for
the "P00001" project is 409. Getting the head revisions works.
I have still several testcases duplicated in the list, both having the same
name, shortname and revision now, hence the difference.
Regards,
Fabian.
Is there a way to get the currently active Project from a groovy script?
The query below still returns 428 Testcases, the total number shown on the projects page for
the "P00001" project is 409. Getting the head revisions works.
I have still several testcases duplicated in the list, both having the same
name, shortname and revision now, hence the difference.
Regards,
Fabian.
![thumbnail](/image/xuser_portrait,qimg_id=693610,aimg_id_token=fMoa9c30fC1li9DQ8ak,P2BQQ8ZQzA,P3D,at=1714929091176.pagespeed.ic.cLVQevgJHa.jpg)
Torsten Stolpmann, geändert vor 10 Jahren.
RE: testcase.getSuccessor() always null. (Antwort)
Jedi Council Member Beiträge: 756 Beitrittsdatum: 12.02.09 Neueste Beiträge
Sure: context.getActiveProject() is your friend, which documented here: http://www.klaros-testmanagement.com/files/doc/html/User-Manual.Appendix.Report.html
In case you have not seen it yet: The example in our Report Tutorial also uses this method amongst other hopefully useful information.
Regards,
Torsten
In case you have not seen it yet: The example in our Report Tutorial also uses this method amongst other hopefully useful information.
Regards,
Torsten