Giter Club home page Giter Club logo

microprofile-samples's Introduction

MicroProfile - Samples

Purpose of these samples

Give different examples using the MicroProfile :

  • Canonical Simplest sample using JAX-RS 2.0 / CDI 1.2 / JSON-P 1.0

  • Swagger Adding Swagger to the canonical sample

Building

To build these examples you can just :

  • mvn clean install does not run any test

  • mvn clean install -Plicense,skipTests checks the licenses and does not run any test

Formatting Code

To format / re-format code call :

  • mvn clean compile -PformatCode formats the source code and does not run any test

Testing

These examples use Arquillian Tests. By default, Arquillian uses WildFly embedded, but other forms of containers can also be plugged in.

  • mvn clean test -Pwildfly-swarm tests against a WildFly Swarm

  • mvn clean test -Parquillian-wildfly-managed tests against an embedded WildFly

  • mvn clean test -Parquillian-wildfly-remote tests against a running WildFly

  • mvn clean test -Parquillian-tomee-managed tests against an embedded Apache TomEE

  • mvn clean test -Parquillian-tomee-remote tests against a remote Apache TomEE

Running

You can package a WAR file and deploy it on your application server. Once deployed and up and running, just go to http://localhost:<portNumber>/msTopCDs to invoke the microservice. You should get a list of random "Top Rated CDs" in JSON format, such as :

[
    {
        id: 1101
    },
    {
        id: 1147
    },
    {
        id: 1112
    },
    {
        id: 1132
    },
    {
        id: 1168
    }
 ]

But you can also use other forms of packaging to execute this services

WildFly Swarm

Package the samples with WildFly Swarm using the following Maven command :

  • mvn clean package -Pwildfly-swarm

This will create an executable JAR under the target directory. Just execute it with java -jar target/microprofile-sample-canonical-swarm.jar and invoke the microservice at http://localhost:8081/msTopCDs

microprofile-samples's People

Contributors

agoncal avatar andygee avatar cmoulliard avatar ivannov avatar johnament avatar karianna avatar keilw avatar kenfinnigan avatar kwsutter avatar mehmandarov avatar ondromih avatar smillidge 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.