Nearly didn’t remember when was the last time I celebrate Merdeka (at least hoisting our national flag in front of house). But I feel a little special this year as many Merdeka celebration mtv shared around social media 🙂
~Happy Merdeka Malaysia~
Has been a while, I was thinking to blog this out but “lazy” bugs keep biting me 🙁 so I didn’t manage to do it. Until yesterday, I was looking for some related info but I hardly recall what I did previously. Phew… so decided to jot down here.
Typically software application should at least perform 2 types of automate tests which are unit test and integration test. For me… the distinction between these two are pretty straight forward:
Test on smallest unit of application such as method / function
Test on combination of few units in application to prove they run nicely with external resource (if there is any)
Cheap to run, fast to run (normally less than a minute)
Slower compared with unit test (normally few minutes or more)
NOT depends on external resources such as database, third party services, disk access
Normally involve database, disk access, other services
Report generated in <PROJECT>/target/surefire-reports
Report generated in <PROJECT>/target/failsafe-reports
By viewing the status report generated by surefire & failsafe plugin doesn’t create much insight, but we can make use of Jacoco plugin to create code coverage report as below. Here are minimal sample Maven configuration for Jacoco:
Jacoco coverage reports generated at <PROJECT>/target/site/* when we run mvn verify (bind to maven verify phase). To view the coverage reports, simply open <PROJECT>/target/site/jacoco/index.html with browser.
Yay ! we have now cover first part of test (automate unit + integration test), and if you notice, we done all steps manually (run maven command, open report from target folder) just to get the report display.
Moreover, we just able to view the coverage report locally, how if we want to share with other team members or to make it public accessible.
And…….. How can we automate the whole process ?
Da.. Dang !! We have Jenkins (Continuous Integration) + SonarQube (Continuous Code Quality Inspection) to help us 🙂
Setting up Jenkins is pretty straight forward, just follow steps from Jenkins Guided Tour or Installing Jenkins. We should able to see something as below if Jenkins setup successfully and launch in browser. Let’s continue with SonarQube setup by following “Get Started in Two Minutes” guide from it’s official site. And if nothing goes wrong, we should able to bring up SonarQube console via browser as below: Until this stage, you might feel a little tired or sleepy, it’s okie to refresh yourself with a cup of coffee 🙂
To allow Jenkins to work with SonarQube, we might need a little setup as below.
Generate authentication token from SonarQube and store it somewhere as steps below for subsequent Jenkins configuration use.
Goto Manage Jenkins –> Configure System, There should have SonarQube configuration module available.
Just configure it by click on AddSonarQube, and fill in necessary information (sample below), then Save it.
Trying to flash my niece’s phone with other rom which hope to have light weight OS, but no luck and end up with infinite boot screen load 🙁
Google around but also no luck to get any useful info (at least for this model of phone), some people sharing to use SP Flash, any other alternative which doesn’t work for my case too. End up I found the solution from ZTE site, which is to download the original rom and flash it…. phew….
Some call it hot deploy, some refer to runtime class reload/redefine, but whatsoever….
It is just mechanism to reload compiled class file during jvm runtime, to avoid ordinary java development life cycle of “code change -> build -> deploy”, which will significantly save lot’s of wait time (especially when you have multiple modules dependency project).
Both open source project: HotSwapAgent and Spring-Loaded works pretty well for me, but if you are looking for commercial product, JRebel will be the choice.