Client

Windows 上的 Multibit 測試失敗

  • March 11, 2014

我正在嘗試在 Windows 上編譯 Multibit:

Windows 7, 
IDEA 13.0.2, 
Maven 3.0, 
Multibit 0.5.16.

我能夠編譯,但是當我嘗試測試時,總是有 2 次失敗:

Running org.multibit.file.ExportTransactionsSubmitActionTest
11:31:54.896 [main] DEBUG org.multibit.model.BaseModel - Initial view from properties file is 'WELCOME_VIEW' 
11:31:55.671 [main] DEBUG o.m.model.bitcoin.WalletInfoData - The wallet version in the constructor was '3'. In the wallet info file it was '2'. Using the latter. 
11:31:55.678 [main] DEBUG org.multibit.file.FileHandler - rememberFileSizesAndLastModified: Wallet filename C:\Projects\BCColors\multibit-master\.\.\src\test\resources\wallets\protobuf1.wallet , walletFileSize 986 ,walletFileLastModified 1393765318000 ,walletInfoFileSize 688 ,walletInfoFileLastModified 1393765318000 
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.8 sec <<< FAILURE!
testExportTransactions(org.multibit.file.ExportTransactionsSubmitActionTest)  Time elapsed: 0.799 sec  <<< FAILURE!
junit.framework.ComparisonFailure: Row 1 incorrect expected:<29 Jul 2013 1[0]:23,"Sent to ""unenc...> but was:<29 Jul 2013 1[2]:23,"Sent to ""unenc...>

Running org.multibit.viewsystem.swing.action.CreateNewReceivingAddressSubmitActionTest
<......>

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 46.048 sec <<< FAILURE!
testAddReceivingAddressesWithEncryptedWallet(org.multibit.viewsystem.swing.action.CreateNewReceivingAddressSubmitActionTest)  Time elapsed: 46.047 sec  <<< FAILURE!
junit.framework.AssertionFailedError: Wrong number of keys after addition of 20 keys expected:<22> but was:<2>

還有更常見的問題。多位程式碼的文件記錄很差。有人對此有任何參考/教程/解釋嗎?

您提到的測試是直接驅動 UI 類的測試。它們有點像機器人測試,有點繁瑣。如果你不執行這些特定的測試,你會失去一些 UI 測試覆蓋率,但不會覆蓋更深的類。

回复:程式碼記錄不充分:有很多 Java 文件註釋,幾乎無處不在。您會欣賞到文件工作更多地是在最終使用者方面。MultiBit 是一個相當典型的 MVC 架構,當然隨著時間的推移它已經積累了相當多的垃圾。令人驚訝的是,程式碼幾乎總是線上記錄。

引用自:https://bitcoin.stackexchange.com/questions/23371