-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ran1.java
More file actions
24 lines (21 loc) · 865 Bytes
/
test_ran1.java
File metadata and controls
24 lines (21 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.lang.reflect.*;
public class test_ran1 {
public static void main(String[] args)
throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
System.out.println("Test ran1");
Class myClass = Class.forName("EcgCalc");
EcgCalc ecgCalc = new EcgCalc(new EcgParam());
String methodName = "ran1";
Class[] parameterType = null;
Method method = myClass.getDeclaredMethod(methodName, parameterType);
if (method == null) {
System.out.println("cant find ran1");
} else {
method.setAccessible(true);
double r = (double) method.invoke(ecgCalc);
System.out.println("ran1 " + r);
r = (double) method.invoke(ecgCalc);
System.out.println("ran1 " + r);
}
}
}