开源改变世界!!

GrbControllerTest 中的单元测试失败 #183

推推 grbl 2年前 (2023-01-26) 131次浏览
关闭
droidmunkey 打开了这个问题 2014 年 8 月 16 日 · 7条评论
关闭

GrbControllerTest 中的单元测试失败#183

droidmunkey 打开了这个问题 2014 年 8 月 16 日 · 7条评论

注释

GrbControllerTest 中的单元测试失败 #183

好的,也许这就是它失败的原因-

[junit] Testcase: testPolling(com.willwinder.universalgcodesender.GrblControllerTest):      FAILED
[junit] expected:<1> but was:<0>
[junit] junit.framework.AssertionFailedError: expected:<1> but was:<0>
[junit]     at com.willwinder.universalgcodesender.GrblControllerTest.testPolling(GrblControllerTest.java:925)
[junit] 
[junit] 
[junit] Testcase: testCancelSend(com.willwinder.universalgcodesender.GrblControllerTest):   FAILED
[junit] expected:<0> but was:<30>
[junit] junit.framework.AssertionFailedError: expected:<0> but was:<30>
[junit]     at com.willwinder.universalgcodesender.GrblControllerTest.testCancelSend(GrblControllerTest.java:735)
[junit] 
[junit] 
[junit] Test com.willwinder.universalgcodesender.GrblControllerTest FAILED
GrbControllerTest 中的单元测试失败 #183

这是 UIPendant 测试的完整输出

-do-test-run:
[junit] 测试套件:com.willwinder.universalgcodesender.CommUtilsTest
[junit] checkRoomInBuffer
[junit] getSizeOfBuffer
[junit] 测试运行:3,失败:0,错误:0,跳过:0,经过的时间: 0.295 秒
[junit]
[junit] ————– 标准输出 ————–
[junit] checkRoomInBuffer
[junit] getSizeOfBuffer
[junit] – ———- —————— ————–
[junit] 测试套件:com。 willwinder.universalgcodesender.GcodePreprocessorUtilsTest
[junit] removeAllWhitespace
[junit] parseCodes
[junit] overrideSpeed
[junit] removeComment
[junit] parseComment
[junit] truncateDecimals
[junit] 测试运行:6,失败:0,错误:0,跳过:0,经过的时间:0.331 秒
[junit]
[junit] ———— 标准输出 —- ———-
[junit] removeAllWhitespace
[junit] parseCodes
[junit] overrideSpeed
[junit] removeComment
[junit] parseComment
[junit] truncateDecimals
[junit] ———- – ————– ————–
[junit] 测试套件:com.willwinder.universalgcodesender.GrblCommunicatorTest
[junit] setLineTerminator
[junit ] closeCommPort
[junit] – 不测试 RXTX。
[junit] softReset
[junit] openCommPort
[junit] – 不测试 RXTX。
[junit] 暂停发送
[junit] streamCommands
[junit] areActiveCommands
[junit] cancelSend
[junit] sendByteImmediately
[junit] queueStringForComm
[junit] 测试运行:10,失败:0,错误:0,跳过:0,经过的时间:1.205 秒
[junit]
[junit] — ———- 标准输出 ————–
[junit] setLineTerminator
[junit] closeCommPort
[junit] – 不测试 RXTX。
[junit] softReset
[junit] openCommPort
[junit] – 不测试 RXTX。
[junit] pauseSend
[junit] streamCommands
[junit] areActiveCommands
[junit] cancelSend
[junit] sendByteImmediately
[junit] queueStringForComm
[junit] ———— ——— —— ————–
[junit] 测试套件:com.willwinder.universalgcodesender.GrblControllerTest
[junit] commandSent
[junit] appendGcodeFile
[junit] rawResponseListener
[junit] closeCommPort/isCommOpen
[junit] isStreamingFile
[junit] commandComplete
[junit] 异常:试图完成一个不执行的命令’t exist: <(-1)>
[junit] openCommPort/isCommOpen
[junit] verboseMessageForConsole
[junit] testRowsAsteriskMethods
[junit] beginStreaming
[junit] messageForConsole
[junit] testPolling(通过 rawResponseListener)
[junit] preprocessAndAppendGcodeCommand
[junit] resumeStreaming
[junit ] addListener
[junit] getSendDuration
[junit] performHomingCycle
[junit] pauseStreaming
[junit] cancelSend
[junit] getGrblVersion
[junit] setSpeedOverride/getSpeedOverride
[junit] issueSoftReset
[junit] isReadyToStreamFile
[junit] queueStringForComm
[junit] 测试运行:24,失败:1,错误:0,跳过:0,经过的时间:13.936 秒
[junit]
[junit] ———— 标准输出 —————-
[junit] commandSent
[ junit] appendGcodeFile
[junit] rawResponseListener
[junit] closeCommPort/isCommOpen
[junit] isStreamingFile
[junit] commandComplete
[junit] 异常:试图完成不存在的命令:<(-1)>
[junit] openCommPort/isCommOpen
[junit] verboseMessageForConsole [
junit] testRowsAsteriskMethods [ junit
] beginStreaming
[junit] messageForConsole
[junit] 测试轮询(通过 rawResponseListener)
[junit] preprocessAndAppendGcodeCommand [junit] pauseStreaming [junit] cancelSend [junit] getGrblVersion [junit] setSpeedOverride/getSpeedOverride [junit] issueSoftReset [junit] isReadyToStreamFile [junit] queueStringForComm [junit] ———— —- ————————–

