geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r471683 - in /geronimo/server/trunk/modules: geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ geronimo-kernel/src/main/java/org/apache/geronimo/gbean/ geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ geronim...
Date Mon, 06 Nov 2006 10:28:55 GMT
Author: djencks
Date: Mon Nov  6 02:28:54 2006
New Revision: 471683

URL: http://svn.apache.org/viewvc?view=rev&rev=471683
Log:
GERONIMO-2541 priority order for gbeans, including Gianny's backward compatibility patch

Added:
    geronimo/server/trunk/modules/geronimo-kernel/src/test/data/gbeandata/
    geronimo/server/trunk/modules/geronimo-kernel/src/test/data/gbeandata/SERIALIZATION_-1012491431781444074.ser
  (with props)
    geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanDataTest.java
  (with props)
Modified:
    geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java

Modified: geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?view=diff&rev=471683&r1=471682&r2=471683
==============================================================================
--- geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
(original)
+++ geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
Mon Nov  6 02:28:54 2006
@@ -36,6 +36,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
+import java.util.Collections;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -384,9 +385,11 @@
             throw new DeploymentException(message.toString());
         }
 
+        ArrayList gbeans = new ArrayList(configuration.getGBeans().values());
+        Collections.sort(gbeans, new GBeanData.PriorityComparator());
         ConfigurationData configurationData = new ConfigurationData(configuration.getModuleType(),
                 new LinkedHashSet(configuration.getClassPath()),
-                new ArrayList(configuration.getGBeans().values()),
+                gbeans,
                 childConfigurationDatas,
                 configuration.getEnvironment(),
                 baseDir,

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java?view=diff&rev=471683&r1=471682&r2=471683
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanData.java
Mon Nov  6 02:28:54 2006
@@ -21,6 +21,7 @@
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -31,11 +32,19 @@
  * @version $Rev$ $Date$
  */
 public class GBeanData implements Externalizable {
+    private static final long serialVersionUID = -1012491431781444074L;
+
+    private Externalizable backwardExternalizables[] = new Externalizable[] {
+            new V0Externalizable(),
+            new V1Externalizable()
+    };
+
     private GBeanInfo gbeanInfo;
     private final Map attributes;
     private final Map references;
     private final Set dependencies;
     private AbstractName abstractName;
+    private int priority;
 
     public GBeanData() {
         attributes = new HashMap();
@@ -45,17 +54,17 @@
 
     public GBeanData(GBeanInfo gbeanInfo) {
         this();
-        this.gbeanInfo = gbeanInfo;
+        setGBeanInfo(gbeanInfo);
     }
 
     public GBeanData(AbstractName abstractName, GBeanInfo gbeanInfo) {
         this();
         this.abstractName = abstractName;
-        this.gbeanInfo = gbeanInfo;
+        setGBeanInfo(gbeanInfo);
     }
 
     public GBeanData(GBeanData gbeanData) {
-        gbeanInfo = gbeanData.gbeanInfo;
+        setGBeanInfo(gbeanData.gbeanInfo);
         attributes = new HashMap(gbeanData.attributes);
         references = new HashMap(gbeanData.references);
         dependencies = new HashSet(gbeanData.dependencies);
@@ -84,6 +93,11 @@
 
     public void setGBeanInfo(GBeanInfo gbeanInfo) {
         this.gbeanInfo = gbeanInfo;
+        if (gbeanInfo == null) {
+            priority = GBeanInfo.PRIORITY_NORMAL;
+        } else {
+            priority = gbeanInfo.getPriority();
+        }
     }
 
     public Map getAttributes() {
@@ -169,13 +183,27 @@
         this.dependencies.add(new ReferencePatterns(dependency));
     }
 
+    public int getPriority() {
+        return priority;
+    }
+
+    public void setPriority(int priority) {
+        this.priority = priority;
+    }
+
     public void writeExternal(ObjectOutput out) throws IOException {
+        // write version index
+        out.writeObject(new Integer(backwardExternalizables.length -1));
+
         // write the gbean info
         out.writeObject(gbeanInfo);
 
         // write the abstract name
         out.writeObject(abstractName);
 
+        // write the priority
+        out.writeInt(priority);
+
         // write the attributes
         out.writeInt(attributes.size());
         for (Iterator iterator = attributes.entrySet().iterator(); iterator.hasNext();) {
@@ -215,64 +243,119 @@
                 throw (IOException) new IOException("Unable to write dependency pattern in
gbean: " + abstractName).initCause(e);
             }
         }
-
     }
 
 
     public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        // read the gbean info
-        gbeanInfo = (GBeanInfo) in.readObject();
+        Object opaque = in.readObject();
+        if (opaque instanceof Integer) {
+            backwardExternalizables[((Integer) opaque).intValue()].readExternal(in);
+        } else {
+            gbeanInfo = (GBeanInfo) opaque;
+            backwardExternalizables[0].readExternal(in);
+        }
+    }
+
+    /**
+     * Note: this comparator
+     * imposes orderings that are inconsistent with equals.
+     */
+    public static class PriorityComparator implements Comparator {
+
+        public int compare(Object o1, Object o2) {
+            if (o1 instanceof GBeanData && o2 instanceof GBeanData) {
+                return ((GBeanData)o1).priority - ((GBeanData)o2).priority;
+            }
+            return 0;
+        }
+    }
+
+    private class V0Externalizable implements Externalizable {
 
-        // read the abstract name
-        try {
-            abstractName = (AbstractName) in.readObject();
-        } catch (IOException e) {
-            throw (IOException) new IOException("Unable to deserialize AbstractName for GBeanData
of type " + gbeanInfo.getClassName()).initCause(e);
+        public void writeExternal(ObjectOutput out) throws IOException {
+            throw new UnsupportedOperationException();
         }
 
+        public final void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
+            // read the gbean info
+            readGBeanInfo(in);
 
-        try {
-            // read the attributes
-            int attributeCount = in.readInt();
-            for (int i = 0; i < attributeCount; i++) {
-                String attributeName = (String) in.readObject();
-                Object attributeValue;
-                try {
-                    attributeValue = in.readObject();
-                } catch (ClassNotFoundException e) {
-                    throw new ClassNotFoundException("Unable to find class used in GBeanData
" + abstractName + ", attribute: " + attributeName, e);
-                } catch (IOException e) {
-                    throw (IOException) new IOException("Unable to deserialize GBeanData
" + abstractName + ", attribute: " + attributeName).initCause(e);
-                }
-                setAttribute(attributeName, attributeValue);
+            // read the abstract name
+            try {
+                abstractName = (AbstractName) in.readObject();
+            } catch (IOException e) {
+                throw (IOException) new IOException("Unable to deserialize AbstractName for
GBeanData of type " + gbeanInfo.getClassName()).initCause(e);
             }
 
-            // read the references
-            int endpointCount = in.readInt();
-            for (int i = 0; i < endpointCount; i++) {
-                String referenceName = (String) in.readObject();
-                ReferencePatterns referencePattern;
-                try {
-                    referencePattern = (ReferencePatterns) in.readObject();
-                } catch (ClassNotFoundException e) {
-                    throw new ClassNotFoundException("Unable to find class used in GBeanData
" + abstractName + ", reference: " + referenceName, e);
-                } catch (IOException e) {
-                    throw (IOException) new IOException("Unable to deserialize GBeanData
" + abstractName + ", reference: " + referenceName).initCause(e);
+            readPriority(in);
+
+            try {
+                // read the attributes
+                int attributeCount = in.readInt();
+                for (int i = 0; i < attributeCount; i++) {
+                    String attributeName = (String) in.readObject();
+                    Object attributeValue;
+                    try {
+                        attributeValue = in.readObject();
+                    } catch (ClassNotFoundException e) {
+                        throw new ClassNotFoundException("Unable to find class used in GBeanData
" + abstractName + ", attribute: " + attributeName, e);
+                    } catch (IOException e) {
+                        throw (IOException) new IOException("Unable to deserialize GBeanData
" + abstractName + ", attribute: " + attributeName).initCause(e);
+                    }
+                    setAttribute(attributeName, attributeValue);
+                }
+
+                // read the references
+                int endpointCount = in.readInt();
+                for (int i = 0; i < endpointCount; i++) {
+                    String referenceName = (String) in.readObject();
+                    ReferencePatterns referencePattern;
+                    try {
+                        referencePattern = (ReferencePatterns) in.readObject();
+                    } catch (ClassNotFoundException e) {
+                        throw new ClassNotFoundException("Unable to find class used in GBeanData
" + abstractName + ", reference: " + referenceName, e);
+                    } catch (IOException e) {
+                        throw (IOException) new IOException("Unable to deserialize GBeanData
" + abstractName + ", reference: " + referenceName).initCause(e);
+                    }
+                    setReferencePatterns(referenceName, referencePattern);
                 }
-                setReferencePatterns(referenceName, referencePattern);
+
+                //read the dependencies
+                int dependencyCount = in.readInt();
+                for (int i = 0; i < dependencyCount; i++) {
+                    ReferencePatterns depdendencyPattern = (ReferencePatterns) in.readObject();
+                    dependencies.add(depdendencyPattern);
+                }
+            } catch (IOException e) {
+                throw (IOException) new IOException("Unable to deserialize GBeanData " +
abstractName).initCause(e);
+            } catch (ClassNotFoundException e) {
+                throw new ClassNotFoundException("Unable to find class used in GBeanData
" + abstractName, e);
             }
+        }
+
+        protected void readGBeanInfo(ObjectInput in) throws IOException, ClassNotFoundException
{
+        }
 
-            //read the dependencies
-            int dependencyCount = in.readInt();
-            for (int i = 0; i < dependencyCount; i++) {
-                ReferencePatterns depdendencyPattern = (ReferencePatterns) in.readObject();
-                dependencies.add(depdendencyPattern);
-            }
-        } catch (IOException e) {
-            throw (IOException) new IOException("Unable to deserialize GBeanData " + abstractName).initCause(e);
-        } catch (ClassNotFoundException e) {
-            throw new ClassNotFoundException("Unable to find class used in GBeanData " +
abstractName, e);
+        protected void readPriority(ObjectInput in) throws IOException, ClassNotFoundException
{
+            priority = GBeanInfo.PRIORITY_NORMAL;
         }
+
+    }
+
+    private class V1Externalizable extends V0Externalizable {
+
+        public void writeExternal(ObjectOutput out) throws IOException {
+            throw new UnsupportedOperationException();
+        }
+
+        protected void readGBeanInfo(ObjectInput in)  throws IOException, ClassNotFoundException
{
+            gbeanInfo = (GBeanInfo) in.readObject();
+        }
+
+        protected void readPriority(ObjectInput in) throws IOException, ClassNotFoundException
{
+            priority = in.readInt();
+        }
+
     }
 
 }

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java?view=diff&rev=471683&r1=471682&r2=471683
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfo.java
Mon Nov  6 02:28:54 2006
@@ -38,6 +38,10 @@
  * @version $Rev$ $Date$
  */
 public final class GBeanInfo implements Serializable {
+
+    public static final int PRIORITY_CLASSLOADER = 1;
+    public static final int PRIORITY_NORMAL = 5;
+
     private static final Set DEFAULT_NOTIFICATIONS = Collections.unmodifiableSet(new HashSet(Arrays.asList(NotificationType.TYPES)));
 
     /**
@@ -91,40 +95,41 @@
     private final Set references;
     private final Map referencesByName;
     private final Set interfaces;
+    private final int priority;
 
     /**
      * @deprecated use GBeanInfoBuilder
      */
     public GBeanInfo(String name, String className, String j2eeType, Collection attributes,
GConstructorInfo constructor, Collection operations, Set references, Set interfaces) {
-        this(null, name, className, j2eeType, attributes, constructor, operations, references,
interfaces, DEFAULT_NOTIFICATIONS);
+        this(null, name, className, j2eeType, attributes, constructor, operations, references,
interfaces, DEFAULT_NOTIFICATIONS, PRIORITY_NORMAL);
     }
 
     /**
      * @deprecated use GBeanInfoBuilder
      */
     public GBeanInfo(String className, String j2eeType, Collection attributes, GConstructorInfo
constructor, Collection operations, Set references, Set interfaces) {
-        this(null, className, className, j2eeType, attributes, constructor, operations, references,
interfaces, DEFAULT_NOTIFICATIONS);
+        this(null, className, className, j2eeType, attributes, constructor, operations, references,
interfaces, DEFAULT_NOTIFICATIONS, PRIORITY_NORMAL);
     }
 
     /**
      * @deprecated use GBeanInfoBuilder
      */
     public GBeanInfo(String className, String j2eeType, Collection attributes, GConstructorInfo
constructor, Collection operations, Set references, Set interfaces, Set notifications) {
-        this(null, className, className, j2eeType, attributes, constructor, operations, references,
interfaces, notifications);
+        this(null, className, className, j2eeType, attributes, constructor, operations, references,
interfaces, notifications, PRIORITY_NORMAL);
     }
 
     /**
      * @deprecated use GBeanInfoBuilder
      */
     public GBeanInfo(String name, String className, String j2eeType, Collection attributes,
GConstructorInfo constructor, Collection operations, Set references, Set interfaces, Set notifications)
{
-        this(null, name, className, j2eeType, attributes, constructor, operations, references,
interfaces, notifications);
+        this(null, name, className, j2eeType, attributes, constructor, operations, references,
interfaces, notifications, PRIORITY_NORMAL);
     }
 
-    GBeanInfo(String sourceClass, String name, String className, String j2eeType, Collection
attributes, GConstructorInfo constructor, Collection operations, Set references, Set interfaces)
{
-        this(sourceClass, name, className, j2eeType, attributes, constructor, operations,
references, interfaces, DEFAULT_NOTIFICATIONS);
+    GBeanInfo(String sourceClass, String name, String className, String j2eeType, Collection
attributes, GConstructorInfo constructor, Collection operations, Set references, Set interfaces,
int priority) {
+        this(sourceClass, name, className, j2eeType, attributes, constructor, operations,
references, interfaces, DEFAULT_NOTIFICATIONS, priority);
     }
 
-    GBeanInfo(String sourceClass, String name, String className, String j2eeType, Collection
attributes, GConstructorInfo constructor, Collection operations, Set references, Set interfaces,
Set notifications) {
+    GBeanInfo(String sourceClass, String name, String className, String j2eeType, Collection
attributes, GConstructorInfo constructor, Collection operations, Set references, Set interfaces,
Set notifications, int priority) {
         this.sourceClass = sourceClass;
         this.name = name;
         this.className = className;
@@ -173,6 +178,7 @@
         } else {
             this.notifications = Collections.unmodifiableSet(new HashSet(notifications));
         }
+        this.priority = priority;
     }
 
     /**
@@ -263,6 +269,10 @@
 
     public Set getInterfaces() {
         return interfaces;
+    }
+
+    public int getPriority() {
+        return priority;
     }
 
     public String toString() {

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java?view=diff&rev=471683&r1=471682&r2=471683
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
Mon Nov  6 02:28:54 2006
@@ -130,6 +130,8 @@
 
     private final Set interfaces = new HashSet();
 
+    private int priority = GBeanInfo.PRIORITY_NORMAL;
+
     public GBeanInfoBuilder(Class gbeanType) {
         this(checkNotNull(gbeanType).getName(), gbeanType, null, null);
     }
@@ -201,6 +203,8 @@
 
             //in case subclass constructor has same parameters as superclass.
             constructor = source.getConstructor();
+
+            priority = source.getPriority();
         }
         if (j2eeType != null) {
             this.j2eeType = j2eeType;
@@ -423,6 +427,10 @@
         references.put(name, new RefInfo(type.getName(), null));
     }
 
+    public void setPriority(int priority) {
+        this.priority = priority;
+    }
+
     public GBeanInfo getBeanInfo() {
         // get the types of the constructor args
         // this also verifies that we have a valid constructor
@@ -459,7 +467,7 @@
             referenceInfos.add(new GReferenceInfo(referenceName, referenceType, proxyType,
setterName, namingType));
         }
 
-        return new GBeanInfo(sourceClass, name, gbeanType.getName(), j2eeType, attributes.values(),
constructor, operations.values(), referenceInfos, interfaces);
+        return new GBeanInfo(sourceClass, name, gbeanType.getName(), j2eeType, attributes.values(),
constructor, operations.values(), referenceInfos, interfaces, priority);
     }
 
     private Map getConstructorTypes() throws InvalidConfigurationException {

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?view=diff&rev=471683&r1=471682&r2=471683
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Mon Nov  6 02:28:54 2006
@@ -22,7 +22,6 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -32,6 +31,7 @@
 import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
+
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?view=diff&rev=471683&r1=471682&r2=471683
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
Mon Nov  6 02:28:54 2006
@@ -342,7 +342,8 @@
     }
 
     static void startConfigurationGBeans(AbstractName configurationName, Configuration configuration,
Kernel kernel) throws InvalidConfigException {
-        Collection gbeans = configuration.getGBeans().values();
+        List gbeans = new ArrayList(configuration.getGBeans().values());
+        Collections.sort(gbeans, new GBeanData.PriorityComparator());
 
         List loaded = new ArrayList(gbeans.size());
         List started = new ArrayList(gbeans.size());

Added: geronimo/server/trunk/modules/geronimo-kernel/src/test/data/gbeandata/SERIALIZATION_-1012491431781444074.ser
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/test/data/gbeandata/SERIALIZATION_-1012491431781444074.ser?view=auto&rev=471683
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/trunk/modules/geronimo-kernel/src/test/data/gbeandata/SERIALIZATION_-1012491431781444074.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanDataTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanDataTest.java?view=auto&rev=471683
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanDataTest.java
(added)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanDataTest.java
Mon Nov  6 02:28:54 2006
@@ -0,0 +1,51 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.gbean;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.geronimo.testsupport.TestSupport;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class GBeanDataTest extends TestSupport {
+
+  public void testBackwardCompatibility() throws Exception {
+      FileInputStream fis = new FileInputStream(resolveFile("src/test/data/gbeandata/SERIALIZATION_-1012491431781444074.ser"));
+      ObjectInputStream is = new ObjectInputStream(fis);
+      is.readObject();
+    }
+    
+    public void testCurrentSerialization() throws Exception {
+        GBeanData beanData = new GBeanData();
+        
+        ByteArrayOutputStream memOut = new ByteArrayOutputStream();
+        ObjectOutputStream os = new ObjectOutputStream(memOut);
+        os.writeObject(beanData);
+        
+        ByteArrayInputStream memIn = new ByteArrayInputStream(memOut.toByteArray());
+        ObjectInputStream is = new ObjectInputStream(memIn);
+        is.readObject();
+    }
+    
+}

Propchange: geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanDataTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanDataTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/gbean/GBeanDataTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message