org.squashtest.tm.service.internal.campaign
Class IterationTestPlanManagerServiceImpl

java.lang.Object
  extended by org.squashtest.tm.service.internal.campaign.IterationTestPlanManagerServiceImpl
All Implemented Interfaces:
IterationTestPlanFinder, IterationTestPlanManagerService

@Service(value="squashtest.tm.service.IterationTestPlanManagerService")
@Transactional
public class IterationTestPlanManagerServiceImpl
extends Object
implements IterationTestPlanManagerService


Constructor Summary
IterationTestPlanManagerServiceImpl()
           
 
Method Summary
 void addTestCasesToIteration(List<Long> objectsIds, long iterationId)
          Adds a list of test cases to an iteration.
 List<org.squashtest.tm.domain.campaign.IterationTestPlanItem> addTestPlanItemsToIteration(List<Long> testNodesIds, org.squashtest.tm.domain.campaign.Iteration iteration)
          Adds a list of test cases to an iteration.
 void addTestPlanToIteration(List<org.squashtest.tm.domain.campaign.IterationTestPlanItem> testPlan, long iterationId)
           persist each iteration_test_plan_item and add it to iteration
 void assignUserToTestPlanItem(long testPlanItemId, long userId)
          Assign User with Execute Access to a TestPlan item.
 void assignUserToTestPlanItems(List<Long> testPlanIds, long userId)
          Assign User with Execute Access to a multiple TestPlan items.
 void changeTestPlanPosition(long iterationId, int newPosition, List<Long> itemIds)
           
 Collection<org.squashtest.tm.domain.campaign.IterationTestPlanItem> createTestPlanFragment(org.squashtest.tm.domain.testcase.TestCase testCase, org.squashtest.tm.domain.users.User assignee)
          Creates a fragment of test plan, containing either : a unique item when the test case is not parameterized one item per dataset when the test case is parameterized Note : The returned test plan fragment is in a transient state.
 List<org.squashtest.tm.domain.users.User> findAssignableUserForTestPlan(long iterationId)
          Get Users with Execute Access for an Iteration and its TestPlan.
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<IndexedIterationTestPlanItem>> findAssignedTestPlan(long iterationId, org.squashtest.tm.core.foundation.collection.PagingAndMultiSorting sorting, org.squashtest.tm.core.foundation.collection.ColumnFiltering columnFiltering)
          Returns an iteration filtered for a specific user.
 List<org.squashtest.tm.domain.testcase.TestCaseLibrary> findLinkableTestCaseLibraries()
          Returns a collection of TestCaseLibrary, the test cases of which may be added to the campaign
 List<org.squashtest.tm.domain.testcase.TestCase> findPlannedTestCases(Long iterationId)
           
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<IndexedIterationTestPlanItem>> findTestPlan(long iterationId, org.squashtest.tm.core.foundation.collection.PagingAndSorting filter)
           
 org.squashtest.tm.domain.campaign.IterationTestPlanItem findTestPlanItem(long itemTestPlanId)
           
 org.squashtest.tm.domain.campaign.IterationTestPlanItem findTestPlanItemByTestCaseId(long iterationId, long testCaseId)
          Deprecated. method used only in Integration tests should be removed
 void forceExecutionStatus(long iterationTestPlanItemId, String statusName)
          Assigns an execution status to a test plan item.
 List<org.squashtest.tm.domain.execution.ExecutionStatus> getExecutionStatusList()
           
 boolean removeTestPlanFromIteration(long testPlanItemId)
          Removes a test case from an iteration except if the test plans was executed
 boolean removeTestPlansFromIteration(List<Long> testPlanIds, long iterationId)
          Removes a list of test cases from a campaign excepted the test plans which were executed
 boolean removeTestPlansFromIterationObj(List<Long> testPlanItemsIds, org.squashtest.tm.domain.campaign.Iteration iteration)
          Removes a list of test cases from an iteration excepted the test plans which were executed
 void reorderTestPlan(long iterationId, org.squashtest.tm.core.foundation.collection.MultiSorting newSorting)
           
 void updateMetadata(org.squashtest.tm.domain.campaign.IterationTestPlanItem item)
          Will update the item test plan execution metadata using the last execution data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IterationTestPlanManagerServiceImpl

