[kaffe] regression test: loading all kaffe's Klasses

Dalibor Topic robilad@yahoo.com
Sun, 2 Jun 2002 17:33:44 -0700 (PDT)


--0-1798262769-1023064424=:97808
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

A couple of weeks ago[1] I proposed that somebody
writes a test program
that would load all classes in Klasses.jar in order to
check if they
load at all. Since noone stood up to the challenge, I
went ahead and
wrote it myself. ;)

The attached program loads all classes in all jar
files passed to it
via the command line.

What is it good for?
 
As another regression test. I'll check in a patch if
there are no
complaints. You can also use it as a rather simplistic
way to test if
some jar file may need classes that are not
implemented in kaffe yet.

Beware: it needs a lot of memory. To load all jars
included with
kaffe at once, it takes around 30M on linux i686,
jit3.

cheers,

dalibor topic

[1] After the jikes 1.15 vs Klasses.jar fight ;)

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--0-1798262769-1023064424=:97808
Content-Type: application/octet-stream; name="JarLoader.java"
Content-Transfer-Encoding: base64
Content-Description: JarLoader.java
Content-Disposition: attachment; filename="JarLoader.java"

LyogSmFyTG9hZGVyOiAoYykgMjAwMiBEYWxpYm9yIFRvcGljCiAqIExpY2Vu
c2U6IEdQTC4KICoKICogVXNhZ2U6CiAqIGthZmZlIEphckxvYWRlciBzb21l
LmphciAuLi4KICoKICogVGhpcyBzaW1wbGUgcHJvZ3JhbSBsb2FkcyBhbGwg
Y2xhc3NlcyB0aGF0IGl0IGNhbiBmaW5kCiAqIGluIHRoZSBqYXIgZmlsZXMg
aW4gaXRzIHBhcmFtZXIgbGlzdC4KICoKICogSXQgaXMgdXNlZnVsIHdoZW4g
eW91IHdhbnQgdG8gdGVzdCB0aGUgdmVyaWZpZXIsIG9yIHRoZQogKiBjbGFz
cyBsb2FkaW5nIG1lY2hhbmlzbSwgb3IgdGhlIGphciBmaWxlIGludGVncml0
eSwKICogb3IgLi4uCiAqLwppbXBvcnQgamF2YS5pby4qOwppbXBvcnQgamF2
YS51dGlsLio7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