Skip to content

Configure template for Java unit tests #14

@mjansen4857

Description

@mjansen4857

The template already includes configuration for running unit tests on native code, but does not include configuration for any Java tests. I have added my own configuration as is documented here for robot projects:

dependencies {
    ...

    testImplementation 'junit:junit:4.12'
}

...

test {
    useJUnit()
}

This works fine unless a test requires use of the HAL i.e. HAL.initialize(500, 0). This will throw an exception:

java.io.IOException: wpiHaljni could not be loaded from path or an embedded resource.
	attempted to load for platform /windows/x86-64/

I have tried this on a fresh copy of the template on a couple different computers that are able to run these tests just fine in a robot project, so I believe there is some extra configuration that the GradleRIO plugin would normally take care of and not an issue with my system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions