org.squashtest.tm.service.internal.campaign
Class CustomIterationModificationServiceImpl

java.lang.Object
  extended by org.squashtest.tm.service.internal.campaign.CustomIterationModificationServiceImpl
All Implemented Interfaces:
CustomIterationModificationService, IterationFinder, IterationTestPlanManager

@Service(value="CustomIterationModificationService")
@Transactional
public class CustomIterationModificationServiceImpl
extends Object
implements CustomIterationModificationService, IterationTestPlanManager


Constructor Summary
CustomIterationModificationServiceImpl()
           
 
Method Summary
 org.squashtest.tm.domain.execution.Execution addAutomatedExecution(org.squashtest.tm.domain.campaign.IterationTestPlanItem item)
           
 org.squashtest.tm.domain.execution.Execution addAutomatedExecution(long testPlanItemId)
           
 org.squashtest.tm.domain.execution.Execution addExecution(org.squashtest.tm.domain.campaign.IterationTestPlanItem item)
           
 org.squashtest.tm.domain.execution.Execution addExecution(long testPlanItemId)
           
 int addIterationToCampaign(org.squashtest.tm.domain.campaign.Iteration iteration, long campaignId, boolean copyTestPlan)
          Adds an iteration to the list of iterations of a campaign.
 void addTestSuite(org.squashtest.tm.domain.campaign.Iteration iteration, org.squashtest.tm.domain.campaign.TestSuite suite)
           
 void addTestSuite(long iterationId, org.squashtest.tm.domain.campaign.TestSuite suite)
           
 List<org.squashtest.tm.domain.campaign.TestSuite> copyPasteTestSuitesToIteration(Long[] testSuiteIds, long iterationId)
           will create a copy of the test suites and their test plan , then associate them to the given iteration
will rename test suites if there is name conflict at destination
 org.squashtest.tm.domain.campaign.TestSuite copyPasteTestSuiteToIteration(long testSuiteId, long iterationId)
           Will create a copy of the test suite and it's test plan , then associate it to the given iteration
will rename test suite if there is name conflict at destination
 org.squashtest.tm.domain.testautomation.AutomatedSuite createAndStartAutomatedSuite(List<org.squashtest.tm.domain.campaign.IterationTestPlanItem> testPlanItems)
           
 org.squashtest.tm.domain.testautomation.AutomatedSuite createAndStartAutomatedSuite(long iterationId)
          Create an automated execution for every automated item test plan in the given iteration, group them in an automated suite and tells the connector to process them.
 org.squashtest.tm.domain.testautomation.AutomatedSuite createAndStartAutomatedSuite(long iterationId, Collection<Long> testPlanIds)
          Create an automated execution for each of the test plan in arguments, group them in an automated suite and tells the connectors to process them .
 org.squashtest.tm.domain.testautomation.AutomatedSuite createAndStartAutomatedSuiteByITPIsIds(Collection<Long> testPlanIds)
           
 String delete(long iterationId)
           
 OperationReport deleteNodes(List<Long> targetIds)
          that method should delete the nodes.
 List<org.squashtest.tm.domain.execution.Execution> findAllExecutions(long iterationId)
           
 List<org.squashtest.tm.domain.campaign.TestSuite> findAllTestSuites(long iterationId)
           
 org.squashtest.tm.domain.campaign.Iteration findById(long iterationId)
           
 List<org.squashtest.tm.domain.execution.Execution> findExecutionsByTestPlan(long iterationId, long testPlanId)
           
 List<org.squashtest.tm.domain.campaign.Iteration> findIterationContainingTestCase(long testCaseId)
           
 List<org.squashtest.tm.domain.campaign.Iteration> findIterationsByCampaignId(long campaignId)
           
 List<org.squashtest.tm.domain.testcase.TestCase> findPlannedTestCases(long iterationId)
           
 IterationStatisticsBundle gatherIterationStatisticsBundle(long iterationId)
           
 OperationReport removeTestSuites(List<Long> suitesIds)
           That method will remove each test suite, leaving it's test plan items linked to no test_suite
 void rename(long iterationId, String newName)
           
 List<SuppressionPreviewReport> simulateDeletion(List<Long> targetIds)
          that method should investigate the consequences of the deletion request, and return a report about what will happen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomIterationModificationServiceImpl

