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

java.lang.Object
  extended by org.squashtest.csp.tm.internal.service.CustomTestCaseModificationServiceImpl
All Implemented Interfaces:
CustomTestCaseModificationService

@Service(value="CustomTestCaseModificationService")
public class CustomTestCaseModificationServiceImpl
extends Object
implements CustomTestCaseModificationService

Author:
Gregory Fouquet

Constructor Summary
CustomTestCaseModificationServiceImpl()
           
 
Method Summary
 TestStep addActionTestStep(long parentTestCaseId, ActionTestStep newTestStep)
           
 void changeTestStepPosition(long testCaseId, long testStepId, int newStepPosition)
          Deprecated. 
 void changeTestStepsPosition(long testCaseId, int newPosition, List<Long> stepIds)
          Will move a list of steps to a new position.
 org.squashtest.csp.core.infrastructure.collection.PagedCollectionHolder<List<RequirementVersion>> findAllDirectlyVerifiedRequirementsByTestCaseId(long testCaseId, org.squashtest.csp.core.infrastructure.collection.PagingAndSorting pas)
          Returns the filtered list of RequirementVersions directly verified by a test case.
 org.squashtest.csp.core.infrastructure.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllVerifiedRequirementsByTestCaseId(long testCaseId, org.squashtest.csp.core.infrastructure.collection.PagingAndSorting pas)
           
 TestCase findById(long testCaseId)
           
 FilteredCollectionHolder<List<TestCase>> findCallingTestCases(long testCaseId, CollectionSorting sorting)
          That method returns the list of test cases having at least one CallTestStep directly calling the test case identified by testCaseId.
 List<TestStep> findStepsByTestCaseId(long testCaseId)
           
 FilteredCollectionHolder<List<TestStep>> findStepsByTestCaseIdFiltered(long testCaseId, CollectionFilter filter)
           
 TestCase findTestCaseWithSteps(long testCaseId)
           
 void pasteCopiedTestStep(Long testCaseId, Long idToCopyAfter, Long copiedTestStepId)
          will insert a test step into a test case script, possibly after a step (the position), given their Ids.
 void removeListOfSteps(long testCaseId, List<Long> testStepIds)
           
 void removeStepFromTestCase(long testCaseId, long testStepId)
           
 void rename(long testCaseId, String newName)
           
 void updateTestStepAction(long testStepId, String newAction)
           
 void updateTestStepExpectedResult(long testStepId, String newExpectedResult)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomTestCaseModificationServiceImpl

public CustomTestCaseModificationServiceImpl()
Method Detail

rename

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void rename(long testCaseId,
                                String newName)
            throws DuplicateNameException
Specified by:
rename in interface CustomTestCaseModificationService
Throws:
DuplicateNameException

findById

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'READ\') or hasRole(\'ROLE_ADMIN\')")
public TestCase findById(long testCaseId)
Specified by:
findById in interface CustomTestCaseModificationService

findStepsByTestCaseId

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<TestStep> findStepsByTestCaseId(long testCaseId)
Specified by:
findStepsByTestCaseId in interface CustomTestCaseModificationService

addActionTestStep

@PreAuthorize(value="hasPermission(#parentTestCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public TestStep addActionTestStep(long parentTestCaseId,
                                               ActionTestStep newTestStep)
Specified by:
addActionTestStep in interface CustomTestCaseModificationService

updateTestStepAction

@PreAuthorize(value="hasPermission(#testStepId, \'org.squashtest.csp.tm.domain.testcase.TestStep\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void updateTestStepAction(long testStepId,
                                              String newAction)
Specified by:
updateTestStepAction in interface CustomTestCaseModificationService

updateTestStepExpectedResult

@PreAuthorize(value="hasPermission(#testStepId, \'org.squashtest.csp.tm.domain.testcase.TestStep\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void updateTestStepExpectedResult(long testStepId,
                                                      String newExpectedResult)
Specified by:
updateTestStepExpectedResult in interface CustomTestCaseModificationService

