Examples of ThreadLocalStorageImpl


Examples of org.apache.hivemind.service.impl.ThreadLocalStorageImpl

    }

    public void testWithNotifier()
    {
        ThreadEventNotifier notifier = new ThreadEventNotifierImpl();
        ThreadLocalStorageImpl s = new ThreadLocalStorageImpl();

        s.setNotifier(notifier);

        s.put("biff", "bamf");

        assertEquals("bamf", s.get("biff"));

        notifier.fireThreadCleanup();

        assertNull(s.get("biff"));
    }
View Full Code Here

Examples of org.apache.hivemind.service.impl.ThreadLocalStorageImpl

    }

    public void testThreadCleanup() throws Throwable
    {
        ThreadEventNotifier notifier = new ThreadEventNotifierImpl();
        ThreadLocalStorageImpl local = new ThreadLocalStorageImpl();

        local.setNotifier(notifier);

        local.put("session", "Main Session");

        TestRunner tr = new TestRunner(local, notifier);
        TestThreadGroup tg = new TestThreadGroup("Test Thread Group");
        new Thread(tg, tr).start();

        while (!_testRunnerCompleted)
            Thread.yield();

        if (_testRunnerFailure != null)
            throw _testRunnerFailure;

        assertEquals(local.get("session"), "Main Session");

        notifier.fireThreadCleanup();

        assertNull(local.get("session"));
    }
View Full Code Here

Examples of org.apache.hivemind.service.impl.ThreadLocalStorageImpl

    }

    public void testWithNotifier()
    {
        ThreadEventNotifier notifier = new ThreadEventNotifierImpl();
        ThreadLocalStorageImpl s = new ThreadLocalStorageImpl();

        s.setNotifier(notifier);

        s.put("biff", "bamf");

        assertEquals("bamf", s.get("biff"));

        notifier.fireThreadCleanup();

        assertNull(s.get("biff"));
    }
View Full Code Here

Examples of org.apache.hivemind.service.impl.ThreadLocalStorageImpl

    }

    public void testThreadCleanup() throws Throwable
    {
        ThreadEventNotifier notifier = new ThreadEventNotifierImpl();
        ThreadLocalStorageImpl local = new ThreadLocalStorageImpl();

        local.setNotifier(notifier);

        local.put("session", "Main Session");

        TestRunner tr = new TestRunner(local, notifier);
        TestThreadGroup tg = new TestThreadGroup("Test Thread Group");
        new Thread(tg, tr).start();

        while (!_testRunnerCompleted)
            Thread.yield();

        if (_testRunnerFailure != null)
            throw _testRunnerFailure;

        assertEquals(local.get("session"), "Main Session");

        notifier.fireThreadCleanup();

        assertNull(local.get("session"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.