org.squashtest.tm.service.internal.testautomation.service
Class TestAutomationManagementServiceImpl

java.lang.Object
  extended by org.squashtest.tm.service.internal.testautomation.service.TestAutomationManagementServiceImpl
All Implemented Interfaces:
InsecureTestAutomationManagementService, TestAutomationFinderService

@Transactional
@Service(value="squashtest.tm.service.TestAutomationService")
public class TestAutomationManagementServiceImpl
extends Object
implements InsecureTestAutomationManagementService


Constructor Summary
TestAutomationManagementServiceImpl()
           
 
Method Summary
 void fetchAllResultURL(org.squashtest.tm.domain.testautomation.TestAutomationProject project, org.squashtest.tm.domain.testautomation.AutomatedSuite suite)
          Will (attempt to) retrieve the result url for all the executions that belongs to a given automated suite, and of which tests belongs to a given project.
 org.squashtest.tm.domain.testautomation.AutomatedSuite findAutomatedTestSuiteById(String suiteId)
           
 List<org.squashtest.tm.domain.execution.Execution> findExecutionsByAutomatedTestSuiteId(String automatedTestSuiteId)
          Given the id of an automated test suite, returns the list of executions associated to this automated test suite.
 org.squashtest.tm.domain.testautomation.TestAutomationProject findProjectById(long projectId)
           
 org.squashtest.tm.domain.testautomation.AutomatedTest findTestById(long testId)
           
 org.squashtest.tm.domain.testautomation.TestAutomationServer getDefaultServer()
          That method returns the default server configuration.
 int getTimeoutMillis()
           
 Collection<org.squashtest.tm.domain.testautomation.TestAutomationProject> listProjectsOnServer(org.squashtest.tm.domain.testautomation.TestAutomationServer server)
          see TestAutomationFinderService.listProjectsOnServer(URL, String, String), using a TestAutomationServer for argument
 Collection<org.squashtest.tm.domain.testautomation.TestAutomationProject> listProjectsOnServer(URL serverURL, String login, String password)
          Given the URL of the test automation server, and the credentials required to connect it, will return the list of project currently available on it.
 Collection<TestAutomationProjectContent> listTestsInProjects(Collection<org.squashtest.tm.domain.testautomation.TestAutomationProject> projects)
          Given a collection of TestAutomationProject, will return the aggregated list of AutomatedTest paired with their owner project.
 org.squashtest.tm.domain.testautomation.AutomatedTest persistOrAttach(org.squashtest.tm.domain.testautomation.AutomatedTest newTest)
          Pretty much the same than InsecureTestAutomationManagementService.persistOrAttach(TestAutomationProject).
 org.squashtest.tm.domain.testautomation.TestAutomationProject persistOrAttach(org.squashtest.tm.domain.testautomation.TestAutomationProject newProject)
           Will persist the supplied remote TestAutomationProject.
 void setAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor executor)
           
 void setTimeoutMillis(int timeoutMillis)
           
 void startAutomatedSuite(org.squashtest.tm.domain.testautomation.AutomatedSuite suite)
          Will start a test suite, by dispatching the tests to the corresponding connectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestAutomationManagementServiceImpl

public TestAutomationManagementServiceImpl()
Method Detail

setAsyncTaskExecutor

@Inject
public void setAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor executor)

getTimeoutMillis

public int getTimeoutMillis()

setTimeoutMillis

public void setTimeoutMillis(int timeoutMillis)

listProjectsOnServer

public Collection<org.squashtest.tm.domain.testautomation.TestAutomationProject> listProjectsOnServer(org.squashtest.tm.domain.testautomation.TestAutomationServer server)
Description copied from interface: TestAutomationFinderService
see TestAutomationFinderService.listProjectsOnServer(URL, String, String), using a TestAutomationServer for argument

Specified by:
listProjectsOnServer in interface TestAutomationFinderService
Returns:

listProjectsOnServer

public Collection<org.squashtest.tm.domain.testautomation.TestAutomationProject> listProjectsOnServer(URL serverURL,
                                                                                                      String login,
                                                                                                      String password)
Description copied from interface: TestAutomationFinderService

Given the URL of the test automation server, and the credentials required to connect it, will return the list of project currently available on it. The credentials will be tested on the fly.

Specified by:
listProjectsOnServer in interface TestAutomationFinderService
Returns:
a collection of projects hosted on that server

listTestsInProjects

public Collection<TestAutomationProjectContent> listTestsInProjects(Collection<org.squashtest.tm.domain.testautomation.TestAutomationProject> projects)
Description copied from interface: TestAutomationFinderService
Given a collection of TestAutomationProject, will return the aggregated list of AutomatedTest paired with their owner project.

Specified by:
listTestsInProjects in interface TestAutomationFinderService
Returns:

findExecutionsByAutomatedTestSuiteId

@PostFilter(value="hasPermission(filterObject, \'READ\') or hasRole(\'ROLE_ADMIN\')")
@Transactional(readOnly=true)
public List<org.squashtest.tm.domain.execution.Execution> findExecutionsByAutomatedTestSuiteId(String automatedTestSuiteId)
Description copied from interface: TestAutomationFinderService
Given the id of an automated test suite, returns the list of executions associated to this automated test suite.

Specified by:
findExecutionsByAutomatedTestSuiteId in interface TestAutomationFinderService
Returns:

persistOrAttach

public org.squashtest.tm.domain.testautomation.TestAutomationProject persistOrAttach(org.squashtest.tm.domain.testautomation.TestAutomationProject newProject)
Description copied from interface: InsecureTestAutomationManagementService

Will persist the supplied remote TestAutomationProject. The argument must be attached to a TestAutomationServer and return it using TestAutomationProject.getServer().

The service will first try to reattach the server and project instance to existing instance in the database (See org.squashtest.tm.domain.testautomation package info for more about this), then persist the unknown entities.

That method returns the persisted instance of TestAutomationProject, that should be used in place of the one supplied in arguments from now on by the client code. That method is idempotent : an attached entity won't be peristed again.

Specified by:
persistOrAttach in interface InsecureTestAutomationManagementService

persistOrAttach

public org.squashtest.tm.domain.testautomation.AutomatedTest persistOrAttach(org.squashtest.tm.domain.testautomation.AutomatedTest newTest)
Description copied from interface: InsecureTestAutomationManagementService

Pretty much the same than InsecureTestAutomationManagementService.persistOrAttach(TestAutomationProject). The argument must be attached to a persisted and session-bound TestAutomationProject.

Same principles and same results apply here

Specified by:
persistOrAttach in interface InsecureTestAutomationManagementService
Returns:
a persisted TestAutomationTest, that should be used by the client code from now on.

findProjectById

public org.squashtest.tm.domain.testautomation.TestAutomationProject findProjectById(long projectId)
Specified by:
findProjectById in interface InsecureTestAutomationManagementService

findTestById

public org.squashtest.tm.domain.testautomation.AutomatedTest findTestById(long testId)
Specified by:
findTestById in interface InsecureTestAutomationManagementService

getDefaultServer

public org.squashtest.tm.domain.testautomation.TestAutomationServer getDefaultServer()
Description copied from interface: InsecureTestAutomationManagementService
That method returns the default server configuration. It is classified as insecure because a TestAutomationServer isn't a valid ACL entity, and yet it contains a password in clear (omg).

Specified by:
getDefaultServer in interface InsecureTestAutomationManagementService
Returns:
the default instance of TestAutomationServer.

startAutomatedSuite

public void startAutomatedSuite(org.squashtest.tm.domain.testautomation.AutomatedSuite suite)
Description copied from interface: InsecureTestAutomationManagementService
Will start a test suite, by dispatching the tests to the corresponding connectors.

Specified by:
startAutomatedSuite in interface InsecureTestAutomationManagementService

findAutomatedTestSuiteById

public org.squashtest.tm.domain.testautomation.AutomatedSuite findAutomatedTestSuiteById(String suiteId)
Specified by:
findAutomatedTestSuiteById in interface TestAutomationFinderService

fetchAllResultURL

public void fetchAllResultURL(org.squashtest.tm.domain.testautomation.TestAutomationProject project,
                              org.squashtest.tm.domain.testautomation.AutomatedSuite suite)
Description copied from interface: InsecureTestAutomationManagementService
Will (attempt to) retrieve the result url for all the executions that belongs to a given automated suite, and of which tests belongs to a given project.

Specified by:
fetchAllResultURL in interface InsecureTestAutomationManagementService


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