Skip to content

Commit c35f52e

Browse files
Release 4.0.1 (#271)
1 parent 39bc7ae commit c35f52e

20 files changed

Lines changed: 124 additions & 23 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Tcases: A Model-Based Test Case Generator #
22

3-
[![Maven](https://img.shields.io/badge/maven-4.0.0-green.svg)](https://search.maven.org/search?q=tcases-shell)
4-
[![Javadoc](https://img.shields.io/badge/javadoc-4.0.0-green.svg)](https://javadoc.io/doc/org.cornutum.tcases/tcases-shell)
3+
[![Maven](https://img.shields.io/badge/maven-4.0.1-green.svg)](https://search.maven.org/search?q=tcases-shell)
4+
[![Javadoc](https://img.shields.io/badge/javadoc-4.0.1-green.svg)](https://javadoc.io/doc/org.cornutum.tcases/tcases-shell)
55

66
## What's New? ##
7-
* The latest version ([Tcases 4.0.0](ReleaseNotes.md#400)) is now available at the Maven Central Repository.
7+
* The latest version ([Tcases 4.0.1](ReleaseNotes.md#401)) is now available at the Maven Central Repository.
88
See [*How To Download Tcases*](HowToDownload.md) for download instructions.
99

10-
* With Tcases 4.0.0, JSON becomes the preferred format for all Tcases documents. Also new in this release:
11-
[schema-based value definitions](./Tcases-Guide.md#defining-value-schemas) and the
12-
[`tcases-copy`](./Tcases-Guide.md#copying-a-tcases-project) command.
10+
* Tcases 4.0.1 provides several improvements, including a new guide to [using the Tcases API](Using-Tcases-API.md).
11+
See the [release notes](ReleaseNotes.md#401) for details.
1312

1413
* Having trouble with Tcases? Check out [these tips](./Troubleshooting-FAQs.md).
1514

@@ -67,6 +66,7 @@ definition into a Java source code template for a JUnit or TestNG test class.
6766
* **Helpful Guides**
6867
* [How To Download Using Maven](HowToDownload.md)
6968
* [How To Setup a Tcases Web Service](./Tcases-Web-Service.md)
69+
* [Using The Tcases API](./Using-Tcases-API.md)
7070
* [Troubleshooting FAQ](./Troubleshooting-FAQs.md#troubleshooting-faqs)
7171
* [Release Notes](ReleaseNotes.md)
7272

ReleaseNotes.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Release Notes #
22

3+
## 4.0.1 ##
4+
5+
This release provides the following improvements.
6+
7+
* **Using the Tcases API to generate tests**
8+
9+
The Tcases command line interface is implemented using a Java API. You can use the same API to do all of the same things in
10+
your own Java program, including creating a system input definition, generating test cases, and reading or writing Tcases
11+
documents. For details, see [_Using The Tcases API_](./Using-Tcases-API.md).
12+
13+
Thanks to [grzegorzgrzegorz](https://github.com/grzegorzgrzegorz) for inspiring improvements to make this API easier to use.
14+
15+
* **`Tcases::getTests`: Resolve schemas by default**
16+
17+
The [`Tcases::getTests`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/Tcases.html#getTests-org.cornutum.tcases.SystemInputDef-org.cornutum.tcases.generator.IGeneratorSet-org.cornutum.tcases.resolve.TestCaseResolverFactory-org.cornutum.tcases.SystemTestDef-org.cornutum.tcases.generator.GeneratorOptions-)
18+
method is the basic interface for generating test cases. It includes an optional
19+
[`TestCaseResolverFactory`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/resolve/TestCaseResolverFactory.html)
20+
parameter that defines how test case values are resolved. In this release, the default `TestCaseResolverFactory` uses the
21+
schemas defined by variable definitions and value definitions to resolve test case values.
22+
23+
* **`Tcases::getEffectiveInputDef`: Normalize all schemas**
24+
25+
In this release, the `Tcases::getEffectiveInputDef` method ensures that all schema definitions in the resulting system input
26+
definition have been "normalized". Schema normalization updates the original schema definition to resolve any
27+
inconsistencies. For example, a schema that defined both `"minimum": 0` and `"exclusiveMinimum": 1` would be normalized to
28+
define only `"minimum": 2`. Any change made during schema normalization is reported in a log message.
29+
30+
* **Upgraded dependencies**
31+
32+
Upgraded to swagger-parser 2.1.10.
33+
334
## 4.0.0 ##
435

536
With this major release, JSON becomes the preferred format for all Tcases documents. From now on, unless otherwise stated, new

Using-Tcases-API.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Using The Tcases API #
2+
3+
## Tcases In Code ##
4+
5+
The Tcases command line interface is implemented using a Java API. You can use the same API to do all of the same things in your own Java program,
6+
including [creating a system input definition](#builders), [generating test cases](#test-cases), and [reading or writing Tcases documents](#documents).
7+
8+
## Builders ##
9+
10+
The [`tcases-lib`](https://search.maven.org/search?q=g:org.cornutum.tcases%20AND%20a:tcases-lib) JAR contains all of the core
11+
classes needed to create a [system input definition](Tcases-Guide.md#defining-system-functions). You can use methods from the
12+
[`SystemInputs`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/SystemInputs.html) class for a fluent interface to
13+
the various builder classes needed to construct a complete [`SystemInputDef`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/SystemInputDef.html).
14+
For a complete example, see the [`SystemInputBuilderTest`](./tcases-io/src/test/java/org/cornutum/tcases/io/SystemInputBuilderTest.java).
15+
16+
## Test Cases ##
17+
18+
The [`tcases-lib`](https://search.maven.org/search?q=g:org.cornutum.tcases%20AND%20a:tcases-lib) JAR all contains all of the interfaces needed to
19+
generate a [system test definition](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/SystemTestDef.html)
20+
that contains all of the [test cases](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/TestCase.html) for a system input definition.
21+
22+
To generate test cases, use the [`Tcases`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/Tcases.html) class. `Tcases` defines
23+
several variations on the
24+
[`getTests`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/Tcases.html#getTests-org.cornutum.tcases.SystemInputDef-org.cornutum.tcases.generator.IGeneratorSet-org.cornutum.tcases.resolve.TestCaseResolverFactory-org.cornutum.tcases.SystemTestDef-org.cornutum.tcases.generator.GeneratorOptions-)
25+
method perform this task. The primary input parameter is the `SystemInputDef` but additional parameters define optional helper objects.
26+
For these, you can use a `null` value to apply a default value.
27+
For an example, see the [`SystemInputBuilderTest`](./tcases-io/src/test/java/org/cornutum/tcases/io/SystemInputBuilderTest.java).
28+
29+
For example, `Tcases:getTests` accepts a [generator definition](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/generator/IGeneratorSet.html)
30+
object to define the required [coverage](Tcases-Guide.md#defining-higher-coverage) for test cases.
31+
You can use methods from the [`Generators`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/generator/Generators.html) class for a
32+
fluent interface to the various builder classes needed to construct a generator definition.
33+
For a complete example, see the [`GeneratorsTest`](./tcases-io/src/test/java/org/cornutum/tcases/generator/io/GeneratorsTest.java).
34+
35+
To run the [Tcases Reducer](Tcases-Guide.md#reducing-test-cases-a-random-walk),
36+
use the [`Reducer`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/Reducer.html) class.
37+
`Reducer` defines several variations on the
38+
[`reduce`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/Reducer.html#reduce-org.cornutum.tcases.SystemInputDef-org.cornutum.tcases.generator.GeneratorSet-org.cornutum.tcases.SystemTestDef-org.cornutum.tcases.ReducerOptions-)
39+
method to perform this task.
40+
41+
## Documents ##
42+
43+
The [`tcases-io`](https://search.maven.org/search?q=g:org.cornutum.tcases%20AND%20a:tcases-io) JAR contains classes needed to handle
44+
the following types of Tcases documents.
45+
46+
* System input definition
47+
48+
* [`SystemInputJsonReader`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/SystemInputJsonReader.html)
49+
* [`SystemInputJsonWriter`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/SystemInputJsonWriter.html)
50+
* [`SystemInputDocReader`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/SystemInputDocReader.html)
51+
* [`SystemInputDocWriter`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/SystemInputDocWriter.html)
52+
53+
* Generator definition
54+
55+
* [`GeneratorSetJsonReader`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/generator/io/GeneratorSetJsonReader.html)
56+
* [`GeneratorSetJsonWriter`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/generator/io/GeneratorSetJsonWriter.html)
57+
* [`GeneratorSetDocReader`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/generator/io/GeneratorSetDocReader.html)
58+
* [`GeneratorSetDocWriter`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/generator/io/GeneratorSetDocWriter.html)
59+
60+
* System test definition
61+
62+
* [`SystemTestJsonReader`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/SystemTestJsonReader.html)
63+
* [`SystemTestJsonWriter`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/SystemTestJsonWriter.html)
64+
* [`SystemTestDocReader`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/SystemTestDocReader.html)
65+
* [`SystemTestDocWriter`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/SystemTestDocWriter.html)
66+
67+
* Project definition
68+
69+
* [`ProjectJsonReader`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/ProjectJsonReader.html)
70+
* [`ProjectJsonWriter`](http://www.cornutum.org/tcases/docs/api/org/cornutum/tcases/io/ProjectJsonWriter.html)

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>org.cornutum.tcases</groupId>
88
<artifactId>tcases</artifactId>
99
<packaging>pom</packaging>
10-
<version>4.0.1-SNAPSHOT</version>
10+
<version>4.0.1</version>
1111

1212
<name>Tcases</name>
1313
<description>Generates test cases from system input space models</description>

tcases-ant/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.cornutum.tcases</groupId>
99
<artifactId>tcases</artifactId>
10-
<version>4.0.1-SNAPSHOT</version>
10+
<version>4.0.1</version>
1111
</parent>
1212

1313
<artifactId>tcases-ant</artifactId>

tcases-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.cornutum.tcases</groupId>
99
<artifactId>tcases</artifactId>
10-
<version>4.0.1-SNAPSHOT</version>
10+
<version>4.0.1</version>
1111
</parent>
1212

1313
<artifactId>tcases-cli</artifactId>

tcases-io/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.cornutum.tcases</groupId>
99
<artifactId>tcases</artifactId>
10-
<version>4.0.1-SNAPSHOT</version>
10+
<version>4.0.1</version>
1111
</parent>
1212

1313
<artifactId>tcases-io</artifactId>

tcases-io/src/main/java/org/cornutum/tcases/generator/io/GeneratorSetJsonReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import javax.json.JsonReader;
2121

2222
/**
23-
* An {@link IGeneratorSetSource} that reads from an JSON document.
23+
* An {@link IGeneratorSetSource} that reads from a JSON document.
2424
*
2525
*/
2626
public class GeneratorSetJsonReader implements IGeneratorSetSource, Closeable

tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJsonReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import javax.json.JsonReader;
2323

2424
/**
25-
* Reads a {@link Project} definition from an JSON document.
25+
* Reads a {@link Project} definition from a JSON document.
2626
*
2727
*/
2828
public class ProjectJsonReader implements Closeable

tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJsonReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import javax.json.JsonReader;
2323

2424
/**
25-
* An {@link ISystemInputSource} that reads from an JSON document.
25+
* An {@link ISystemInputSource} that reads from a JSON document.
2626
*/
2727
public class SystemInputJsonReader extends ContextHandler<SystemInputContext> implements ISystemInputSource, Closeable
2828
{

0 commit comments

Comments
 (0)