Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space CPPTDESKDEV and version 2020.1

This topic explains how to build a custom integration to any source control system you want to integrate with C/C++test. In this section:

Table of Contents
maxLevel1

Introduction

C/C++test ships with support for most common version control / source control systems, such as SVN or Git; see Connecting to Source Control for details. In addition, it provides an open Source Control API, which allows other source control tools to integrate with C/C++test.

API Javadoc

C/C++test provides Source Control API documentation that includes Javadoc documentation for all classes and interfaces that must be implemented. The Javadoc documentation is available in the installation directory of C/C++test submodule, Parasoft Test: [INSTALL_DIR]\[version]\plugins\com.parasoft.xtest.sourcecontrol.eclipse.core_[version]\javadoc\com\parasoft\xtest\sourcecontrol\openapi".

Main Interfaces

The interface that connects and creates all required implementation is com.parasoft.xtest.sourcecontrol.openapi.IVersionControlFactory.

This factory provides specific implementation for the following interfaces:

  • com.parasoft.xtest.sourcecontrol.openapi.IRepositoryDetector
  • com.parasoft.xtest.sourcecontrol.openapi.IVersionControl
  • com.parasoft.xtest.sourcecontrol.openapi.IVersionControlHelper

Implementation and Compilation

The source control API and all related classes are located in the jar file in [INSTALL_DIR]\plugins\com.parasoft.xtest.libs/Parasoft/sourcecontrol.jar.

Before you can compile, you may need to add the following additional jar files to your classpath:

  • [INSTALL_DIR]\com.parasoft.xtest.libs/Parasoft/util.jar
  • [INSTALL_DIR]\com.parasoft.xtest.libs/Parasoft/common.jar
  • [INSTALL_DIR]\com.parasoft.xtest.libs/Parasoft/preference_api.jar

To implement a custom integration:

  1. Create a project in any location.
  2. Add the required jars to the project's classpath.
  3. Start implementing custom version control support. Begin with the IVersionControlFactory implementation and incrementally add the required classes.

Deployment and Verification

After implementation is completed:

  1. 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.
  2. Copy your jar file into the following location in the Parasoft Test installation directory: [INSTALL_DIR]\plugins\com.parasoft.xtest.sourcecontrol.eclipse.core\ext.
  3. Restart C/C++test.
  4. Verify the implementation as follows:
    1. Choose Parasoft> Preferences> Source Control.
    2. Ensure that Use DTP settings is cleared.
    3. Verify that a checkbox with your implementation name appears among the builtin version controls.
    4. Select the checkbox for your implementation, click New, add the required properties, and then click Apply.
    5. Go to the Preferences> Scope and Authorship page and verify that Use source control to compute scope is enabled.
    6. Open a file controlled by your version control system, right-click anywhere in the file’s source code, then choose Show author at line. You should see valid version control author information.

Sample Implementation

C/C++test provides a sample implementation for the Source Control Open API. A zipped package is located in [INSTALL_DIR]\plugins\com.parasoft.xtest.sourcecontrol.eclipse.core\openapi\demo\.

After you extract the open_api_demo.zip file, the following directory structure should be created:

  • open_api_demo/demo.jar - Contains a compiled version of the demo source control implementation for Eclipse.
  • open_api_demo/demo.dll - Contains a compiled version of the demo source control implementation for Visual Studio 2005 or later.
  • 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 play with the demo:

  1. Deploy the demo.jar file.
  2. Unpack the local repository to any location.
  3. Restart C++test.
  4. Import the demo local repository project into your workspace.
  5. Under Parasoft> Preferences> Source Control, enable the demo implementation.



  6. Click New and provide the required properties; then click Check Connection to verify the connection with the server.
  7. 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.