7. Governing SOA Through Test Automation
PushToTest TestMaker is architected to surface performance, interoperability and functional issues in service environments. It should be natural to expect that PushToTest runs as a service itself.
Governing SOA Through Test Automation
Overview
This section contains the following sections:
Governing SOA Through Test Automation
Governing Services Using Registry / Repository And Test Automation
Integrating SoftwareAG X-Registry and PushToTest TestMaker
Specification of the TestMaker / X-Registry Integration
Modify the TestNodes to Allow Them to Operate Multiple Tests Concurrently.
Develop a Class that Becomes a Service
Governing SOA Through Test Automation
PushToTest TestMaker is architected to surface performance, interoperability and functional issues in service environments. It should be natural to expect that PushToTest runs as a service itself.
Governing Services Using Registry / Repository And Test Automation
Software developers, QA technicians and IT managers are learning how SOA governance and test automation tools benefit their organization's ability to develop, manage and deliver services to determined quality levels. Examples of these governance platforms include SoftwareAG's X-Registry , BEA AquaLogic Enterprise Repository and IONA Repository . PushToTest publishes an open-source test automation tool that when combined with the power of an SOA repository delivers SOA governance benefits. PushToTest TestMaker delivers an inter-operability mechanism between the PushToTest test automation run-time and a repository platform:
- • Delivers immediate useful test automation functions to governance platform users.
- • Provides metadata for services being governed, including service up / down status, time-since-last-failure data, service deployment correct validation status and service reliability history.
- • Provides a mechanism to do service monitoring, scalability and performance tests managed by a governance platform.
- • Provides a widely-adopted test API, test runtime environment and test development toolkit to governance platform users.
An SOA governance platform provides controls and functions enabling enterprises to manage a set of interdependent information services. From the developer's perspective, a governance platform gives a developer a way to discover a service that implements a particular function which therefore wont need to be written. In an SOA context, governance adds a registry, enabling developers to search for services, a database of metadata about the services' qualities and a set of policies to control the service's use at development and deployment time. For example, a policy attached to a service creating new employee email accounts requiring a developer to also use service authorizing requests. Inter-operability between a governance and test automation platform, an example policy says, "You must run a test script successfully to verify this service is correctly configured before deploying this service to a production environment". This inter-operability, the governance tool manages policies, stores the functional tests scripts, issues a call for PushToTest to run a test and saves the results as metadata for the service entry in the repository. The inter-operability provides a way to accomplish "test by policy" methods.
A Practical Example

Using a governance platform, software developers and IT managers can see management policies prescribing developers to use a particular service or set of services in the application. The governance platform shows developers and IT managers service dependencies allowing them to determine a service's reliability and build redundancy into the service to handle instances when an upstream service goes down. Software developers can do this today, without SOA or governance platforms. For example, one developer may tell another about a great US Postal Zip code look-up service for use in a product registration Web page enabling users to type in their zip code and have the page automatically fill-in the city and state fields. The same developer may warn he noticed the service throws errors when used on the weekends. This developer-to-developer exchange conveys the following knowledge:
- • The existence and location of the Zip code look-up service
- • The service was not reliable on the weekends, but worked fine on weekdays
- • The service functioned according to its published schema
In an ideal world, the SOA governance platform conveys the same knowledge. For instance, a search showing a list of services and their metadata, including their up / down status.
Integration with PushToTest runtime provides knowledge about services, reliability and quality. In an SOA environment, PushToTest runtime drives a composite application using its native protocols to determine its functionality, scalability, performance and up-time. PushToTest is popular with software developers because it turns their existing unit and functional tests into SOA function, scalability, performance and service monitor tests automatically. Additionally, PushToTest is a distributed test automation platform where tests run on remote TestNodes on multiple networks and machines. IT managers, software developers and architects like PushToTest TestMaker because its’ tests provide knowledge feeds to governance tools, like:
Integrating SoftwareAG X-Registry and PushToTest TestMaker
PushToTest and SoftwareAG took the PushToTest As A Service concept into reality. A proof of concept (POC) project for adding governance information to SoftwareAG’s X-Registry . In the POC, TestMaker monitors a service registered in X-Registry and sends that service's governance results statistics information to the X-Registry governance’s registry system, including current up / down service status, time since last problem and average response times. Within X-Registry, the statistics appear as the registered service's metadata.
Introduction

