⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 piyclassloadertest.java

📁 PIY(Program It Yourself)是一个基于Java的应用程序开发环境
💻 JAVA
字号:
package piytest;

import piy.PIYClassLoader;
import piy.UserComponent;
import java.io.*;
import junit.framework.*;

/**
* Tests the functionality of the PIYClassLoader.  The tests make use of the dummy test set
* (the classes as presented in the "dummy" directory and its subdirectories).
* @author David Vivash
* @version 1.0, 22/11/00
*/
public class PIYClassLoaderTest extends TestCase
{
	public PIYClassLoaderTest(String name) {
		super(name);
	}

	public static Test suite() {
		return new TestSuite(PIYClassLoaderTest.class);
	}

	public void testDirectoryRecursion() {

		try{
			//there should be five valid classes when we recurse
			assert(PIYClassLoader.getClasses(new File("piytest\\dummy\\"), "piytest.", UserComponent.class, java.awt.Component.class, true).length == 5);

			//there should only be 3 valid classes if we don't recurse
			assert(PIYClassLoader.getClasses(new File("piytest\\dummy\\"), "piytest.", UserComponent.class, java.awt.Component.class, false).length == 3);
		} catch (FileNotFoundException e) {
			fail("The file is there - but we've got a file not found exception!");
			e.printStackTrace();
		}
	}


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -