Package javax.tools.diagnostics.runtime.java

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


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

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

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


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

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

   
    while (waiters.hasNext()) {
      Object next = waiters.next();
     
      if (next instanceof JavaThread) {
        JavaThread thread = (JavaThread) next;
        foundSet.add(thread.getName());
      }
    }
   
    for(int i=0; i < count; i++) {
      String threadName = prefix+"-"+i;
View Full Code Here

        if (next instanceof CorruptData) {
          System.out.println("enter waiter corrupt: "+ next);
          continue;
        }
       
        JavaThread thread = (JavaThread) next;
       
        try {
          System.out.println("EnterWaiter: "+thread.getName());
        } catch (CorruptDataException e) {
          assertNotNull(e.getCorruptData());
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
               
               
      }
     
      System.out.println("\nmonitor.getNotifyWaiters():");
     
      Iterator notifiers = monitor.getNotifyWaiters().iterator();
     
      while (notifiers.hasNext()) {
        Object next = notifiers.next();
       
        if (next instanceof CorruptData) {
          System.out.println("notify waiter corrupt: "+ next);
          continue;
        }
       
        JavaThread thread = (JavaThread) next;
       
        try {
          System.out.println("NotifyWaiter: "+thread.getName());
        } catch (CorruptDataException e) {
          assertNotNull(e.getCorruptData());
          // TODO Auto-generated catch block
          e.printStackTrace();
        }               
      }
     
      JavaThread thread;
      try {
        thread = monitor.getOwner();
        if (thread == null) {
          System.out.println("Owner thread = null");
        } else {
          try {
            System.out.println("Owner thread = "+thread.getName());
          } catch (CorruptDataException e) {
            assertNotNull(e.getCorruptData());
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
View Full Code Here

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

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

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

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

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

    assertEquals("Waiters count incorrect :" + count, 0, count);
View Full Code Here

    JavaMonitor monitor = (JavaMonitor) setup.findMonitorThreadConfig(0, 1, 1).getMonitor();
    int count = 0;
    Iterator enters = monitor.getEnterWaiters().iterator();

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

    }
  }

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

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

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

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

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

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

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

  }
View Full Code Here

TOP

Related Classes of javax.tools.diagnostics.runtime.java.JavaThread

Copyright © 2018 www.massapicom. 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.