TestMaker 5.x and later have the capacity to work as a soap-based Web service known as PushToTest As A Service (PAAS). SoftwareAG owns webMethods, a company providing business process integration to the world's largest corporations and government agencies. SoftwareAG publishes X-Registry (formerly WebMethods and Infravio X-Registry). X-Registry is a commercial software product providing registry, repository and governance essentials for successful company-wide adoption of service-oriented architecture (SOA). The integration of TestMaker and X-Registry delivers necessary functions to X-Registry users needing to govern services, by enabling X-Registry to realize the current state of a service and other governance information by adding PAAS to the governance platform. PAAS runs tests to the Web Services registered in X-Registry and stores governance information about the quality of those services. To accomplish this, several architectural and functional issues needed to be resolved:
- • Who will write the test?
- • How will PAAS information be accessed?
- • Who will update the governance repository’s information?
- • How often must governance information be updated?
- • How will the security issues be managed?
- • Does the monitor-test only check the system or should it also update the repository information?
Source Code, Resources, Files

All the necessary code, files and resources for this integration may be downloaded for free at:
Specification of the TestMaker / X-Registry Integration

This figure illustrates the implementation of the Proof of Concept:

The following steps demonstrate the integration.
0. User adds SendSMS to X-Registry
To compile SendSMS, use ant jar in the SendSMS folder.
- • In file SendSMS/dist/TOMCAT/bin run startup.sh or startup.cmd according your OS.
- • Add SendSMS to X-Registry
- • Log in to X-Registry system as a provider manager:


http://localhost:8686/SendSMS/ws/SMS?wsdl
where localhost is the name of the system hosting the SendSMS service
- 1. Connect to X-Registry
- • Start PAAS using the command startup.sh or startup.cmd according to your OS. The files are located in the directory TRUNK/tm5/testmaker_distribution/TestNetwork/TestNode/bin .
- • Start the PAAS test using the command PAASTest.bat or PAASTest.sh according to your OS. The files are located in the folder TRUNK/SendSMS .
- • The program will connect to X-Registry
- 2. Connect to PAAS
- • The program PAASTest will connect to both systems using web services:

- 3. PAAS check SendSMS Status
- • PAAS system will periodically check the Service SendSMS by a user-specified time; for POC this time is 2 minutes.
- • If the SendSMS test works, the system will state there were no errors.

- • If the service is not running or is not working as expected, PAAS will state the test failed with the reason for the failure

- 4. Get GSRS information from PAAS
- • The PAAS test will automatically get historical service information from PAAS
- • The service information is XML data known as GSRS (Governance Statistics Result Set)
- • The GSRS is known as PushToTest-Governance and the document PushToTest_Governance.pdf describes its specification and design
- • This is a sample GSRS for a correctly running service:
This is a sample GSRS for a service with a problem:
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
...
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
- 5. Update SendSMS information
- • PAAS will send the GSRS to X-Registry. Currently it is posted in the description place, but being restricted to 255 characters is a problem. The future plan is to have the GSRS file added as a separate file and a new field added to indicate the service status.
- • This figure shows a POC display of a service running as expected:


The preceding steps demonstrated how TestMaker monitors a service registered in X-Registry and sends service governance results statistics information, to X-Registry governance registry system, such as current up / down service status, time since last problem and average response times as well as how X-registry stores and displays registered service information as metadata.
The PAAS Interface
TestMaker is an automation framework with a distributed test environment to test services for functionality, scalability and performance. The TestMaker Console sends required information to specialized and optimized TestNodes (located on several computers), runs the tests and sends results back to the Console. The Console processes the results to create statistics files, charts and reports. A simplified workflow of TestMaker

TestMaker 5 enables the Console to receive soap-based Web service requests to operate a TestScenario. TestMaker has been upgraded to allow any application using a connector class to connect to the Console and run a test, with PushToTest As A Service. The upgraded workflow of TestMaker;

