Overview
Define, prepare, and control servers and proxies for either Anvil workflow.
An environment contains the server and proxy processes a test or prepared scenario needs. Describe its topology and inputs once, then reuse that declaration for automated verification or a manual session with a real client.
The Java declaration is AnvilScenario. AnvilScenarioDefinition supplies one independently
discoverable declaration. Neither requires that players be created inside the declaration: a
running context can create them when needed.
Build the environment
- Define the environment: name its processes and select an entrypoint.
- Choose platforms: select server and proxy implementations.
- Provision the software: select executable artifacts, Java, and acquisition policy.
- Prepare workspaces: install your plugin and choose file persistence, snapshots, and cleanup.
- Configure execution: choose host directories, execution settings, and limits.
- Prepare live state with a setup hook when the shared starting point needs ready processes or players.
The first test provides a minimal Paper declaration you can expand. Declare only the processes and inputs relevant to the behavior you want to inspect.
A process that every scenario needs but none inspects can keep running between them; see Process lifetime.
Control the running processes
Use Actions to issue console commands, call installed agent operations, and
restart a server or proxy. These guides use a running ScenarioContext and its named process
handles. The scenario owns process startup and shutdown.
Players is the separate building block for native clients and their capabilities. Its APIs let a test or setup hook add participants to this environment.
Reuse it across workflows
For Testing, the test starts the environment, performs a journey, and asserts the results. For Scenarios, the runner exposes a prepared definition that stays available while a human joins and tests it. A manual variant can reuse the same definition while changing only the settings needed for that workflow.
Integrations covers the entry points. If preparation or execution fails, start with Troubleshooting.