org.squashtest.tm.service.internal.requirement
Class VerifiedRequirementsManagerServiceImpl

java.lang.Object
  extended by org.squashtest.tm.service.internal.requirement.VerifiedRequirementsManagerServiceImpl
All Implemented Interfaces:
VerifiedRequirementsManagerService

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


Constructor Summary
VerifiedRequirementsManagerServiceImpl()
           
 
Method Summary
 Collection<org.squashtest.tm.exception.requirement.VerifiedRequirementException> addVerifiedRequirementsToTestCase(List<Long> requirementsIds, long testCaseId)
          Adds a list of requirements to the ones verified by a test case.
 Collection<org.squashtest.tm.exception.requirement.VerifiedRequirementException> addVerifiedRequirementsToTestStep(List<Long> requirementsIds, long testStepId)
          Adds a list of requirement-versions to the ones verified by the step's test case and bind them to the step.
 Collection<org.squashtest.tm.exception.requirement.VerifiedRequirementException> addVerifyingRequirementVersionsToTestCase(Map<org.squashtest.tm.domain.testcase.TestCase,List<org.squashtest.tm.domain.requirement.RequirementVersion>> requirementVersionsByTestCase)
          Adds a list of requirement-versions to the ones verified by a test case.
 int changeVerifiedRequirementVersionOnTestCase(long oldVerifiedRequirementVersionId, long newVerifiedRequirementVersionId, long testCaseId)
          Removes a requirement version from the given test case and replaces it with the wanted version if the same version is selected as was previously attached, nothing happens
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllDirectlyVerifiedRequirementsByTestCaseId(long testCaseId, org.squashtest.tm.core.foundation.collection.PagingAndSorting pagingAndSorting)
          Returns the filtered list of VerifiedRequirements directly verified by a test case.
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllDirectlyVerifiedRequirementsByTestStepId(long testStepId, org.squashtest.tm.core.foundation.collection.PagingAndSorting paging)
          Will find all RequirementVersion verified by the test case containing the step of the given id.
 List<VerifiedRequirement> findAllVerifiedRequirementsByTestCaseId(long testCaseId)
          Returns all VerifiedRequirement for the TestCase matching the given id.
 org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllVerifiedRequirementsByTestCaseId(long testCaseId, org.squashtest.tm.core.foundation.collection.PagingAndSorting pas)
          Returns all VerifiedRequirement for the TestCase matching the given id.
 void removeVerifiedRequirementVersionFromTestCase(long requirementVersionId, long testCaseId)
          Removes a requirement from the ones verified by a test case.
 void removeVerifiedRequirementVersionsFromTestCase(List<Long> requirementVersionsIds, long testCaseId)
          Removes a list of requirements from the ones verified by a test case.
 void removeVerifiedRequirementVersionsFromTestStep(List<Long> requirementVersionsIds, long testStepId)
          Removes a requirement from the step but not from the test case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerifiedRequirementsManagerServiceImpl

public VerifiedRequirementsManagerServiceImpl()
Method Detail

addVerifiedRequirementsToTestCase

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.tm.domain.testcase.TestCase\' , \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public Collection<org.squashtest.tm.exception.requirement.VerifiedRequirementException> addVerifiedRequirementsToTestCase(List<Long> requirementsIds,
                                                                                                                                       long testCaseId)
Description copied from interface: VerifiedRequirementsManagerService
Adds a list of requirements to the ones verified by a test case. If a requirement is already verified, nothing special happens.

Specified by:
addVerifiedRequirementsToTestCase in interface VerifiedRequirementsManagerService
Returns:

removeVerifiedRequirementVersionsFromTestCase

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.tm.domain.testcase.TestCase\' , \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void removeVerifiedRequirementVersionsFromTestCase(List<Long> requirementVersionsIds,
                                                                       long testCaseId)
Description copied from interface: VerifiedRequirementsManagerService
Removes a list of requirements from the ones verified by a test case. If a requirement is not verified by the test case, nothing special happens.

Specified by:
removeVerifiedRequirementVersionsFromTestCase in interface VerifiedRequirementsManagerService

removeVerifiedRequirementVersionFromTestCase

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.tm.domain.testcase.TestCase\' , \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void removeVerifiedRequirementVersionFromTestCase(long requirementVersionId,
                                                                      long testCaseId)
Description copied from interface: VerifiedRequirementsManagerService
Removes a requirement from the ones verified by a test case. If the requirement was not previously verified by the test case, nothing special happens.

Specified by:
removeVerifiedRequirementVersionFromTestCase in interface VerifiedRequirementsManagerService

changeVerifiedRequirementVersionOnTestCase

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.tm.domain.testcase.TestCase\' , \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public int changeVerifiedRequirementVersionOnTestCase(long oldVerifiedRequirementVersionId,
                                                                   long newVerifiedRequirementVersionId,
                                                                   long testCaseId)
Description copied from interface: VerifiedRequirementsManagerService
Removes a requirement version from the given test case and replaces it with the wanted version if the same version is selected as was previously attached, nothing happens

Specified by:
changeVerifiedRequirementVersionOnTestCase in interface VerifiedRequirementsManagerService

