//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void blockingChainDescriptionForIndependentTransactionsIsEmpty() public virtual void BlockingChainDescriptionForIndependentTransactionsIsEmpty() { 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); assertThat(resolver.DescribeBlockingTransactions(handle1), EmptyString); assertThat(resolver.DescribeBlockingTransactions(handle2), EmptyString); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void blockingChainDescriptionForDirectlyBlockedTransaction() public virtual void BlockingChainDescriptionForDirectlyBlockedTransaction() { Dictionary <KernelTransactionHandle, IList <QuerySnapshot> > map = new Dictionary <KernelTransactionHandle, IList <QuerySnapshot> >(); TestKernelTransactionHandle handle1 = new TestKernelTransactionHandleWithLocks(new StubKernelTransaction(), 3, singletonList(ActiveLock.exclusiveLock(ResourceTypes.NODE, 1))); TestKernelTransactionHandle handle2 = new TestKernelTransactionHandleWithLocks(new StubKernelTransaction()); map[handle1] = singletonList(CreateQuerySnapshot(1)); map[handle2] = singletonList(CreateQuerySnapshotWaitingForLock(2, false, ResourceTypes.NODE, 1)); TransactionDependenciesResolver resolver = new TransactionDependenciesResolver(map); assertThat(resolver.DescribeBlockingTransactions(handle1), EmptyString); assertEquals("[transaction-3]", resolver.DescribeBlockingTransactions(handle2)); }
private string GetExecutingStatus(KernelTransactionHandle handle, TransactionDependenciesResolver transactionDependenciesResolver) { return(transactionDependenciesResolver.IsBlocked(handle) ? "Blocked by: " + transactionDependenciesResolver.DescribeBlockingTransactions(handle) : RUNNING_STATE); }