Re: svn commit: r909858 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r909858 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java

Scott Gray-2

On 13/02/2010, at 10:45 AM, [hidden email] wrote:

> Author: adrianc
> Date: Sat Feb 13 17:45:11 2010
> New Revision: 909858
>
> URL: http://svn.apache.org/viewvc?rev=909858&view=rev
> Log:
> Test XStream serialization/deserialization of GenericValue.
>
> Modified:
>    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
>
> Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=909858&r1=909857&r2=909858&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original)
> +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Sat Feb 13 17:45:11 2010
> @@ -29,6 +29,9 @@
> import org.ofbiz.base.util.Debug;
> import org.ofbiz.base.util.UtilDateTime;
> import org.ofbiz.base.util.UtilMisc;
> +import org.ofbiz.base.util.UtilXml;
> +import org.ofbiz.entity.Delegator;
> +import org.ofbiz.entity.DelegatorFactory;
> import org.ofbiz.entity.GenericEntity;
> import org.ofbiz.entity.GenericEntityException;
> import org.ofbiz.entity.GenericPK;
> @@ -108,6 +111,31 @@
>     }
>
>     /*
> +     * Tests XML serialization by serializing/deserializing a GenericValue
> +     */
> +    public void testXmlSerialization() throws Exception {
> +        try {
> +            // Must use the default delegator because the deserialized GenericValue can't
> +            // find the randomized one.
Hi Adrian,

Could you clarify what you mean by this?

Thanks
Scott

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r909858 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java

Adrian Crum-2
--- On Sat, 2/13/10, Scott Gray <[hidden email]> wrote:

> From: Scott Gray <[hidden email]>
> Subject: Re: svn commit: r909858 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
> To: [hidden email]
> Date: Saturday, February 13, 2010, 9:53 AM
>
> On 13/02/2010, at 10:45 AM, [hidden email]
> wrote:
>
> > Author: adrianc
> > Date: Sat Feb 13 17:45:11 2010
> > New Revision: 909858
> >
> > URL: http://svn.apache.org/viewvc?rev=909858&view=rev
> > Log:
> > Test XStream serialization/deserialization of
> GenericValue.
> >
> > Modified:
> >   
> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
> >
> > Modified:
> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=909858&r1=909857&r2=909858&view=diff
> >
> ==============================================================================
> > ---
> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
> (original)
> > +++
> ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
> Sat Feb 13 17:45:11 2010
> > @@ -29,6 +29,9 @@
> > import org.ofbiz.base.util.Debug;
> > import org.ofbiz.base.util.UtilDateTime;
> > import org.ofbiz.base.util.UtilMisc;
> > +import org.ofbiz.base.util.UtilXml;
> > +import org.ofbiz.entity.Delegator;
> > +import org.ofbiz.entity.DelegatorFactory;
> > import org.ofbiz.entity.GenericEntity;
> > import org.ofbiz.entity.GenericEntityException;
> > import org.ofbiz.entity.GenericPK;
> > @@ -108,6 +111,31 @@
> >     }
> >
> >     /*
> > +     * Tests XML serialization by
> serializing/deserializing a GenericValue
> > +     */
> > +    public void testXmlSerialization()
> throws Exception {
> > +        try {
> > +            // Must use
> the default delegator because the deserialized GenericValue
> can't
> > +            // find the
> randomized one.
>
> Hi Adrian,
>
> Could you clarify what you mean by this?

The test suite creates a testing delegator using a randomized delegator name. That testing delegator is created using a delegator method instead of the factory method. So, when the GenericValue is deserialized, it can't find the "NS29WP14" delegator that created the original GenericValue.

-Adrian