You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Stepan Mishura <st...@gmail.com> on 2006/08/08 11:48:39 UTC

[classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Hi Jimmy,

I expect that we agreed to use new serialization framework for new tests.
But I see that people continue develop tests for serialization using the old
framework (i.e. SerializationTester).

Could you tell me why you prefer the old framework? Is the new framework for
testing serialization complex, hard-to-use, bad documented or something
else?

Thank you in advance for your feedback,
Stepan.


On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
>
>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
>
> Jimmy, Jing Lv updated HARMONY-1098:
> ------------------------------------
>
>    Attachment: instrument_patch.zip
>
> Hi,
>
>    Would you please try my patch?
>    Please decompress to module\instrument, and run
> module\instrument\instrument_patch\filecp.sh
>
> Thanks!
>
> Best regards,
> Jimmy
>
> > [classlib][instrument]Add tests for UnmodifiableClassException and
> IllegalClassFormatException
> >
> ----------------------------------------------------------------------------------------------
> >
> >                 Key: HARMONY-1098
> >                 URL: http://issues.apache.org/jira/browse/HARMONY-1098
> >             Project: Harmony
> >          Issue Type: Improvement
> >          Components: Classlib
> >            Reporter: Jimmy, Jing Lv
> >         Attachments: instrument_patch.zip
> >
> >
> > Add serialization tests for UnmodifiableClassException and
> IllegalClassFormatException.
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>


-- 
Thanks,
Stepan Mishura
Intel Middleware Products Division

------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by Stepan Mishura <st...@gmail.com>.
On 8/8/06, Jimmy, Jing Lv wrote:
>
> Stepan Mishura wrote:
> > Hi Jimmy,
> >
> > I expect that we agreed to use new serialization framework for new
> tests.
> > But I see that people continue develop tests for serialization using the
> > old
> > framework (i.e. SerializationTester).
> >
> > Could you tell me why you prefer the old framework? Is the new framework
> > for
> > testing serialization complex, hard-to-use, bad documented or something
> > else?
> >
> > Thank you in advance for your feedback,
> > Stepan.
> >
>
> Hi Stepan,
>
>    Perhaps people are all lazy... (just kidding :P)
>    In fact, I've try the new framework already some days ago, I find
> two problems:
>    1. I find no method to make the ser file, as you know, in old
> framework, if no such file was found, it will create one at once, that
> was easy for us to put the file to the proper directory and run again,
> this time the test passes successfully. To me, write test once, run
> twice, only in two minutes I finish the testing, that was nice :)


Added createGoldenFile() method at r430213.

Thanks,
Stepan.

   2. Perhaps this is my mistake, I write a test[1], though I put ser
> file to the directory (e.g,
>
> src/tset/resource/serialization/org/apache/harmony/tests/java/lang/instrument),
> the new framework fails to load the file. I've debug into the code, find
> the path name correct, but the classloader load null(on eclipse 3.2,
> winxp). After that I thought the framework may be still on progress and
> not ready yet, so I give up and go on with the old one.
>
>    Please correct me if I misuse the new framework.
>
>    However I shall agree to use the new framework if no more problem
> exists. Indeed the new framework looks good to me :) And the effort to
> change test code is not heavy then.
>
> [1]
> public void test_compatibilitySerialization() throws Exception {
>         SerializationTest.verifyGolden(this, new
>                                        llegalClassFormatException());
>     }
>
> >
> > On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
> >>
> >>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
> >>
> >> Jimmy, Jing Lv updated HARMONY-1098:
> >> ------------------------------------
> >>
> >>    Attachment: instrument_patch.zip
> >>
> >> Hi,
> >>
> >>    Would you please try my patch?
> >>    Please decompress to module\instrument, and run
> >> module\instrument\instrument_patch\filecp.sh
> >>
> >> Thanks!
> >>
> >> Best regards,
> >> Jimmy
> >>
> >> > [classlib][instrument]Add tests for UnmodifiableClassException and
> >> IllegalClassFormatException
> >> >
> >>
> ----------------------------------------------------------------------------------------------
> >>
> >> >
> >> >                 Key: HARMONY-1098
> >> >                 URL:
> http://issues.apache.org/jira/browse/HARMONY-1098
> >> >             Project: Harmony
> >> >          Issue Type: Improvement
> >> >          Components: Classlib
> >> >            Reporter: Jimmy, Jing Lv
> >> >         Attachments: instrument_patch.zip
> >> >
> >> >
> >> > Add serialization tests for UnmodifiableClassException and
> >> IllegalClassFormatException.
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> -
> >> If you think it was sent incorrectly contact one of the administrators:
> >> http://issues.apache.org/jira/secure/Administrators.jspa
> >> -
> >> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> >>
> >>
> >>
> >
> >
>
>
> --
>
> Best Regards!
>
> Jimmy, Jing Lv
> China Software Development Lab, IBM
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Thanks,
Stepan Mishura
Intel Middleware Products Division

------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Stepan Mishura wrote:
> On 8/10/06, Jimmy, Jing Lv wrote:
>>
>> Stepan Mishura wrote:
>> <snip>
>> >> BufferOverflowException());
>> >> >
>> >> >
>> >> > But then you have to move generated file to the appropriate place by
>> >> hands.
>> >> > Is this convenient?
>> >> >
>> >>
>> >> Hi Stepan,
>> >>
>> >>     IMO, most ser file should be put into a certain directory, so the
>> >> the appropriate directory is always there.
>> >>
>> >>     I'd like to add a new method to the framework as:
>> >>
>> >> public static void createGoldenFile(TestCase test,Object object)
>> >> throws  IOException {
>> >>     createGoldenFile("src/test/resources/serialization",test,object);
>> >> }
>> >
>> >
>> > But if 'root' param is relative path them the generated file is placed
>> in
>> > 'bin' (i.e. <module_root>/bin/test).  folder. Am I right? So you 
>> have to
>> > move it by hands anyway to
>> <module_root>/src/test/resources/serialization
>> > folder.
>> >
>>
>> Ah sorry, I only test it on eclipse. Yes, if run on ant, it would
>> properly be "<module_root>/bin/test".
>>
>> IMO, mostly, people write code and create file once (for me, on
>> eclipse), so it is still a convenience if the framework offer such 
>> method.
>>
>> And for people who use ant to run test, still can offer a method  for
>> that, e.g.
>> public static void createGoldenFileUsingAnt(TestCase test,Object object)
>>    throws  IOException {
>> createGoldenFile("../../src/test/resources/serialization",test,object);
>> }
>>
>> Am I right? Thanks! :)
> 
> 
> IMHO the framework shouldn't contain methods that work for selected tool
> only.
> 

OK, I'm fine with it (I shall make one on my own workspace :) ).

So I'll make a new patch for Harmony-1098 according to new framework.


> Thanks,
> Stepan.
> ------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by Stepan Mishura <st...@gmail.com>.
On 8/10/06, Jimmy, Jing Lv wrote:
>
> Stepan Mishura wrote:
> <snip>
> >> BufferOverflowException());
> >> >
> >> >
> >> > But then you have to move generated file to the appropriate place by
> >> hands.
> >> > Is this convenient?
> >> >
> >>
> >> Hi Stepan,
> >>
> >>     IMO, most ser file should be put into a certain directory, so the
> >> the appropriate directory is always there.
> >>
> >>     I'd like to add a new method to the framework as:
> >>
> >> public static void createGoldenFile(TestCase test,Object object)
> >> throws  IOException {
> >>     createGoldenFile("src/test/resources/serialization",test,object);
> >> }
> >
> >
> > But if 'root' param is relative path them the generated file is placed
> in
> > 'bin' (i.e. <module_root>/bin/test).  folder. Am I right? So you have to
> > move it by hands anyway to
> <module_root>/src/test/resources/serialization
> > folder.
> >
>
> Ah sorry, I only test it on eclipse. Yes, if run on ant, it would
> properly be "<module_root>/bin/test".
>
> IMO, mostly, people write code and create file once (for me, on
> eclipse), so it is still a convenience if the framework offer such method.
>
> And for people who use ant to run test, still can offer a method  for
> that, e.g.
> public static void createGoldenFileUsingAnt(TestCase test,Object object)
>    throws  IOException {
> createGoldenFile("../../src/test/resources/serialization",test,object);
> }
>
> Am I right? Thanks! :)


