harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Luht" <anton.l...@gmail.com>
Subject Re: Where to run tests? (was Re: [classlib][support] Using new framework for testing serialization (was: ...)
Date Fri, 11 Aug 2006 11:08:49 GMT
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 <stepan.mishura@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


Mime
View raw message