简体   繁体   English

jPos JUnit在Eclipse中测试失败

[英]jPos JUnit Tests Fail in Eclipse

When I attempt to run unit tests in eclipse for jPos I receive error messages concerning missing resource bundles: 当我尝试在Eclipse中为jPos运行单元测试时,我收到有关缺少资源包的错误消息:

org.jpos.core.ConfigurationException: org.jpos.security.SMException: java.util.MissingResourceException: Can't find bundle for base name org/jpos/q2/buildinfo, locale en_US (java.util.MissingResourceException: Can't find bundle for base name org/jpos/q2/buildinfo, locale en_US) (org.jpos.security.SMException: java.util.MissingResourceException: Can't find bundle for base name org/jpos/q2/buildinfo, locale en_US (java.util.MissingResourceException: Can't find bundle for base name org/jpos/q2/buildinfo, locale en_US))

Also gradle fails complaining about invalid signing keys when building the project. 同样,gradle在构建项目时也不会抱怨无效的签名密钥。

Download and install the buildship gradle plugin for eclipse and import jPos as a gradle project. 下载并安装用于Eclipse的buildship gradle插件,并将jPos作为gradle项目导入。 (This will bring in the main jpos project and a few other related projects) (这将引入主要的jpos项目和其他一些相关项目)

Run ./gradlew build from the root jPos folder to generate the missing resource files. 从根jPos文件夹中运行./gradlew build以生成缺少的资源文件。 (Alternatively run the build task from within eclipse) (或者从Eclipse中运行构建任务)

Now we can add the newly generated resources to the runtime classpath of eclipse. 现在,我们可以将新生成的资源添加到eclipse的运行时类路径中。 Right click on the jpos-jpos project and select "Configure build path". 右键单击jpos-jpos项目,然后选择“配置构建路径”。 Then add the build/resources/main folder to your classpath and then you should be able to run the tests from within eclipse. 然后将build / resources / main文件夹添加到您的类路径中,然后您应该能够从eclipse中运行测试。


To fix the signing key issue, comment out the signing plugin, signing configuration, and uploadArchives configuration in the root build.gradle project. 要解决签名密钥问题,请在root build.gradle项目中注释掉签名插件,签名配置和uploadArchives配置。 Though this doesn't solve the underlying issue for why signing isn't working (probably requires key generation/configuration) it will at least allow the project to be built. 尽管这不能解决签名为什么不起作用的潜在问题(可能需要密钥生成/配置),但至少将允许构建项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM