public SavePoint() { MockFixture mockFixture = TestRun.mockFixture(); previousTransformedClasses = mockFixture.getTransformedClasses(); previousRedefinedClasses = mockFixture.getRedefinedClasses(); previousCaptureTransformerCount = mockFixture.getCaptureTransformerCount(); previousMockedClasses = mockFixture.getMockedClasses(); previousMockClasses = TestRun.getMockClasses().new SavePoint(); }
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(); } }
public SavePoint() { MockFixture mockFixture = TestRun.mockFixture(); previousTransformedClasses = mockFixture.getTransformedClasses(); previousRedefinedClasses = mockFixture.getRedefinedClasses(); previousMockInstancesCount = TestRun.getMockClasses().getRegularMocks().getInstanceCount(); }