Skip to content

Test case generators

Alberto Martín López edited this page Jun 1, 2020 · 4 revisions

Table of contents

  1. Abstract test case generator
  2. Currently supported test case generators
    1. Random test case generator
    2. Constraint-based test case generator
  3. How to create a new test case generator

Abstract test case generator

WIP

Currently supported test case generators

WIP

Random test case generator

WIP

Constraint-based test case generator

WIP

How to create a new test case generator

You can implement a new test case generator extending the AbstractTestCaseGenerator class. You have to implement—at least⁠—the following methods:

  • Collection<TestCase> generateOperationTestCases(Operation specOperation, es.us.isa.restest.configuration.pojos.Operation testOperation, String path, HttpMethod method). This method must generate a collection of test cases for a specific operation you want to test.
  • TestCase generateNextTestCase(Operation specOperation, es.us.isa.restest.configuration.pojos.Operation testOperation, String path, HttpMethod method, String faultyReason). You will use this method in the previous one to generate each test case. The method must generate a test case for a specific operation.
  • boolean hasNext(). The method must return true if there are more test cases to be generated.

You will have to modify the createGenerator() method of the IterativeExample class to add support for your test case generator. You may have to add new parameters to the properties file to fully support your new generator.