findAllDirectlyVerifiedRequirementsByTestCaseId

@PreAuthorize(value="hasPermission(#testCaseId, \'org.squashtest.tm.domain.testcase.TestCase\' , \'READ\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllDirectlyVerifiedRequirementsByTestCaseId(long testCaseId,
                                                                                                                                                                  org.squashtest.tm.core.foundation.collection.PagingAndSorting pagingAndSorting)
Description copied from interface: VerifiedRequirementsManagerService
Returns the filtered list of VerifiedRequirements directly verified by a test case. The non directly verified requirements (by called test-cases) are NOT included in the result.

Specified by:
findAllDirectlyVerifiedRequirementsByTestCaseId in interface VerifiedRequirementsManagerService
Parameters:
testCaseId - : the id of the concerned TestCase.
Returns:
a PagedCollectionHolder of VerifiedRequirement containing directly verified requirements for the test case of the given id.

addVerifyingRequirementVersionsToTestCase

public Collection<org.squashtest.tm.exception.requirement.VerifiedRequirementException> addVerifyingRequirementVersionsToTestCase(Map<org.squashtest.tm.domain.testcase.TestCase,List<org.squashtest.tm.domain.requirement.RequirementVersion>> requirementVersionsByTestCase)
Description copied from interface: VerifiedRequirementsManagerService
Adds a list of requirement-versions to the ones verified by a test case. If the version or a sister is already verified, the requirement is not added and nothing special happens.

Specified by:
addVerifyingRequirementVersionsToTestCase in interface VerifiedRequirementsManagerService
Parameters:
requirementVersionsByTestCase - : list of requirementVersions mapped by test-case
Returns:

addVerifiedRequirementsToTestStep

@PreAuthorize(value="hasPermission(#testStepId, \'org.squashtest.tm.domain.testcase.TestStep\' , \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public Collection<org.squashtest.tm.exception.requirement.VerifiedRequirementException> addVerifiedRequirementsToTestStep(List<Long> requirementsIds,
                                                                                                                                       long testStepId)
Description copied from interface: VerifiedRequirementsManagerService
Adds a list of requirement-versions to the ones verified by the step's test case and bind them to the step. If the version already verified by the test case, it is only bound to the step. If a sister version is already bound to the test case the version is not added.

Specified by:
addVerifiedRequirementsToTestStep in interface VerifiedRequirementsManagerService
testStepId - : the id of the concerned ActionTestStep
Returns:

findAllVerifiedRequirementsByTestCaseId

@Transactional(readOnly=true)
public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllVerifiedRequirementsByTestCaseId(long testCaseId,
                                                                                                                                                           org.squashtest.tm.core.foundation.collection.PagingAndSorting pas)
Description copied from interface: VerifiedRequirementsManagerService
Returns all VerifiedRequirement for the TestCase matching the given id. VerifiedRequirements verified by the CallTestSteps of the TestCase will be included.

Specified by:
findAllVerifiedRequirementsByTestCaseId in interface VerifiedRequirementsManagerService
Parameters:
testCaseId - : the id of the concerned TestCase
pas - : the PagingAndSorting to organize the result with
Returns:
a PagedCollectionHolder of VerifiedRequirement containing directly and non directly (call steps) verified requirements for the test case of the given id.

findAllVerifiedRequirementsByTestCaseId

public List<VerifiedRequirement> findAllVerifiedRequirementsByTestCaseId(long testCaseId)
Description copied from interface: VerifiedRequirementsManagerService
Returns all VerifiedRequirement for the TestCase matching the given id. VerifiedRequirements verified by the CallTestSteps of the TestCase will be included.

Specified by:
findAllVerifiedRequirementsByTestCaseId in interface VerifiedRequirementsManagerService
Parameters:
testCaseId - : the id of the concerned TestCase
Returns:
a List of VerifiedRequirement containing directly and non directly (call steps) verified requirements for the test case of the given id.

findAllDirectlyVerifiedRequirementsByTestStepId

public org.squashtest.tm.core.foundation.collection.PagedCollectionHolder<List<VerifiedRequirement>> findAllDirectlyVerifiedRequirementsByTestStepId(long testStepId,
                                                                                                                                                     org.squashtest.tm.core.foundation.collection.PagingAndSorting paging)
Description copied from interface: VerifiedRequirementsManagerService
Will find all RequirementVersion verified by the test case containing the step of the given id. The result will be paged according to the given PagingAndSorting param.

Specified by:
findAllDirectlyVerifiedRequirementsByTestStepId in interface VerifiedRequirementsManagerService
Parameters:
testStepId - : the id of the concerned TestStep
paging - : the PagingAndSorting to organize the result with
Returns:
the list of verified requirements, paged and sorted.

removeVerifiedRequirementVersionsFromTestStep

public void removeVerifiedRequirementVersionsFromTestStep(List<Long> requirementVersionsIds,
                                                          long testStepId)
Description copied from interface: VerifiedRequirementsManagerService
Removes a requirement from the step but not from the test case. If the requirement was not previously verified by the test step, nothing special happens.

Specified by:
removeVerifiedRequirementVersionsFromTestStep in interface VerifiedRequirementsManagerService


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