Sdaas / sample-webapp

Sample Java webapp using Jersey and Jetty. Includes support for unit, integration, and coverage tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What
====

A sample webapp

* Jersey
* Jetty Web server
* Maven
* TestNG for UnitTest
* Selenium for Integration Tests
* JMockit Coverage for Coverage Tests

Steps
====

To run unit tests (including code coverage ) and webapp

* mvn package
* mvn jetty:run
* curl http://127.0.0.1:8080/api/hello   ( will point to servlet )
* curl http://127.0.0.1:8080/static/test.html ( will point to static content )
* curl http://127.0.0.1:8080/api/api-docs  ( swagger )

To run integration tests

* make sure that popup blocker is disabled in Safari
* mvn verify

Unit Test results are available in target/surefire-reports/index.html
Coverage results are available in target/my-coverage-report/index.html

Tests
=====

All tests that use selenium ( integration tests ) must end with the **IntegrationTest.java. These
files are configured in the pom to be excluded from unit tests ( by surefire plugin ) and included
in integration tests ( by failsafe plugin )

Tags
====

Run the following command to see list of all the git tags

git tag -n

Running and Debugging from inside IntelliJ
===========================================

Go to Maven Projects tab, then expand Plugins/jetty, right-click jetty:run and select Run /  Debug.

Swagger
=======

* QuickStart https://github.com/wordnik/swagger-core/wiki/Java-JAXRS-Quickstart
* UI https://github.com/wordnik/swagger-ui

Stuff To Do
===========

- Make the swagger UI point to itself without requiring any manual configuration


About

Sample Java webapp using Jersey and Jetty. Includes support for unit, integration, and coverage tests


Languages

Language:Java 100.0%