public IterationTestPlanManagerServiceImpl()
Method Detail

findLinkableTestCaseLibraries

@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<org.squashtest.tm.domain.testcase.TestCaseLibrary> findLinkableTestCaseLibraries()
Description copied from interface: IterationTestPlanFinder
Returns a collection of TestCaseLibrary, the test cases of which may be added to the campaign

Specified by:
findLinkableTestCaseLibraries in interface IterationTestPlanFinder

findAssignedTestPlan

public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<IndexedIterationTestPlanItem>> findAssignedTestPlan(long iterationId,
                                                                                                                                   org.squashtest.tm.core.foundation.collection.PagingAndMultiSorting sorting,
                                                                                                                                   org.squashtest.tm.core.foundation.collection.ColumnFiltering columnFiltering)
Description copied from interface: IterationTestPlanManagerService
Returns an iteration filtered for a specific user. It returns an iteration with a test plan containing only the items that are assigned to that user or have been executed by that user.

Specified by:
findAssignedTestPlan in interface IterationTestPlanManagerService
Returns:
the test plan of given iteration filtered by the current user
See Also:
org.squashtest.tm.service.campaign.CustomIterationModificationService#findAssignedTestPlan(long, Paging)

addTestCasesToIteration

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void addTestCasesToIteration(List<Long> objectsIds,
                                                 long iterationId)
Description copied from interface: IterationTestPlanManagerService
Adds a list of test cases to an iteration.

Specified by:
addTestCasesToIteration in interface IterationTestPlanManagerService

addTestPlanItemsToIteration

@PreAuthorize(value="hasPermission(#iteration, \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public List<org.squashtest.tm.domain.campaign.IterationTestPlanItem> addTestPlanItemsToIteration(List<Long> testNodesIds,
                                                                                                              org.squashtest.tm.domain.campaign.Iteration iteration)
Description copied from interface: IterationTestPlanManagerService
Adds a list of test cases to an iteration.

Specified by:
addTestPlanItemsToIteration in interface IterationTestPlanManagerService

addTestPlanToIteration

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void addTestPlanToIteration(List<org.squashtest.tm.domain.campaign.IterationTestPlanItem> testPlan,
                                                long iterationId)
Description copied from interface: IterationTestPlanManagerService

persist each iteration_test_plan_item and add it to iteration

Specified by:
addTestPlanToIteration in interface IterationTestPlanManagerService

changeTestPlanPosition

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void changeTestPlanPosition(long iterationId,
                                                int newPosition,
                                                List<Long> itemIds)
Specified by:
changeTestPlanPosition in interface IterationTestPlanManagerService
See Also:
CustomIterationModificationService#changeTestPlanPosition(long, int, List)

reorderTestPlan

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void reorderTestPlan(long iterationId,
                                         org.squashtest.tm.core.foundation.collection.MultiSorting newSorting)
Specified by:
reorderTestPlan in interface IterationTestPlanManagerService

removeTestPlansFromIteration

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public boolean removeTestPlansFromIteration(List<Long> testPlanIds,
                                                         long iterationId)
Description copied from interface: IterationTestPlanManagerService
Removes a list of test cases from a campaign excepted the test plans which were executed

Specified by:
removeTestPlansFromIteration in interface IterationTestPlanManagerService
Parameters:
testPlanIds - the ids of the test plan managing that test case for that iteration
iterationId - the id of the iteration
Returns:
true if at least one test plan item was deleted (because of insufficient rights on executed item)

removeTestPlansFromIterationObj

@PreAuthorize(value="hasPermission(#iteration, \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public boolean removeTestPlansFromIterationObj(List<Long> testPlanItemsIds,
                                                            org.squashtest.tm.domain.campaign.Iteration iteration)
Description copied from interface: IterationTestPlanManagerService
Removes a list of test cases from an iteration excepted the test plans which were executed

Specified by:
removeTestPlansFromIterationObj in interface IterationTestPlanManagerService
Parameters:
testPlanItemsIds - the ids of the test plan managing that test case for that iteration
iteration - the iteration
Returns:
true if at least one test plan was already executed and therefore not deleted

removeTestPlanFromIteration

