Concordion

repository·master·Indexed 42 days ago

https://github.com/concordion/concordion

An open source runner for executable specifications that creates living documentation by verifying human-readable specifications through automated tests. It supports JUnit Jupiter and JUnit Vintage and utilizes the Manifold preprocessor for compile-time configuration.

Tokens
871
Snippets
6
Records
8
Agent score
4%

What's inside Concordion

  1. Set implementation status for example commands

    master

    When your Concordion specification contains example commands, you cannot use fixture-level implementation status annotations (like @ExpectedToFail or @Unimplemented) because these are checked at the JUnit test level and do not apply to individual examples.

    Instead, you must set the implementation status directly on the example command using the status attribute. This allows you to specify whether a specific example is expected to pass or fail.

    <!-- Example of an example command that is expected to fail -->
    [Should fail](- "c:assertTrue=false")
    
    <!-- Example of a successful example command -->
    [Success](- "c:assertTrue=true")
  2. How the Concordion pre-processor works

    master

    Concordion uses the Manifold preprocessor to switch between JUnit Jupiter and JUnit Vintage test configurations at compile time.

    The testVintage Gradle task sets the JUNIT_VINTAGE compiler argument. This allows you to use conditional compilation logic in your Java code, such as:

    #if JUNIT_VINTAGE
    @RunWith(ConcordionRunner.class)
    #else
    @ConcordionFixture
    #endif
  3. Use a local Concordion JAR in a Gradle project

    master

    To consume a version of Concordion installed in your local Maven repository, you must configure your Gradle project to look in mavenLocal().

    1. Add mavenLocal() to your repositories block in build.gradle (or globally in ~/.gradle/init.gradle):
    allprojects {
        repositories {
            mavenLocal()
        }
    }
    1. Reference the specific version in your dependencies:
    dependencies {
        implementation 'org.concordion:concordion:2.0.0-SNAPSHOT'
        // Or use '+' for the latest version
        // implementation 'org.concordion:concordion:+'
    }
  4. Compile and run Concordion tests

    master

    Concordion supports both JUnit Jupiter and JUnit Vintage. You can run the full test suite (specification tests and unit tests) using the following commands:

    To run with JUnit Jupiter:

    ./gradlew clean test

    To run with JUnit Vintage:

    ./gradlew clean testVintage

    Running these tasks will download dependencies, clean the project, recompile source code, and execute tests. The Concordion specification output is saved to the ./build/reports/spec directory.

  5. Build Concordion using Gradle

    master

    Concordion uses Gradle as its build tool and includes the Gradle Wrapper. You can use the wrapper to manage tasks without installing Gradle manually.

    To see all available tasks, run:

    ./gradlew tasks

    *(Note: Use `.\