DEV Community

Lynn Langit
Lynn Langit

Posted on

Github Codespaces Java Test Tools

For a client scenario I am building a custom Github Java Codespace. This client uses unit testing frequently. To that end I wanted to get JUnit up and running in the simplest possible way in my custom Codespace.

To do this I downloaded and then uploaded the two required JAR files (junit and hamcrest) to my jars directory in my Repo. Then I manually added each JAR file to the .classpath file.

I installed the following extensions.

  • Java Extension Pack
  • Debugger for Java
  • Java Test Runner

Then I tried a sample test. I also tested the Java debugger (shown below).

Alt Text

My sample test was designed to fail in order to test the testing functionality. It worked as expected (shown below).

Alt Text

Top comments (0)