I'm running karate tests in Visual Studio Code and I get the following failure. I've compared the VSCode file structure and content to our working Eclipse setup and don't find any differences. Why does VSCode fail? I am running a stand-alone karate instance.
Karate version: 0.9.5.RC5...
security.codes.CodesEdit: -unknown-:6 - javascript evaluation failed: Java.type('util.SqlConnection').getInstance(), java.lang.ClassNotFoundException: util.SqlConnection
The feature file is located in src/test/java/security/codes and the call to the class not found is:
Background:
* def db = Java.type('util.SqlConnection').getInstance()
The class not found located in src/test/java/util/SqlConnection.java and contains the following (this isn't the whole class, just what I think is relevant):
package util;
public class SqlConnection {
private SqlConnection() {
}
public static synchronized SqlConnection getInstance() {
...
}
}
This is the relevant part of my .classpath file:
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
I'm new to both karate and Java, so please let me know if I've left out any information.