Opened 15 years ago

Closed 15 years ago

#1486 closed enhancement (fixed)

Add call to getUsingItems() in all TestFoo.test_delete() methods

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.16
Component: test Version:
Keywords: Cc:

Description

I think the getUsingItems() method is never called otherwise during regular testing and there are a lot of non-trivial queries in there. NOTE! All test cases should delete only items which has no other items using it, so it is expected that the method call always return an empty list.

Change History (3)

comment:1 by Nicklas Nordborg, 15 years ago

Milestone: BASE 2.16

comment:2 by Nicklas Nordborg, 15 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

Something like this should be enough:

dc.deleteItem(item);
Set<ItemProxy> using = item.getUsingItems();
if (using.size() > 0) 
{
   throw new BaseException(item + " is used by " + using);
}
dc.commit();

The call to dc.deleteItem() and dc.commit() is already in the code.

comment:3 by Nicklas Nordborg, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [5340]) Fixes #1486: Add call to getUsingItems() in all TestFoo.test_delete() methods

Note: See TracTickets for help on using tickets.