IMHO the framework shouldn't contain methods that work for selected tool
only.

Thanks,
Stepan.
------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Stepan Mishura wrote:
<snip>
>> BufferOverflowException());
>> >
>> >
>> > But then you have to move generated file to the appropriate place by
>> hands.
>> > Is this convenient?
>> >
>>
>> Hi Stepan,
>>
>>     IMO, most ser file should be put into a certain directory, so the
>> the appropriate directory is always there.
>>
>>     I'd like to add a new method to the framework as:
>>
>> public static void createGoldenFile(TestCase test,Object object)
>> throws  IOException {
>>     createGoldenFile("src/test/resources/serialization",test,object);
>> }
> 
> 
> But if 'root' param is relative path them the generated file is placed in
> 'bin' (i.e. <module_root>/bin/test).  folder. Am I right? So you have to
> move it by hands anyway to <module_root>/src/test/resources/serialization
> folder.
> 

Ah sorry, I only test it on eclipse. Yes, if run on ant, it would 
properly be "<module_root>/bin/test".

IMO, mostly, people write code and create file once (for me, on 
eclipse), so it is still a convenience if the framework offer such method.

And for people who use ant to run test, still can offer a method  for 
that, e.g.
public static void createGoldenFileUsingAnt(TestCase test,Object object)
    throws  IOException {
  createGoldenFile("../../src/test/resources/serialization",test,object);
}

Am I right? Thanks! :)

