KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > junit > tests > LoadedFromJar


1 package junit.tests;
2
3 /**
4  * Test class used in TestTestCaseClassLoader
5  */

6 import junit.framework.*;
7 import junit.runner.*;
8
9 public class LoadedFromJar extends Assert {
10     public void verify() {
11         verifyApplicationClassLoadedByTestLoader();
12     }
13     private boolean isTestCaseClassLoader(ClassLoader JavaDoc cl) {
14         return (cl != null && cl.getClass().getName().equals(junit.runner.TestCaseClassLoader.class.getName()));
15     }
16     private void verifyApplicationClassLoadedByTestLoader() {
17         assertTrue(isTestCaseClassLoader(getClass().getClassLoader()));
18     }
19 }
Popular Tags