You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mark Hindess <ma...@googlemail.com> on 2006/08/11 11:34:50 UTC

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

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: 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