Package com.volantis.mcs.management.tracking

Examples of com.volantis.mcs.management.tracking.PageTrackerFactory


     * Simple tests to ensure the JMXPageDetailsManagerFactory is working as
     * expected.
     * @throws Exception
     */
    public void testCreatePageDetailsManager() throws Exception {
        PageTrackerFactory managerFactory =
                new JMXPageTrackerFactory();

        // ensure we have a clean slate
        JMXTestUtilities.removeAllMBeanServers();

        // test multiple calls to manager Factory
        PageDetailsManager pdManager1 =
                managerFactory.createPageDetailsManager();
        PageDetailsManager pdManager2 =
                managerFactory.createPageDetailsManager();

        ArrayList mBeanServers = MBeanServerFactory.findMBeanServer(null);
        assertEquals("There should only be one MBeanServer",
                1, mBeanServers.size());

View Full Code Here


     */
    public void testMBeanIsAvailable() throws Exception {

        // ensure we have a clean slate
        JMXTestUtilities.removeAllMBeanServers();
        PageTrackerFactory managerFactory =
                new JMXPageTrackerFactory();

        // this should have registered an MBean with a server.
        PageDetailsManager pdManager1 =
                managerFactory.createPageDetailsManager();

        PageTrackerFactory ptFactory = new JMXPageTrackerFactory();
        CanvasDetails canvasDetails = ptFactory.createCanvasDetails("TITLE",
                CanvasType.INCLUSION, "FAKE_THEME", "FAKE_LAYOUT");
        PageDetails pageDetails = ptFactory.createPageDetails(canvasDetails, "WIBBLE");
        pdManager1.addPageDetails(pageDetails);

        ArrayList mBeanServers = MBeanServerFactory.findMBeanServer(null);

        // we know this is the only MBeanServer.
View Full Code Here

    /**
     * Perform tests to ensure that a valid CanvasDetails object is returned.
     * @throws Exception
     */
    public void testCanvasDetails() throws Exception {
        PageTrackerFactory ptFactory = new JMXPageTrackerFactory();

        String title = "myTitle";
        CanvasType canvasType = CanvasType.INCLUSION;
        String themeName = "myTheme";
        String layoutName = "layoutName";

        // use factory to create CanvasDetails object
        CanvasDetails canvasDetails = ptFactory.createCanvasDetails(title,
                canvasType, themeName, layoutName);

        // compare to the parameters passed to the factory.
        DefaultCanvasDetailsTestCase.doComparison(canvasDetails, title,
                canvasType, themeName, layoutName);
View Full Code Here

     * Perform tests to ensure that a valid Page details object is returned
     * @throws Exception
     */
    public void testPageDetails() throws Exception {

        PageTrackerFactory ptFactory = new JMXPageTrackerFactory();
        String title = "myTitle";
        CanvasType canvasType = CanvasType.INCLUSION;
        String themeName = "myTheme";
        String layoutName = "layoutName";
        String deviceName = "fakeDevice";

        // use factory to create CanvasDetails object
        CanvasDetails canvasDetails = ptFactory.createCanvasDetails(title,
                canvasType, themeName, layoutName);
        PageDetails pageDetails =
                ptFactory.createPageDetails(canvasDetails, deviceName);
        DefaultPageDetailsTestCase.
                doComparison(pageDetails, canvasDetails, deviceName);
    }
View Full Code Here

     * Ensure that the JMXPageTrackerFactory returns the same instance
     * of the PageDetailsManager each time it is called.
     * @throws Exception
     */
    public void testPageDetailsManager() throws Exception {
        PageTrackerFactory ptFactory = new JMXPageTrackerFactory();
        PageDetailsManager manager1 = ptFactory.createPageDetailsManager();
        PageDetailsManager manager2 = ptFactory.createPageDetailsManager();
        assertSame("The two PageDetailsManager objects returned should be the same",
                manager1, manager2);


    }
View Full Code Here

            throws PAPIException {

        int result = elementEndImpl(context, papiAttributes);

        // add page tracking functionality
        PageTrackerFactory ptFactory = pageContext.
                getVolantisBean().getPageTrackerFactory();
        if (ptFactory != null) {
            PageAttributes canvasAttributes = (PageAttributes) papiAttributes;
            CanvasDetails canvasDetails = ptFactory.
                    createCanvasDetails(canvasAttributes.getPageTitle(),
                            getCanvasType(),
                            canvasAttributes.getTheme(),
                            canvasAttributes.getLayoutName());
            PageDetails pageDetails = ptFactory.createPageDetails(
                    canvasDetails,
                    pageContext.getDeviceName());
            try {
                ptFactory.createPageDetailsManager().addPageDetails(
                        pageDetails);
            } catch (PageTrackerException pte) {
                // ptFactory does not log errors so do it here.
                logger.error("pagedetails-creation-failure", pte);
                throw new PAPIException(
View Full Code Here

TOP

Related Classes of com.volantis.mcs.management.tracking.PageTrackerFactory

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.