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

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

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

Author:
Gregory Fouquet

Constructor Summary
CustomTestCaseModificationServiceImpl()
           
 
Method Summary
 TestStep addActionTestStep(long parentTestCaseId, ActionTestStep newTestStep)
           
 AutomatedTest bindAutomatedTest(Long testCaseId, Long taProjectId, String testName)
           
 void changeImportanceAuto(long testCaseId, boolean auto)
          will change the test case importance too if auto is true.
 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.tm.core.foundation.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllVerifiedRequirementsByTestCaseId(long testCaseId, org.squashtest.tm.core.foundation.collection.PagingAndSorting pas)
           
 Collection<TestAutomationProjectContent> findAssignableAutomationTests(long testCaseId)
           
 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, org.squashtest.tm.core.foundation.collection.Paging 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 pasteCopiedTestStepToLastIndex(long testCaseId, long copiedTestStepId)
          will insert a test step into a test case script at the last position
 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\' , \'SMALL_EDIT\') 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 TestCaseFinder

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 TestCaseFinder

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 TestCaseFinder

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,
                                                                                           org.squashtest.tm.core.foundation.collection.Paging filter)
Specified by:
findStepsByTestCaseIdFiltered in interface TestCaseFinder

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.

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.

pasteCopiedTestStepToLastIndex

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void pasteCopiedTestStepToLastIndex(long testCaseId,
                                                        long copiedTestStepId)
Description copied from interface: CustomTestCaseModificationService
will insert a test step into a test case script at the last position

Specified by:
pasteCopiedTestStepToLastIndex in interface CustomTestCaseModificationService
Parameters:
testCaseId - the id of the test case.
copiedTestStepId - the id of the testStep to copy.

findAllVerifiedRequirementsByTestCaseId

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

findCallingTestCases

public FilteredCollectionHolder<List<TestCase>> findCallingTestCases(long testCaseId,
                                                                     CollectionSorting sorting)
Description copied from interface: TestCaseFinder
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 TestCaseFinder
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.

changeImportanceAuto

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void changeImportanceAuto(long testCaseId,
                                              boolean auto)
Description copied from interface: CustomTestCaseModificationService
will change the test case importance too if auto is true.

Specified by:
changeImportanceAuto in interface CustomTestCaseModificationService

findAssignableAutomationTests

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

bindAutomatedTest

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public AutomatedTest bindAutomatedTest(Long testCaseId,
                                                    Long taProjectId,
                                                    String testName)
Specified by:
bindAutomatedTest in interface CustomTestCaseModificationService


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