Exampple.Router.ConnCase (exampple v0.7.2)

ConnCase is used for tests. When a test is using this module we have available the start of the Exampple behaviours, DummyTcp server and the different asserts.

Link to this section Summary

Functions

The assert_all_stanza_receive macro receives as many messages as needed to match the list of stanzas passed as the first parameter in the process and checks it out against the list of stanzas passed as the first parameter. It waits for an incoming stanza for the timeout passed as second parameter. By default the second parameter is configured to 5 seconds.

The assert_stanza_receive macro receives a message in the process and checks it out against the stanza passed as a parameter. It waits for an incoming stanza for the timeout passed as second parameter. By default the second parameter is configured to 5 seconds.

The assert_stanza_received macro asks to DummyTcp for a stanza received and compares it to the stanza passed as parameter. If there is no stanzas received previously, nil is returned.

The component_received macro injects a stanza inside of the component. The stanza should be in %Xmlel{} format.

The stanza_receive macro waits for a message during the timeout passed as a parameter or 5 seconds by default.

The stanza_received macro ask for a previously received stanza to DummyTcp. If there is no stanzas waiting then it returns nil.

Starts the TCP server and subscribe the caller process. It is called by the setup macro injected when ConnCase is used.

Link to this section Functions

Link to this macro

assert_all_stanza_receive(stanzas, timeout \\ 5000)

(macro)

The assert_all_stanza_receive macro receives as many messages as needed to match the list of stanzas passed as the first parameter in the process and checks it out against the list of stanzas passed as the first parameter. It waits for an incoming stanza for the timeout passed as second parameter. By default the second parameter is configured to 5 seconds.

Link to this macro

assert_stanza_receive(stanza, timeout \\ 5000)

(macro)

The assert_stanza_receive macro receives a message in the process and checks it out against the stanza passed as a parameter. It waits for an incoming stanza for the timeout passed as second parameter. By default the second parameter is configured to 5 seconds.

Link to this macro

assert_stanza_received(stanza)

(macro)

The assert_stanza_received macro asks to DummyTcp for a stanza received and compares it to the stanza passed as parameter. If there is no stanzas received previously, nil is returned.

Link to this macro

component_received(stanza)

(macro)

The component_received macro injects a stanza inside of the component. The stanza should be in %Xmlel{} format.

Link to this macro

stanza_receive(timeout \\ 5000)

(macro)

The stanza_receive macro waits for a message during the timeout passed as a parameter or 5 seconds by default.

Link to this macro

stanza_received()

(macro)

The stanza_received macro ask for a previously received stanza to DummyTcp. If there is no stanzas waiting then it returns nil.

Link to this macro

start_tcp()

(macro)

Starts the TCP server and subscribe the caller process. It is called by the setup macro injected when ConnCase is used.