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

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

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


Constructor Summary
CallStepManagerServiceImpl()
           
 
Method Summary
 void addCallTestStep(long parentTestCaseId, long calledTestCaseId)
          will add a call test step.
 void checkForCyclicStepCallBeforeExecutionCreation(Long rootTestCaseId)
          Used to check if the testPlan call tree is not cyclic before creating it's execution This method is used to prevent infinite cycle in case of bugged data.
 void checkForCyclicStepCallBeforePaste(long destinationTestCaseId, String[] pastedStepId)
          Used to check if the destination test case id is found in the calling tree of the pasted steps if so : a CyclicStepCallException is thrown.
 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<TestCaseLibrary> findLinkableTestCaseLibraries()
          Returns the collection of TestCaseLibrarys which TestCases can be linked by a TestCase via a CallTestStep
 TestCase findTestCase(long testCaseId)
           
 Set<Long> getTestCaseCallTree(Long rootTcId)
          given the Id of a test case, will compute the subsequent test case call tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallStepManagerServiceImpl

public CallStepManagerServiceImpl()
Method Detail

addCallTestStep

@PreAuthorize(value="(hasPermission(#parentTestCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'WRITE\') and hasPermission(#calledTestCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'READ\')) or hasRole(\'ROLE_ADMIN\')")
public void addCallTestStep(long parentTestCaseId,
                                         long calledTestCaseId)
Description copied from interface: CallStepManagerService
will add a call test step.

Specified by:
addCallTestStep in interface CallStepManagerService
Parameters:
parentTestCaseId - that calls a step
calledTestCaseId - being called

findTestCase

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

findLinkableTestCaseLibraries

@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<TestCaseLibrary> findLinkableTestCaseLibraries()
Description copied from interface: CallStepManagerService
Returns the collection of TestCaseLibrarys which TestCases can be linked by a TestCase via a CallTestStep

Specified by:
findLinkableTestCaseLibraries in interface CallStepManagerService
Returns:

getTestCaseCallTree

@PreAuthorize(value="hasPermission(#rootTcId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'READ\') or hasRole(\'ROLE_ADMIN\')\t")
public Set<Long> getTestCaseCallTree(Long rootTcId)
Description copied from interface: CallStepManagerService
given the Id of a test case, will compute the subsequent test case call tree.

Specified by:
getTestCaseCallTree in interface CallStepManagerService
Returns:
a set containing the ids of the called test cases, that will not include the calling test case id. Not null, possibly empty.

findCallingTestCases

public List<TestCase> findCallingTestCases(long testCaseId,
                                           CollectionSorting sorting)
Description copied from interface: CallStepManagerService
That method returns the list of test cases having at least one CallTestStep directly calling the test case identified by testCaseId.

Specified by:
findCallingTestCases in interface CallStepManagerService
Parameters:
testCaseId - the Id of the called test case.
sorting - the sorting parameters.
Returns:
a non null but possibly empty list of test cases calling the argument test case (first level only)

checkForCyclicStepCallBeforePaste

@PreAuthorize(value="hasPermission(#destinationTestCaseId, \'org.squashtest.csp.tm.domain.testcase.TestCase\' , \'READ\') or hasRole(\'ROLE_ADMIN\')")
public void checkForCyclicStepCallBeforePaste(long destinationTestCaseId,
                                                           String[] pastedStepId)
Description copied from interface: CallStepManagerService
Used to check if the destination test case id is found in the calling tree of the pasted steps if so : a CyclicStepCallException is thrown.

Specified by:
checkForCyclicStepCallBeforePaste in interface CallStepManagerService

checkForCyclicStepCallBeforeExecutionCreation

public void checkForCyclicStepCallBeforeExecutionCreation(Long rootTestCaseId)
Description copied from interface: CallStepManagerService
Used to check if the testPlan call tree is not cyclic before creating it's execution This method is used to prevent infinite cycle in case of bugged data. if so : a CyclicStepCallException is thrown.

Specified by:
checkForCyclicStepCallBeforeExecutionCreation in interface CallStepManagerService


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