Giter VIP home page Giter VIP logo

java-test-applications's Introduction

Java Test Applications

A collection of applications used for testing the Java buildpack.

Applications

Name Description
dist-zip-application A Spring Boot application, deployed as a distZip
ejb-application A JEE EJB application using Servlet 3
groovy-application An application started with groovy
java-main-application A Spring Boot application started with java -jar
ratpack-application A Ratpack application, deployed as a distZip
spring-boot-cli-application A Spring Boot CLI application, deployed with spring grab
spring-boot-cli-jar-application A Spring Boot CLI application, deployed with spring jar
web-application A Spring MVC application using Servlet 3
web-servlet-2-application A Spring MVC application using Servlet 2

Output Content

All applications support the following REST operations:

URI Description
GET / The health of the application
GET /class-path The classpath of the application
GET /environment-variables The environment variables available to the application
GET /input-arguments The list of JVM input arguments for the application
POST /out-of-memory The URL to trigger an out of memory error
GET /request-headers The http request headers of the current request
GET /security-providers The system security providers available to the application
GET /system-properties The system properties available to the application

Building

Before building the project, the following tools must be installed:

This project is built with Gradle. After installing the pre-requisites, run:

./gradlew

Building Behind a Proxy

Since this project downloads its dependencies from the internet, building behing a proxy requires some extra effort. In order configure gradle properly, use the following system properties. More information can be found here.

./gradlew -Dhttp.proxyHost=<HOST> -Dhttp.proxyPort=<PORT>

Deploying to Cloud Foundry

Each test application contains a manifest.yml file which allows the built application to be deployed to Cloud Foundry by simply issuing:

cf push

To avoid clashing with the URLs of other applications, you should specify your own subdomain for the application (unless the test application does not need a subdomain).

Failure Testing

Failure testing is supported for each of the above applications by setting a suitable environment variable.

If the environment variable FAIL_INIT is set, the application will fail to initialize:

cf set-env <application name> FAIL_INIT true

If the environment variable FAIL_OOM is set, the application will repeatedly exhaust the heap until the JVM is killed:

cf set-env <application name> FAIL_OOM true

Running Tests

To run the tests, do the following:

./gradlew

License

The Tomcat Builder is released under version 2.0 of the Apache License.

java-test-applications's People

Contributors

cgfrost avatar glyn avatar nebhale avatar ramnivas avatar scottfrederick avatar violetagg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-test-applications's Issues

Errors With Spring Boot Examples

I tried the spring boot examples, in particular I was trying the /mongodb/url endpoint. When I do it looks like there is a NPE.

java.lang.NullPointerException
    com.gopivotal.cloudfoundry.test.core.MongoDbUtils.getUrl(MongoDbUtils.java:38)
    com.gopivotal.cloudfoundry.test.core.MongoDbUtils.getUrl(MongoDbUtils.java:24)
    com.gopivotal.cloudfoundry.test.controller.ServiceController.url(ServiceController.java:40)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:606)
    org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
    org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)
    org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)

README Typo

In the README it says there is an endpoint called /datasource-url however it should be /datasource/url.

Grails app missing

I came across this repository while searching for sample Grails applications that are built to be deployed to CloudFoundry. The README.md mentions that grails-application however, I haven't been able to find any grails-application. Is the README.md missing some information or am I just not seeing the grails-application

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.