Executing Tests

## 5 Executing Tests

The Expression Language TCK uses the Junit framework to execute the tests.

This chapter includes the following topics:

- Starting the tests

- Running a Subset of the Tests

- Running the TCK Against your selected CI

- Running the TCK Against a Vendor’s Implementation

- Test Reports

Note | The instructions in this chapter assume that you have installed and configured your test environment as described in Chapter 3, "Installation," and Chapter 4, "Setup and Configuration,", respectively.

Note | The Jakarta Expression Language TCK is not depended on any particular build tool to run the tests. It will be convenient and advisable to create a Apache Maven project to setup and run the TCK. This chapter will henceforth use instructions and steps to provide setup with Apache Maven as a build tool.

### 5.1 Starting the tests

The Expression Language TCK can be run from the command line in your shell environment by executing the TCK jar.

Note | The `mvn` command referenced in the following two procedures and elsewhere in this guide is the Apache Maven build tool, which will need to be downloaded separately.

#### 5.1.1 To Start Tests in Command-Line Mode

Start the Junit tests using the following command:

    mvn verify

Example 5-1 Expression Language TCK Signature Tests

To run the Expression Language TCK signature tests, use the sigtest-maven-plugin in the TCK runner as below.

<plugin> <groupId>jakarta.tck</groupId> <artifactId>sigtest-maven-plugin</artifactId> <version>2.2</version> <configuration> <sigfile>path-to-sig-file-provided-with-TCK</sigfile> <packages>jakarta.el</packages> <classes>path-to-api-jar</classes> <report>target/sig-report.txt</report> </configuration> <executions> <execution> <id>sigtest</id> <goals> <goal>check</goal> </goals> <phase>verify</phase> </execution> </executions> </plugin>

Example 5-2 Single Test Directory

To run a single test directory, enter the following commands:

    mvn verify -Dit.test=com/sun/ts/tests/el/api/client.**

Example 5-3 Subset of Test Directories

To run a subset of test directories, enter the following commands:

    mvn verify -Dit.test=com/sun/ts/tests/el/api.**

### 5.2 Running a Subset of the Tests

Use the following modes to run a subset of the tests:

- Section 5.2.1, "To Run a Subset of Tests in Command-Line Mode"

#### 5.2.1 To Run a Subset of Tests in Command-Line Mode

Start the test run by executing the following command:

    mvn verify -Dit.test=com/sun/ts/tests/el/api.**

The tests in the directory and its subdirectories are run.

Note | Currently there are no Junit test tags(groups) available in the TCK.

#### 5.2.2 To Run a Group of Tests in Command-Line Mode

Start the test run by executing the following command:

    mvn verify -Dgroups={groupsExample}

Only the tests in the group `{groupsExample}` is run. Multiple groups can be separated by comma.

#### 5.2.3 To Exclude a Group of Tests in Command-Line Mode

Start the test run by executing the following command:

    mvn verify -DexcludedGroups={groupsExample}

The tests in the group `{groupsExample}` is exclued from the run. Multiple groups can be separated by comma.

### 5.3 Running Signature Test

sigtest-maven-plugin is used to run the EL signature test. Please refer the sample provided in the platform TCK repository.

Note | Use below configuration while using sigtest-maven-plugin with goal as `check`.
    <configuration>
        <sigfile>path-to-sig-file-provided-with-TCK</sigfile>
        <packages>jakarta.el</packages>
        <classes><path-to-api-jar</classes>
        <report>sig-report.txt</report>
    </configuration>

### 5.4 Running the TCK Against another CI

Some test scenarios are designed to ensure that the configuration and deployment of all the prebuilt Expression Language TCK tests against one Compatible Implementation are successful operating with other compatible implementations, and that the TCK is ready for compatibility testing against the Vendor and Compatible Implementations.

1. Verify that you have followed the configuration instructions in Section 4.1, "Configuring Your Environment to Run the TCK Against the Compatible Implementation."

2. If required, verify that you have completed the steps in Section 4.3.2, "Deploying the Prebuilt Archives."

3. Run the tests, as described in Section 5.1, "Starting the tests," and, if desired, Section 5.2, "Running a Subset of the Tests."

### 5.5 Running the TCK Against a Vendor’s Implementation

This test scenario is one of the compatibility test phases that all Vendors must pass.

1. Verify that you have followed the configuration instructions in Section 4.2, "Configuring Your Environment to Repackage and Run the TCK Against the Vendor Implementation."

2. If required, verify that you have completed the steps in Section 4.3.3, "Deploying the Test Applications Against the Vendor Implementation."

3. Run the tests, as described in Section 5.1, "Starting the tests," and, if desired, Section 5.2, "Running a Subset of the Tests."

### 5.6 Test Reports

A set of report files is created for every test run. These report files can be found in the target directory that the test is run. After a test run is completed, the Junit framework writes reports for the test run.

Copyright © 2017, 2021 Oracle and/or its affiliates. All rights reserved.