Examples of JavaThread


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

    assertEquals("Enters count incorrect :" + count, 2, count);
  }

  public void testCountOwners_0_2_1() throws Exception {
    JavaMonitor monitor = (JavaMonitor)setup.findMonitorThreadConfig(0, 2, 1).getMonitor();
    JavaThread owner = monitor.getOwner();

    assertNotNull("Owner count incorrect", owner);
  }
View Full Code Here

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

    JavaMonitor monitor = (JavaMonitor)setup.findMonitorThreadConfig(0, 2, 1).getMonitor();
    int count = 0;
    Iterator waiters = monitor.getNotifyWaiters().iterator();

    while (waiters.hasNext()) {
      JavaThread next = (JavaThread) waiters.next();
      assertEquals("Waiters name incorrect", generatePrefix(0, 2, 1)
          + "-" + SetupJavaMonitor_ObjectMonitors.monitorNotifyThreadName + "-" + count, next
          .getName());
      count++;
    }
  }
View Full Code Here

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

    assertNull(error, error);
  }
 
  public void testNameOwners_0_2_1() throws Exception {
    JavaMonitor monitor = (JavaMonitor)setup.findMonitorThreadConfig(0, 2, 1).getMonitor();
    JavaThread owner = monitor.getOwner();

    assertEquals("Owner name incorrect", generatePrefix(0, 2, 1) + "-"
        + SetupJavaMonitor_ObjectMonitors.monitorOwnerThreadName + "-0", owner.getName());
  }
View Full Code Here

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

    Iterator it = time.getThreads().iterator();
    assertNotNull(it);
    assertTrue(it.hasNext());
    //threads without stack frames aren't very useful for testing so ignore them
    // unless they are the only ones
    JavaThread candidate = null;
    do {
      candidate = (JavaThread) it.next();
    } while ((it.hasNext()) && (!candidate.getStackFrames().iterator().hasNext()));
    return candidate;
  }
View Full Code Here

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

      if (next instanceof CorruptData) {
        System.err.println("returned CorruptData `" + next + "'");
        break;
      }

      JavaThread thread = (JavaThread) next;

      try {
        if (0==SetupJavaThread_getName.threadName.compareTo(thread.getName())){
          foundThread=true;
        }
      } catch (CorruptDataException e) {
        assertNotNull(e.getCorruptData());
        // TODO Auto-generated catch block
View Full Code Here

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

   * @throws Exception
   */
  public void testGetStackMethods() throws Exception {
    Iterator threads = getJavaRuntime().getThreads().iterator();
   
    JavaThread testThread = null;
    while(threads.hasNext()) {
      Object next = threads.next();
     
      if (next instanceof JavaThread) {
        JavaThread thread = (JavaThread) next;
        if (thread.getName().equals(SetupJavaMethod_getName.threadName)) {
          testThread = thread;
          break;
        }
      } else {
        break;
View Full Code Here

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

  public void testSimpleThreadCreation() throws Exception {
    assertNotNull(threadDumpInstances);
    JavaObject o1=threadDumpInstances[0];
   
    Thread t=new Thread();
    JavaThread jt;
   
  }
View Full Code Here

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

 
  public void setUp () {
    JavaRuntime runtime = getJavaRuntime();
    Iterator threads = runtime.getThreads().iterator();
    JavaThread contrivedThread = null;
    while (threads.hasNext()) {
      Object next = threads.next();
     
      if (next instanceof JavaThread) {
        JavaThread thread = (JavaThread) next;
        try {
          //System.out.println("Thread: " + thread.getName());
          if (SetupJavaStackFrame_getHeapRoots.threadName.equals( thread.getName())) {
//            System.out.println("Thread " + thread.getName() + " found!");
            contrivedThread = thread;
            break;
          }
        } catch (CorruptDataException e) {
View Full Code Here

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

  public void testAllThreadsNamed()
  {
    Iterator threads = defaultJavaRuntime().getThreads().iterator();
   
    while (threads.hasNext()) {
      JavaThread thread = (JavaThread) threads.next();
     
      try {
        assertNotNull(thread.getName());
        thread.getPriority();
      } catch (CorruptDataException e) {
        assertTrue(false);
      }
    }
  }
View Full Code Here

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

{
  private JavaStackFrame _frame = null;
 
  public  JavaStackFrame defaultJavaStackFrame()
  {
    JavaThread thread = defaultJavaThread();
    Iterator it = thread.getStackFrames().iterator();
    assertNotNull(it);
    assertTrue(it.hasNext());
    return (JavaStackFrame) it.next();
  }
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.