Package org.apache.harmony.testframework.serialization.SerializationTest

Examples of org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert


         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);
                 assertSame(mock, mock.support.beanContextChildPeer);
View Full Code Here


        sup.addPropertyChangeListener(l1);
        sup.addPropertyChangeListener("myProp", l1);
        sup.addPropertyChangeListener("myProp", l2);
        sup2.addPropertyChangeListener(l1);
        sup2.addPropertyChangeListener("myProp", l1);
        SerializationTest.verifyGolden(this, sup2, new SerializableAssert() {
            public void assertDeserialized(Serializable initial,
                    Serializable deserialized) {
                PropertyChangeSupport sup2 = (PropertyChangeSupport) initial;
                PropertyChangeSupport deSup = (PropertyChangeSupport) deserialized;
                assertEquals(sup2.getPropertyChangeListeners()[0], deSup
View Full Code Here

                 new MockBeanContextServiceProviderS("p1"));
         support
                 .addService(Set.class,
                         new MockBeanContextServiceProviderS("p2"));
         support.addService(Map.class, new MockBeanContextServiceProvider());
         SerializationTest.verifyGolden(this, support, new SerializableAssert(){
             public void assertDeserialized(Serializable initial, Serializable deserialized) {
                 assertEqualsSerially((BeanContextServicesSupport) initial,
                         (BeanContextServicesSupport) deserialized);
             }
         });
View Full Code Here

                 "id of vcl2");
         support.addPropertyChangeListener("beanContext", pcl1);
         support.addPropertyChangeListener("beanContext", pcl2);
         support.addVetoableChangeListener("beanContext", vcl1);
         support.addVetoableChangeListener("beanContext", vcl2);
         SerializationTest.verifyGolden(this, support, new SerializableAssert(){
             public void assertDeserialized(Serializable orig, Serializable ser) {
                 assertEqualsSerially((BeanContextChildSupport) orig,
                         (BeanContextChildSupport) ser);
             }
         });
View Full Code Here

       things.add("2");
       things.add("3");
       BeanContextMembershipEvent event = new BeanContextMembershipEvent(
               new MockBeanContext(), things);
       event.setPropagatedFrom(new MockBeanContextDelegateS("from ID"));
       SerializationTest.verifyGolden(this, event, new SerializableAssert(){
           public void assertDeserialized(Serializable orig, Serializable ser) {
               assertEqualsSerially((BeanContextMembershipEvent) orig,
                       (BeanContextMembershipEvent) ser);
           }
       });
View Full Code Here

         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);
                 assertSame(mock, mock.support.beanContextChildPeer);
View Full Code Here

                null, Locale.FRANCE, false, false);
        final BeanContextServicesSupport ctx2 = new BeanContextServicesSupport(
                ctx, Locale.ITALY, true, true);
        BeanContextEvent event = new MockBeanContextEvent(ctx2);
        event.setPropagatedFrom(ctx);
        SerializationTest.verifySelf(event, new SerializableAssert(){
            public void assertDeserialized(Serializable arg0, Serializable arg1) {
                BeanContextEvent e1 = (BeanContextEvent)arg0;
                BeanContextEvent e2 = (BeanContextEvent)arg1;
                assertNull((BeanContextServicesSupport)e2.getSource());
                assertNotNull((BeanContextServicesSupport)e1.getSource());
View Full Code Here

        final BeanContextServicesSupport ctx2 = new BeanContextServicesSupport(
                null, Locale.CHINA, true, true);
       
        BeanContextEvent event = new MockBeanContextEvent(ctx);
        event.setPropagatedFrom(ctx2);
        SerializationTest.verifyGolden(this, event, new SerializableAssert(){
            public void assertDeserialized(Serializable arg0, Serializable arg1) {
                BeanContextEvent e1 = (BeanContextEvent)arg0;
                BeanContextEvent e2 = (BeanContextEvent)arg1;
                assertNull((BeanContextServicesSupport)e2.getSource());
                assertNotNull((BeanContextServicesSupport)e1.getSource());
View Full Code Here

     public void testSerialization_Compatibility() throws Exception {
         BeanContextServiceAvailableEvent event = new BeanContextServiceAvailableEvent(
                 new MockBeanContextServices(), ArrayList.class);
         event.setPropagatedFrom(new MockBeanContextDelegateS("from ID"));
         SerializationTest.verifyGolden(this, event, new SerializableAssert(){
             public void assertDeserialized(Serializable orig, Serializable ser) {
                 assertEqualsSerially((BeanContextServiceAvailableEvent) orig,
                         (BeanContextServiceAvailableEvent) ser);
             }
         });
View Full Code Here

        assertEquals(15, mat.end());
    }

    public void testSerialization() throws Exception {
        Pattern pat = Pattern.compile("a*bc");
        SerializableAssert comparator = new SerializableAssert() {
            public void assertDeserialized(Serializable initial,
                    Serializable deserialized) {
                assertEquals(((Pattern) initial).toString(),
                        ((Pattern) deserialized).toString());
            }
View Full Code Here

TOP

Related Classes of org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert

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.