CI tests: Add more tests
- Separate the "stap-prep" phase out to a separate phase - Add tests/Sanity/byteman-java-methods-probing - Add tests/Sanity/kernel-modules - Add tests/Sanity/userspace-probes - Add tests/Sanity/stap-server-basic-sanity - Add tests/Regression/small-tests
This commit is contained in:
parent
7b59f81081
commit
107122a4e8
20 changed files with 809 additions and 18 deletions
|
|
@ -0,0 +1,60 @@
|
|||
package foo.bar;
|
||||
|
||||
import java.lang.*;
|
||||
import java.util.*;
|
||||
|
||||
class ThreadedExample
|
||||
{
|
||||
|
||||
public static void printMessage(int message) {
|
||||
System.out.println("message: " + message);
|
||||
}
|
||||
|
||||
public static void printMessage(long message) {
|
||||
System.out.println("message: " + message);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
// sleep so that stap can start and byteman agent gets installed
|
||||
try {
|
||||
Thread.sleep(30000);
|
||||
} catch(InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
String[] inputs = new String[] {"int", "foo", "long"};
|
||||
for (String next : inputs) {
|
||||
|
||||
final String arg = next;
|
||||
final int i = 42;
|
||||
final long j = 987234864;
|
||||
Thread thread = new Thread(arg) {
|
||||
public void run() {
|
||||
if(arg.equals("int"))
|
||||
printMessage(i);
|
||||
else if(arg.equals("long"))
|
||||
printMessage(j);
|
||||
else
|
||||
System.out.println("Neither of the types");
|
||||
}
|
||||
};
|
||||
thread.start();
|
||||
try {
|
||||
thread.join();
|
||||
} catch (Exception e){}
|
||||
}
|
||||
} catch (Exception e){}
|
||||
|
||||
|
||||
// sleep so that stap can finish still while probed java program still runs
|
||||
try {
|
||||
Thread.sleep(80000);
|
||||
} catch(InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue