Examples of BeanContextSupport


Examples of java.beans.beancontext.BeanContextSupport

        BeanContextSupport beanContextSupport = new BeanContextSupport();
        beanContextSupport.readChildren((ObjectInputStream) null);
    }

    public void test_readChildren_NPE_scenario3() throws Exception {
        BeanContextSupport beanContextSupport = new BeanContextSupport();
        beanContextSupport.add(new Object());
        beanContextSupport.readChildren((ObjectInputStream) null);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

        beanContextSupport.add(new Object());
        beanContextSupport.readChildren((ObjectInputStream) null);
    }

    public void test_readChildren_NPE_scenario4() throws Exception {
        BeanContextSupport beanContextSupport = new BeanContextSupport();
        beanContextSupport.add("Serializable");
        try {
            beanContextSupport.readChildren((ObjectInputStream) null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }
        beanContextSupport.remove("Serializable");
        beanContextSupport.readChildren((ObjectInputStream) null);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

                return childSupport;
            }
        }
       
        // Regression test for HARMONY-1829
        BeanContextSupport obj = new BeanContextSupport();
        obj.add(new TestBean());
        assertEquals(2, obj.size());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

        // covered by testReadChildren()
    }

    public void testSerialization_NoPeer() throws IOException,
            ClassNotFoundException {
        BeanContextSupport support = new BeanContextSupport(null, Locale.ITALY,
                true, true);
        support
                .addBeanContextMembershipListener(new MockBeanContextMembershipListener());
        support
                .addBeanContextMembershipListener(new MockBeanContextMembershipListenerS(
                        "l2"));
        support
                .addBeanContextMembershipListener(new MockBeanContextMembershipListenerS(
                        "l3"));
        support
                .addBeanContextMembershipListener(new MockBeanContextMembershipListener());
        support.add("abcd");
        support.add(new MockBeanContextChild());
        support.add(new MockBeanContextChildS("a child"));
        support.add(new MockBeanContextChild());
        support.add("1234");
        support.add(new MockBeanContextProxyS("proxy",
                new MockBeanContextChildS("b child")));

        assertEqualsSerially(support, (BeanContextSupport) SerializationTester
                .getDeserilizedObject(support));
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

    }

    public void testSerialization_Peer() throws IOException,
            ClassNotFoundException {
        MockBeanContextDelegateS mock = new MockBeanContextDelegateS("main id");
        BeanContextSupport support = mock.support;
        support
                .addBeanContextMembershipListener(new MockBeanContextMembershipListener());
        support
                .addBeanContextMembershipListener(new MockBeanContextMembershipListenerS(
                        "l2"));
        support
                .addBeanContextMembershipListener(new MockBeanContextMembershipListenerS(
                        "l3"));
        support
                .addBeanContextMembershipListener(new MockBeanContextMembershipListener());
        support.add("abcd");
        support.add(new MockBeanContextChild());
        support.add(new MockBeanContextChildS("a child"));
        support.add(new MockBeanContextChild());
        support.add("1234");
        support.add(new MockBeanContextProxyS("proxy",
                new MockBeanContextChildS("b child")));

        MockBeanContextDelegateS serMock = (MockBeanContextDelegateS) SerializationTester
                .getDeserilizedObject(mock);
        assertEquals(mock.id, serMock.id);
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

        assertEqualsSerially(mock.support, serMock.support);
    }

     public void testSerialization_Compatibility() throws Exception {
         MockBeanContextDelegateS mock = new MockBeanContextDelegateS("main id");
         BeanContextSupport support = mock.support;
         support.addBeanContextMembershipListener(new MockBeanContextMembershipListener());
         support.addBeanContextMembershipListener(new MockBeanContextMembershipListenerS("l2"));
         support.addBeanContextMembershipListener(new MockBeanContextMembershipListenerS("l3"));
         support.addBeanContextMembershipListener(new MockBeanContextMembershipListener());
         support.add("abcd");
         support.add(new MockBeanContextChild());
         support.add(new MockBeanContextChildS("a child"));
         support.add(new MockBeanContextChild());
         support.add("1234");
         SerializationTest.verifyGolden(this, mock, new SerializableAssert(){
             public void assertDeserialized(Serializable orig, Serializable ser) {
                 MockBeanContextDelegateS serMock = (MockBeanContextDelegateS) ser;
                 MockBeanContextDelegateS mock = (MockBeanContextDelegateS) orig;
                 assertEquals(mock.id, serMock.id);
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

        p.firePropertyChange(null, new Object(), new Object());
    }
   
    //Regression Test for HARMONY-3757
    public void testSelfSerializatoin() throws Exception {
        BeanContextSupport beanContextSupport = new BeanContextSupport();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        new ObjectOutputStream(baos).writeObject(beanContextSupport);
        ObjectInputStream oin = new ObjectInputStream(new ByteArrayInputStream(
                baos.toByteArray()));
        Object obj = oin.readObject();
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

  }

  // Link the supplied beans into the KnowledgeFlow gui
  private void integrateFlow(Vector beans, Vector connections) {
    java.awt.Color bckC = getBackground();
    m_bcSupport = new BeanContextSupport();
    m_bcSupport.setDesignTime(true);

    // register this panel as a property change listener with each
    // bean
    for (int i = 0; i < beans.size(); i++) {
View Full Code Here

Examples of java.beans.beancontext.BeanContextSupport

        connections = (Vector) ois.readObject();
        ois.close();
      }

      java.awt.Color bckC = getBackground();
      m_bcSupport = new BeanContextSupport();
      m_bcSupport.setDesignTime(true);

      // register this panel as a property change listener with each
      // bean
      for (int i = 0; i < beans.size(); i++) {
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.