SDK MAN – Software Development Kit Manager

I use sdk man to maintain multiple versions of Groovy, Java, Scala. It makes switching very easy.

SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. It provides a convenient Command Line Interface (CLI) and API for installing, switching, removing and listing Candidates. Formerly known as GVM the Groovy enVironment Manager, it was inspired by the very useful RVM and rbenv tools, used at large by the Ruby community.

Installing SDKMAN! on UNIX-like platforms is as easy as ever. SDKMAN! installs smoothly on Mac OSX, Linux, Cygwin, Solaris and FreeBSD. We also support Bash and ZSH shells.
Simply open a new terminal and enter:

$ curl -s "https://get.sdkman.io" | bash

Follow the instructions on-screen to complete installation.
Next, open a new terminal or enter:

$ source "$HOME/.sdkman/bin/sdkman-init.sh"

Lastly, run the following code snippet to ensure that installation succeeded:

$ sdk version

If all went well, the version should be displayed. Something like:

  sdkman 5.0.0+51

testNG: How to write time test

 

Some time performance is critical. Lets a repository call does return the response withing request time out units then it will cause the application to break. Just to keep those things and performance in mind, testNG tests can be calibrate on the measure of time in milli seconds.

The “Time Test” means if an unit test takes longer than the specified number of milliseconds to run, the test will terminated and mark as failed.

import org.testng.annotations.*;public class TestNGTest4 {

	@Test(timeOut = 1000)  
	public void infinity() {  
		while (true); 
              // userRepository.getAllUsersInEntireWorld(); 
	}  

}

In above example, the infinity() method will not return, so the TestNG engine will mark it as failed and throw an exception

FAILED: infinity
org.testng.internal.thread.ThreadTimeoutException: 
Method public void TestNGTest4.infinity() didn't finish within the time-out 1000
... Removed 18 stack frames