> Thanks,
> Stepan.
> 
>    I have tried the new method, and it works well :)
>>     Can I or would you please make a patch for it? Thanks! :)
>>
<snip>
> Thanks,
> Stepan Mishura
> Intel Middleware Products Division
> 
> ------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Where to run tests? (was Re: [classlib][support] Using new framework for testing serialization (was: ...)

Posted by Anton Luht <an...@gmail.com>.
Hello,

Mess with golden files seem to be a problem. Why not just pass path to
an alternative JVM as an argument to the tests? Maybe an environment
variable or a VM property. The test framework can serialize some data
in one vm, deserialize it in another and check that object was
deserialized correctly. Process communication or serialization to
temporary files can be used to exchange data between VMs. This
approach will:
- remove golden files
- allow test that data serialized in Harmony is deserialized in
another VM correctly
- allow compare Harmony serialization with any VM, not only the one
used when golden files were produced.

The test based on such framework will look something like:

public void writeTestData(ObjectOutputStream oos) {
   oos.write(new Integer(2));
}

public void readTestData(ObjectInputStream ois) {
   Integer i = (Integer) ois.readObject();
   assertEquals(i.intValue(), 2);
}

On 8/11/06, Stepan Mishura <st...@gmail.com> wrote:
> On 8/11/06, Mark Hindess wrote:
> >
> >
> > On 10 August 2006 at 14:51, "Stepan Mishura" wrote:
> > >
> > > On 8/10/06, Jimmy, Jing Lv wrote:
> > > >
> > > > Hi Stepan,
> > > >
> > > >     IMO, most ser file should be put into a certain directory, so
> > > > the the appropriate directory is always there.
> > > >
> > > >     I'd like to add a new method to the framework as:
> > > >
> > > > public static void createGoldenFile(TestCase test,Object object)
> > > > throws  IOException {
> > > >     createGoldenFile("src/test/resources/serialization",test,object);
> > > > }
> > >
> > > But if 'root' param is relative path them the generated
> > > file is placed in 'bin' (i.e. <module_root>/bin/test).
> > > folder. Am I right? So you have to move it by hands anyway to
> > > <module_root>/src/test/resources/serialization folder.
> >
> > I was thinking about this.  Currently all of the relative paths in
> > modules/<name>/build.xml are relative to modules/<name>, except those
> > on test invocations which are relative to modules/<name>/bin/test.
> >
> > IMHO, this is slightly confusing for instance in the security module,
> > For example, modules/security/build.xml sets the classpath (in ant) to
> > include
> > "../../build/tests" when running the api tests, but when running the
> > api injected tests it appends "../../../../build/tests" to the
> > bootclasspath (using -X vm argument).
>
>
> Yes, I agree that this is confusing and should be fixed.
>
> Thanks,
> Stepan.
>
> I think ant should just run tests in modules/<name>.
> >
> > (I didn't realise that eclipse already ran the tests for there or I'd
> > probably have suggested it earlier.)
> >
> > Regards,
> > Mark.
> >
> >
> >
> >
> ------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Regards,
Anton Luht,
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Where to run tests? (was Re: [classlib][support] Using new framework for testing serialization (was: ...)

Posted by Stepan Mishura <st...@gmail.com>.
On 8/11/06, Mark Hindess wrote:
>
>
> On 10 August 2006 at 14:51, "Stepan Mishura" wrote:
> >
> > On 8/10/06, Jimmy, Jing Lv wrote:
> > >
> > > Hi Stepan,
> > >
> > >     IMO, most ser file should be put into a certain directory, so
> > > the the appropriate directory is always there.
> > >
> > >     I'd like to add a new method to the framework as:
> > >
> > > public static void createGoldenFile(TestCase test,Object object)
> > > throws  IOException {
> > >     createGoldenFile("src/test/resources/serialization",test,object);
> > > }
> >
> > But if 'root' param is relative path them the generated
> > file is placed in 'bin' (i.e. <module_root>/bin/test).
> > folder. Am I right? So you have to move it by hands anyway to
> > <module_root>/src/test/resources/serialization folder.
>
> I was thinking about this.  Currently all of the relative paths in
> modules/<name>/build.xml are relative to modules/<name>, except those
> on test invocations which are relative to modules/<name>/bin/test.
>
> IMHO, this is slightly confusing for instance in the security module,
> For example, modules/security/build.xml sets the classpath (in ant) to
> include
> "../../build/tests" when running the api tests, but when running the
> api injected tests it appends "../../../../build/tests" to the
> bootclasspath (using -X vm argument).


Yes, I agree that this is confusing and should be fixed.

Thanks,
Stepan.

I think ant should just run tests in modules/<name>.
>
> (I didn't realise that eclipse already ran the tests for there or I'd
> probably have suggested it earlier.)
>
> Regards,
> Mark.
>
>
>
>
------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: Where to run tests? (was Re: [classlib][support] Using new framework for testing serialization (was: ...)

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Mark Hindess wrote:
> On 10 August 2006 at 14:51, "Stepan Mishura" <st...@gmail.com> wrote:
>> On 8/10/06, Jimmy, Jing Lv wrote:
>>> Hi Stepan,
>>>
>>>     IMO, most ser file should be put into a certain directory, so
>>> the the appropriate directory is always there.
>>>
>>>     I'd like to add a new method to the framework as:
>>>
>>> public static void createGoldenFile(TestCase test,Object object)
>>> throws  IOException {
>>>     createGoldenFile("src/test/resources/serialization",test,object);
>>> }
>> But if 'root' param is relative path them the generated
>> file is placed in 'bin' (i.e. <module_root>/bin/test).
>> folder. Am I right? So you have to move it by hands anyway to
>> <module_root>/src/test/resources/serialization folder.
> 
> I was thinking about this.  Currently all of the relative paths in
> modules/<name>/build.xml are relative to modules/<name>, except those
> on test invocations which are relative to modules/<name>/bin/test.
> 
> IMHO, this is slightly confusing for instance in the security module,
> For example, modules/security/build.xml sets the classpath (in ant) to include 
> "../../build/tests" when running the api tests, but when running the 
> api injected tests it appends "../../../../build/tests" to the 
> bootclasspath (using -X vm argument).
> 
> I think ant should just run tests in modules/<name>.
> 
> (I didn't realise that eclipse already ran the tests for there or I'd
> probably have suggested it earlier.)
> 

Great idea! :)
So Stepan will not object my method of createGolden, right? ;)

> Regards,
>  Mark.
> 
> 
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Where to run tests? (was Re: [classlib][support] Using new framework for testing serialization (was: ...)

Posted by Mark Hindess <ma...@googlemail.com>.
On 10 August 2006 at 14:51, "Stepan Mishura" <st...@gmail.com> wrote:
> 
> On 8/10/06, Jimmy, Jing Lv wrote:
> >
> > Hi Stepan,
> >
> >     IMO, most ser file should be put into a certain directory, so
> > the the appropriate directory is always there.
> >
> >     I'd like to add a new method to the framework as:
> >
> > public static void createGoldenFile(TestCase test,Object object)
> > throws  IOException {
> >     createGoldenFile("src/test/resources/serialization",test,object);
> > }
> 
> But if 'root' param is relative path them the generated
> file is placed in 'bin' (i.e. <module_root>/bin/test).
> folder. Am I right? So you have to move it by hands anyway to
> <module_root>/src/test/resources/serialization folder.

I was thinking about this.  Currently all of the relative paths in
modules/<name>/build.xml are relative to modules/<name>, except those
on test invocations which are relative to modules/<name>/bin/test.

IMHO, this is slightly confusing for instance in the security module,
For example, modules/security/build.xml sets the classpath (in ant) to include 
"../../build/tests" when running the api tests, but when running the 
api injected tests it appends "../../../../build/tests" to the 
bootclasspath (using -X vm argument).

I think ant should just run tests in modules/<name>.

(I didn't realise that eclipse already ran the tests for there or I'd
probably have suggested it earlier.)

Regards,
 Mark.



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by Stepan Mishura <st...@gmail.com>.
On 8/10/06, Jimmy, Jing Lv wrote:
>
> Stepan Mishura wrote:
> > On 8/10/06, Jimmy, Jing Lv wrote:
> >>
> >> Stepan Mishura wrote:
> >> > Hi Jimmy,
> >> >
> >> > I looked into SerializationTester - it creates golden file if it
> failed
> >> to
> >> > find required file. But IMO generating ser-files should be done
> >> explicitly.
> >> > And I like unambiguity in behaviour. So if there is no ser-file a
> test
> >> > should just fail reporting that there is no required file.
> >> >
> >> > So I'm going just add utility method: createGoldenFile -  you should
> >> invoke
> >> > it from your test, for example,
> >>
> >> Hi Stepan,
> >>
> >>     Yes, I agree, it'll be great if there's one such method.
> >>
> >> > public void testSerializationCompatibility() {
> >> >
> >> > SerializationTest.createGoldenFile
> >> ("<module_nio>/src/test/resources/serialization",
> >> >
> >> > this, new BufferOverflowException());
> >> > }
> >> >
> >>
> >> I remember pass "this" as a parameter can parse the name of the
> >> directory, so I suggest it can just be:
> >>
> >> SerializationTest.createGoldenFile(this, new
> BufferOverflowException());
> >
> >
> > But then you have to move generated file to the appropriate place by
> hands.
> > Is this convenient?
> >
>
> Hi Stepan,
>
>     IMO, most ser file should be put into a certain directory, so the
> the appropriate directory is always there.
>
>     I'd like to add a new method to the framework as:
>
> public static void createGoldenFile(TestCase test,Object object)
> throws  IOException {
>     createGoldenFile("src/test/resources/serialization",test,object);
> }


But if 'root' param is relative path them the generated file is placed in
'bin' (i.e. <module_root>/bin/test).  folder. Am I right? So you have to
move it by hands anyway to <module_root>/src/test/resources/serialization
folder.

Thanks,
Stepan.

    I have tried the new method, and it works well :)
>     Can I or would you please make a patch for it? Thanks! :)
>
> >> And after running a test on RI replace with
> >> SerializationTest.verifyGolden
> >> > ();
> >> >
> >> > If there will be better idea how to generate golden files (or you'll
> >> > convince me that SerializationTester  does the right thing) I with
> >> pleasure
> >> > commit a patch or implement it by myself.
> >> >
> >>
> >> I've tried the new framework again and it works for me now :)
> >>
> >> However I have a little question here, as it parse "this" for the path
> >> of the ser file, and because of the our test naming convention, the
> path
> >> name is very long here.Is that possible to cut it shorter?
> >> in old framework,it is:
> >> (src/test/resource/)serialization.java.lang.instrument
> >> in new framework,it changes to:
> >>
> >>
> (src/test/resource/)serialization.org.apache.harmony.tests.java.lang.instrument
> >>
> >
> >
> > Well, it is possible to update framework to shrink the path in that way.
> > But
> > is this really necessary? I guess that after generating ser-files we put
> > them to SVN and won't look at them any more. It is not expected to
> update
> > them often.
> >
>
> OK, let it be :)
>
> > Thanks,
> > Stepan.
> >
> > This is a little problem though. I'm OK if it does not changes.
> >>
> >> > Thanks,
> >> > Stepan.
> >> >
> >> >
> >> > On 8/9/06, Stepan Mishura wrote:
> >> >>
> >> >>  On 8/8/06, Jimmy, Jing Lv wrote:
> >> >> >
> >> >> > Stepan Mishura wrote:
> >> >> > > Hi Jimmy,
> >> >> > >
> >> >> > > I expect that we agreed to use new serialization framework for
> new
> >> >> > tests.
> >> >> > > But I see that people continue develop tests for serialization
> >> using
> >> >> > the
> >> >> > > old
> >> >> > > framework (i.e. SerializationTester).
> >> >> > >
> >> >> > > Could you tell me why you prefer the old framework? Is the new
> >> >> > framework
> >> >> > > for
> >> >> > > testing serialization complex, hard-to-use, bad documented or
> >> >> > something
> >> >> > > else?
> >> >> > >
> >> >> > > Thank you in advance for your feedback,
> >> >> > > Stepan.
> >> >> > >
> >> >> >
> >> >> > Hi Stepan,
> >> >> >
> >> >> >    Perhaps people are all lazy... (just kidding :P)
> >> >> >    In fact, I've try the new framework already some days ago, I
> find
> >> >> > two problems:
> >> >> >    1. I find no method to make the ser file, as you know, in old
> >> >> > framework, if no such file was found, it will create one at once,
> >> that
> >> >> > was easy for us to put the file to the proper directory and run
> >> again,
> >> >> > this time the test passes successfully. To me, write test once,
> run
> >> >> > twice, only in two minutes I finish the testing, that was nice :)
> >> >>
> >> >>
> >> >>  OK, I see. I'll think how to add this to the new framework. I'll
> let
> >> you
> >> >> know when I add this to the framework.
> >> >>
> >> >>    2. Perhaps this is my mistake, I write a test[1], though I put
> ser
> >> >> > file to the directory (e.g,
> >> >> >
> >> >>
> >>
> src/tset/resource/serialization/org/apache/harmony/tests/java/lang/instrument),
> >>
> >> >>
> >> >> >
> >> >> > the new framework fails to load the file. I've debug into the
> code,
> >> >> find
> >> >> > the path name correct, but the classloader load null(on eclipse
> 3.2,
> >> >> > winxp). After that I thought the framework may be still on
> progress
> >> and
> >> >> > not ready yet, so I give up and go on with the old one.
> >> >>
> >> >>
> >> >>  I think that you should check your classpath - src/test/resource
> >> folder
> >> >> should be included or ser files from this folder should be copied to
> >> the
> >> >> classpath by the build.
> >> >>
> >> >> Thanks,
> >> >>  Stepan.
> >> >>
> >> >>    Please correct me if I misuse the new framework.
> >> >> >
> >> >> >    However I shall agree to use the new framework if no more
> problem
> >> >> > exists. Indeed the new framework looks good to me :) And the
> effort
> >> to
> >> >> > change test code is not heavy then.
> >> >> >
> >> >> > [1]
> >> >> > public void test_compatibilitySerialization() throws Exception {
> >> >> >         SerializationTest.verifyGolden (this, new
> >> >> >
> >> llegalClassFormatException());
> >> >> >     }
> >> >> >
> >> >> > >
> >> >> > > On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
> >> >> > >>
> >> >> > >>     [
> >> http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
> >> >> > >>
> >> >> > >> Jimmy, Jing Lv updated HARMONY-1098:
> >> >> > >> ------------------------------------
> >> >> > >>
> >> >> > >>    Attachment: instrument_patch.zip
> >> >> > >>
> >> >> > >> Hi,
> >> >> > >>
> >> >> > >>    Would you please try my patch?
> >> >> > >>    Please decompress to module\instrument, and run
> >> >> > >> module\instrument\instrument_patch\filecp.sh
> >> >> > >>
> >> >> > >> Thanks!
> >> >> > >>
> >> >> > >> Best regards,
> >> >> > >> Jimmy
> >> >> > >>
> >> >> > >> > [classlib][instrument]Add tests for
> UnmodifiableClassException
> >> and
> >> >> > >> IllegalClassFormatException
> >> >> > >> >
> >> >> > >>
> >> >> >
> >> >>
> >>
> ----------------------------------------------------------------------------------------------
> >>
> >> >>
> >> >> > >>
> >> >> > >> >
> >> >> > >> >                 Key: HARMONY-1098
> >> >> > >> >                 URL:
> >> >> > http://issues.apache.org/jira/browse/HARMONY-1098
> >> >> > >> >             Project: Harmony
> >> >> > >> >          Issue Type: Improvement
> >> >> > >> >          Components: Classlib
> >> >> > >> >            Reporter: Jimmy, Jing Lv
> >> >> > >> >         Attachments: instrument_patch.zip
> >> >> > >> >
> >> >> > >> >
> >> >> > >> > Add serialization tests for UnmodifiableClassException and
> >> >> > >> IllegalClassFormatException.
> >> >> > >>
> >> >> > >> --
> >> >> > >> This message is automatically generated by JIRA.
> >> >> > >> -
> >> >> > >> If you think it was sent incorrectly contact one of the
> >> >> > administrators:
> >> >> > >> http://issues.apache.org/jira/secure/Administrators.jspa
> >> >> > >> -
> >> >> > >> For more information on JIRA, see:
> >> >> > http://www.atlassian.com/software/jira
>
> --
Thanks,
Stepan Mishura
Intel Middleware Products Division

------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Stepan Mishura wrote:
> On 8/10/06, Jimmy, Jing Lv wrote:
>>
>> Stepan Mishura wrote:
>> > Hi Jimmy,
>> >
>> > I looked into SerializationTester - it creates golden file if it failed
>> to
>> > find required file. But IMO generating ser-files should be done
>> explicitly.
>> > And I like unambiguity in behaviour. So if there is no ser-file a test
>> > should just fail reporting that there is no required file.
>> >
>> > So I'm going just add utility method: createGoldenFile -  you should
>> invoke
>> > it from your test, for example,
>>
>> Hi Stepan,
>>
>>     Yes, I agree, it'll be great if there's one such method.
>>
>> > public void testSerializationCompatibility() {
>> >
>> > SerializationTest.createGoldenFile
>> ("<module_nio>/src/test/resources/serialization",
>> >
>> > this, new BufferOverflowException());
>> > }
>> >
>>
>> I remember pass "this" as a parameter can parse the name of the
>> directory, so I suggest it can just be:
>>
>> SerializationTest.createGoldenFile(this, new BufferOverflowException());
> 
> 
> But then you have to move generated file to the appropriate place by hands.
> Is this convenient?
> 

Hi Stepan,

     IMO, most ser file should be put into a certain directory, so the 
the appropriate directory is always there.

     I'd like to add a new method to the framework as:

public static void createGoldenFile(TestCase test,Object object) 
throws 	IOException {
     createGoldenFile("src/test/resources/serialization",test,object);
}

     I have tried the new method, and it works well :)
     Can I or would you please make a patch for it? Thanks! :)

