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

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

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


Constructor Summary
CustomIterationModificationServiceImpl()
           
 
Method Summary
 Execution addAutomatedExecution(IterationTestPlanItem item)
           
 Execution addAutomatedExecution(long iterationId, long testPlanId)
           
 Execution addExecution(IterationTestPlanItem item)
           
 Execution addExecution(long iterationId, long testPlanId)
           
 int addIterationToCampaign(Iteration iteration, long campaignId, boolean copyTestPlan)
          Adds an iteration to the list of iterations of a campaign.
 void addTestSuite(Iteration iteration, TestSuite suite)
           
 void addTestSuite(long iterationId, TestSuite suite)
           
 void changeTestPlanPosition(long iterationId, int newPosition, List<Long> itemIds)
           
 List<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
 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
 AutomatedSuite createAutomatedSuite(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.
 AutomatedSuite createAutomatedSuite(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 .
 String delete(long iterationId)
           
 List<Long> deleteNodes(List<Long> targetIds)
          that method should delete the nodes.
 List<IterationTestPlanItem> filterIterationForCurrentUser(long iterationId)
          Returns an iteration filtered for a specific user.
 List<Execution> findAllExecutions(long iterationId)
           
 List<TestSuite> findAllTestSuites(long iterationId)
           
 Iteration findById(long iterationId)
           
 List<Execution> findExecutionsByTestPlan(long iterationId, long testPlanId)
           
 List<Iteration> findIterationsByCampaignId(long campaignId)
           
 List<TestCase> findPlannedTestCases(long iterationId)
           
 TestPlanStatistics getIterationStatistics(long iterationId)
           
 List<Long> 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)
           
 void setUserAccountService(UserAccountService service)
           
 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

setUserAccountService

@ServiceReference
public void setUserAccountService(UserAccountService service)

addIterationToCampaign

@PreAuthorize(value="hasPermission(#campaignId, \'org.squashtest.csp.tm.domain.campaign.Campaign\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public int addIterationToCampaign(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.csp.tm.domain.campaign.Campaign\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<Iteration> findIterationsByCampaignId(long campaignId)
Specified by:
findIterationsByCampaignId in interface IterationFinder

findById

@PostAuthorize(value="hasPermission(returnObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public Iteration findById(long iterationId)
Specified by:
findById in interface IterationFinder

delete

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.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.csp.tm.domain.campaign.Iteration\', \'SMALL_EDIT\') or hasRole(\'ROLE_ADMIN\')")
public void rename(long iterationId,
                                String newName)
Specified by:
rename in interface CustomIterationModificationService

addExecution

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'EXECUTE\') or hasRole(\'ROLE_ADMIN\')")
public Execution addExecution(long iterationId,
                                           long testPlanId)
Specified by:
addExecution in interface CustomIterationModificationService

addAutomatedExecution

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'EXECUTE\') or hasRole(\'ROLE_ADMIN\')")
public Execution addAutomatedExecution(long iterationId,
                                                    long testPlanId)
Specified by:
addAutomatedExecution in interface CustomIterationModificationService

createAutomatedSuite

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'EXECUTE\') or hasRole(\'ROLE_ADMIN\')")
public AutomatedSuite createAutomatedSuite(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:
createAutomatedSuite in interface CustomIterationModificationService
Returns:
an AutomatedSuite

createAutomatedSuite

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'EXECUTE\') or hasRole(\'ROLE_ADMIN\')")
public AutomatedSuite createAutomatedSuite(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:
createAutomatedSuite 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

changeTestPlanPosition

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'LINK\') or hasRole(\'ROLE_ADMIN\')")
public void changeTestPlanPosition(long iterationId,
                                                int newPosition,
                                                List<Long> itemIds)
Specified by:
changeTestPlanPosition in interface CustomIterationModificationService
See Also:
CustomIterationModificationService.changeTestPlanPosition(long, int, List)

findAllExecutions

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

findExecutionsByTestPlan

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

findPlannedTestCases

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<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 List<Long> 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.csp.tm.domain.campaign.Iteration\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public void addTestSuite(long iterationId,
                                      TestSuite suite)
Specified by:
addTestSuite in interface CustomIterationModificationService

addTestSuite

public void addTestSuite(Iteration iteration,
                         TestSuite suite)
Specified by:
addTestSuite in interface IterationTestPlanManager

findAllTestSuites

@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
public List<TestSuite> findAllTestSuites(long iterationId)
Specified by:
findAllTestSuites in interface CustomIterationModificationService

copyPasteTestSuiteToIteration

@PreAuthorize(value="hasPermission(#iterationId, \'org.squashtest.csp.tm.domain.campaign.Iteration\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public 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.csp.tm.domain.campaign.Iteration\', \'CREATE\') or hasRole(\'ROLE_ADMIN\')")
public List<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 List<Long> 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:
the deleted suitesIds

addExecution

public Execution addExecution(IterationTestPlanItem item)
                       throws TestPlanItemNotExecutableException
Specified by:
addExecution in interface IterationTestPlanManager
Throws:
TestPlanItemNotExecutableException

addAutomatedExecution

public Execution addAutomatedExecution(IterationTestPlanItem item)
                                throws TestPlanItemNotExecutableException
Throws:
TestPlanItemNotExecutableException

getIterationStatistics

public TestPlanStatistics getIterationStatistics(long iterationId)
Specified by:
getIterationStatistics in interface IterationFinder

filterIterationForCurrentUser

public List<IterationTestPlanItem> filterIterationForCurrentUser(long iterationId)
Description copied from interface: IterationFinder
Returns an iteration filtered for a specific user. It returns an iteration with a test plan containing only the items that are assigned to that user or have been executed by that user.

Specified by:
filterIterationForCurrentUser in interface IterationFinder
Returns:


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