Skip to content

Commit

Permalink
docs: Improved README
Browse files Browse the repository at this point in the history
  • Loading branch information
viv committed Jan 7, 2025
1 parent bde3f46 commit c5eb482
Showing 1 changed file with 50 additions and 23 deletions.
73 changes: 50 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# Openfire Integration Tests

Integration tests for Openfire, focusing on federation scenarios.
Integration tests for Openfire XMPP server, focusing on federation scenarios. These tests verify server-to-server (S2S) communication, user authentication, and message routing in a federated environment.

## Test Infrastructure

These tests run against a federated Openfire environment provided by the [openfire-docker-compose](https://github.com/surevine/openfire-docker-compose) project, which is included as a Git submodule. That project provides:

- A complete Docker-based federation environment
- Network configuration for server-to-server testing
- Certificate management infrastructure
- Pre-configured users and databases

For full details of the test infrastructure, see the [openfire-docker-compose documentation](https://github.com/surevine/openfire-docker-compose/blob/main/federation/README.md).

## Prerequisites

- Java 17
- Java 17 or later
- Docker and Docker Compose

The [openfire-docker-compose](https://github.com/surevine/openfire-docker-compose) system used by these tests expects
to find an image tagged as openfire:latest locally. To build one, from
the [openfire](https://github.com/igniterealtime/Openfire) project root:
### Building the Openfire Image

The docker-compose-based test environment [currently requires a local Openfire Docker image](https://github.com/surevine/openfire-docker-compose/issues/77) tagged as `openfire:latest`. To build this:

1. Clone the Openfire repository:
```bash
git clone https://github.com/igniterealtime/Openfire.git
cd Openfire
```

2. Build the Docker image:
```bash
docker build -t openfire:latest .
```
Expand All @@ -23,50 +41,59 @@ git clone https://github.com/surevine/openfire-integration-tests.git
cd openfire-integration-tests
```

2. Initialize and update the submodule:
2. Initialise and update the openfire-docker-compose submodule:
```bash
git submodule update --init
```

## Running Tests

The project uses Maven Wrapper, so no local Maven installation is required.
The project uses Maven Wrapper (no local Maven installation required).

Run all integration tests:
### Running All Tests
```bash
./mvnw verify
```

Run a specific test:
### Running Specific Tests
```bash
# Run a single test class
./mvnw verify -Dit.test=ConnectAndAuthenticateIT

# Run a specific test method
./mvnw verify -Dit.test=FederatedChatIT#federatedMessageTest
```

## Test Environment
### Test Users

The tests use the Openfire Docker Compose environment from the `openfire-docker-compose` repository (included as a submodule).
The test environment comes with pre-configured users:

The environment provides:
- Two Openfire instances:
- xmpp1 (ports: 5221, 7071, 9091)
- xmpp2 (ports: 5222, 7072, 9092)
- PostgreSQL databases for each instance
- Pre-configured users:
- xmpp1: user1/password, user2/password
- xmpp2: user3/password, user4/password
- Network configuration for federation
Server 1 (xmpp1.localhost.example):
- user1/password
- user2/password

Server 2 (xmpp2.localhost.example):
- user3/password
- user4/password

## Development

### Keeping Up to Date

1. Pull latest changes from both repositories:
1. Pull latest changes:
```bash
# Update main repository
git pull

# Update openfire-docker-compose submodule to latest version
git submodule update --remote
```

2. If switching branches or updating submodule reference:
2. When switching branches or updating submodule reference:
```bash
git submodule update --init
```
```

## License

This project is licensed under the same terms as Openfire. See [Openfire's license](https://github.com/igniterealtime/Openfire/blob/main/LICENSE.txt) for details.

0 comments on commit c5eb482

Please sign in to comment.