@PreAuthorize(value="hasPermission(#testPlanItemId, \'org.squashtest.tm.domain.campaign.IterationTestPlanItem\', \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public boolean removeTestPlanFromIteration(long testPlanItemId)
Description copied from interface: IterationTestPlanManagerService
Removes a test case from an iteration except if the test plans was executed

Specified by:
removeTestPlanFromIteration in interface IterationTestPlanManagerService
Returns:
true if the test plan was already executed and therefore not deleted

findPlannedTestCases

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<org.squashtest.tm.domain.testcase.TestCase> findPlannedTestCases(Long iterationId)
Specified by:
findPlannedTestCases in interface IterationTestPlanFinder

updateMetadata

public void updateMetadata(org.squashtest.tm.domain.campaign.IterationTestPlanItem item)
Description copied from interface: IterationTestPlanManagerService
Will update the item test plan execution metadata using the last execution data.

Specified by:
updateMetadata in interface IterationTestPlanManagerService

findTestPlan

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<IndexedIterationTestPlanItem>> findTestPlan(long iterationId,
                                                                                                                                        org.squashtest.tm.core.foundation.collection.PagingAndSorting filter)
Specified by:
findTestPlan in interface IterationTestPlanFinder

findAssignableUserForTestPlan

public List<org.squashtest.tm.domain.users.User> findAssignableUserForTestPlan(long iterationId)
Description copied from interface: IterationTestPlanFinder
Get Users with Execute Access for an Iteration and its TestPlan.

Specified by:
findAssignableUserForTestPlan in interface IterationTestPlanFinder

assignUserToTestPlanItem

public void assignUserToTestPlanItem(long testPlanItemId,
                                     long userId)
Description copied from interface: IterationTestPlanManagerService
Assign User with Execute Access to a TestPlan item.

Specified by:
assignUserToTestPlanItem in interface IterationTestPlanManagerService
See Also:
IterationTestPlanManagerService.assignUserToTestPlanItem(long, long)

assignUserToTestPlanItems

public void assignUserToTestPlanItems(List<Long> testPlanIds,
                                      long userId)
Description copied from interface: IterationTestPlanManagerService
Assign User with Execute Access to a multiple TestPlan items.

Specified by:
assignUserToTestPlanItems in interface IterationTestPlanManagerService
See Also:
IterationTestPlanManagerService.assignUserToTestPlanItems(java.util.List, long)

findTestPlanItemByTestCaseId

@Deprecated
public org.squashtest.tm.domain.campaign.IterationTestPlanItem findTestPlanItemByTestCaseId(long iterationId,
                                                                                                       long testCaseId)
Deprecated. method used only in Integration tests should be removed

Specified by:
findTestPlanItemByTestCaseId in interface IterationTestPlanFinder
Parameters:
iterationId -
testCaseId -
Returns:

findTestPlanItem

public org.squashtest.tm.domain.campaign.IterationTestPlanItem findTestPlanItem(long itemTestPlanId)
Specified by:
findTestPlanItem in interface IterationTestPlanFinder

getExecutionStatusList

public List<org.squashtest.tm.domain.execution.ExecutionStatus> getExecutionStatusList()
Specified by:
getExecutionStatusList in interface IterationTestPlanManagerService
Returns:
the list of defined execution statuses

forceExecutionStatus

public void forceExecutionStatus(long iterationTestPlanItemId,
                                 String statusName)
Description copied from interface: IterationTestPlanManagerService
Assigns an execution status to a test plan item. Overrides the current execution status, and other executions metadata.

Specified by:
forceExecutionStatus in interface IterationTestPlanManagerService

createTestPlanFragment

public Collection<org.squashtest.tm.domain.campaign.IterationTestPlanItem> createTestPlanFragment(org.squashtest.tm.domain.testcase.TestCase testCase,
                                                                                                  org.squashtest.tm.domain.users.User assignee)
Description copied from interface: IterationTestPlanManagerService
Creates a fragment of test plan, containing either : Note : The returned test plan fragment is in a transient state. Also assigns each item to the given user.

Specified by:
createTestPlanFragment in interface IterationTestPlanManagerService
Returns:
See Also:
IterationTestPlanManagerService.createTestPlanFragment(org.squashtest.tm.domain.testcase.TestCase, org.squashtest.tm.domain.users.User)


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.