I need to black box test a jar file provided to me.
I’ve created a new project and added the jar file, let’s call it test.jar to the build path. I don’t know how I’m supposed to access the methods to test them because it is a jar file instead of a java file.
How can I create a JUnit test case that can access the methods of the jar so I can test them?
If the JAR file is in your project you should be able to test it just like you would test classes that you had the source code for. Create test classes for the classes in the JAR and create test cases for the public methods of those classes.
If you’re using Eclipse, you should be able to expand the Referenced Libraries entry in the Package Explorer window to see what the package structure of the JAR is, and what classes and methods there are.