Integrations

Integrating Concordion with other tools

This page shows the integrations for Java. Click the toggle buttons above to choose other options.

IDEs

IntelliJ IDEA

The excellent Concordion support plugin for IDEA provides support such as autocompletion, 2-way navigation between specifications and fixtures, run test from specification, surround with Concordion command, go to declaration and renaming. See the home page for documentation of the features and keyboard shortcuts.

This plugin supports both HTML and Markdown format specifications.

For Markdown format specifications, a Markdown plugin is also required. The official IntelliJ IDEA Markdown Support plugin is recommended. The Markdown Navigator plugin is also supported.

Star

Eclipse

The concordion-eclipse plugin provides content assist and validation for Concordion specifications, integrated into Eclipse’s HTML and Web Page (Source) editors.

This plugin currently supports HTML format specifications (not Markdown). It has not been updated with the Concordion 2.0 commands yet, so will show these as errors, but still works well.


Build tools

Gradle

Concordion tests can be run using the standard test task. A typical build script is:

apply plugin: 'java'

repositories {
  mavenCentral()
}

dependencies {
  testCompile "org.concordion:concordion:x.y.z"
}

test {
  testLogging.showStandardStreams = true   // display test output on console
  systemProperties['concordion.output.dir'] = "$reporting.baseDir/spec"  // write output to build/reports/spec
  outputs.upToDateWhen { false }   // force tests to run even if code hasn't changed
}

where x.y.z is replaced by the Concordion version, for example 2.0.0.

If you have created a suite of specifications using the run command, you may want to run only your main fixture class by adding this line inside the test block:

  include '**/MainFixture.*' 

where MainFixture.java is the fixture class corresponding to the main index page.

(This is not strictly necessary since Concordion will cache test results so that tests are not run multiple times within a single test run. The number of tests reported will be less if you only run the main fixture class.)

Gradle Bug

The gradle command line option “–tests” does not currently work correctly with Concordion and will:

  • prevent @AfterSuite annotated methods from running
  • construct all test classes (but not run them)

Until this is corrected either use the older command line option “-DtaskName.single = testNamePattern” or use includes as shown above.

Maven

Concordion tests can be run using the surefire plugin. For example:

<build>
  <plugins>
    ......
    <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.19.1</version>
      <configuration>
        <systemPropertyVariables>
          <concordion.output.dir>target/concordion</concordion.output.dir>
        </systemPropertyVariables>
      </configuration>
    </plugin>
    ......
  </plugins>
</build>

Note that the Surefire plugin, by default, only includes test classes with filenames that start or end with Test or end with TestCase. If your Concordion fixture class names don’t end with Test or you want to limit the fixture classes that are run, you will need to specify the fixtures you want to include. For example:

  <includes>
    <include>**/MainFixture.java</include>
  </includes>

There is also a maven-concordion-reporting-plugin which allows you to incorporate Concordion reports into a Maven site report in the project reports section.


Build servers

Jenkins

The HTML Publisher plugin can publish the Concordion results, maintain a per-build history, and let you download the output as a zip file.

Note: as of Jenkins 1.641 / 1.625.3, the new Content Security Policy results in Concordion reports no longer being fully functional in Jenkins, with the error "Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Concordion reports use inline CSS and Javascript.

While we investigate the issue further, the only workaround is to restore the security vulnerability. To do this, relax the policy to allow script-src 'unsafe-inline' and style-src 'unsafe-inline' by appending

-Dhudson.model.DirectoryBrowserSupport.CSP=\" sandbox; default-src 'none'; img-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; script-src 'unsafe-inline';\"

to the value of the JAVA_ARGS variable in the Jenkins startup script (/etc/default/jenkins on Linux) and restarting Jenkins. Note that we are still investigating this further - see the discussion.


Frameworks

Spring

The chiiknrice/concordion-spring-runner provides integration between Concordion and Spring Framework.

JUnit 5 will have a flexible extension model to allow combinations of runners to work together. We’re aiming to support this in Concordion 2.1.