junit.framework.AssertionFailedError: No tests found in JUnit.test at junit junit.framework.Asserti

本文解决在使用JUnit进行单元测试时遇到的AssertionFailedError问题,重点在于方法名的规范使用,提示将大写方法名修改为小写,并在必要时添加测试前缀。提供了解决常见测试配置错误的实用技巧。
junit.framework.AssertionFailedError: No tests found in JUnit.test  at junit

解决办法:
将大写的 TestAdd() 修改成 testAdd()即可,若是方法名仅为Add,请在方法名前加上test
方法名前面不要大写
java.lang.AssertionError: on-device tests failed: com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest#testBlocklistAllConstellationsButGPS: junit.framework.AssertionFailedError: Failing tests are: (Test: FAIL) Must receive enough GnssStatus changes in time. If failed, possibly, the test has been run deep indoors. Consider retrying test outdoors. at junit.framework.Assert.fail(Assert.java:50) at com.google.android.gts.location.gnss.SoftAssert.assertAll(SoftAssert.java:128) at com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest.blocklistSatellitesAndVerify(GnssSatelliteBlocklistTest.java:110) at com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest.testBlocklistAllConstellationsButGPS(GnssSatelliteBlocklistTest.java:62) com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest#testBlocklistSomeGalileoSatellites: junit.framework.AssertionFailedError: Failing tests are: (Test: FAIL) Must receive enough GnssStatus changes in time. If failed, possibly, the test has been run deep indoors. Consider retrying test outdoors. at junit.framework.Assert.fail(Assert.java:50) at com.google.android.gts.location.gnss.SoftAssert.assertAll(SoftAssert.java:128) at com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest.blocklistSatellitesAndVerify(GnssSatelliteBlocklistTest.java:110) at com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest.testBlocklistSomeGalileoSatellites(GnssSatelliteBlocklistTest.java:76) com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest#testBlocklistSomeGlonassSatellites: junit.framework.AssertionFailedError: Failing tests are: (Test: FAIL) Must receive enough GnssStatus changes in time. If failed, possibly, the test has been run deep indoors. Consider retrying test outdoors. at junit.framework.Assert.fail(Assert.java:50) at com.google.android.gts.location.gnss.SoftAssert.assertAll(SoftAssert.java:128) at com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest.blocklistSatellitesAndVerify(GnssSatelliteBlocklistTest.java:110) at com.google.android.gts.location.gnss.GnssSatelliteBlocklistTest.testBlocklistSomeGlonassSatellites(GnssSatelliteBlocklistTest.java:69)
03-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值