public synchronized void rollback() { if (rollbackActions != null) { for (Runnable action : rollbackActions) { action.run(); } } MockFixture mockFixture = TestRun.mockFixture(); mockFixture.restoreTransformedClasses(previousTransformedClasses); mockFixture.restoreRedefinedClasses(previousRedefinedClasses); TestRun.getMockClasses().getRegularMocks().removeInstances(previousMockInstancesCount); }
public synchronized void rollback() { RECORD_OR_REPLAY_LOCK.lock(); try { MockFixture mockFixture = TestRun.mockFixture(); mockFixture.removeCaptureTransformers(previousCaptureTransformerCount); mockFixture.restoreTransformedClasses(previousTransformedClasses); mockFixture.restoreRedefinedClasses(previousRedefinedClasses); mockFixture.removeMockedClasses(previousMockedClasses); previousMockClasses.rollback(); } finally { RECORD_OR_REPLAY_LOCK.unlock(); } }