[DISCUSS] Questions: testing compatibility test with older version on a POJO

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[DISCUSS] Questions: testing compatibility test with older version on a POJO

clebertsuconic
I need to write a test where the binary output would need to be
checked against an older version of a class.


The test would be something like:


{
   MessageImpl currentMessage = new MessageImpl();
   setProperties(currentMessages); // some method that will generate
data on message

   // something that will encode the message
   currentMessage.encode(someBuffer);

   osgiMagic(someBuffer);
}

I'm looking for some OSGI Magic where I can then make comparissons
with MessageImpl from 1.5.0.


Is there any manageable way of doing this? Manageable = not so bad
that only me would understand the code.


I don't even know what to look for on google, hence the question here.



thanks for any help is appreciated!


Clebert
Reply | Threaded
Open this post in threaded view
|

Re: [DISCUSS] Questions: testing compatibility test with older version on a POJO

chirino
Try storing the 1.5.0 encoded buffer as a resource file in your test.

On Wed, Dec 7, 2016 at 9:55 PM, Clebert Suconic <[hidden email]>
wrote:

> I need to write a test where the binary output would need to be
> checked against an older version of a class.
>
>
> The test would be something like:
>
>
> {
>    MessageImpl currentMessage = new MessageImpl();
>    setProperties(currentMessages); // some method that will generate
> data on message
>
>    // something that will encode the message
>    currentMessage.encode(someBuffer);
>
>    osgiMagic(someBuffer);
> }
>
> I'm looking for some OSGI Magic where I can then make comparissons
> with MessageImpl from 1.5.0.
>
>
> Is there any manageable way of doing this? Manageable = not so bad
> that only me would understand the code.
>
>
> I don't even know what to look for on google, hence the question here.
>
>
>
> thanks for any help is appreciated!
>
>
> Clebert
>



--
Hiram Chirino
Engineering | Red Hat, Inc.
[hidden email] | fusesource.com | redhat.com
skype: hiramchirino | twitter: @hiramchirino
Reply | Threaded
Open this post in threaded view
|

Re: [DISCUSS] Questions: testing compatibility test with older version on a POJO

clebertsuconic
Nice idea. :). I can the use simple OSGI stuff i guess.  I will still need
to figure out but I know where to look.


Thanks.


On Thu, Dec 8, 2016 at 7:34 AM Hiram Chirino <[hidden email]> wrote:

> Try storing the 1.5.0 encoded buffer as a resource file in your test.
>
>
>
> On Wed, Dec 7, 2016 at 9:55 PM, Clebert Suconic <[hidden email]
> >
>
> wrote:
>
>
>
> > I need to write a test where the binary output would need to be
>
> > checked against an older version of a class.
>
> >
>
> >
>
> > The test would be something like:
>
> >
>
> >
>
> > {
>
> >    MessageImpl currentMessage = new MessageImpl();
>
> >    setProperties(currentMessages); // some method that will generate
>
> > data on message
>
> >
>
> >    // something that will encode the message
>
> >    currentMessage.encode(someBuffer);
>
> >
>
> >    osgiMagic(someBuffer);
>
> > }
>
> >
>
> > I'm looking for some OSGI Magic where I can then make comparissons
>
> > with MessageImpl from 1.5.0.
>
> >
>
> >
>
> > Is there any manageable way of doing this? Manageable = not so bad
>
> > that only me would understand the code.
>
> >
>
> >
>
> > I don't even know what to look for on google, hence the question here.
>
> >
>
> >
>
> >
>
> > thanks for any help is appreciated!
>
> >
>
> >
>
> > Clebert
>
> >
>
>
>
>
>
>
>
> --
>
> Hiram Chirino
>
> Engineering | Red Hat, Inc.
>
> [hidden email] | fusesource.com | redhat.com
>
> skype: hiramchirino | twitter: @hiramchirino
>
>