Writing unit tests requiring a Petals Registry Overlay


To unitary test interactions with a real Petals Registry Overlay (as the fractal component 'Petals Registry Client'), it is needed to be able to simply instantiate embedded Petals Registry Overlay members.

Such an implementation was created to provide this embedded Petals Registry Overlay members: Petals Registry Overlay JUnit extension.

It is available as JUnit Rule, and so the Petals environment is cleaned between each unit test.

No contributors found for: authors on selected page(s)

Using the Petals Registry Overlay JUnit extension

The JUnit rule to instantiate an embedded Petals Registry Overlay member is: org.ow2.petals.registry_overlay.junit.PetalsRegistryOverlayNode:

    public PetalsRegistryOverlayNode petalsRegistryNode = new PetalsRegistryOverlayNode();

    public void test...() {

        ... Your unit test source code ...

        assertEquals(..., this.petalsRegistryNode.getHost());
        assertEquals(..., this.petalsRegistryNode.getPort());
        assertEquals(..., this.petalsRegistryNode.getGroupName());
        assertEquals(..., this.petalsRegistryNode.getPassword());

        ... Your unit test source code ...


The following methods can be used to retrieve all connection information required to established a connection to the current Petals Registry Ovelray member:

  • getHost(),
  • getPort(),
  • getGroupName(),
  • getPassword().


The Petals Registry Overlay JUnit extension is available as a Maven artifact to add to the POM of your project:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.