Package com.sun.faces.mgbean

Examples of com.sun.faces.mgbean.ManagedBeanInfo$MapEntry


                                                       mapEntry,
                                                       null);
        properties.add(property);


        ManagedBeanInfo bean = new ManagedBeanInfo(beanName,
                                                   beanName,
                                                   "request",
                                                   null,
                                                   null,
                                                   properties,
View Full Code Here


                                                 null,
                                                 listEntry);
        List<ManagedBeanInfo.ManagedProperty> list =
             new ArrayList<ManagedBeanInfo.ManagedProperty>(1);
        list.add(property);
        ManagedBeanInfo bean = new ManagedBeanInfo(beanName,
                                                   beanName,
                                                   "session",
                                                   null,
                                                   null,
                                                   list,
View Full Code Here

                                                 null,
                                                 mapEntry,
                                                 null);
        properties.add(property);

        ManagedBeanInfo bean = new ManagedBeanInfo(beanName,
                                                   beanName,
                                                   "request",
                                                   null,
                                                   null,
                                                   properties,
View Full Code Here

                                                 null,
                                                 null);
        List<ManagedBeanInfo.ManagedProperty> list =
             new ArrayList<ManagedBeanInfo.ManagedProperty>(1);
        list.add(property);
        ManagedBeanInfo bean = new ManagedBeanInfo(beanName,
                                                   beanName,
                                                   "session",
                                                   null,
                                                   null,
                                                   list,
View Full Code Here

                                                 null,
                                                 null);
        List<ManagedBeanInfo.ManagedProperty> list =
             new ArrayList<ManagedBeanInfo.ManagedProperty>(1);
        list.add(property);
        ManagedBeanInfo bean = new ManagedBeanInfo(beanName,
                                                   beanName,
                                                   "session",
                                                   null,
                                                   null,
                                                   list,
                                                   null);
        BeanManager beanManager =
             ApplicationAssociate.getCurrentInstance().getBeanManager();
        beanManager.register(bean);

        //testing with a property set
        assertNotNull(testBean = (TestBean) beanManager.create(beanName,
                                                               getFacesContext()));

        //make sure bean instantiated properly. Get property back from bean.
        assertTrue(testBean.getOne().equals("one"));


        //testing with:
        //  valueref in request scope
        //  managed bean in application scope
        getFacesContext().getExternalContext().getApplicationMap()
             .remove("TestRefBean");
        getFacesContext().getExternalContext().getRequestMap().put(
            "TestRefBean", testBean);

        bean = new ManagedBeanInfo(beanName,
                                   beanName,
                                   "application",
                                   null,
                                   null,
                                   list,
                                   null);
        beanManager.register(bean);

        exceptionThrown = false;
        try {
            //testing with a property set
            beanManager.create(beanName, getFacesContext());
            fail("Should have thrown FacesException");
        } catch (FacesException ex) {
            exceptionThrown = true;
        }
        assertTrue(exceptionThrown);

        //cleanup
        getFacesContext().getExternalContext().getRequestMap().remove(
            "TestRefBean");

        //testing with:
        //  valueref in session scope
        //  managed bean in no scope
        getFacesContext().getExternalContext().getSessionMap().put(
            "TestRefBean", testBean);

       bean = new ManagedBeanInfo(beanName,
                                   beanName,
                                   "none",
                                   null,
                                   null,
                                   list,
View Full Code Here

                                                 null,
                                                 null);
        List<ManagedBeanInfo.ManagedProperty> list =
             new ArrayList<ManagedBeanInfo.ManagedProperty>(1);
        list.add(property);
        ManagedBeanInfo bean = new ManagedBeanInfo(beanName,
                                                   beanName,
                                                   "none",
                                                   null,
                                                   null,
                                                   list,
View Full Code Here

       
    }
   
    public void testIsInjectable() throws Exception {

        ManagedBeanInfo bean = new ManagedBeanInfo(beanName,
                                                   beanName,
                                                   "session",
                                                   null,
                                                   null,
                                                   null,
                                                   null);
        BeanManager beanManager =
             ApplicationAssociate.getCurrentInstance().getBeanManager();
        beanManager.register(bean);
        BeanBuilder builder = beanManager.getBuilder(beanName);
        Boolean isInjectable = (Boolean) TestingUtil.invokePrivateMethod("scanForAnnotations",
                                                                         new Class[] { Class.class },
                                                                         new Object[] { TestBean.class },
                                                                         BeanBuilder.class,
                                                                         builder);
        assertTrue(!isInjectable);

        bean = new ManagedBeanInfo(beanName,
                                   "com.sun.faces.config.TestManagedBeanFactory$InjectionBean",
                                   "request",
                                   null,
                                   null,
                                   null,
View Full Code Here

                                                 null,
                                                 "#{'this'} is a String",
                                                 null,
                                                 null);
        properties.add(property);
        ManagedBeanInfo bean = new ManagedBeanInfo(beanName,
                                                   beanName,
                                                   "request",
                                                   null,
                                                   null,
                                                   properties,
View Full Code Here

     * application's managed bean factory list.
     */
    public void testManagedBean() throws Exception {
        String beanName = "com.sun.faces.TestBean";

        ManagedBeanInfo beanInfo = new ManagedBeanInfo(beanName,
                                                       beanName,
                                                       "session",
                                                       null,
                                                       null,
                                                       null,
View Full Code Here

                }
            }
        }
        */

        return new ManagedBeanInfo(name,
                                   annotatedClass.getName(),
                                   scope,
                                   eager,
                                   null,
                                   null,
View Full Code Here

TOP

Related Classes of com.sun.faces.mgbean.ManagedBeanInfo$MapEntry

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.