Three significant changes to TestMaker enabled the upgrade:
Modify the TestNodes to Allow Them to Operate Multiple Tests Concurrently.

In previous versions of the TestMaker TestNetwork architecture, TestNodes could receive instructions from only one Console. The new TestMaker 5 architecture allows TestNodes to receive instructions from multiple applications (Consoles), which has been checked for availability, stability and confidentiality.
- • Availability means a scenario can access all of its own resources.
To accomplish this, each scenario is given an unique ID in the form ID_ plus an ID number. Using the ID as its name, a directory (the application's root directory) is created and contains alll the resources of each test. - • Stability means any process can not affect any other process.
To accomplish this, each monitor is run as an isolated thread with its own variable and ClassLoader, used to load the new required jar resources for a JAVA test. - • Confidentiality means any scenario can not access any other scenario's data.
To accomplish this, each scenario only knows its own root directory.
Develop a Class that Becomes a Service

- • The goal was to create a new class and use Apache Axis to turn it into a Web Service. This involved two tasks, compiling the new class and configuring tomcat to accept the new service.
- • The new class needed to be simple, yet functional and complete as described in Classes.
Classes
Configuring Axis to accept the new class as a new service was surprisingly easy; simply add a new service tag to the Axis configuration file (server-config.wsdd)
The new service is located on the server at:
http://ServerName:8080/TestNetwork/ws/PAAS
The requests in the service WSDL definition are:
Develop a Class to Connect to PAAS

This is an interface between the application and PAAS. It is available as a standalone library for clients to connect their applications to the PAAS Farms. Class Method describes the class methods:
Class Method
|
PAASClient(String ServerURL, String Username, String Password) |
The class constructor; creates a new object for connecting to PAAS. The username and password are stored for future calls. The ServerURL is usually: http//ServerName:8080/TestNetwork/ws/PAAS |
|
Calls PAAS RunTest and returns the test status. Requires an array of files required by the scenario and the filename to be executed (only the name, not the full path). |
|
Example implementation
This code snippet shows a simple communication connection between an application and PAAS:
PAASClient client= null; // First we create the client
String [] files = new String[2]; // We add the required files
files[0] = "./SMSMonitor.xml"; // The Scenario
files[1]= "SendSMS.jar"; // The resources needed
String GSRSFile = "GSRS.xml"; // The file to save the GSRS
/* We create a client using the localhost as the server
* with pushtotest as the username and paas as the password
"http://localhost:8080/TestNetwork/ws/PAAS",
// We launch the test using the SMSMonitor.xml as the
client.doRunTest(files,"SMSMonitor.xml");
// If nothing goes wrong we inform of the success
System.out.println("Connection to PAAS Done");
// Something goes wrong, we inform the situation and quit
System.out.println("Connection to PAAS Failed");
* Every amount of time we read the current GSRS and show it in
client.doGetSnapshot(GSRSFile);
BufferedReader buff = new BufferedReader(new java.io.FileReader(src));
String line = buff.readLine();
//Prints lines of the of the Governance
try { Thread.sleep(10000); } catch (Exception e){}
//Errors obtaining the GSRS, we show it and quit
System.out.println("Error adding the GSRS");
We found these resources helpful while implementing PAAS:
Microsoft Developer Network: Software as a service
Microsoft Developer Network: Architecture Strategies for Catching the Long Tail
PAAS Response
Each PAAS request to TestMaker generates a PAAS response:
PAAS Request / TestMaker Response
Governance Statistics Result Set (GSRS)
PushToTest executes a test and returns a Governance Statistics Results Set (GSRS) response document. The XML Schema Definition (XSD) for the GSRS document is found in testmaker_home/example_agents/GSRS.xsd
![]() |
Additional documentation, product downloads and updates are at www.PushToTest.com. While the PushToTest testMaker software is distributed under an open-source license, the documenation remains (c) 2008 PushToTest. All rights reserved. PushToTest is a trademark of the PushToTest company. |

