[bisq-network/bisq] [TESTS] Add tests for P2PDataStorage in order to safely refactor (#3554)

Julian Knutsen notifications at github.com
Mon Nov 4 18:24:42 UTC 2019


These tests create real versions of the supported Payload & Entry types and
run them through the 3 entry points (onMessage, Init, standard add()/remove()/refresh(),
to verify the expected return values, internal state changes, and
external signals (listeners, broadcasts).

The tests are involved and I am proposing future work to make many of the objects
more testable that will greatly reduce the work and tests cases needed.

This work identified a few unexpected scenarios and potential bugs that are addressed
in dependent pull requests.

Code coverage when running P2PDataStorageTest:

Before:
Line: 4%
Branch: 0%

After:
Line: 78%
Branch 76%
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/3554

-- Commit Summary --

  * [TESTS] Add tests for P2PDataStorage in order to safely refactor

-- File Changes --

    M build.gradle (1)
    M core/src/main/java/bisq/core/alert/Alert.java (2)
    M p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java (2)
    M p2p/src/test/java/bisq/network/p2p/storage/P2PDataStorageTest.java (1525)
    A p2p/src/test/java/bisq/network/p2p/storage/mocks/AppendOnlyDataStoreServiceFake.java (42)
    A p2p/src/test/java/bisq/network/p2p/storage/mocks/DateTolerantPayloadStub.java (50)
    A p2p/src/test/java/bisq/network/p2p/storage/mocks/PersistableNetworkPayloadStub.java (43)
    A p2p/src/test/java/bisq/network/p2p/storage/mocks/ProtectedDataStoreServiceFake.java (45)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/3554.patch
https://github.com/bisq-network/bisq/pull/3554.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3554
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191104/f0d0efec/attachment.html>


More information about the bisq-github mailing list