Skip to main content

check50_java

This is an extension for the CS50 automarker check50 that provides convenient wrappers around check50.run for directly compiling and interpreting Java source/byte code.

See also check50_junit and check50_checkstyle for related utilities that make writing check50 checks for java less painful.

Example Usage

All examples below assume that you're importing check50 and check50_java.

Compile Java source code

@check50.check()
def someclass_compiles():
    check50_java.compile("SomeClass.java"
        classpaths=['your/classpaths',
                    'relative/to/the',
                    'pset/directory.jar']
    )

The classpaths argument defaults to None ~ '.'.

Check that a class is executable (has well-formed main method)

@check50.check(someclass_compiles)
def someclass_main_exists():
    """SomeClass is application class"""
    check50_java.checks.is_application_class("SomeClass")

Execute an application class and check that its output is as expected

@check50.check(someclass_main_exists)
def someclass_main_output():
    """SomeClass.main() output"""
    expected = "X"
    actual = check50_java.run("SomeClass").stdout()
    help_msg = "did you introduce training newline or whitespace characters?"
    if actual != expected:
        raise check50.Mismatch(expected, actual, help=help_msg)

Metadata

Release files for check50-java 0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for check50-java 0.5
File Size Uploaded Provenance Actions
check50_java-0.5.tar.gz 3.9 kB Without provenance Details for check50_java-0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for check50-java 0.5
File Interpreter ABI Platform Actions
check50_java-0.5-py3-none-any.whl Python 3 none any Details for check50_java-0.5-py3-none-any.whl

Total release size: 21.0 kB

Release files / check50_java-0.5.tar.gz

Download URL check50_java-0.5.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
966796d8ba3fa9ca0c79d9c726f360fb6da950510b1777f9dbab578034ff662d
BLAKE2b-256 checksum
How to use checksums
674a911ef95dfb1fe8af7fc80fc2fbfe0e6dda8737f4e2f0ab168a6c277e2997
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / check50_java-0.5-py3-none-any.whl

Download URL check50_java-0.5-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6881c96dba6335571ecf1a0057e38ab97d191393bccc52a280a2bdcac50b6885
BLAKE2b-256 checksum
How to use checksums
2d4cc7d59d9fec0b76b66c1f1e685d2575ccd1fd03fa2b2b37535315eb7f5038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Security for check50-java 0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page