This is a learning project. You can use it to learn about dependency injection, testing and RxJava in a near project similar set up. This means all the data is accesses from a external client over http and passed to a java business logic which processed the request and passed the response to the client. You must implement the business logic.
- Install git https://git-scm.com/)
- Install IntelliJ community edition (https://www.jetbrains.com/idea/download/)
- Install postman (https://www.getpostman.com/)
- Clone the git repository from the server in your working directory
git clone <Repo>
- Import the project as gradle project into IntelliJ
- Use always the git console to improve your knowledge
- Creates a branch with you changes
git branch -b [username]/[branchname]
- Pushes the branch to the repo server
git push origin [username]/[branchname]
This is gradle multiproject containing:
- entertainment-lib
- vertx-server
- vertx-example
Simulates a simple audio and radio player. Create it by calling the EntertainmentService constructor.
// create the instance of the entertainment
Entertainment entertainment = new EntertainmentService(Schedulers.single());
Entertainment is a facade for multiple underlying subsystems. Subsystems are interconnected. Subsystems can be accessed by calling corresponding methods.
// get the audio
entertainment.audio()
// start a connection
.start(Audio.Connection.USB)
// don't forget to subscribe
.subscribe()
Starts a simple http and websocket server. Create it by calling the VertxServer constructor. Server itself does not implement any logic, but it can be extended by supplying request handlers. See VertxServer javadoc for details.
This is simple example with a launcher class. You can run it by calling
./gradlew vertx-example:run
To test the http interface you use postman. You can access the vertx webserver on port 7780.
Depending on how much time you want to invest, different tasks can be accomplished. For a 4 day training the following tasks must be fullfilled:
- Try to run the example project (vertex-exmaple)
- Creates interface and code to handle the source switch between media and radio sources
- Creates interface and code to provide the current playing station or track
- Extends the current playing track or station with additional meta informations
- Introduce Dagger 2 for the code
- Write Unit tests for the services
- Write integration tests
Create a new subproject (similar to vertx-example). Make sure to apply gradle application plugin. Start with a "Hello world" application. You will have to adjust gradle.settings for that.
In your launcher, bootstrap entertainment-lib, vertx-server and an adapter, which connects both. Start small and add more features as you go.
Use Dagger2 to bootstrap the application. You can get rid of the EntertainmentService and instantiate it's parts in a Dagger2 module.
Create unit and medium (integration) tests for the whole application and it's parts.