W3C home > Mailing lists > Public > www-dom-ts@w3.org > January 2003

Re: DOMOutputStream

From: Jeroen van Rotterdam <jvrdam@xs4all.nl>
Date: Thu, 30 Jan 2003 21:31:18 +0100 (CET)
Message-ID: <5023.>
To: www-dom-ts@w3.org

> - a method to create a new File OutputStream a.k.a. in java new
> FileOutputStream(String fileName)

There are a lot of issues involved with letting the tests write to the
file system.  If writing to the file system is needed, then the
temporary filenames should be generated by the framework.  However, even
these could not be supported by browser based implementations.  I'm
pretty darn curious about what would be considered a DOMOutputStream on
an ECMAScript implementation.

Ok, so for the framework you suggest testing DOMWriter using pipes
by creating an inputstream from an outputstream ?

I guess I can live with that.

> - a method to test whether a substring appears in a file

>Is this specific to files?

We probably can skip this, see above.

> - a method to get the size of a file

This is typically used to do weak tests on e.g. pretty print. Since pretty
print is weakly defined you would probably fall back to test whether the
output has a different size than the input after applying pretty-print.
I know this isn't great but it's probably the best you can do.

If we use strings and read from the outputstream I can do it with

>Would there be any need (hopefully not) for this to something other than
>a resource provided with the test?

No, DOMInputSource can have both a DOMInputStream as a DOMReader as an input.

>Do we want to provide a mechanism to mechanism to create a reader from a
>file?  It would be difficult to implement for ECMAScript.  It might be
>cleaner just to provide a mechanism to initialize a reader from a string.

If we just use strings in tests we won't be able to test System
Exceptions. It is currently still an open issue whether System Exceptions
are passed on and how. If this will be done by a DOMException than it
makes sense to build a test for it (something like parse a non existing
file and find out whether a DOMException is thrown).


X-Hive Corporation
Jeroen van Rotterdam, CEO
e-mail: jeroen@x-hive.com
phone: +31 10 2818080
Received on Thursday, 30 January 2003 15:31:20 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:06 UTC