Examples of TestException


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

        long leaseTime1 = timeout1;
        long leaseTime2 = timeout2;

        // first check that space is empty
        if (!checkSpace(space)) {
            throw new TestException(
                    "Space is not empty in the beginning.");
        }

        // create snapshots
        snapshot1 = space.snapshot(sampleEntry1);
        snapshot2 = space.snapshot(sampleEntry2);

        // create the non null transaction
        txn = getTransaction();

        /*
         * write snapshot of 1-st entry with Lease.FOREVER lease time
         * to the space within the transaction
         */
        space.write(snapshot1, txn, Lease.FOREVER);

        /*
         * check that written entry is available
         * in the space within the transaction
         */
        result = (SimpleEntry) space.read(sampleEntry1, txn, checkTime);

        if (result == null) {
            throw new TestException(
                    "written within the non null transaction snapshot of "
                    + sampleEntry1 + " with Lease.FOREVER lease time"
                    + " is not available in the space"
                    + " within the transaction.");
        }
        logDebugText(sampleEntry1.toString() + " with Lease.FOREVER"
                + " lease time has been successfully"
                + " written to the space using it's snapshot"
                + " within the non null transaction.");

        /*
         * write snapshot of 2-nd entry with Lease.ANY value for lease time
         * to the space within the transaction
         */
        space.write(snapshot2, txn, Lease.ANY);

        /*
         * check that written entry is available
         * in the space within the transaction
         */
        result = (SimpleEntry) space.read(sampleEntry2, txn, checkTime);

        if (result == null) {
            throw new TestException(
                    "written within the non null transaction snapshot of "
                    + sampleEntry2 + " with Lease.ANY value for lease time"
                    + " is not available in the space"
                    + " within the transaction.");
        }
        logDebugText(sampleEntry1.toString() + " with Lease.ANY value"
                + " for lease time has been successfully"
                + " written to the space using it's snapshot"
                + " within the non null transaction.");

        /*
         * write snapshot of 1-st and 2-nd entries to the space within the
         * transaction again with finite lease times
         */
        space.write(snapshot1, txn, leaseTime1);
        logDebugText(sampleEntry1.toString() + " with " + leaseTime1
                + " has been successfully written again to the space"
                + " using it's snapshot within the non null transaction.");
        space.write(snapshot2, txn, leaseTime2);
        logDebugText(sampleEntry2.toString() + " with " + leaseTime2
                + " has been successfully written again to the space"
                + " using it's snapshot within the non null transaction.");

        // abort the transaction
        txnAbort(txn);

        // check that there are no entries in the space
        result = (SimpleEntry) space.read(null, null, checkTime);

        if (result != null) {
            throw new TestException(
                    "there is " + result + " still available in the"
                    + " space after transaction's aborting"
                    + " but null is expected.");
        }
        logDebugText("There are no entries in the space after"
View Full Code Here

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

  Lease managedLease = set.remove(testLease);
  if (managedLease == null) { // new membership was not honored
      String message = "The membership duration was apparently ";
      message += "not updated to the longer value\n";
      message += "when the lease was re-added to the set.";
      throw new TestException(message);
  }

  /* now assert that a shorter time will also be honored.
     start managing the lease for the base membership time
     again */
  logger.log(Level.FINE, "Adding lease with membership of " +
        doubleDuration + " milliseconds");
  set.renewFor(testLease, doubleDuration);
  logger.log(Level.FINE, "Re-adding lease with membership of " +
        membershipDuration + " milliseconds");
  set.renewFor(testLease, membershipDuration);
 
  // sleep 1.5 times the membership to ensure expiration
  sleepTime = membershipDuration + (membershipDuration / 2);
  rstUtil.sleepAndTell(sleepTime, "1.5 X membership duration.");

  /* if the membership duration was honored we should NOT be able
     to remove the lease because its membership has expired */
  managedLease = set.remove(testLease);
  if (managedLease != null) { // new membership was not honored
      String message = "The membership duration was apparently\n";
      message += "updated to a value that was longer than\n";
      message += "the base membership duration when the lease\n";
      message += "was re-added to the set.";
      throw new TestException(message);
  }
    }
