samedi 6 février 2016

JUnit Testing without starting tomcat explicitly

I'm working on designing Junit framework which requires

Run Junit test cases even without starting tomcat (use something like embedded tomcat)

I'm making use of Jersey test framework.

<dependency>
    <groupId>org.glassfish.jersey.containers</groupId>
    <artifactId>jersey-container-grizzly2-servlet</artifactId>
    <version>${jersey2.version}</version>
</dependency>

Starting tomcat in background in @Before method of suite

server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, rc);

    server.start();

And stop tomcat when testing is completed.

This work successfully. I don't have to start tomcat explicitly. Embedded tomcat is started when Junit suite starts and stops after completing test suite.

I'm thinking of rest assured test framework instead of Jersey test framework.

But I did not find information of background tomcat with rest assured framework.

Any help would be great!

Thanks, Sachin

Aucun commentaire:

Enregistrer un commentaire