
Untitled
By: a guest on
Feb 14th, 2011 | syntax:
None | size: 0.58 KB | views:
84 | expires: Never
//todo - remove this when https://issues.jboss.org/browse/ARQ-56 is fixed
public static boolean runningInAS() {
Exception e = new Exception();
StackTraceElement[] stack = e.getStackTrace();
for (int i=stack.length-1; i>=0; i--) {
//we're looking for the HTTP invoker (part of jboss)
//to see if we're running server-side (as part of
//an arquillian-generated HTTP GET request)
if (stack[i].getClassName().contains("http11")) {
return true;
}
}
return false;
}