This is the mail archive of the mauve-discuss@sources.redhat.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ClassTest on class.getClassLoader()


One of Mauve Test cases. 
\java\lang\Class\ClassTest.java:
public void test_getClassloader()
{
   try {
        Class obj1 =
Class.forName("java.lang.String");
        ClassLoader ldr = obj1.getClassLoader();
       if ( ldr != null )
						harness.fail("Error: test_getClassLoader failed
- 1");
        Class obj2 = Class.forName("ClassTest");
	ClassLoader ldr1 = obj2.getClassLoader();
	if ( ldr1 != null )				harness.fail("Error:
test_getClassLoader failed on ClassTest- 2");
      }
      catch ( Exception e ){
			harness.fail("Error: test_getClassLoader failed -
2");
}
}

I test on jdk1.1.4
I get the result
Class name  = java.lang.String
Classloader = null
Class name  = ClassTest
Classloader = null

But when I test on jdk1.2.2
I get the different result
Class name  = java.lang.String
Classloader = null
Class name  = ClassTest_test_getClassloader
Classloader =
sun.misc.Launcher$AppClassLoader@e6775003
Error: test_getClassLoader failed - 2

IT seems to me the customer class and system class
should both return null. Does somebody know why i get
the different result ? which one is correct?

Thanks







__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]