>> And after running a test on RI replace with 
>> SerializationTest.verifyGolden
>> > ();
>> >
>> > If there will be better idea how to generate golden files (or you'll
>> > convince me that SerializationTester  does the right thing) I with
>> pleasure
>> > commit a patch or implement it by myself.
>> >
>>
>> I've tried the new framework again and it works for me now :)
>>
>> However I have a little question here, as it parse "this" for the path
>> of the ser file, and because of the our test naming convention, the path
>> name is very long here.Is that possible to cut it shorter?
>> in old framework,it is:
>> (src/test/resource/)serialization.java.lang.instrument
>> in new framework,it changes to:
>>
>> (src/test/resource/)serialization.org.apache.harmony.tests.java.lang.instrument 
>>
> 
> 
> Well, it is possible to update framework to shrink the path in that way. 
> But
> is this really necessary? I guess that after generating ser-files we put
> them to SVN and won't look at them any more. It is not expected to update
> them often.
> 

OK, let it be :)

> Thanks,
> Stepan.
> 
> This is a little problem though. I'm OK if it does not changes.
>>
>> > Thanks,
>> > Stepan.
>> >
>> >
>> > On 8/9/06, Stepan Mishura wrote:
>> >>
>> >>  On 8/8/06, Jimmy, Jing Lv wrote:
>> >> >
>> >> > Stepan Mishura wrote:
>> >> > > Hi Jimmy,
>> >> > >
>> >> > > I expect that we agreed to use new serialization framework for new
>> >> > tests.
>> >> > > But I see that people continue develop tests for serialization
>> using
>> >> > the
>> >> > > old
>> >> > > framework (i.e. SerializationTester).
>> >> > >
>> >> > > Could you tell me why you prefer the old framework? Is the new
>> >> > framework
>> >> > > for
>> >> > > testing serialization complex, hard-to-use, bad documented or
>> >> > something
>> >> > > else?
>> >> > >
>> >> > > Thank you in advance for your feedback,
>> >> > > Stepan.
>> >> > >
>> >> >
>> >> > Hi Stepan,
>> >> >
>> >> >    Perhaps people are all lazy... (just kidding :P)
>> >> >    In fact, I've try the new framework already some days ago, I find
>> >> > two problems:
>> >> >    1. I find no method to make the ser file, as you know, in old
>> >> > framework, if no such file was found, it will create one at once,
>> that
>> >> > was easy for us to put the file to the proper directory and run
>> again,
>> >> > this time the test passes successfully. To me, write test once, run
>> >> > twice, only in two minutes I finish the testing, that was nice :)
>> >>
>> >>
>> >>  OK, I see. I'll think how to add this to the new framework. I'll let
>> you
>> >> know when I add this to the framework.
>> >>
>> >>    2. Perhaps this is my mistake, I write a test[1], though I put ser
>> >> > file to the directory (e.g,
>> >> >
>> >>
>> src/tset/resource/serialization/org/apache/harmony/tests/java/lang/instrument), 
>>
>> >>
>> >> >
>> >> > the new framework fails to load the file. I've debug into the code,
>> >> find
>> >> > the path name correct, but the classloader load null(on eclipse 3.2,
>> >> > winxp). After that I thought the framework may be still on progress
>> and
>> >> > not ready yet, so I give up and go on with the old one.
>> >>
>> >>
>> >>  I think that you should check your classpath - src/test/resource
>> folder
>> >> should be included or ser files from this folder should be copied to
>> the
>> >> classpath by the build.
>> >>
>> >> Thanks,
>> >>  Stepan.
>> >>
>> >>    Please correct me if I misuse the new framework.
>> >> >
>> >> >    However I shall agree to use the new framework if no more problem
>> >> > exists. Indeed the new framework looks good to me :) And the effort
>> to
>> >> > change test code is not heavy then.
>> >> >
>> >> > [1]
>> >> > public void test_compatibilitySerialization() throws Exception {
>> >> >         SerializationTest.verifyGolden (this, new
>> >> >                                        
>> llegalClassFormatException());
>> >> >     }
>> >> >
>> >> > >
>> >> > > On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
>> >> > >>
>> >> > >>     [ 
>> http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
>> >> > >>
>> >> > >> Jimmy, Jing Lv updated HARMONY-1098:
>> >> > >> ------------------------------------
>> >> > >>
>> >> > >>    Attachment: instrument_patch.zip
>> >> > >>
>> >> > >> Hi,
>> >> > >>
>> >> > >>    Would you please try my patch?
>> >> > >>    Please decompress to module\instrument, and run
>> >> > >> module\instrument\instrument_patch\filecp.sh
>> >> > >>
>> >> > >> Thanks!
>> >> > >>
>> >> > >> Best regards,
>> >> > >> Jimmy
>> >> > >>
>> >> > >> > [classlib][instrument]Add tests for UnmodifiableClassException
>> and
>> >> > >> IllegalClassFormatException
>> >> > >> >
>> >> > >>
>> >> >
>> >>
>> ---------------------------------------------------------------------------------------------- 
>>
>> >>
>> >> > >>
>> >> > >> >
>> >> > >> >                 Key: HARMONY-1098
>> >> > >> >                 URL:
>> >> > http://issues.apache.org/jira/browse/HARMONY-1098
>> >> > >> >             Project: Harmony
>> >> > >> >          Issue Type: Improvement
>> >> > >> >          Components: Classlib
>> >> > >> >            Reporter: Jimmy, Jing Lv
>> >> > >> >         Attachments: instrument_patch.zip
>> >> > >> >
>> >> > >> >
>> >> > >> > Add serialization tests for UnmodifiableClassException and
>> >> > >> IllegalClassFormatException.
>> >> > >>
>> >> > >> --
>> >> > >> This message is automatically generated by JIRA.
>> >> > >> -
>> >> > >> If you think it was sent incorrectly contact one of the
>> >> > administrators:
>> >> > >> http://issues.apache.org/jira/secure/Administrators.jspa
>> >> > >> -
>> >> > >> For more information on JIRA, see:
>> >> > http://www.atlassian.com/software/jira
>> >> > >>
>> >> >
>> >> >
>> >
>> >
>>
>>
>> -- 
>>
>> Best Regards!
>>
>> Jimmy, Jing Lv
>> China Software Development Lab, IBM
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
> 
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by Stepan Mishura <st...@gmail.com>.
On 8/10/06, Jimmy, Jing Lv wrote:
>
> Stepan Mishura wrote:
> > Hi Jimmy,
> >
> > I looked into SerializationTester - it creates golden file if it failed
> to
> > find required file. But IMO generating ser-files should be done
> explicitly.
> > And I like unambiguity in behaviour. So if there is no ser-file a test
> > should just fail reporting that there is no required file.
> >
> > So I'm going just add utility method: createGoldenFile -  you should
> invoke
> > it from your test, for example,
>
> Hi Stepan,
>
>     Yes, I agree, it'll be great if there's one such method.
>
> > public void testSerializationCompatibility() {
> >
> > SerializationTest.createGoldenFile
> ("<module_nio>/src/test/resources/serialization",
> >
> > this, new BufferOverflowException());
> > }
> >
>
> I remember pass "this" as a parameter can parse the name of the
> directory, so I suggest it can just be:
>
> SerializationTest.createGoldenFile(this, new BufferOverflowException());


But then you have to move generated file to the appropriate place by hands.
Is this convenient?

> And after running a test on RI replace with SerializationTest.verifyGolden
> > ();
> >
> > If there will be better idea how to generate golden files (or you'll
> > convince me that SerializationTester  does the right thing) I with
> pleasure
> > commit a patch or implement it by myself.
> >
>
> I've tried the new framework again and it works for me now :)
>
> However I have a little question here, as it parse "this" for the path
> of the ser file, and because of the our test naming convention, the path
> name is very long here.Is that possible to cut it shorter?
> in old framework,it is:
> (src/test/resource/)serialization.java.lang.instrument
> in new framework,it changes to:
>
> (src/test/resource/)serialization.org.apache.harmony.tests.java.lang.instrument


Well, it is possible to update framework to shrink the path in that way. But
is this really necessary? I guess that after generating ser-files we put
them to SVN and won't look at them any more. It is not expected to update
them often.

Thanks,
Stepan.

This is a little problem though. I'm OK if it does not changes.
>
> > Thanks,
> > Stepan.
> >
> >
> > On 8/9/06, Stepan Mishura wrote:
> >>
> >>  On 8/8/06, Jimmy, Jing Lv wrote:
> >> >
> >> > Stepan Mishura wrote:
> >> > > Hi Jimmy,
> >> > >
> >> > > I expect that we agreed to use new serialization framework for new
> >> > tests.
> >> > > But I see that people continue develop tests for serialization
> using
> >> > the
> >> > > old
> >> > > framework (i.e. SerializationTester).
> >> > >
> >> > > Could you tell me why you prefer the old framework? Is the new
> >> > framework
> >> > > for
> >> > > testing serialization complex, hard-to-use, bad documented or
> >> > something
> >> > > else?
> >> > >
> >> > > Thank you in advance for your feedback,
> >> > > Stepan.
> >> > >
> >> >
> >> > Hi Stepan,
> >> >
> >> >    Perhaps people are all lazy... (just kidding :P)
> >> >    In fact, I've try the new framework already some days ago, I find
> >> > two problems:
> >> >    1. I find no method to make the ser file, as you know, in old
> >> > framework, if no such file was found, it will create one at once,
> that
> >> > was easy for us to put the file to the proper directory and run
> again,
> >> > this time the test passes successfully. To me, write test once, run
> >> > twice, only in two minutes I finish the testing, that was nice :)
> >>
> >>
> >>  OK, I see. I'll think how to add this to the new framework. I'll let
> you
> >> know when I add this to the framework.
> >>
> >>    2. Perhaps this is my mistake, I write a test[1], though I put ser
> >> > file to the directory (e.g,
> >> >
> >>
> src/tset/resource/serialization/org/apache/harmony/tests/java/lang/instrument),
> >>
> >> >
> >> > the new framework fails to load the file. I've debug into the code,
> >> find
> >> > the path name correct, but the classloader load null(on eclipse 3.2,
> >> > winxp). After that I thought the framework may be still on progress
> and
> >> > not ready yet, so I give up and go on with the old one.
> >>
> >>
> >>  I think that you should check your classpath - src/test/resource
> folder
> >> should be included or ser files from this folder should be copied to
> the
> >> classpath by the build.
> >>
> >> Thanks,
> >>  Stepan.
> >>
> >>    Please correct me if I misuse the new framework.
> >> >
> >> >    However I shall agree to use the new framework if no more problem
> >> > exists. Indeed the new framework looks good to me :) And the effort
> to
> >> > change test code is not heavy then.
> >> >
> >> > [1]
> >> > public void test_compatibilitySerialization() throws Exception {
> >> >         SerializationTest.verifyGolden (this, new
> >> >                                        llegalClassFormatException());
> >> >     }
> >> >
> >> > >
> >> > > On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
> >> > >>
> >> > >>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
> >> > >>
> >> > >> Jimmy, Jing Lv updated HARMONY-1098:
> >> > >> ------------------------------------
> >> > >>
> >> > >>    Attachment: instrument_patch.zip
> >> > >>
> >> > >> Hi,
> >> > >>
> >> > >>    Would you please try my patch?
> >> > >>    Please decompress to module\instrument, and run
> >> > >> module\instrument\instrument_patch\filecp.sh
> >> > >>
> >> > >> Thanks!
> >> > >>
> >> > >> Best regards,
> >> > >> Jimmy
> >> > >>
> >> > >> > [classlib][instrument]Add tests for UnmodifiableClassException
> and
> >> > >> IllegalClassFormatException
> >> > >> >
> >> > >>
> >> >
> >>
> ----------------------------------------------------------------------------------------------
> >>
> >> > >>
> >> > >> >
> >> > >> >                 Key: HARMONY-1098
> >> > >> >                 URL:
> >> > http://issues.apache.org/jira/browse/HARMONY-1098
> >> > >> >             Project: Harmony
> >> > >> >          Issue Type: Improvement
> >> > >> >          Components: Classlib
> >> > >> >            Reporter: Jimmy, Jing Lv
> >> > >> >         Attachments: instrument_patch.zip
> >> > >> >
> >> > >> >
> >> > >> > Add serialization tests for UnmodifiableClassException and
> >> > >> IllegalClassFormatException.
> >> > >>
> >> > >> --
> >> > >> This message is automatically generated by JIRA.
> >> > >> -
> >> > >> If you think it was sent incorrectly contact one of the
> >> > administrators:
> >> > >> http://issues.apache.org/jira/secure/Administrators.jspa
> >> > >> -
> >> > >> For more information on JIRA, see:
> >> > http://www.atlassian.com/software/jira
> >> > >>
> >> >
> >> >
> >
> >
>
>
> --
>
> Best Regards!
>
> Jimmy, Jing Lv
> China Software Development Lab, IBM
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Thanks,
Stepan Mishura
Intel Middleware Products Division

