CTK Test Runner Requirements

JOSIF Main Page | JOSIF Platform | Prototype CTK RI Project | CTK Test Runner Requirements

Introduction

This page describes the JOSIF CTK Test Runner which is generated with interface specifications as a starting point for implementing full Compatibility Test Kits (CTK)

CTK Framework Phase 1 (16/8/11)

The JOSIF CTK framework is packaged as a simple war which can run in jetty. To run the framework from maven,

1. Build the entire project from the bvase project to make sure that you have al the required dependencies

2. open a terminal in the CTK project

3. type mvn jetty:run-war

4. The CTK will host a web browser at http//localhost:9091/CTK

5. The address of the RI to which the CTK tries to connect is set by the file src/main/resources/tipinterface.properties

 
  1. This file is used to set the instance specific URL for the service
  1. http://<hostAddress>:<hostPort>/<systemName>/<serviceContext>/<InterfaceName>
  1. <InterfaceName> is standardised in the build for the particular interface
  1. org.openoss.tip.interface.hostAddress=localhost

org.openoss.tip.interface.hostAddress=88.96.72.51
org.openoss.tip.interface.hostPort=9090
org.openoss.tip.interface.systemName=RI
org.openoss.tip.interface.serviceContext=services

 

You can run an RI and CTK on the same machine as they use different ports.
The address/port 88.96.72.51:9090 is the current address of the hosted RI.

The present CTK uses a simple web app having a single JSP. This provides buttons to run the tests and view the results. The CTK uses the testNG framework (http://testng.org) and the Spring Test testNG integration (http://static.springsource.org/spring/docs/2.5.x)/reference/testing.html. The Run Tests action of the Test.jsp starts a new instance of the TestNG test runner which discovers and runs all of the annotated tests in a given class path.

All of the tests in the JOSIF CTK framework inherit from

org.openoss.test.BaseTestNGTestClass.java

in the TIP_EjbImpl_BaseClasses project. In Josif Release 1.1, this class contained a static reference to an application context which was used by all of the tests which inherited from it. This worked fine but was not a suitable strategy for running tests in a web app which might be simultaneously used by more than one user ( multi threading).

This strategy has been replaced by having the BaseTestNGTestClass inherit from

org.springframework.test.context.testng.AbstractTestNGSpringContextTests

which allows each test to pick up a common spring application context (TestContext) without using a static reference.

@ContextConfiguration(locations=\{"/BaseTestNGTestClass-context.xml"\})
public class BaseTestNGTestClass extends org.springframework.test.context.testng.AbstractTestNGSpringContextTests\{
...

In the present implementation this common TestContext defined in BaseTestNGTestClass-context.xml is simply used as a container for all tests to access the same application context which is constructed from properties files when the BaseTestNGTestClass is first run. This simply avoids a static reference to the application context. There may be opportunity in the future to simplify the application context construction but for now the constructed application context against which the tests run is the same as in JOSIF Release 1.1 for backwards compatibility.

Initial Requirements

The basic CTK Framework provided in Phase 1 is a functional starting point. However the full CTK framework will need the following features added.

The following requirements are sufficient for the first release of the CTK framework

1.Use Spring MVC (see http://static.springsource.org/spring/docs/2.0.x/reference/mvc.html)

The present simple JSP application needs replaced with a more sophisticated Spring MVC web app. This will proved a consistent framework for developing a complex CTK implementation. In the first instance the simple web page and JSP should be incorporated into a Spring MVC implementation where the page flow is controlled by Spring MVC rather than directly in the pages links. This will give us a good starting point for enabling web based test configuration. The RI code provides an example of how to run a spring application context from within a war in jetty 6 (This is used to run Apache CXF in the RI). Wiring Spring MVC into a webapp in jetty should be a fairly simple extension.

2. User web configuration of CTK

Provide a page for users to change the configuration data initially in tipinterface.properties to change the address which the tests run against. tipinterface.properties can provide the defaults (which will be set to run against the hosted RI) while users can change the setting to suit their environment.

3. List test documentation

Provide a page which lists all the tests discovered by TestNG using the data taken from the @test description annotation. This will be the primary way in which tests are documented in the code and the test results. Allow these tests to be shown in a hierarchy of groups and pre and post tests.

4. Select and run Tests

Allow users to select individual tests or groups of tests to run from the UI and run those tests

Advanced Requirements

These requirements are for future releases of the CTK framework

1. Allow more than one session to run simultaneously - with different user configurations

The present implementation can only support one user at a time, this is primarily because the generated test results are placed in a single directory and different user tests would overwrite each other.This is fine for a stand alone CTK but needs enhanced for a multi user CTK.

2. User login with persisted user accounts containing their test configurations and test results

3. Extend the framework to allow more than one CTK (or CTK version) to be accessed from a user account