I teach a large intro CS class, and in transitioning from 14 to 16, have hit a wall because I cannot work out how to straightforwardly execute individual tests from within a jar under IntelliJ 16.
For one important part of my class, I distribute to the students jars with compiled unit tests that I've prepared for them (class files, not sources). They then write their code against these tests.
Previously, I instructed students to:
- Create their project
- Get JUnit4 in their class path,
- download then add my jar to their project's dependencies, and
- run a specific test within the jar using the context menu when selecting the given test, and choosing "Run..."
This worked just great. I distributed jars with many tests; the students wrote code, added my jar and then tested their code against my tests by right-clicking on the test in question and selecting "Run...".
I've now updated to IntelliJ 2016 and cannot get this to work. The context menu for a test within the distributed jar does not offer "Run..." any longer.
I have managed two things:
- to manually construct run configurations for each test, but this is untenable when the number of tests is >> 10 and I have > 300 students of varying skill levels
- to add the jar as a project source and label it as a test source. This gives me the "Run..." option under the context menu when right clicking on the test within the jar, but leads to the error message: "Error:resources: "xxx/IdeaProjects/yyyy/out/test/yyyy/. (Is a directory)"
I've spent quite a few frustrated hours on this, and would appreciate any insight any of you might have. It's not at all obvious why the 14->16 upgrade should have wreaked such havoc with a central part of my large, carefully prepared, Java class.
What am I doing wrong??
Thanks for any help you may have.