//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void detectIndependentTransactionsAsNotBlocked() public virtual void DetectIndependentTransactionsAsNotBlocked() { Dictionary <KernelTransactionHandle, IList <QuerySnapshot> > map = new Dictionary <KernelTransactionHandle, IList <QuerySnapshot> >(); TestKernelTransactionHandle handle1 = new TestKernelTransactionHandleWithLocks(new StubKernelTransaction()); TestKernelTransactionHandle handle2 = new TestKernelTransactionHandleWithLocks(new StubKernelTransaction()); map[handle1] = singletonList(CreateQuerySnapshot(1)); map[handle2] = singletonList(CreateQuerySnapshot(2)); TransactionDependenciesResolver resolver = new TransactionDependenciesResolver(map); assertFalse(resolver.IsBlocked(handle1)); assertFalse(resolver.IsBlocked(handle2)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void detectBlockedTransactionsBySharedLock() public virtual void DetectBlockedTransactionsBySharedLock() { Dictionary <KernelTransactionHandle, IList <QuerySnapshot> > map = new Dictionary <KernelTransactionHandle, IList <QuerySnapshot> >(); TestKernelTransactionHandle handle1 = new TestKernelTransactionHandleWithLocks(new StubKernelTransaction(), 0, singletonList(ActiveLock.sharedLock(ResourceTypes.NODE, 1))); TestKernelTransactionHandle handle2 = new TestKernelTransactionHandleWithLocks(new StubKernelTransaction()); map[handle1] = singletonList(CreateQuerySnapshot(1)); map[handle2] = singletonList(CreateQuerySnapshotWaitingForLock(2, true, ResourceTypes.NODE, 1)); TransactionDependenciesResolver resolver = new TransactionDependenciesResolver(map); assertFalse(resolver.IsBlocked(handle1)); assertTrue(resolver.IsBlocked(handle2)); }
private string GetExecutingStatus(KernelTransactionHandle handle, TransactionDependenciesResolver transactionDependenciesResolver) { return(transactionDependenciesResolver.IsBlocked(handle) ? "Blocked by: " + transactionDependenciesResolver.DescribeBlockingTransactions(handle) : RUNNING_STATE); }