------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Stepan Mishura wrote:
> Hi Jimmy,
> 
> I looked into SerializationTester - it creates golden file if it failed to
> find required file. But IMO generating ser-files should be done explicitly.
> And I like unambiguity in behaviour. So if there is no ser-file a test
> should just fail reporting that there is no required file.
> 
> So I'm going just add utility method: createGoldenFile -  you should invoke
> it from your test, for example,

Hi Stepan,

     Yes, I agree, it'll be great if there's one such method.

> public void testSerializationCompatibility() {
>        
> SerializationTest.createGoldenFile("<module_nio>/src/test/resources/serialization", 
> 
> this, new BufferOverflowException());
> }
> 

I remember pass "this" as a parameter can parse the name of the 
directory, so I suggest it can just be:

SerializationTest.createGoldenFile(this, new BufferOverflowException());


> And after running a test on RI replace with SerializationTest.verifyGolden
> ();
> 
> If there will be better idea how to generate golden files (or you'll
> convince me that SerializationTester  does the right thing) I with pleasure
> commit a patch or implement it by myself.
> 

I've tried the new framework again and it works for me now :)

However I have a little question here, as it parse "this" for the path 
of the ser file, and because of the our test naming convention, the path 
name is very long here.Is that possible to cut it shorter?
in old framework,it is:
(src/test/resource/)serialization.java.lang.instrument
in new framework,it changes to:
(src/test/resource/)serialization.org.apache.harmony.tests.java.lang.instrument

