描述:mockit.internal.MissingInvocation: Missing 1 invocation...
原因:Expectations{}块的情况下,mock对象在运行时必须 依据Expectations块中定义的顺序依次调用方法,不能多调用也不能少调用,可以省略掉Verifications块。
一旦多调用或则少调用,那么测试就不会通过,这样可以清晰的把握单元测试每一步、每一次执行的过程。
解决:依据Expectations块中定义的顺序依次调用方法
描述:Local variable flag defined in an enclosing scope must be final or effectively final
原因:变量必须final
解决:符合final,比如将需要的值放到一个数组,map或是list。
描述:initializationError(org.junit.runner.manipulation.Filter)
原因:单独运行了某个测试方法
解决:In eclipse, don't select the testing function alone to test, while select "Run all the tests in the selected project" option on the Test Tab, when select the Junit project name after click on Run->"Run(Debug) Configuration".
描述:.gitignore规则不生效(.project文件无法忽略)
原因:.gitignore只能忽略那些原来没有被track的文件,如果某些文件已经被纳入了版本管理中,则修改.gitignore是无效的。
解决:git rm -r --cached .project 解决方法就是先把本地缓存删除(改变成未track状态),然后再提交
描述:升级后数据库错乱
原因:新数据库有变更。
解决:在升级前做数据库迁移
描述:TypeError: Cannot read properties of null/Cannot read properties of undefined
原因:对象为null或者undefined
解决:if(对象 && 对象.属性)
描述:git commit时,需要输入用户名密码
原因:clone仓库时,使用了clone with http,http写一下需要认证
解决:修改远程仓库配置
git remote set-url origin git@github.com:zhangsan/shuofa.git
git Extension的场合,Remote repositories > Edit Remote Details > Url
描述:powershell 参数带有空格问题
原因:空格将一个参数分裂为多个参数
powershell -c '%param%'
powershell -c的调用方式可以在任意环境中,比如在CMD和程序中调用
浙公网安备 33010602011771号