Examples of JavaThread


Examples of javax.tools.diagnostics.runtime.java.JavaThread

  public void testExpectedThreadState() throws CorruptDataException {
   
    List allThreads = getJavaRuntime().getThreads();
   
    JavaThread t1=getThread(allThreads,SetupJavaRuntimeThreads.DTFJ_TCK_T1);
    int state=t1.getState();
    assertEquals(JavaThread.STATE_ALIVE | JavaThread.STATE_WAITING | JavaThread.STATE_SLEEPING,
        (state & (JavaThread.STATE_ALIVE | JavaThread.STATE_WAITING | JavaThread.STATE_SLEEPING)));
   
  }
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

 
  public void testHasThreadStack() throws CorruptDataException {
   
    List allThreads = getJavaRuntime().getThreads();
   
    JavaThread t1=getThread(allThreads,SetupJavaRuntimeThreads.DTFJ_TCK_T1);
    Iterator i=t1.getStackFrames().iterator();
    assertTrue(i.hasNext());
   
   
  }
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

  }
  public void testThreadStackFrameLocation() throws CorruptDataException {
   
    List allThreads = getJavaRuntime().getThreads();
   
    JavaThread t1=getThread(allThreads,SetupJavaRuntimeThreads.DTFJ_TCK_T1);
    Iterator i=t1.getStackFrames().iterator();
    JavaStackFrame frame=(JavaStackFrame) i.next();
    JavaLocation location=frame.getLocation();
    assertNotNull(location);
   
   
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

  }
  public void testThreadStackFrameLocationMethod() throws CorruptDataException {
   
    List allThreads = getJavaRuntime().getThreads();
   
    JavaThread t1=getThread(allThreads,SetupJavaRuntimeThreads.DTFJ_TCK_T1);
    Iterator i=t1.getStackFrames().iterator();
    JavaStackFrame frame=(JavaStackFrame) i.next();
    JavaLocation location=frame.getLocation();
    JavaMethod  method=location.getMethod();
    assertNotNull(method);
   
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

  }
public void testThreadStackFrameLocationMethodName() throws CorruptDataException {
   
    List allThreads = getJavaRuntime().getThreads();
   
    JavaThread t1=getThread(allThreads,SetupJavaRuntimeThreads.DTFJ_TCK_T1);
    Iterator i=t1.getStackFrames().iterator();
    JavaStackFrame frame=(JavaStackFrame) i.next();
    JavaLocation location=frame.getLocation();
    JavaMethod  method=location.getMethod();
    String name=method.getName();
    assertEquals(name,"sleep");
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

    Iterator threadIterator=runtime.getThreads().iterator();
    
    List allThreads=new LinkedList();
   
    while(threadIterator.hasNext()) {
      JavaThread thread=(JavaThread) threadIterator.next();
      allThreads.add(thread);
    }
    return allThreads;
  }
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

  
  public void testThreadGroupMembership() throws CorruptDataException {
   
    List allThreads = getJavaRuntime().getThreads();
    JavaThread t1=getThread(allThreads, SetupJavaRuntimeThreads.DTFJ_TCK_T1);
   
   
  }
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

  }
  private JavaThread getThread(List allThreads, String threadname) throws CorruptDataException {
   
    Iterator i=allThreads.iterator();
    while(i.hasNext()) {
      JavaThread thread=(JavaThread) i.next();
      String name=thread.getName();
      if(name.equals(threadname)) return thread;
    }
    return null;
  }
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

   
    while (threads.hasNext()) {
      Object next = threads.next();
     
      if (next instanceof JavaThread) {
        JavaThread thread = (JavaThread) next;
       
        try {
          if (SetupJavaThread_getStackFrames.threadName.equals( thread.getName())) {
            contrivedThread = thread;
            break;
          }
        } catch (CorruptDataException e) {
          assertNotNull(e.getCorruptData());
View Full Code Here

Examples of javax.tools.diagnostics.runtime.java.JavaThread

  /**
   * This test applies only to JVMs whose thread roots only appear with the rest of the roots,
   * and not in JavaStackFrames because of conservative garbage collection.
   */
  public void testJavaThreadRoots() throws Exception {
    JavaThread thread = null;
   
    // Find the thread to match as a root source.
    Iterator threads = getJavaRuntime().getThreads().iterator();
    while(threads.hasNext()) {
      JavaThread candidateThread = (JavaThread) threads.next();
      if (setup.javaLocalRootsthreadName.equals(candidateThread.getName())) {
        thread = candidateThread;
        break;
      }
    }
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.