Skip to content

ghostframe/test-summary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test-summary

A maven plugin that generates web views of test classes, grouping test cases by method tested.

Usage

In your pom.xml:

  • Add the plugin to the build lifecycle:
<build>
  <plugins>
    ...
    <plugin>
      <groupId>com.ghostframe</groupId>
      <artifactId>test-summary-maven-plugin</artifactId>
      <version>1.0.0</version>
      <configuration>
          <outputDirectory>target\test-summary\</outputDirectory>
      </configuration>
      <executions>
          <execution>
              <phase>test</phase>
              <goals>
                  <goal>generate</goal>
              </goals>
          </execution>
      </executions>
    </plugin>
    ...
  </plugins>
</build>
  • Add this to your pluginRepositories for maven to download it from github:
<pluginRepositories>
  <pluginRepository>
    <id>test-case-summary</id>
    <url>https://raw.githubusercontent.com/ghostframe/test-summary/master/maven-repository/</url>
  </pluginRepository>
</pluginRepositories>
  • Run the test goal

What it does

Given this:

package com.myproject;

public class TestClass {

    @Test
    public void method1_withScenarioA_returnsValueA() {
      //...
    }

    @Test
    public void method1_shouldSupportNulls() {
      //...
    }

    @Test
    public void method2_withScenarioA_returnsValueA() {
      //...
    }
    
    @Test
    public void anotherTest() {
      //...
    }

}

It will output target\test-summary\com\myproject\TestClass.html:

TestClass

method1
  • With scenario a → returns value a
  • Should support nulls
method2
  • With scenario a → returns value a
anotherTest

About

Test case summarizer

Resources

Stars

Watchers

Forks

Packages

No packages published