changeTestStepPosition

@Deprecated
@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void changeTestStepPosition(long testCaseId,
                                                           long testStepId,
                                                           int newStepPosition)
Deprecated. 

Specified by:
changeTestStepPosition in interface CustomTestCaseModificationService

changeTestStepsPosition

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void changeTestStepsPosition(long testCaseId,
                                                 int newPosition,
                                                 List<Long> stepIds)
Description copied from interface: CustomTestCaseModificationService
Will move a list of steps to a new position.

Specified by:
changeTestStepsPosition in interface CustomTestCaseModificationService
Parameters:
testCaseId - the id of the test case
newPosition - the position we want the first element of movedSteps to be once the operation is complete

removeStepFromTestCase

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void removeStepFromTestCase(long testCaseId,
                                                long testStepId)
Specified by:
removeStepFromTestCase in interface CustomTestCaseModificationService

findTestCaseWithSteps

@PostAuthorize(value="hasPermission(returnObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public TestCase findTestCaseWithSteps(long testCaseId)
Specified by:
findTestCaseWithSteps in interface CustomTestCaseModificationService

findAllDirectlyVerifiedRequirementsByTestCaseId

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'READ\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.csp.core.infrastructure.collection.PagedCollectionHolder<List<RequirementVersion>> findAllDirectlyVerifiedRequirementsByTestCaseId(long testCaseId,
                                                                                                                                                                      org.squashtest.csp.core.infrastructure.collection.PagingAndSorting pas)
Description copied from interface: CustomTestCaseModificationService
Returns the filtered list of RequirementVersions directly verified by a test case.

Specified by:
findAllDirectlyVerifiedRequirementsByTestCaseId in interface CustomTestCaseModificationService
Returns:

removeListOfSteps

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void removeListOfSteps(long testCaseId,
                                           List<Long> testStepIds)
Specified by:
removeListOfSteps in interface CustomTestCaseModificationService

findStepsByTestCaseIdFiltered

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'READ\') or hasRole(\'ROLE_ADMIN\')")
public FilteredCollectionHolder<List<TestStep>> findStepsByTestCaseIdFiltered(long testCaseId,
                                                                                           CollectionFilter filter)
Specified by:
findStepsByTestCaseIdFiltered in interface CustomTestCaseModificationService

pasteCopiedTestStep

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void pasteCopiedTestStep(Long testCaseId,
                                             Long idToCopyAfter,
                                             Long copiedTestStepId)
Description copied from interface: CustomTestCaseModificationService
will insert a test step into a test case script, possibly after a step (the position), given their Ids. If no position is provided, it defaults to the first position.

Specified by:
pasteCopiedTestStep in interface CustomTestCaseModificationService
Parameters:
testCaseId - the id of the test case.
idToCopyAfter - the id of the step after which we'll insert the copy of a step, may be null.
copiedTestStepId - the id of the testStep to copy.

findAllVerifiedRequirementsByTestCaseId

public org.squashtest.csp.core.infrastructure.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllVerifiedRequirementsByTestCaseId(long testCaseId,
                                                                                                                                                  org.squashtest.csp.core.infrastructure.collection.PagingAndSorting pas)
Specified by:
findAllVerifiedRequirementsByTestCaseId in interface CustomTestCaseModificationService
Returns:

findCallingTestCases

public FilteredCollectionHolder<List<TestCase>> findCallingTestCases(long testCaseId,
                                                                     CollectionSorting sorting)
Description copied from interface: CustomTestCaseModificationService
That method returns the list of test cases having at least one CallTestStep directly calling the test case identified by testCaseId. The list is wrapped in a FilteredCollectionHolder, that contains meta informations regarding the filtering, as usual.

Specified by:
findCallingTestCases in interface CustomTestCaseModificationService
Parameters:
testCaseId - the Id of the called test case.
sorting - the sorting parameters.
Returns:
a non null but possibly empty FilteredCollectionHolder wrapping the list of first-level calling test cases.


Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.