Writing automatic tests requiring external resources

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (2)

View Page History

The Petals JUnit Framework comes with several external resources ready to use:
* a Petals Registry Overlay,
* a Web server,
* a FTP server,
{section}

h1. A Petals Registry Overlay as external resource

The {{PetalsRegistryOverlayNode}} rule allows creation of a member of a Petals Registry Overlay cluster that is guaranteed to be deleted when the test method finishes (whether it passes or fails):
{code}
public static class HasPetalsRegistryOverlayCluster {
@Rule
public PetalsRegistryOverlayNode member_1 = new PetalsRegistryOverlayNode();

@Rule
public PetalsRegistryOverlayNode member_2 = new PetalsRegistryOverlayNode();

@Test
public void testUsingPetalsRegistryOverlayCluster() throws IOException {
// ...
final int port_1 = this.member_1.getPort();
// ...
}
}
{code}

h1. A Web server as external resource