This topic explains how to build a custom integration to any source control system.
In this section:
Table of Contents | ||
---|---|---|
|
Introduction
SOAtest has builtin support for most common version control / source control systems, such as SVN and Git. See Connecting to Your Source Control Repository for details. Additionally, SOAtest includes an open Source Control API, which allows other source control tools to be integrated with SOAtest.
API Javadoc
The Source Control API includes an open_api_javadoc.zip file containing Javadoc documentation for all classes and interfaces that must be implemented. The Javadoc archive file is located in the <INSTALL>/plugins/com.parasoft.ptest.sourcecontrol.eclipse.core/openapi/ directory.
Main Interfaces
The interface that connects and creates all required implementation is com.parasoft.ptest.sourcecontrol.openapi.IVersionControlFactory.
This factory provides specific implementation for the following interfaces:
- com.parasoft.ptest.sourcecontrol.openapi.IRepositoryDetector
- com.parasoft.ptest.sourcecontrol.openapi.IVersionControl
- com.parasoft.ptest.sourcecontrol.openapi.IVersionControlHelper
Implementation and Compilation
The source control API and all related classes are located in the sourcecontrol.jar file located in the <INSTALL>/plugins/com.parasoft.ptest.libs_<VERSION>/Parasoft directory.
Before you can compile, you may need to add the following additional jar files to your classpath:
- util.jar
- common.jar
- preference_api.jar
All JAR files are located in the <INSTALL>/plugins/com.parasoft.ptest.libs_<VERSION> directory.
To implement a custom integration:
- Create a project in any location.
- Add the required jars to the project's classpath.
- Start implementing custom version control support. Begin with the IVersionControlFactory implementation and incrementally add the required classes.
Deployment and Verification
After implementation is completed:
- Create a single jar file containing all of the required classes. There are no specific rules concerning the jar file name or package names etc.
- Copy your jar file into the <INSTALL>/plugins/com.parasoft.ptest.sourcecontrol.eclipse.core/ext directory and restart SOAtest.
- Verify the implementation as follows:
- Choose Parasoft> Preferences> Source Control and disable the Use DTP settings option.
- Verify that an option for your implementation name appears among the builtin version controls.
- Enable the option for your implementation and click New.
- Add the required properties, and click Apply.
- Choose Preferences> Scope and Authorship and verify that Use source control to compute scope is enabled.
- Open a file controlled by your version control system and right-click anywhere in the file’s source code
- Choose Show author at line. You should see valid version control author information.
Sample Implementation
SOAtest ships with a sample implementation for the Source Control Open API. A zipped package is located in <INSTALL>/plugins/com.parasoft.ptest.sourcecontrol.eclipse.core_<VERSION>/openapi/demo.
Create the following directory structure after extracting the open_api_demo.zip file:
- open_api_demo/demo.jar - Contains a compiled version of the demo source control implementation for Eclipse.
- open_api_demo/src/* - This is the source code for the Open API demo implementation.
- open_api_demo/local_repository/* - This is a sample Eclipse project for demonstration purposes.
The demo was compiled using JDK 1.6.0_29.
You can compile and deploy it using the procedures described in the preceding section.
To interact with the demo:
- Deploy the demo.jar file.
- Unpack the local repository to any location.
- Restart your Parasoft Test product.
- Import the demo local repository project into your workspace.
- Under Parasoft> Preferences> Source Control, enable the demo implementation.
- Open a file, right-click anywhere in the file’s source code, then choose Show author at line. You should see valid version control author information.