GithubHelp home page GithubHelp logo

isabella232 / remote-junit-runner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datastax/remote-junit-runner

0.0 0.0 0.0 82 KB

JUnit runner that executes tests in a remote JVM

License: Apache License 2.0

Java 91.31% Groovy 8.69%

remote-junit-runner's Introduction

What?

This JUnit extension enables remote execution of a JUnit test, supporting arbitrary JUnit runner on the remote JVM.

Why?

Useful for running your integration tests within the context of your running application that cannot be easily embedded into your test JVM. In such a situation, it is easier to inject the test into the running application JVM.

How?

  • Add the artifact 'com.datastax:remote-junit-runner:0.1' to your project

  • Annotate test class with @RunWith(com.datastax.junit.remote.Remote.class). The annotation can be placed on a superclass.

  • If you need to specify the JUnit runner that is going to be used on the remote side, add @Remote.RunWith annotation on the test class:

    Running remotely a test suite:

@RunWith(Remote.class)
@Remote.RunWith(Suite.class)
@Suite.SuiteClasses({RemoteSuite.Test1.class})
public class RemoteSuite
{

    public static class Test1
    {
        @Test
        public void test1()
        {
            System.out.println("test1");
        }
    }
}

Running remotely parametrized tests:

@RunWith(Remote.class)
@Remote.RunWith(JUnitParamsRunner.class)
public class RemoteParametrizedTest
{
    @Parameters({
            "1, 2, 3",
            "2, 3, 5"

    })
    @Test
    public void test(int a, int b, int c)
    {
        Assert.assertEquals(c, a + b);
    }
}

Remote Spock tests:

@RunWith(Remote)
@Remote.RunWith(Sputnik)
class RemoteSpockSpec extends Specification
{

    def test() {
        expect:
        true
    }
}
  • Additionally, you can specify the location of the remote server via @Remote.Host annotation. (default: localhost:4567)
  • Start the remote server:
java -cp remote-junit-runner.jar com.datastax.junit.remote.RemoteTestServer

or embed it into your application (check the JavaDoc for RemoteTestServer)

remote-junit-runner's People

Contributors

justinchuch avatar pedjak avatar sdelmas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.