Package org.codehaus.aspectwerkz.cflow

Examples of org.codehaus.aspectwerkz.cflow.AbstractCflowSystemAspect


        staticMethod = cflowAspect.getDeclaredMethod("isInCflowBelow", new Class[0]);
        b = (Boolean) staticMethod.invoke(null, new Object[0]);
        assertFalse(b.booleanValue());


        final AbstractCflowSystemAspect cflow = (AbstractCflowSystemAspect)cflowAspect.newInstance();

        assertFalse(cflow.inCflow());
        assertFalse(cflow.inCflowBelow());
        Thread t = new Thread() {
            public void run() {
                System.out.println(Thread.currentThread());
                cflow.enter();
                assertTrue(cflow.inCflow());
                assertTrue( ! cflow.inCflowBelow());
                cflow.enter();
                assertTrue(cflow.inCflow());
                assertFalse( ! cflow.inCflowBelow());
                cflow.exit();
                // leave the cflow in "inCflow" state is in this thread
            }
        };
        t.start();
        System.out.println(Thread.currentThread());

        assertFalse(cflow.inCflow());
        assertFalse(cflow.inCflowBelow());
    }
View Full Code Here


        assertFalse(b.booleanValue());



        final AbstractCflowSystemAspect cflow = (AbstractCflowSystemAspect)

                cflowAspect.getDeclaredMethod("aspectOf", new Class[0]).invoke(null, new Object[0]);



        assertFalse(cflow.inCflow());

        Thread t = new Thread() {

            public void run() {

                System.out.println(Thread.currentThread());

                cflow.enter();

                assertTrue(cflow.inCflow());

                cflow.enter();

                assertTrue(cflow.inCflow());

                cflow.exit();

                // leave the cflow in "inCflow" state is in this thread

            }

        };

        t.start();

        System.out.println(Thread.currentThread());



        assertFalse(cflow.inCflow());

    }
View Full Code Here

        // check NPE
        Method staticMethod = cflowAspect.getDeclaredMethod("isInCflow", new Class[0]);
        Boolean b = (Boolean) staticMethod.invoke(null, new Object[0]);
        assertFalse(b.booleanValue());

        final AbstractCflowSystemAspect cflow = (AbstractCflowSystemAspect)
                cflowAspect.getDeclaredMethod("aspectOf", new Class[0]).invoke(null, new Object[0]);

        assertFalse(cflow.inCflow());
        Thread t = new Thread() {
            public void run() {
                System.out.println(Thread.currentThread());
                cflow.enter();
                assertTrue(cflow.inCflow());
                cflow.enter();
                assertTrue(cflow.inCflow());
                cflow.exit();
                // leave the cflow in "inCflow" state is in this thread
            }
        };
        t.start();
        System.out.println(Thread.currentThread());

        assertFalse(cflow.inCflow());
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.cflow.AbstractCflowSystemAspect

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.