org.squashtest.csp.tm.internal.service
Class CustomTestSuiteModificationServiceImpl

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.CustomTestSuiteModificationServiceImpl
All Implemented Interfaces:
CustomTestSuiteModificationService, TestSuiteFinder

@Service(value="CustomTestSuiteModificationService")
public class CustomTestSuiteModificationServiceImpl
extends Object
implements CustomTestSuiteModificationService


Constructor Summary
CustomTestSuiteModificationServiceImpl()
           
 
Method Summary
 void bindTestPlan(long suiteId, List<Long> itemTestPlanIds)
          That method will attach several IterationTestPlanItem to the given TestSuite.
 void bindTestPlanObj(TestSuite testSuite, List<IterationTestPlanItem> itemTestPlans)
          That method will attach several IterationTestPlanItem to the given TestSuite.
 void changeTestPlanPosition(Long testSuiteId, int newIndex, List<Long> itemIds)
           
 AutomatedSuite createAutomatedSuite(long suiteId)
          Create an automated execution for every automated item test plan in the given test-suite, group them in an automated suite and tells the connector to process them.
 List<IterationTestPlanItem> filterTestSuiteByUser(List<IterationTestPlanItem> testPlanItems, String userLogin, Long projectId)
           
 TestSuite findById(long suiteId)
          That method will find the test Suite by its ID
 TestPlanStatistics findTestSuiteStatistics(long suiteId)
          That method will retrieve the data and fill the testSuiteStatistics DTO.
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<IterationTestPlanItem>> findTestSuiteTestPlan(long suiteId, org.squashtest.tm.core.foundation.collection.Paging paging)
          That method will retrieve the test plan items attached to a given test suite.
 void rename(long suiteId, String newName)
          That method will update the name of the suite with newName, identified by suiteId.
 void setUserAccountService(UserAccountService service)
           
 void unbindTestPlanObj(TestSuite testSuite, List<IterationTestPlanItem> itemTestPlans)
          That method will detach several IterationTestPlanItem from the given TestSuite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomTestSuiteModificationServiceImpl

public CustomTestSuiteModificationServiceImpl()
Method Detail

setUserAccountService

@ServiceReference
public void setUserAccountService(UserAccountService service)

rename

@PreAuthorize(value="hasPermission(#suiteId, \'org.squashtest.csp.tm.domain.campaign.TestSuite\', \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void rename(long suiteId,
                                String newName)
            throws DuplicateNameException
Description copied from interface: CustomTestSuiteModificationService
That method will update the name of the suite with newName, identified by suiteId. Will throw a DuplicateNameException if the suite could not rename itself due to name already used by another suite from the same owning Iteration (as as spec of TestSuite).

Specified by:
rename in interface CustomTestSuiteModificationService
Throws:
DuplicateNameException

bindTestPlan

@PreAuthorize(value="hasPermission(#suiteId, \'org.squashtest.csp.tm.domain.campaign.TestSuite\', \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void bindTestPlan(long suiteId,
                                      List<Long> itemTestPlanIds)
Description copied from interface: CustomTestSuiteModificationService

That method will attach several IterationTestPlanItem to the given TestSuite. As usual, they are identified using their Ids. Since a given item can be bound to at most one test suite, the item be deassociated from its former TestSuite.

The implementation must also check that all these entities all belong to the same iteration or throw an unchecked exception if not. TODO : define that exception.

Specified by:
bindTestPlan in interface CustomTestSuiteModificationService

bindTestPlanObj

@PreAuthorize(value="hasPermission(#testSuite, \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void bindTestPlanObj(TestSuite testSuite,
                                         List<IterationTestPlanItem> itemTestPlans)
Description copied from interface: CustomTestSuiteModificationService

That method will attach several IterationTestPlanItem to the given TestSuite. They are identified using their Objects. Since a given item can be bound to at most one test suite, the item be deassociated from its former TestSuite.

These entities all belong to the same iteration since they have previously been attached to it.

Specified by:
bindTestPlanObj in interface CustomTestSuiteModificationService

unbindTestPlanObj

@PreAuthorize(value="hasPermission(#testSuite, \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void unbindTestPlanObj(TestSuite testSuite,
                                           List<IterationTestPlanItem> itemTestPlans)
Description copied from interface: CustomTestSuiteModificationService

That method will detach several IterationTestPlanItem from the given TestSuite. They are identified using their Objects. Since a given item can be bound to at most one test suite, the item be deassociated from its former TestSuite.

These entities all belong to the same iteration since they have previously been attached to it.

Specified by:
unbindTestPlanObj in interface CustomTestSuiteModificationService

findById

@PreAuthorize(value="hasPermission(#suiteId, \'org.squashtest.csp.tm.domain.campaign.TestSuite\',\'READ\') or hasRole(\'ROLE_ADMIN\')")
public TestSuite findById(long suiteId)
Description copied from interface: TestSuiteFinder
That method will find the test Suite by its ID

Specified by:
findById in interface TestSuiteFinder

findTestSuiteTestPlan

@PreAuthorize(value="hasPermission(#suiteId, \'org.squashtest.csp.tm.domain.campaign.TestSuite\',\'READ\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<IterationTestPlanItem>> findTestSuiteTestPlan(long suiteId,
                                                                                                                                          org.squashtest.tm.core.foundation.collection.Paging paging)
Description copied from interface: CustomTestSuiteModificationService

That method will retrieve the test plan items attached to a given test suite.

Specified by:
findTestSuiteTestPlan in interface CustomTestSuiteModificationService

findTestSuiteStatistics

@PreAuthorize(value="hasPermission(#suiteId, \'org.squashtest.csp.tm.domain.campaign.TestSuite\',\'READ\') or hasRole(\'ROLE_ADMIN\')")
public TestPlanStatistics findTestSuiteStatistics(long suiteId)
Description copied from interface: CustomTestSuiteModificationService

That method will retrieve the data and fill the testSuiteStatistics DTO.

Specified by:
findTestSuiteStatistics in interface CustomTestSuiteModificationService

changeTestPlanPosition

@PreAuthorize(value="hasPermission(#testSuiteId, \'org.squashtest.csp.tm.domain.campaign.TestSuite\',\'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void changeTestPlanPosition(Long testSuiteId,
                                                int newIndex,
                                                List<Long> itemIds)
Specified by:
changeTestPlanPosition in interface CustomTestSuiteModificationService

createAutomatedSuite

@PreAuthorize(value="hasPermission(#suiteId, \'org.squashtest.csp.tm.domain.campaign.TestSuite\', \'EXECUTE\') or hasRole(\'ROLE_ADMIN\')")
public AutomatedSuite createAutomatedSuite(long suiteId)
Description copied from interface: CustomTestSuiteModificationService
Create an automated execution for every automated item test plan in the given test-suite, group them in an automated suite and tells the connector to process them.

Specified by:
createAutomatedSuite in interface CustomTestSuiteModificationService
Returns:
an AutomatedSuite

filterTestSuiteByUser

public List<IterationTestPlanItem> filterTestSuiteByUser(List<IterationTestPlanItem> testPlanItems,
                                                         String userLogin,
                                                         Long projectId)


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