Package com.volantis.xml.pipeline.sax

Examples of com.volantis.xml.pipeline.sax.ResourceOwnerMock


     */
    public void testPopResourceOwnerInTransactionSuppressRelease()
            throws Exception {
        TestRecoverableResourceOwnerStack trros =
                new TestRecoverableResourceOwnerStack();
        final ResourceOwnerMock toPopMock =
                 new ResourceOwnerMock("toPopMock", expectations);
        trros.startTransaction();
        trros.push(toPopMock, false);

        Object popped = trros.pop();
        assertSame("Unexpected object popped.", toPopMock, popped);
View Full Code Here


     * with an unnested transaction.   
     */
    public void testCommitTransactionImplUnNested() throws Exception {
        TestRecoverableResourceOwnerStack trros =
                new TestRecoverableResourceOwnerStack();
        final ResourceOwnerMock toPopMock =
                 new ResourceOwnerMock("toPopMock", expectations);
        trros.startTransaction();
        trros.push(toPopMock, true);

        Object popped = trros.pop();
        assertSame("Unexpected object popped.", toPopMock, popped);
View Full Code Here

                new TestRecoverableResourceOwnerStack();
       
        final Object onStack = new Object();
        trros.push(onStack, false);
       
        final ResourceOwnerMock toPopMock =
                 new ResourceOwnerMock("toPopMock", expectations);
        trros.startTransaction();
        trros.push(toPopMock, true);
        Object popped = trros.pop();
       
        assertSame("Unexpected object popped.", toPopMock, popped);
        Object onPopped = trros.poppedResourceOwners.peek();
        assertSame("Expected object on popped stack.", toPopMock,
                ((ReleasableResourceOwner) onPopped).getResourceOwner());

        // Nest another transaction
        final ResourceOwnerMock nestedMock =
                 new ResourceOwnerMock("nestedMock", expectations);
        trros.startTransaction();
        trros.push(nestedMock, true);
        Object nestedPopped = trros.pop();       
        assertSame("Unexpected object popped.", nestedMock, nestedPopped);
        onPopped = trros.poppedResourceOwners.peek();
View Full Code Here

                new TestRecoverableResourceOwnerStack();

        final Object onStack = new Object();
        trros.push(onStack, false);

        final ResourceOwnerMock unnestedMock =
                 new ResourceOwnerMock("unnestedMock", expectations);
        trros.startTransaction();
        trros.push(unnestedMock, true);

        Object pushedObject = trros.pushedResourceOwners.peek();
        assertSame("Expected object on popped stack.", unnestedMock,
                ((ReleasableResourceOwner) pushedObject).getResourceOwner());

        // Nest another transaction
        final ResourceOwnerMock nestedMock =
                 new ResourceOwnerMock("nestedMock", expectations);
        trros.startTransaction();
        trros.push(nestedMock, true);
        pushedObject = trros.pushedResourceOwners.peek();
        assertSame("Expected object on popped stack.", nestedMock,
                ((ReleasableResourceOwner) pushedObject).getResourceOwner());
View Full Code Here

     */
    public void testRelease() throws Exception {
        TestRecoverableResourceOwnerStack trros =
                new TestRecoverableResourceOwnerStack();

        final ResourceOwnerMock resourceOwnerMock =
                 new ResourceOwnerMock("resourceOwnerMock", expectations);
        trros.push(resourceOwnerMock, false);
       
        final ResourceOwnerMock releasableMock =
                 new ResourceOwnerMock("releasableMock", expectations);
        trros.push(releasableMock, true);

        final ResourceOwnerMock unnestedMock =
                 new ResourceOwnerMock("unnestedMock", expectations);
        trros.startTransaction();
        trros.push(unnestedMock, true);

        Object pushedObject = trros.pushedResourceOwners.peek();
        assertSame("Expected object on pushed stack.", unnestedMock,
                ((ReleasableResourceOwner) pushedObject).getResourceOwner());

        // Nest another transaction
        final ResourceOwnerMock nestedMock =
                 new ResourceOwnerMock("nestedMock", expectations);
        trros.startTransaction();
        trros.push(nestedMock, true);
        pushedObject = trros.pushedResourceOwners.peek();
        assertSame("Expected object on pushed stack.", nestedMock,
                ((ReleasableResourceOwner) pushedObject).getResourceOwner());
View Full Code Here

     */
    public void testReleaseStack() throws Exception {
        TestRecoverableResourceOwnerStack trros =
                new TestRecoverableResourceOwnerStack();

        final ResourceOwnerMock unreleasableMock =
                 new ResourceOwnerMock("unreleasableMock", expectations);
        trros.push(unreleasableMock, false);

        final ResourceOwnerMock releasable1Mock =
                 new ResourceOwnerMock("releasable1Mock", expectations);
        trros.push(releasable1Mock, true);

        final ResourceOwnerMock releasable2Mock =
                 new ResourceOwnerMock("releasable2Mock", expectations);
        trros.push(releasable2Mock, true);
       
        Stack stack = trros.getStack();
        assertTrue("Expected three items on stack", stack.size() == 3);
       
View Full Code Here

     */
    public void testContains() throws Exception {
        TestRecoverableResourceOwnerStack trros =
                new TestRecoverableResourceOwnerStack();

        final ResourceOwnerMock unreleasableMock =
                 new ResourceOwnerMock("unreleasableMock", expectations);
        trros.push(unreleasableMock, false);

        final ResourceOwnerMock releasable1Mock =
                 new ResourceOwnerMock("releasable1Mock", expectations);
        trros.push(releasable1Mock, true);

        final ResourceOwnerMock releasable2Mock =
                 new ResourceOwnerMock("releasable2Mock", expectations);
        trros.push(releasable2Mock, true);

        final ResourceOwnerMock notInStackMock =
                 new ResourceOwnerMock("notInStackMock", expectations);
       
        Stack stack = trros.getStack();
        assertTrue("Expected three items on stack", stack.size() == 3);
       
        boolean contains =
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.ResourceOwnerMock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.