This is a little problem though. I'm OK if it does not changes.

> Thanks,
> Stepan.
> 
> 
> On 8/9/06, Stepan Mishura wrote:
>>
>>  On 8/8/06, Jimmy, Jing Lv wrote:
>> >
>> > Stepan Mishura wrote:
>> > > Hi Jimmy,
>> > >
>> > > I expect that we agreed to use new serialization framework for new
>> > tests.
>> > > But I see that people continue develop tests for serialization using
>> > the
>> > > old
>> > > framework (i.e. SerializationTester).
>> > >
>> > > Could you tell me why you prefer the old framework? Is the new
>> > framework
>> > > for
>> > > testing serialization complex, hard-to-use, bad documented or
>> > something
>> > > else?
>> > >
>> > > Thank you in advance for your feedback,
>> > > Stepan.
>> > >
>> >
>> > Hi Stepan,
>> >
>> >    Perhaps people are all lazy... (just kidding :P)
>> >    In fact, I've try the new framework already some days ago, I find
>> > two problems:
>> >    1. I find no method to make the ser file, as you know, in old
>> > framework, if no such file was found, it will create one at once, that
>> > was easy for us to put the file to the proper directory and run again,
>> > this time the test passes successfully. To me, write test once, run
>> > twice, only in two minutes I finish the testing, that was nice :)
>>
>>
>>  OK, I see. I'll think how to add this to the new framework. I'll let you
>> know when I add this to the framework.
>>
>>    2. Perhaps this is my mistake, I write a test[1], though I put ser
>> > file to the directory (e.g,
>> > 
>> src/tset/resource/serialization/org/apache/harmony/tests/java/lang/instrument), 
>>
>> >
>> > the new framework fails to load the file. I've debug into the code, 
>> find
>> > the path name correct, but the classloader load null(on eclipse 3.2,
>> > winxp). After that I thought the framework may be still on progress and
>> > not ready yet, so I give up and go on with the old one.
>>
>>
>>  I think that you should check your classpath - src/test/resource folder
>> should be included or ser files from this folder should be copied to the
>> classpath by the build.
>>
>> Thanks,
>>  Stepan.
>>
>>    Please correct me if I misuse the new framework.
>> >
>> >    However I shall agree to use the new framework if no more problem
>> > exists. Indeed the new framework looks good to me :) And the effort to
>> > change test code is not heavy then.
>> >
>> > [1]
>> > public void test_compatibilitySerialization() throws Exception {
>> >         SerializationTest.verifyGolden (this, new
>> >                                        llegalClassFormatException());
>> >     }
>> >
>> > >
>> > > On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
>> > >>
>> > >>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
>> > >>
>> > >> Jimmy, Jing Lv updated HARMONY-1098:
>> > >> ------------------------------------
>> > >>
>> > >>    Attachment: instrument_patch.zip
>> > >>
>> > >> Hi,
>> > >>
>> > >>    Would you please try my patch?
>> > >>    Please decompress to module\instrument, and run
>> > >> module\instrument\instrument_patch\filecp.sh
>> > >>
>> > >> Thanks!
>> > >>
>> > >> Best regards,
>> > >> Jimmy
>> > >>
>> > >> > [classlib][instrument]Add tests for UnmodifiableClassException and
>> > >> IllegalClassFormatException
>> > >> >
>> > >>
>> > 
>> ---------------------------------------------------------------------------------------------- 
>>
>> > >>
>> > >> >
>> > >> >                 Key: HARMONY-1098
>> > >> >                 URL:
>> > http://issues.apache.org/jira/browse/HARMONY-1098
>> > >> >             Project: Harmony
>> > >> >          Issue Type: Improvement
>> > >> >          Components: Classlib
>> > >> >            Reporter: Jimmy, Jing Lv
>> > >> >         Attachments: instrument_patch.zip
>> > >> >
>> > >> >
>> > >> > Add serialization tests for UnmodifiableClassException and
>> > >> IllegalClassFormatException.
>> > >>
>> > >> --
>> > >> This message is automatically generated by JIRA.
>> > >> -
>> > >> If you think it was sent incorrectly contact one of the
>> > administrators:
>> > >> http://issues.apache.org/jira/secure/Administrators.jspa
>> > >> -
>> > >> For more information on JIRA, see:
>> > http://www.atlassian.com/software/jira
>> > >>
>> >
>> >
> 
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by Stepan Mishura <st...@gmail.com>.
Hi Jimmy,

