Examples of BeanContextSupport


Examples of java.beans.beancontext.BeanContextSupport

    logger.debug("OUT");
  }
  // ===================================
 
  private void reset() {
    this.beanContextSupport = new BeanContextSupport();
    this.beans = new Vector();
    this.connections = new Vector();
    this.loaders = new Vector();
    this.savers = new Vector();
    this.associators = new Vector();
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

      v     = (Vector) xml.read(template);
     
      beans        = (Vector) v.get(XMLBeans.INDEX_BEANINSTANCES);
      connections  = (Vector) v.get(XMLBeans.INDEX_BEANCONNECTIONS);
     
      beanContextSupport = new BeanContextSupport(); // why?
      beanContextSupport.setDesignTime(true);
         
      for(int i = 0; i < beans.size(); i++) {
        BeanInstance bean = (BeanInstance)beans.get(i);
        logger.debug("   " + (i+1) + ". " + bean.getBean().getClass().getName());
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

    public void test_writeObject_java_beans_beancontext_BeanContextSupport() throws PropertyVetoException{
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
            byteArrayOutputStream));
        BeanContextSupport support = new BeanContextSupport();

        encoder.writeObject(support);
        encoder.close();
        DataInputStream stream = new DataInputStream(new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray()));
        XMLDecoder decoder = new XMLDecoder(stream);
        BeanContextSupport aSupport = (BeanContextSupport) decoder.readObject();
        assertEquals(Locale.getDefault(), aSupport.getLocale());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

     */
    public void testInstantiateClassLoaderStringBeanContext_Class()
            throws Exception {

        ClassLoader loader = new BinClassLoader();
        BeanContext context = new BeanContextSupport();
        Object bean = Beans.instantiate(loader, MOCK_JAVA_BEAN2, context);

        assertEquals("as_class", (String) bean.getClass().getMethod(
                "getPropertyOne", (Class[]) null).invoke(bean, (Object[]) null));
        assertSame(loader, bean.getClass().getClassLoader());
        assertTrue(context.contains(bean));
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

    }

    public void testInstantiateClassLoaderStringBeanContext_Ser()
            throws Exception {
        ClassLoader loader = new SerClassLoader();
        BeanContext context = new BeanContextSupport();
        Object bean = Beans.instantiate(loader, MOCK_JAVA_BEAN2, context);

        assertEquals("as_object", (String) bean.getClass().getMethod(
                "getPropertyOne", (Class[]) null).invoke(bean, (Object[]) null));
        assertSame(loader, bean.getClass().getClassLoader());
        assertTrue(context.contains(bean));
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

        assertTrue(context.contains(bean));
    }

    public void testInstantiateClassLoaderStringBeanContext_ClassLoaderNull()
            throws Exception {
        BeanContext context = new BeanContextSupport();
        Object bean = Beans.instantiate(null, MockJavaBean.class.getName(),
                context);

        assertEquals(bean.getClass(), MockJavaBean.class);
        assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
                .getClassLoader());
        assertTrue(context.contains(bean));
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

        assertTrue(context.contains(bean));
    }

    public void testInstantiateClassLoaderStringBeanContext_BeanNameNull()
            throws Exception {
        BeanContext context = new BeanContextSupport();
        ClassLoader loader = createSpecificClassLoader();

        try {
            Beans.instantiate(loader, null, context);
            fail("Should throw NullPointerException.");
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

     * AppletInitializer)
     */
    public void testInstantiateClassLoaderStringBeanContextAppletInitializer_Class()
            throws Exception {
        ClassLoader loader = new BinClassLoader();
        BeanContext context = new BeanContextSupport();
        AppletInitializer appInit = new MockAppletInitializer();
        Object bean = Beans.instantiate(loader, MOCK_JAVA_BEAN2, context,
                appInit);

        assertEquals("as_class", (String) bean.getClass().getMethod(
                "getPropertyOne", (Class[]) null).invoke(bean, (Object[]) null));
        assertSame(loader, bean.getClass().getClassLoader());
        assertTrue(context.contains(bean));
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

    public void testInstantiateClassLoaderStringBeanContextAppletInitializer_Ser()
            throws Exception {

        ClassLoader loader = new SerClassLoader();
        BeanContext context = new BeanContextSupport();
        AppletInitializer appInit = new MockAppletInitializer();
        Object bean = Beans.instantiate(loader, MOCK_JAVA_BEAN2, context,
                appInit);

        assertEquals("as_object", (String) bean.getClass().getMethod(
                "getPropertyOne", (Class[]) null).invoke(bean, (Object[]) null));
        assertSame(loader, bean.getClass().getClassLoader());
        assertTrue(context.contains(bean));
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

    }

    public void testInstantiateClassLoaderStringBeanContextAppletInitializer_LoaderNull()
            throws Exception {
        String beanName = "org.apache.harmony.beans.tests.support.mock.MockJavaBean";
        BeanContext context = new BeanContextSupport();
        AppletInitializer appInit = new MockAppletInitializer();

        Object bean = Beans.instantiate(null, beanName, context, appInit);

        assertSame(ClassLoader.getSystemClassLoader(), bean.getClass()
                .getClassLoader());
        assertEquals(beanName, bean.getClass().getName());
        assertTrue(context.contains(bean));
    }
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.