Sign inSign up

singpath/verifier2-java

By singpath

Updated over 10 years ago

Java verifier image

Image
1

10K+

singpath/verifier2-java repository overview

Java Verifier for SingPath.com

Compile a Java class in memory and run junit test against it inside a docker container.

Usage

To download the the docker image and run the solutions and its tests.

docker run -ti --rm \
	--net="none" \
	--cap-drop=ALL \
	singpath/verifier2-java:latest \
	verify '---
tests: |
  SingPath sp = new SingPath();
  assertEquals(2.0, sp.add());
solution: |
  public class SingPath {
    public Double add() {
      return 2.0;
    }
  }
'

You can provide the solution/tests payload as JSON or YAML. If in YAML, the YAML document must start with "---".

To pass the content of a file:

docker run -ti --rm \
	--net="none" \
	--cap-drop=ALL \
	singpath/verifier2-java:latest \
	verify "$(< examples/float.yaml)"

To build the verifier instead of downloading it:

git clone https://github.com/ChrisBoesch/singpath-verifiers.git
cd singpath-verifiers/java
make
docker run -ti --rm \
	--net="none" \
	--cap-drop=ALL \
	singpath/verifier2-java:latest \
	verify '---
tests: |
  SingPath sp = new SingPath();
  assertEquals(2.0, sp.add());
solution: |
  public class SingPath {
    public Double add() {
      return 2.0;
    }
  }
'

Tag summary

Content type

Image

Digest

sha256:511bc1910

Size

234.1 MB

Last updated

over 10 years ago

docker pull singpath/verifier2-java