Examples of TestException


Examples of bugjac511a.bugjac511b.TestException

*/
public class BugJac511ServerImpl extends BugJac511ServerPOA
{
    public void request_sending_exception() throws TestException
    {
        throw new TestException();
    }
View Full Code Here

Examples of com.hp.mwtests.ts.jts.exceptions.TestException

      res = false;
  }

  if (!res)
      throw new TestException();
  else
      return value;
    }
View Full Code Here

Examples of com.hp.mwtests.ts.txoj.common.exceptions.TestException

  if (setlock(new Lock(LockMode.WRITE), 0) == LockResult.GRANTED)
  {
      state += value;

      if (A.commit() != ActionStatus.COMMITTED)
    throw new TestException("Action commit error.");
      else
    return;
  }
  else
  {
      if (printDebug)
    System.out.println("Error - could not set write lock.");
  }
 
  A.abort();

  throw new TestException("Write lock error.");
    }
View Full Code Here

Examples of com.sun.jini.qa.harness.TestException

  Class[] classTypes = null;
  classTypes = proxy.getServiceTypes(emptyTmpl,null);
  if (!QATestUtils.classTypesEqualTypeDescriptors(classTypes,
              expectedTypeDescs))
  {
      throw new TestException("not ALL service type "
            + "descriptors were returned");
  }
    }
View Full Code Here

Examples of com.sun.jini.qa.harness.TestException

     * event; and that the transition associated with the event equals
     * the expected transition.
     */
    private void verifyNotification(int transition) throws TestException {
  if(srvcItems.length != numEvnt )
            throw new TestException("# of Events Received ("+
            numEvnt+
            ") != # of Events Expected ("+
            srvcItems.length+")");

  for(int i=0; i <srvcItems.length; i++) {
      if(!verifyServiceItemTransition(srvcItems[i],transition)) {
                throw new TestException("transition mismatch (index "+i+")");
      }
  } 
    }
View Full Code Here

Examples of com.sun.jini.qa.harness.TestException

      set.renewFor(testLease, 0);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += " with a 0 membership duration has failed.";
      throw new TestException(message, ex);
  }     

  /* assert that using a membership duration of -99 (negative test)
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, -99);
      // success, keep on trucking ... 
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a negative membership duration has ";
      message += "failed.";
      throw new TestException(message, ex);
  }     

  // trying to remove the lease should result in null value
  Lease managedLease = set.remove(testLease);
  if (managedLease != null) {
      String message = "Lease was added to renewal set in error\n";
      message += "from a call to renewFor with 0 membership.";
      throw new TestException(message);
  }
 
  /* assert that using a membership duration of Lease.ANY
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, Lease.ANY);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a Lease.ANY membership duration\n";
      message += "has failed with an IllegalArgumentException.";
      throw new TestException(message, ex);
  }     

  /* assert that using a membership duration of Lease.FOREVER
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, Lease.FOREVER);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a Lease.FOREVER membership duration\n";
      message += "has failed with an IllegalArgumentException.";
      throw new TestException(message, ex);
  }     

  /* assert that using a membership duration of Long.MAX_VALUE
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, Long.MAX_VALUE);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a Long.MAX_VALUE membership duration\n";
      message += "has failed with an IllegalArgumentException.";
      throw new TestException(message, ex);
  }     

  /* assert that using a membership duration of 1 (edge case)
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, 1);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a 1 millisecond membership duration\n";
      message += "has failed with an IllegalArgumentException.";
      throw new TestException(message, ex);
  }     

  /* assert that using a membership duration of 30000 (normal case)
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, 30000L);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a 30000 millisecond membership duration\n";
      message += "has failed with an IllegalArgumentException.";
      throw new TestException(message, ex);
  }     
    }
View Full Code Here

Examples of com.sun.jini.qa.harness.TestException

    public void run() throws Exception {
  ServiceRegistration[] oldSrvcRegs = super.registerAll();
  /* "pretend" the registration process failed ==> must re-register */
  ServiceRegistration[] newSrvcRegs = super.registerAll();
  if ( oldSrvcRegs.length != newSrvcRegs.length ) {
      throw new TestException
                ("Original number of services registered ("
                 +oldSrvcRegs.length+
                 ") != number of services RE-registered ("
                 +newSrvcRegs.length+")");
  } else {
      for (int i = 0; i < oldSrvcRegs.length; i++ ) {
          if ( !(oldSrvcRegs[i].getServiceID().equals
                                       (newSrvcRegs[i].getServiceID())) )
          {
              throw new TestException
                        ("Index " + i + "Service IDs not equal ("
                         +oldSrvcRegs[i].getServiceID()+" & "
                         +newSrvcRegs[i].getServiceID()+")");
    }
      }
View Full Code Here

Examples of com.sun.jini.qa.harness.TestException

        for (int i = 0; i < testCases.length; i++) {
            logger.log(Level.FINE, "\n\t+++++ Test Case #" + (i + (int) 1));

            if (!checker(testCases[i])) {
                throw new TestException(
                        "" + " test failed");
            }
        }
        return;
    }
View Full Code Here

Examples of com.sun.jini.qa.harness.TestException

        for (int i = 0; i < constraints.length; i++) {
            logger.log(Level.FINE, "\n\t+++++ Test Case #" + (i + (int) 1));

            if (!checker(constraints[i])) {
                throw new TestException(
                        "" + " test failed");
            }
        }
        return;
    }
View Full Code Here

Examples of com.sun.jini.qa.harness.TestException

                classes.add(NotPrincipal.class);
                callConstructor(testCase, (Collection) classes,
                        IllegalArgumentException.class);
            } else {
                logger.log(Level.FINE, "Bad Test Case: " + testCase.toString());
                throw new TestException(""
                        + " test failed");
            }
        } catch (TestException e) {
            logger.log(Level.FINE, "Test Case failed: " + e);
            throw new TestException(""
                    + " test failed");
        }
        return;
    }
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.