DEV Community

Lynn Langit
Lynn Langit

Posted on

3

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay