CodeSVby CA Technologies

Quick Start Guide

< Back

CA CodeSV is available on Maven repository or for installation from GitHub. You can clone the example project or download the product directly from the CodeSV GitHub page.

Configure Your Project

Choose from one of the setup options below to configure CodeSV:

Maven Setup

To add the CodeSV product dependency to your Maven project follow these steps:

  1. Modify your pom.xml by adding the CA repository
    <repositories>
    <!-- your other repositories -->
    <repository>
    <id>bintray-ca-sv</id>
    <name>bintray-ca</name>
    <url>http://ca.bintray.com/sv</url>
    </repository>
    </repositories>
  2. Add the CodeSV product dependency:
    <dependency>
    <groupId>com.ca.codesv</groupId>
    <artifactId>codesv-dist-jar</artifactId>
    <version>1.2.0</version>
    </dependency>

Gradle Setup

To add CodeSV product dependency to your Gradle project follow these steps:

  1. Modify your build.gradle by adding the CA repository:
    repositories {
    maven {
    url "http://ca.bintray.com/sv"
    }
    }
  2. Add the CodeSV product dependency:
    dependencies {
    compile 'com.ca.codesv:codesv-dist-jar:1.2.0'
    }

Manual Setup

  1. Access the following URL: https://github.com/CA-DevTest/CodeSV.
  2. Click Release.
  3. Download the zip file for the latest release. You can also clone the project by clicking Clone or download on the main page.
  4. Extract the downloaded codesv-dist-<version>.zip file.
  5. Add the .jar files in the lib directory as dependencies to your project classpath.
  6. Add the codesv-*.jar files to your project classpath.

Ready To Go

The example below will allow you to run a jUnit test running an embedded virtual service using CodeSV.

  1. Add the following imports to your jUnit test class:
    import static com.ca.codesv.protocols.http.fluent.HttpFluentInterface.*; 
    import com.ca.codesv.engine.junit4.VirtualServerRule;
  2. Create a jUnit Rule and a test method with the specification of a new virtualized service.
    @Rule
    public VirtualServerRule vs = new VirtualServerRule();
    
    @Test
    public void testBasicExample() throws IOException {
    forGet("http://customUrl:8542/test/url").doReturn(
    okMessage()
    .withStringBody("Success")
    );
    }

More Information

For more code examples, see Code Library.

For API documentation, see Javadoc.

For more information, to share ideas, or to raise issues, see the CA Service Virtualization/DevTest community page.