<div dir="ltr">SnapshotRestoreSetupTask is a nice testsuite convenience, but it needs to be used with great care.<div><br></div><div>What it does is save you the hassle of writing cleanup code to revert any configuration changes your test makes. It saves a snapshot of the xml config before your test runs and then when the test class is done reloads the server using that snapshot. Voila, all config changes magically gone!</div><div><br></div><div>But like all dark magic, there's a hidden cost.</div><div><br></div><div>The problem is reloading to an earlier snapshot is not the same thing as executing management ops to reverse out changes. Management ops don't just change the model, they change runtime resources, and those runtime resource may persist state outside the xml file, e.g. in the data dir. A management op like a 'remove' may result in that persisted state being cleaned up, but a simple reload to a snapshot will not. And that leftover state may have mysterious side effects later.</div><div><br></div><div>The messaging-activemq subsystem seems like a place to be particularly careful.<br clear="all"><div><br></div><div>Cheers,</div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Brian Stansberry<div>Manager, Senior Principal Software Engineer</div><div>Red Hat</div></div></div>
</div></div>