BlvckBytes / BukkitTestRunner

An ultra simplistic test runner to be used within the bukkit environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BukkitTestRunner

An ultra simplistic test runner to be used within the bukkit environment.

Table of Contents

Installation

Install this project into your local maven repository and put the jar file in your server's plugin folder. Then, include this project as a provided dependency to the project you're looking to run tests on.

<dependencies>
    <dependency>
        <groupId>me.blvckbytes</groupId>
        <artifactId>BukkitTestRunner</artifactId>
        <version>0.1</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Implementation

Implement the class ITestable on the class you're extending JavaPlugin (the main plugin class).

ITestable.java
package me.blvckbytes.bukkittestrunner;

public interface ITestable {

  /**
   * Lists all classes which contain methods annotated by {@link org.junit.Test}
   * that are to be executed by the testing framework through the bukkit test runner
   */
  Class<?>[] getTestClasses() throws Exception;

}

Execution

This plugin will wait for all plugins to load. Once loaded, they're iterated and checked for the implementation of the ITestable interface. If the plugin implements it, it's tests get ran and a report is being generated at BukkitTestRunner/reports/<plugin-name>.txt. After this process, the server is shut down immediately, in order to tell the server orchestrating software (if applicable) that the tests are fully executed and done.

About

An ultra simplistic test runner to be used within the bukkit environment.

License:MIT License


Languages

Language:Java 100.0%