public CustomIterationModificationServiceImpl()
Method Detail

addIterationToCampaign

@PreAuthorize(value="hasPermission(#campaignId, \'org.squashtest.tm.domain.campaign.Campaign\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public int addIterationToCampaign(org.squashtest.tm.domain.campaign.Iteration iteration,
                                               long campaignId,
                                               boolean copyTestPlan)
Description copied from interface: CustomIterationModificationService
Adds an iteration to the list of iterations of a campaign.

Specified by:
addIterationToCampaign in interface CustomIterationModificationService
Returns:
the index of the added iteration.

findIterationsByCampaignId

@PreAuthorize(value="hasPermission(#campaignId, \'org.squashtest.tm.domain.campaign.Campaign\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.campaign.Iteration> findIterationsByCampaignId(long campaignId)
Specified by:
findIterationsByCampaignId in interface IterationFinder

findById

@PostAuthorize(value="hasPermission(returnObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
@Transactional(readOnly=true)
public org.squashtest.tm.domain.campaign.Iteration findById(long iterationId)
Specified by:
findById in interface IterationFinder

delete

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'DELETE\') or hasRole(\'ROLE_ADMIN\')")
public String delete(long iterationId)
Specified by:
delete in interface CustomIterationModificationService

rename

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'WRITE\') or hasRole(\'ROLE_ADMIN\')")
public void rename(long iterationId,
                                String newName)
Specified by:
rename in interface CustomIterationModificationService

addExecution

@PreAuthorize(value="hasPermission(#testPlanItemId, \'org.squashtest.tm.domain.campaign.IterationTestPlanItem\', \'EXECUTE\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.domain.execution.Execution addExecution(long testPlanItemId)
Specified by:
addExecution in interface CustomIterationModificationService
See Also:
CustomIterationModificationService.addExecution(long)

addAutomatedExecution

@PreAuthorize(value="hasPermission(#testPlanItemId, \'org.squashtest.tm.domain.campaign.IterationTestPlanItem\', \'EXECUTE\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.domain.execution.Execution addAutomatedExecution(long testPlanItemId)
Specified by:
addAutomatedExecution in interface CustomIterationModificationService
See Also:
CustomIterationModificationService.addAutomatedExecution(long)

createAndStartAutomatedSuite

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

Specified by:
createAndStartAutomatedSuite in interface CustomIterationModificationService
Returns:
an AutomatedSuite

createAndStartAutomatedSuite

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'EXECUTE\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.domain.testautomation.AutomatedSuite createAndStartAutomatedSuite(long iterationId,
                                                                                                        Collection<Long> testPlanIds)
Description copied from interface: CustomIterationModificationService
Create an automated execution for each of the test plan in arguments, group them in an automated suite and tells the connectors to process them .

Specified by:
createAndStartAutomatedSuite in interface CustomIterationModificationService
Parameters:
iterationId - the id of the iteration that holds them all, and against which will be tested the user credentials
Returns:
an AutomatedSuite

findAllExecutions

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.execution.Execution> findAllExecutions(long iterationId)
Specified by:
findAllExecutions in interface IterationFinder

findExecutionsByTestPlan

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.execution.Execution> findExecutionsByTestPlan(long iterationId,
                                                                                                              long testPlanId)
Specified by:
findExecutionsByTestPlan in interface IterationFinder

findPlannedTestCases

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.testcase.TestCase> findPlannedTestCases(long iterationId)
Specified by:
findPlannedTestCases in interface IterationFinder

simulateDeletion

public List<SuppressionPreviewReport> simulateDeletion(List<Long> targetIds)
Description copied from interface: CustomIterationModificationService
that method should investigate the consequences of the deletion request, and return a report about what will happen.

Specified by:
simulateDeletion in interface CustomIterationModificationService
Returns:

deleteNodes

public OperationReport deleteNodes(List<Long> targetIds)
Description copied from interface: CustomIterationModificationService
that method should delete the nodes. It still takes care of non deletable nodes so the implementation should filter out the ids who can't be deleted.

Specified by:
deleteNodes in interface CustomIterationModificationService
Returns:

addTestSuite

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public void addTestSuite(long iterationId,
                                      org.squashtest.tm.domain.campaign.TestSuite suite)
Specified by:
addTestSuite in interface CustomIterationModificationService

addTestSuite

public void addTestSuite(org.squashtest.tm.domain.campaign.Iteration iteration,
                         org.squashtest.tm.domain.campaign.TestSuite suite)
Specified by:
addTestSuite in interface IterationTestPlanManager

findAllTestSuites

@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.campaign.TestSuite> findAllTestSuites(long iterationId)
Specified by:
findAllTestSuites in interface CustomIterationModificationService

copyPasteTestSuiteToIteration

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public org.squashtest.tm.domain.campaign.TestSuite copyPasteTestSuiteToIteration(long testSuiteId,
                                                                                              long iterationId)
Description copied from interface: CustomIterationModificationService

Will create a copy of the test suite and it's test plan , then associate it to the given iteration
will rename test suite if there is name conflict at destination

Specified by:
copyPasteTestSuiteToIteration in interface CustomIterationModificationService
Parameters:
testSuiteId - = test suite to copy
iterationId - = iteration where to add the copy of the test suite
Returns:
the copy of the test suite

copyPasteTestSuitesToIteration

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.tm.domain.campaign.Iteration\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public List<org.squashtest.tm.domain.campaign.TestSuite> copyPasteTestSuitesToIteration(Long[] testSuiteIds,
                                                                                                     long iterationId)
Description copied from interface: CustomIterationModificationService

will create a copy of the test suites and their test plan , then associate them to the given iteration
will rename test suites if there is name conflict at destination

Specified by:
copyPasteTestSuitesToIteration in interface CustomIterationModificationService
Parameters:
testSuiteIds - = list of test suites to copy
iterationId - = iteration where to add the copy of the test suite
Returns:
the list containing all the copies of the test suites

removeTestSuites

public OperationReport removeTestSuites(List<Long> suitesIds)
Description copied from interface: CustomIterationModificationService

That method will remove each test suite, leaving it's test plan items linked to no test_suite

Specified by:
removeTestSuites in interface CustomIterationModificationService
Returns:

addExecution

public org.squashtest.tm.domain.execution.Execution addExecution(org.squashtest.tm.domain.campaign.IterationTestPlanItem item)
                                                          throws org.squashtest.tm.exception.execution.TestPlanItemNotExecutableException
Specified by:
addExecution in interface IterationTestPlanManager
Throws:
org.squashtest.tm.exception.execution.TestPlanItemNotExecutableException

addAutomatedExecution

public org.squashtest.tm.domain.execution.Execution addAutomatedExecution(org.squashtest.tm.domain.campaign.IterationTestPlanItem item)
                                                                   throws org.squashtest.tm.exception.execution.TestPlanItemNotExecutableException
Specified by:
addAutomatedExecution in interface IterationTestPlanManager
Throws:
org.squashtest.tm.exception.execution.TestPlanItemNotExecutableException

createAndStartAutomatedSuite

public org.squashtest.tm.domain.testautomation.AutomatedSuite createAndStartAutomatedSuite(List<org.squashtest.tm.domain.campaign.IterationTestPlanItem> testPlanItems)
Specified by:
createAndStartAutomatedSuite in interface IterationTestPlanManager

createAndStartAutomatedSuiteByITPIsIds

public org.squashtest.tm.domain.testautomation.AutomatedSuite createAndStartAutomatedSuiteByITPIsIds(Collection<Long> testPlanIds)
Specified by:
createAndStartAutomatedSuiteByITPIsIds in interface IterationTestPlanManager

findIterationContainingTestCase

public List<org.squashtest.tm.domain.campaign.Iteration> findIterationContainingTestCase(long testCaseId)
Specified by:
findIterationContainingTestCase in interface IterationFinder

gatherIterationStatisticsBundle

public IterationStatisticsBundle gatherIterationStatisticsBundle(long iterationId)
Specified by:
gatherIterationStatisticsBundle in interface CustomIterationModificationService


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