I looked into SerializationTester - it creates golden file if it failed to
find required file. But IMO generating ser-files should be done explicitly.
And I like unambiguity in behaviour. So if there is no ser-file a test
should just fail reporting that there is no required file.

So I'm going just add utility method: createGoldenFile -  you should invoke
it from your test, for example,
public void testSerializationCompatibility() {
        SerializationTest.createGoldenFile("<module_nio>/src/test/resources/serialization",
this, new BufferOverflowException());
}

And after running a test on RI replace with SerializationTest.verifyGolden
();

If there will be better idea how to generate golden files (or you'll
convince me that SerializationTester  does the right thing) I with pleasure
commit a patch or implement it by myself.

Thanks,
Stepan.


On 8/9/06, Stepan Mishura wrote:
>
>  On 8/8/06, Jimmy, Jing Lv wrote:
> >
> > Stepan Mishura wrote:
> > > Hi Jimmy,
> > >
> > > I expect that we agreed to use new serialization framework for new
> > tests.
> > > But I see that people continue develop tests for serialization using
> > the
> > > old
> > > framework (i.e. SerializationTester).
> > >
> > > Could you tell me why you prefer the old framework? Is the new
> > framework
> > > for
> > > testing serialization complex, hard-to-use, bad documented or
> > something
> > > else?
> > >
> > > Thank you in advance for your feedback,
> > > Stepan.
> > >
> >
> > Hi Stepan,
> >
> >    Perhaps people are all lazy... (just kidding :P)
> >    In fact, I've try the new framework already some days ago, I find
> > two problems:
> >    1. I find no method to make the ser file, as you know, in old
> > framework, if no such file was found, it will create one at once, that
> > was easy for us to put the file to the proper directory and run again,
> > this time the test passes successfully. To me, write test once, run
> > twice, only in two minutes I finish the testing, that was nice :)
>
>
>  OK, I see. I'll think how to add this to the new framework. I'll let you
> know when I add this to the framework.
>
>    2. Perhaps this is my mistake, I write a test[1], though I put ser
> > file to the directory (e.g,
> > src/tset/resource/serialization/org/apache/harmony/tests/java/lang/instrument),
> >
> > the new framework fails to load the file. I've debug into the code, find
> > the path name correct, but the classloader load null(on eclipse 3.2,
> > winxp). After that I thought the framework may be still on progress and
> > not ready yet, so I give up and go on with the old one.
>
>
>  I think that you should check your classpath - src/test/resource folder
> should be included or ser files from this folder should be copied to the
> classpath by the build.
>
> Thanks,
>  Stepan.
>
>    Please correct me if I misuse the new framework.
> >
> >    However I shall agree to use the new framework if no more problem
> > exists. Indeed the new framework looks good to me :) And the effort to
> > change test code is not heavy then.
> >
> > [1]
> > public void test_compatibilitySerialization() throws Exception {
> >         SerializationTest.verifyGolden (this, new
> >                                        llegalClassFormatException());
> >     }
> >
> > >
> > > On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
> > >>
> > >>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
> > >>
> > >> Jimmy, Jing Lv updated HARMONY-1098:
> > >> ------------------------------------
> > >>
> > >>    Attachment: instrument_patch.zip
> > >>
> > >> Hi,
> > >>
> > >>    Would you please try my patch?
> > >>    Please decompress to module\instrument, and run
> > >> module\instrument\instrument_patch\filecp.sh
> > >>
> > >> Thanks!
> > >>
> > >> Best regards,
> > >> Jimmy
> > >>
> > >> > [classlib][instrument]Add tests for UnmodifiableClassException and
> > >> IllegalClassFormatException
> > >> >
> > >>
> > ----------------------------------------------------------------------------------------------
> > >>
> > >> >
> > >> >                 Key: HARMONY-1098
> > >> >                 URL:
> > http://issues.apache.org/jira/browse/HARMONY-1098
> > >> >             Project: Harmony
> > >> >          Issue Type: Improvement
> > >> >          Components: Classlib
> > >> >            Reporter: Jimmy, Jing Lv
> > >> >         Attachments: instrument_patch.zip
> > >> >
> > >> >
> > >> > Add serialization tests for UnmodifiableClassException and
> > >> IllegalClassFormatException.
> > >>
> > >> --
> > >> This message is automatically generated by JIRA.
> > >> -
> > >> If you think it was sent incorrectly contact one of the
> > administrators:
> > >> http://issues.apache.org/jira/secure/Administrators.jspa
> > >> -
> > >> For more information on JIRA, see:
> > http://www.atlassian.com/software/jira
> > >>
> >
> >


-- 
Thanks,
Stepan Mishura
Intel Middleware Products Division

------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by Stepan Mishura <st...@gmail.com>.
On 8/8/06, Jimmy, Jing Lv wrote:
>
> Stepan Mishura wrote:
> > Hi Jimmy,
> >
> > I expect that we agreed to use new serialization framework for new
> tests.
> > But I see that people continue develop tests for serialization using the
> > old
> > framework (i.e. SerializationTester).
> >
> > Could you tell me why you prefer the old framework? Is the new framework
> > for
> > testing serialization complex, hard-to-use, bad documented or something
> > else?
> >
> > Thank you in advance for your feedback,
> > Stepan.
> >
>
> Hi Stepan,
>
>    Perhaps people are all lazy... (just kidding :P)
>    In fact, I've try the new framework already some days ago, I find
> two problems:
>    1. I find no method to make the ser file, as you know, in old
> framework, if no such file was found, it will create one at once, that
> was easy for us to put the file to the proper directory and run again,
> this time the test passes successfully. To me, write test once, run
> twice, only in two minutes I finish the testing, that was nice :)


OK, I see. I'll think how to add this to the new framework. I'll let you
know when I add this to the framework.

   2. Perhaps this is my mistake, I write a test[1], though I put ser
> file to the directory (e.g,
>
> src/tset/resource/serialization/org/apache/harmony/tests/java/lang/instrument),
> the new framework fails to load the file. I've debug into the code, find
> the path name correct, but the classloader load null(on eclipse 3.2,
> winxp). After that I thought the framework may be still on progress and
> not ready yet, so I give up and go on with the old one.


I think that you should check your classpath - src/test/resource folder
should be included or ser files from this folder should be copied to the
classpath by the build.

Thanks,
Stepan.

   Please correct me if I misuse the new framework.
>
>    However I shall agree to use the new framework if no more problem
> exists. Indeed the new framework looks good to me :) And the effort to
> change test code is not heavy then.
>
> [1]
> public void test_compatibilitySerialization() throws Exception {
>         SerializationTest.verifyGolden(this, new
>                                        llegalClassFormatException());
>     }
>
> >
> > On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
> >>
> >>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
> >>
> >> Jimmy, Jing Lv updated HARMONY-1098:
> >> ------------------------------------
> >>
> >>    Attachment: instrument_patch.zip
> >>
> >> Hi,
> >>
> >>    Would you please try my patch?
> >>    Please decompress to module\instrument, and run
> >> module\instrument\instrument_patch\filecp.sh
> >>
> >> Thanks!
> >>
> >> Best regards,
> >> Jimmy
> >>
> >> > [classlib][instrument]Add tests for UnmodifiableClassException and
> >> IllegalClassFormatException
> >> >
> >>
> ----------------------------------------------------------------------------------------------
> >>
> >> >
> >> >                 Key: HARMONY-1098
> >> >                 URL:
> http://issues.apache.org/jira/browse/HARMONY-1098
> >> >             Project: Harmony
> >> >          Issue Type: Improvement
> >> >          Components: Classlib
> >> >            Reporter: Jimmy, Jing Lv
> >> >         Attachments: instrument_patch.zip
> >> >
> >> >
> >> > Add serialization tests for UnmodifiableClassException and
> >> IllegalClassFormatException.
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> -
> >> If you think it was sent incorrectly contact one of the administrators:
> >> http://issues.apache.org/jira/secure/Administrators.jspa
> >> -
> >> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> >>
>
>
-- 
Thanks,
Stepan Mishura
Intel Middleware Products Division

