/demo-devex

Primary LanguageJavaApache License 2.0Apache-2.0

OpenLiberty Developer Experience Demo

Build Status License

Demo highlights

  1. Liberty "dev mode"
  2. MicroShed Boost
  3. MicroShed Testing

How to run:

# One time setup
./setup.sh

mvn install

Scenarios

Dev mode

  1. Start dev mode with: mvn liberty:dev
Hot deployment
  1. In a browser, go to http://localhost:9080/openapi/ui to view the OpenAPI UI which is now available.

  2. In the Java file src/main/java/org/eclipse/microprofile/system/test/app/PersonService.java, add the following annotations above the getAllPeople() method:

    @APIResponse(
        responseCode = "200",
        description = "All of people that have been added.",
        content = @Content(
            mediaType = "application/json",
            schema = @Schema(
                type = SchemaType.OBJECT,
                implementation = Person.class)))
    @Operation(
        summary = "Get all people.",
        description = "Returns all of the people that have been added.")
  1. Save the file. Notice the console shows compilation errors because imports were not added.

  2. Add the following imports:

import org.eclipse.microprofile.openapi.annotations.Operation;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Content;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
  1. Save the file. Notice the console shows compilation was successful and the application gets updated.

  2. In a browser, go to http://localhost:9080/openapi/ui, expand GET /people, and notice the summary, description, and 200 response code which has been added.

Hot testing
  1. Above the method getAllPeople(), delete the @GET annotation.

  2. Save the file. Notice the console shows compilation was successful.

  3. In the console, press Enter to run tests. Notice a test has an error.

  4. Above the method getAllPeople(), restore the @GET annotation.

  5. Save the file. Notice the console shows compilation was successful.

  6. In the console, press Enter to run tests. Notice the tests pass.

Hot debugging
  1. Inside the method getAllPeople(), set a breakpoint.

  2. In your IDE, attach a debugger to port 7777.

  3. In your browser, go to http://localhost:9080/myservice/people.

  4. Notice your IDE pauses at the breakpoint that you set, allowing you to debug.

  5. Disconnect the debugger.

Database support with Boost

  1. ...

MicroShed Testing

  1. Write tests with MicoShed Testing ...