コード例 #1
0
ファイル: SavePoint.java プロジェクト: Varun200864/jmockit1
 public SavePoint() {
   MockFixture mockFixture = TestRun.mockFixture();
   previousTransformedClasses = mockFixture.getTransformedClasses();
   previousRedefinedClasses = mockFixture.getRedefinedClasses();
   previousCaptureTransformerCount = mockFixture.getCaptureTransformerCount();
   previousMockedClasses = mockFixture.getMockedClasses();
   previousMockClasses = TestRun.getMockClasses().new SavePoint();
 }
コード例 #2
0
ファイル: SavePoint.java プロジェクト: borisbrodski/jmockit
  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);
  }
コード例 #3
0
ファイル: SavePoint.java プロジェクト: Varun200864/jmockit1
  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();
    }
  }
コード例 #4
0
ファイル: SavePoint.java プロジェクト: borisbrodski/jmockit
 public SavePoint() {
   MockFixture mockFixture = TestRun.mockFixture();
   previousTransformedClasses = mockFixture.getTransformedClasses();
   previousRedefinedClasses = mockFixture.getRedefinedClasses();
   previousMockInstancesCount = TestRun.getMockClasses().getRegularMocks().getInstanceCount();
 }