-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithmInGraphTest.java
More file actions
33 lines (25 loc) · 1.05 KB
/
AlgorithmInGraphTest.java
File metadata and controls
33 lines (25 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import SupportData.TestUtil;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.*;
public class AlgorithmInGraphTest {
@Test
public void showAlgorithm() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
List<Class<?>> classes = TestUtil.getAllClassesByPackageName("");
for(Class<?> theClass:classes){
if(!theClass.isInterface()){
try {
Object object = theClass.newInstance();
if(object instanceof AlgorithmInGraph) {
System.out.println("当前测试类为:" + theClass.getName()+":\n");
AlgorithmInGraph algorithm = (AlgorithmInGraph) object;
algorithm.showAlgorithm();
System.out.println("========================================================\n");
}
}catch (InstantiationException ex){
ex.printStackTrace();
}
}
}
}
}