org.squashtest.tm.service.testautomation.spi
Interface TestAutomationConnector


public interface TestAutomationConnector


Method Summary
 boolean checkCredentials(org.squashtest.tm.domain.testautomation.TestAutomationServer server)
          Checks that the given server configuration (including credentials) actually works.
 void executeTests(Collection<org.squashtest.tm.domain.testautomation.AutomatedTest> tests, String reference)
          Given a bunch of tests, must tell the remote server to execute them.
 void executeTests(Collection<org.squashtest.tm.domain.testautomation.AutomatedTest> tests, String reference, TestAutomationCallbackService callbackService)
           Same than executeTests(Collection, String) (in particular, it must return as soon as the tests have started).
 String getConnectorKind()
          A String indicating which kind of connector it is
 Map<org.squashtest.tm.domain.testautomation.AutomatedTest,URL> getResultURLs(Collection<org.squashtest.tm.domain.testautomation.AutomatedTest> tests, String reference)
          Given a bunch of tests, must return the URLs of their executions, that can be identified by the reference.
 Collection<org.squashtest.tm.domain.testautomation.TestAutomationProject> listProjectsOnServer(org.squashtest.tm.domain.testautomation.TestAutomationServer server)
          Given a server (that contains everything you need to connect it), returns the collection of TestAutomationProject that it hosts.
 Collection<org.squashtest.tm.domain.testautomation.AutomatedTest> listTestsInProject(org.squashtest.tm.domain.testautomation.TestAutomationProject project)
          Given a project (that contains everything you need to connect it), returns the collection of AutomatedTest that it contains
 

Method Detail

getConnectorKind

String getConnectorKind()
A String indicating which kind of connector it is

Returns:

checkCredentials

boolean checkCredentials(org.squashtest.tm.domain.testautomation.TestAutomationServer server)
Checks that the given server configuration (including credentials) actually works.

Parameters:
server -
Returns:
true if the credentials work, false otherwise

listProjectsOnServer

Collection<org.squashtest.tm.domain.testautomation.TestAutomationProject> listProjectsOnServer(org.squashtest.tm.domain.testautomation.TestAutomationServer server)
                                                                                               throws ServerConnectionFailed,
                                                                                                      AccessDenied,
                                                                                                      UnreadableResponseException,
                                                                                                      NotFoundException,
                                                                                                      BadConfiguration,
                                                                                                      TestAutomationException

Given a server (that contains everything you need to connect it), returns the collection of TestAutomationProject that it hosts.

Parameters:
server -
Returns:
a Collection that may never be null if success
Throws:
ServerConnectionFailed - if could not connect to the server
AccessDenied - if the server was reached but the used user could log in
UnreadableResponseException - if the server replied something that is not suitable for a response or otherwise replied not nicely
NotFoundException - if the server could not find its projects
TestAutomationException - for anything that doesn't fit the exceptions above.
BadConfiguration

listTestsInProject

Collection<org.squashtest.tm.domain.testautomation.AutomatedTest> listTestsInProject(org.squashtest.tm.domain.testautomation.TestAutomationProject project)
                                                                                     throws ServerConnectionFailed,
                                                                                            AccessDenied,
                                                                                            UnreadableResponseException,
                                                                                            NotFoundException,
                                                                                            BadConfiguration,
                                                                                            TestAutomationException

Given a project (that contains everything you need to connect it), returns the collection of AutomatedTest that it contains

Parameters:
project -
Returns:
a Collection possibly empty but never null of TestAutomationTest if success
Throws:
ServerConnectionFailed - if could not connect to the server
AccessDenied - if the server was reached but the used user could log in
UnreadableResponseException - if the server replied something that is not suitable for a response or otherwise was rude to you
NotFoundException - if the tests in that project cannot be found
TestAutomationException - for anything that doesn't fit the exceptions above.
BadConfiguration

executeTests

void executeTests(Collection<org.squashtest.tm.domain.testautomation.AutomatedTest> tests,
                  String reference)
                  throws ServerConnectionFailed,
                         AccessDenied,
                         UnreadableResponseException,
                         NotFoundException,
                         BadConfiguration,
                         TestAutomationException

Given a bunch of tests, must tell the remote server to execute them. These particular executions of those tests are grouped and must be identifiable by a reference.

That method must return immediately after initiating the test start sequence, it must not wait for their completion. However it may possibly start a background task to oversee the remote executions from here.

Parameters:
tests - the tests that must be executed
reference - a reference that index the resulting executions of those tests
Throws:
ServerConnectionFailed - if could not connect to the server
AccessDenied - if the server was reached but the used user could log in
UnreadableResponseException - if the server replied something that is not suitable for a response or otherwise thrown garbages at you
NotFoundException - if the tests in that project cannot be found
TestAutomationException - for anything that doesn't fit the exceptions above.
BadConfiguration

executeTests

void executeTests(Collection<org.squashtest.tm.domain.testautomation.AutomatedTest> tests,
                  String reference,
                  TestAutomationCallbackService callbackService)
                  throws ServerConnectionFailed,
                         AccessDenied,
                         UnreadableResponseException,
                         NotFoundException,
                         BadConfiguration,
                         TestAutomationException

Same than executeTests(Collection, String) (in particular, it must return as soon as the tests have started). Then, later on in an asynchronous process it may use the callback service to provide TM with updates on the given executions when they are available.

The TestAutomationCallbackService instance will handle the security context for you.

Parameters:
tests - the tests that must be executed. These entities are detached copies of the real entities, so they won't keep a session or transaction stuck forever.
reference - a reference that index the resulting executions of those tests
Throws:
ServerConnectionFailed - if could not connect to the server
AccessDenied - if the server was reached but the used user could log in
UnreadableResponseException - if the server replied something that is not suitable for a response or otherwise returned gibberish
NotFoundException - if the tests in that project cannot be found
TestAutomationException - for anything that doesn't fit the exceptions above.
BadConfiguration

getResultURLs

Map<org.squashtest.tm.domain.testautomation.AutomatedTest,URL> getResultURLs(Collection<org.squashtest.tm.domain.testautomation.AutomatedTest> tests,
                                                                             String reference)
                                                                             throws ServerConnectionFailed,
                                                                                    AccessDenied,
                                                                                    UnreadableResponseException,
                                                                                    NotFoundException,
                                                                                    BadConfiguration,
                                                                                    TestAutomationException

Given a bunch of tests, must return the URLs of their executions, that can be identified by the reference. The is a map associating each test to the corresponding URL.

Parameters:
tests - the group of tests we want to know the URL where to look for the results.
reference - the reference of their executions.
Throws:
ServerConnectionFailed - if could not connect to the server
AccessDenied - if the server was reached but the used user could log in
UnreadableResponseException - if the server replied something that is not suitable for a response or otherwise used a too mature language for this audience
NotFoundException - if the tests in that project cannot be found
TestAutomationException - for anything that doesn't fit the exceptions above.
BadConfiguration


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