------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Stepan Mishura wrote:
> Hi Jimmy,
> 
> I expect that we agreed to use new serialization framework for new tests.
> But I see that people continue develop tests for serialization using the 
> old
> framework (i.e. SerializationTester).
> 
> Could you tell me why you prefer the old framework? Is the new framework 
> for
> testing serialization complex, hard-to-use, bad documented or something
> else?
> 
> Thank you in advance for your feedback,
> Stepan.
> 

Hi Stepan,

    Perhaps people are all lazy... (just kidding :P)
    In fact, I've try the new framework already some days ago, I find 
two problems:
    1. I find no method to make the ser file, as you know, in old 
framework, if no such file was found, it will create one at once, that 
was easy for us to put the file to the proper directory and run again, 
this time the test passes successfully. To me, write test once, run 
twice, only in two minutes I finish the testing, that was nice :)
    2. Perhaps this is my mistake, I write a test[1], though I put ser 
file to the directory (e.g, 
src/tset/resource/serialization/org/apache/harmony/tests/java/lang/instrument), 
the new framework fails to load the file. I've debug into the code, find 
the path name correct, but the classloader load null(on eclipse 3.2, 
winxp). After that I thought the framework may be still on progress and 
not ready yet, so I give up and go on with the old one.

    Please correct me if I misuse the new framework.

    However I shall agree to use the new framework if no more problem 
exists. Indeed the new framework looks good to me :) And the effort to 
change test code is not heavy then.

[1]
public void test_compatibilitySerialization() throws Exception {
         SerializationTest.verifyGolden(this, new
                                        llegalClassFormatException());
     }

> 
> On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
>>
>>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
>>
>> Jimmy, Jing Lv updated HARMONY-1098:
>> ------------------------------------
>>
>>    Attachment: instrument_patch.zip
>>
>> Hi,
>>
>>    Would you please try my patch?
>>    Please decompress to module\instrument, and run
>> module\instrument\instrument_patch\filecp.sh
>>
>> Thanks!
>>
>> Best regards,
>> Jimmy
>>
>> > [classlib][instrument]Add tests for UnmodifiableClassException and
>> IllegalClassFormatException
>> >
>> ---------------------------------------------------------------------------------------------- 
>>
>> >
>> >                 Key: HARMONY-1098
>> >                 URL: http://issues.apache.org/jira/browse/HARMONY-1098
>> >             Project: Harmony
>> >          Issue Type: Improvement
>> >          Components: Classlib
>> >            Reporter: Jimmy, Jing Lv
>> >         Attachments: instrument_patch.zip
>> >
>> >
>> > Add serialization tests for UnmodifiableClassException and
>> IllegalClassFormatException.
>>
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> If you think it was sent incorrectly contact one of the administrators:
>> http://issues.apache.org/jira/secure/Administrators.jspa
>> -
>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>
>>
>>
> 
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by Stepan Mishura <st...@gmail.com>.
Yes, it is possible to mark it as Deprecated but IMHO this won't encourage
people quickly migrate to the new framework. So it is better to fix tests
and delete the old version. I'll try to find time to fix such tests. And I
like to ask everybody: please don't develop new serialization tests using
the old version.

Patches for tests and the framework are welcome! :-)

Thanks,
Stepan.

On 8/9/06, Tim Ellison wrote:
>
> Why not mark the old one as Deprecated, or better still fix up the
> references to the old version and delete it.
>
> Regards,
> Tim
>
> Stepan Mishura wrote:
> > Hi Jimmy,
> >
> > I expect that we agreed to use new serialization framework for new
> tests.
> > But I see that people continue develop tests for serialization using the
> > old
> > framework (i.e. SerializationTester).
> >
> > Could you tell me why you prefer the old framework? Is the new framework
> > for
> > testing serialization complex, hard-to-use, bad documented or something
> > else?
> >
> > Thank you in advance for your feedback,
> > Stepan.
> >
> >
> > On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
> >>
> >>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
> >>
> >> Jimmy, Jing Lv updated HARMONY-1098:
> >> ------------------------------------
> >>
> >>    Attachment: instrument_patch.zip
> >>
> >> Hi,
> >>
> >>    Would you please try my patch?
> >>    Please decompress to module\instrument, and run
> >> module\instrument\instrument_patch\filecp.sh
> >>
> >> Thanks!
> >>
> >> Best regards,
> >> Jimmy
> >>
> >> > [classlib][instrument]Add tests for UnmodifiableClassException and
> >> IllegalClassFormatException
> >> >
> >>
> ----------------------------------------------------------------------------------------------
> >>
> >> >
> >> >                 Key: HARMONY-1098
> >> >                 URL:
> http://issues.apache.org/jira/browse/HARMONY-1098
> >> >             Project: Harmony
> >> >          Issue Type: Improvement
> >> >          Components: Classlib
> >> >            Reporter: Jimmy, Jing Lv
> >> >         Attachments: instrument_patch.zip
> >> >
> >> >
> >> > Add serialization tests for UnmodifiableClassException and
> >> IllegalClassFormatException.
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> -
> >> If you think it was sent incorrectly contact one of the administrators:
> >> http://issues.apache.org/jira/secure/Administrators.jspa
> >> -
> >> For more information on JIRA, see:
> http://www.atlassian.com/software/jira
> >>
> >>
> >>
> >
> >
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
> IBM Java technology centre, UK.
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Thanks,
Stepan Mishura
Intel Middleware Products Division

------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Re: [classlib][support] Using new framework for testing serialization (was: Re: [jira] Updated: (HARMONY-1098) [classlib][instrument]Add tests for UnmodifiableClassException and IllegalClassFormatException)

Posted by Tim Ellison <t....@gmail.com>.
Why not mark the old one as Deprecated, or better still fix up the
references to the old version and delete it.

Regards,
Tim

Stepan Mishura wrote:
> Hi Jimmy,
> 
> I expect that we agreed to use new serialization framework for new tests.
> But I see that people continue develop tests for serialization using the
> old
> framework (i.e. SerializationTester).
> 
> Could you tell me why you prefer the old framework? Is the new framework
> for
> testing serialization complex, hard-to-use, bad documented or something
> else?
> 
> Thank you in advance for your feedback,
> Stepan.
> 
> 
> On 8/8/06, Jimmy, Jing Lv (JIRA) <ji...@apache.org> wrote:
>>
>>     [ http://issues.apache.org/jira/browse/HARMONY-1098?page=all ]
>>
>> Jimmy, Jing Lv updated HARMONY-1098:
>> ------------------------------------
>>
>>    Attachment: instrument_patch.zip
>>
>> Hi,
>>
>>    Would you please try my patch?
>>    Please decompress to module\instrument, and run
>> module\instrument\instrument_patch\filecp.sh
>>
>> Thanks!
>>
>> Best regards,
>> Jimmy
>>
>> > [classlib][instrument]Add tests for UnmodifiableClassException and
>> IllegalClassFormatException
>> >
>> ----------------------------------------------------------------------------------------------
>>
>> >
>> >                 Key: HARMONY-1098
>> >                 URL: http://issues.apache.org/jira/browse/HARMONY-1098
>> >             Project: Harmony
>> >          Issue Type: Improvement
>> >          Components: Classlib
>> >            Reporter: Jimmy, Jing Lv
>> >         Attachments: instrument_patch.zip
>> >
>> >
>> > Add serialization tests for UnmodifiableClassException and
>> IllegalClassFormatException.
>>
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> If you think it was sent incorrectly contact one of the administrators:
>> http://issues.apache.org/jira/secure/Administrators.jspa
>> -
>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>
>>
>>
> 
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org