Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void acquireDeferredSharedLocksOnPrepareForCommit()
		 public virtual void AcquireDeferredSharedLocksOnPrepareForCommit()
		 {
			  StatementLocks statementLocks = mock( typeof( StatementLocks ) );
			  SlaveLocksClient slaveLocksClient = mock( typeof( SlaveLocksClient ) );
			  when( statementLocks.Optimistic() ).thenReturn(slaveLocksClient);

			  SlaveStatementLocks slaveStatementLocks = new SlaveStatementLocks( statementLocks );
			  slaveStatementLocks.PrepareForCommit( LockTracer.NONE );

			  verify( statementLocks ).prepareForCommit( LockTracer.NONE );
			  verify( slaveLocksClient ).acquireDeferredSharedLocks( LockTracer.NONE );
		 }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void createSlaveStatementLocks()
        public virtual void CreateSlaveStatementLocks()
        {
            StatementLocksFactory @delegate = mock(typeof(StatementLocksFactory));
            Locks  locks  = mock(typeof(Locks));
            Config config = Config.defaults();

            SlaveStatementLocksFactory slaveStatementLocksFactory = new SlaveStatementLocksFactory(@delegate);

            slaveStatementLocksFactory.Initialize(locks, config);
            StatementLocks statementLocks = slaveStatementLocksFactory.NewInstance();

            assertThat(statementLocks, instanceOf(typeof(SlaveStatementLocks)));
            verify(@delegate).initialize(locks, config);
            verify(@delegate).newInstance();
        }
Esempio n. 3
0
        public override StatementLocks NewInstance()
        {
            StatementLocks statementLocks = @delegate.NewInstance();

            return(new SlaveStatementLocks(statementLocks));
        }
Esempio n. 4
0
 internal SlaveStatementLocks(StatementLocks @delegate)
 {
     this.@delegate = @delegate;
 }