View Full Code Here

Examples of net.sf.joafip.TestException

              + dataRecordIdentifier, set1, set2);
        }
      }

    } catch (HeapException exception) {
      throw new TestException(exception);
    } catch (ObjectIOException exception) {
      throw new TestException(exception);
    } catch (ObjectIODataRecordNotFoundException exception) {
      throw new TestException(exception);
    } catch (ObjectIOClassNotFoundException exception) {
      throw new TestException(exception);
    } catch (ObjectIODataCorruptedException exception) {
      throw new TestException(exception);
    } catch (FilePersistenceException exception) {
      throw new TestException(exception);
    } catch (GarbageException exception) {
      throw new TestException(exception);
    } catch (RBTException exception) {
      throw new TestException(exception);
    }
  }
View Full Code Here

Examples of net.sf.jsqlparser.test.TestException

          break;
        }

        parserManager.parse(new StringReader(statement));
      } catch (JSQLParserException e) {
        throw new TestException("impossible to parse statement: " + statement, e);
      }
    }
  }
View Full Code Here

Examples of net.sourceforge.marathon.action.TestException

            super(new ComponentId("ThrowError"), ScriptModelServerPart.getModelServerPart(), WindowMonitor.getInstance());
            this.message = message;
        }

        public void play(ComponentFinder resolver) {
            throw new TestException(message, ScriptModelServerPart.getModelServerPart(), WindowMonitor.getInstance(), true);
        }
View Full Code Here

Examples of net.thucydides.core.reports.adaptors.xunit.model.TestException

                TestOutcome outcome = TestOutcome.forTestInStory(from.getName(), Story.called(from.getClassname()));
                outcome.setTitle(NameConverter.humanize(from.getName()));
                outcome.setDuration(timeAsLong(from.getTime()));

                if (from.getError().isPresent()) {
                    TestException failure = from.getError().get();
                    outcome.determineTestFailureCause(failure.asException());
                } else if (from.getFailure().isPresent()) {
                    TestException failure = from.getFailure().get();
                    outcome.determineTestFailureCause(failure.asAssertionFailure());
                } else if (from.getSkipped().isPresent()) {
                    //although it is logged by junit as 'skipped', Thucydides
                    //makes a distinction between skipped and ignored.
                    //outcome.setAnnotatedResult(TestResult.IGNORED);
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.dlwmin.sei.TestException

        if (inAction == 0) {
            // echo
            return in;
        } else if (inAction == 1) {
            // throw checked exception that does not have a fault bean
            throw new TestException("TestException thrown", 123);
        } else if (inAction == 2) {
            throw new WebServiceException("WebServiceException thrown");
        } else if (inAction == 3) {
            throw new NullPointerException("NPE thrown");
        } else if (inAction == 4) {
View Full Code Here

Examples of org.apache.batik.test.TestException

        } catch(Exception e) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            e.printStackTrace(pw);
            throw new TestException(INTERNAL_ERROR,
                                    new Object[] { e.getClass().getName(),
                                                   e.getMessage(),
                                                   sw.toString() },
                                    e);
        }
View Full Code Here

Examples of org.apache.batik.test.TestException

            else if(dir.isDirectory()){
                dirOK = true;
            }
        }finally{
            if(!dirOK){
                throw new TestException(errorCode,
                                        new Object[] {dir.getAbsolutePath()},
                                        null);
               
            }
        }
View Full Code Here

Examples of org.apache.batik.test.TestException

            return (TestReportProcessor)XMLReflect.buildObject(element);
        }catch(Exception e){
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            e.printStackTrace(pw);
            throw new TestException(CANNOT_CREATE_TEST_REPORT_PROCESSOR,
                                    new Object[] { element.getAttribute(XR_CLASS_ATTRIBUTE),
                                                   e.getClass().getName(),
                                                   e.getMessage(),
                                                   sw.toString() },
                                    e);
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.