Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void poolGivesBackSameSessionAfterRelease()
        public virtual void PoolGivesBackSameSessionAfterRelease()
        {
            LocalSessionPool sessionPool = new LocalSessionPool(_globalSession);

            OperationContext contextA = sessionPool.AcquireSession();

            sessionPool.ReleaseSession(contextA);

            OperationContext contextB = sessionPool.AcquireSession();

            sessionPool.ReleaseSession(contextB);

            assertEquals(contextA.LocalSession(), contextB.LocalSession());
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void sessionAcquirementIncreasesOperationId()
        public virtual void SessionAcquirementIncreasesOperationId()
        {
            LocalSessionPool sessionPool = new LocalSessionPool(_globalSession);
            OperationContext context;

            context = sessionPool.AcquireSession();
            LocalOperationId operationA = context.LocalOperationId();

            sessionPool.ReleaseSession(context);

            context = sessionPool.AcquireSession();
            LocalOperationId operationB = context.LocalOperationId();

            sessionPool.ReleaseSession(context);

            assertEquals(operationB.SequenceNumber(), operationA.SequenceNumber() + 1);
        }