[junit] 测试用例:testCancelSend(com.willwinder.universalgcodesender.GrblControllerTest):失败
[junit] 预期:<0> 但为:<30>
[junit] junit.framework.AssertionFailedError:预期为:<0> 但为:<30 >
[junit] 在 com.willwinder.universalgcodesender.GrblControllerTest.testCancelSend(GrblControllerTest.java:735)
[junit]
[junit] [junit ]
测试 com.willwinder.universalgcodesender.GrblControllerTest 失败
GrblUtilsTest
[junit] getKillAlarmLockCommand
[junit] getVersionDouble
[junit] getVersionLetter
[junit] isGrblStatusString
[junit] getViewParserStateCommand
[junit] getGrblStatusCapabilities
[junit] getWorkPositionFromStatusString
[junit] isRealTimeCapable
[junit] isGrblVersionString
[junit] getResetCoordCommand
[junit] getStateFromStatusString
[junit] getMachinePositionFromStatusString
[junit] getReturnToHomeCommand
[junit] getHomingCommand
[junit] getToggleCheckModeCommand
[junit] 测试运行:15,错误: 0,跳过:0,经过的时间:0.601 秒
[junit]
[junit] ———— 标准输出 —————-
[junit] getKillAlarmLockCommand
[junit] getVersionDouble
[junit] getVersionLetter
[junit] isGrblStatusString
[junit] getViewParserStateCommand
[junit] getGrblStatusCapabilities
[junit] getWorkPositionFromStatusString
[junit] isRealTimeCapable
[junit] isGrblVersionString
[junit] getResetCoordCommand
[junit] getStateFromStatusString
[junit] getMachinePositionFromStatusString
[junit] getReturnToHomeCommand
[junit] getHomingCommand
[junit] getToggleCheckModeCommand
[junit] —— — ————– ————–
[junit] 测试套件:com.willwinder.universalgcodesender.UtilsTest
[junit] formattedMillis
[ junit] processFile
[junit] timeSince
[junit] millisSince
[junit] 测试运行:4,失败:0,错误:0,跳过:0,经过的时间:0.293 秒
[junit]
[junit] ————– 标准输出 ————–
[junit] formattedMillis
[junit] processFile
[junit] timeSince
[junit] millisSince

GrbControllerTest 中的单元测试失败 #183

好吧,这是因为 rowsRemaining() 返回的是 30 而不是 0 – 我添加了一些调试输出以查看值的来源

当调用 cancelSend() 时,“numCommandsSkipped”是否应该根据队列中的命令数递增?( this.numCommandsSkipped += this.outgoingQueue.size();)

[junit] cancelSend
[junit] cancelSend()- outgoingQueue size before clearing: 30
[junit] rowsRemaining() - numCommandsStreamed: 30
[junit] rowsRemaining() - numCommandsCompleted: 0
[junit] rowsRemaining() - numCommandsSkipped: 0
GrbControllerTest 中的单元测试失败 #183
所有者

这个测试实际上是一个已知的失败。现在“取消”不会清除
GRBL 缓冲区,即使它应该是可能的,所以我把它留在里面作为
提醒。

在 2014 年 8 月 15 日星期五,droidmunkey notifications@github.com写道:

好吧,这是因为 rowsRemaining() 返回的是 30 而不是 0 – 我添加
了一些调试输出以查看值的来源

当调用 cancelSend() 时,“numCommandsSkipped”是否应该根据队列中的命令数递增?(this.numCommandsSkipped +=
this.outgoingQueue.size();)

[junit] cancelSend
[junit] cancelSend()- 清除前的传出队列大小:30
[junit] rowsRemaining() – numCommandsStreamed:30
[junit] rowsRemaining() – numCommandsCompleted:0
[junit] rowsRemaining() – numCommandsSkipped:0


直接回复此电子邮件或在 GitHub
#183(评论)
上查看 。

GrbControllerTest 中的单元测试失败 #183

好的,如果测试失败,我该如何编译 jar 文件?

我正在尝试从命令行进行编译,但这些失败会阻止编译过程完成

GrbControllerTest 中的单元测试失败 #183
所有者

我从 NetBeans 编译 jar,它不运行单元测试。
github read me 中提到了我使用的构建目标。

在 2014 年 8 月 15 日星期五,droidmunkey notifications@github.com写道:

好吧,这是因为 rowsRemaining() 返回的是 30 而不是 0 – 我添加
了一些调试输出以查看值的来源

当调用 cancelSend() 时,“numCommandsSkipped”是否应该根据队列中的命令数递增?(this.numCommandsSkipped +=
this.outgoingQueue.size();)

[junit] cancelSend
[junit] cancelSend()- 清除前的传出队列大小:30
[junit] rowsRemaining() – numCommandsStreamed:30
[junit] rowsRemaining() – numCommandsCompleted:0
[junit] rowsRemaining() – numCommandsSkipped:0


直接回复此电子邮件或在 GitHub
#183(评论)
上查看 。

GrbControllerTest 中的单元测试失败 #183

可能希望将其包含在“编译指南”中——我浪费了很多时间试图找出测试失败的原因。

GrbControllerTest 中的单元测试失败 #183
所有者

现在应该解决这个问题。