空手道参考:未定义的软件包
我正在使用空手道功能文件中的Java代码,引用GitHub Demo:
Background:
* url demoBaseUrl
* def JavaDemo = Java.type('com.intuit.karate.demo.util.JavaDemo')
我注意到该功能文件位于SRC/test/java中,该文件在pom.xml中定义为classPath。同时,UTIL类位于SRC/Main/Java中。
在我的项目中,我使用类似的结构
以下代码在功能文件中,带有类参考:
* def XMLValidator = Java.type(base.utility.XMLValidator)
* def validator = new XMLValidator()
但是我在下面有一个例外:
org.graalvm.polyglot.PolyglotException: ReferenceError: "base" is not defined
这是类问题吗?
I'm using java codes in karate feature file, refering github demo:
Background:
* url demoBaseUrl
* def JavaDemo = Java.type('com.intuit.karate.demo.util.JavaDemo')
I noticed that the feature file is in src/test/java, which defined as classpath in pom.xml. Meanwhile the util class is in src/main/java.
In my project I use similar structure
Following code is in the feature file with Class Reference:
* def XMLValidator = Java.type(base.utility.XMLValidator)
* def validator = new XMLValidator()
But I got an exception below:
org.graalvm.polyglot.PolyglotException: ReferenceError: "base" is not defined
Is it a classpath problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不是缺少引号(对于
java.type()
的字符串参数Aren't you missing the quotes (for a string argument to
Java.type()