Examples of Invariant


Examples of com.crawljax.condition.invariant.Invariant

    assertThat(counterFor(OnNewStatePlugin.class), is(1));
  }

  @Test
  public void invariantViolatedIsCalled() throws Exception {
    Invariant invariant = mock(Invariant.class);
    plugins.runOnInvariantViolationPlugins(invariant, context);
    verify(invariantViolationPlugin).onInvariantViolation(invariant, context);
    assertThat(counterFor(OnInvariantViolationPlugin.class), is(1));
  }
View Full Code Here

Examples of com.crawljax.condition.invariant.Invariant

    StateVertex state2 = new StateVertexImpl(2, "state2", "<table><div>state2</div></table>");
    StateVertex state3 = new StateVertexImpl(3, "state3", "<table><div>state2</div></table>");

    hit = false;
    ImmutableList<Invariant> iList =
            ImmutableList.of(new Invariant("Test123", new Condition() {

              @Override
              public boolean check(EmbeddedBrowser browser) {
                hit = true;
                return false;
View Full Code Here

Examples of com.crawljax.condition.invariant.Invariant

      @Override
      public void onInvariantViolation(Invariant invariant, CrawlerContext context) {
        hit = true;
      }
    });
    builder.crawlRules().addInvariant(new Invariant("Test123", new Condition() {

      @Override
      public boolean check(EmbeddedBrowser browser) {
        return false;
      }
View Full Code Here

Examples of com.crawljax.condition.invariant.Invariant

    // should never fail
    RegexCondition onInvariantsPagePreCondition = new RegexCondition(INVARIANT_TEXT);
    XPathCondition expectElement =
            new XPathCondition("//DIV[@id='SHOULD_ALWAYS_BE_ON_THIS_PAGE']");
    builder.crawlRules().addInvariant(
            new Invariant("testInvariantWithPrecondiions", expectElement,
                    onInvariantsPagePreCondition));
  }
View Full Code Here

Examples of com.crawljax.condition.invariant.Invariant

   *            the description of the invariant.
   * @param condition
   *            the condition to be met.
   */
  public void addInvariant(String description, Condition condition) {
    this.invariants.add(new Invariant(description, condition));
  }
View Full Code Here

Examples of com.crawljax.condition.invariant.Invariant

   *            the invariant condition.
   * @param preConditions
   *            the precondition.
   */
  public void addInvariant(String description, Condition condition, Condition... preConditions) {
    this.invariants.add(new Invariant(description, condition, preConditions));
  }
View Full Code Here

Examples of com.crawljax.condition.invariant.Invariant

   *            the description of the invariant.
   * @param condition
   *            the condition to be met.
   */
  public void addInvariant(String description, Condition condition) {
    this.invariants.add(new Invariant(description, condition));
  }
View Full Code Here

Examples of com.crawljax.condition.invariant.Invariant

   * @param preConditions
   *            the precondition.
   */
  public void addInvariant(
          String description, Condition condition, Condition... preConditions) {
    this.invariants.add(new Invariant(description, condition, preConditions));
  }
View Full Code Here

Examples of org.jboss.aspects.dbc.Invariant

      invariants.put(clazz, inv);
   }

   private static void addInvariantConditions(ArrayList conditions, Class clazz)
   {
      Invariant inv = (Invariant)AnnotationElement.getAnyAnnotation(clazz, Invariant.class);
      if (inv != null)
      {
         if (DesignByContractAspect.verbose) System.out.println("[dbc] Found non-static invariants in class: " + clazz);
         String[] exprs = inv.value();
         if (exprs != null)
         {
            for (int i = 0 ; i < exprs.length ; i++)
            {
               conditions.add(new InvariantCondition(clazz, exprs[i], false));
View Full Code Here

Examples of org.jboss.aspects.dbc.Invariant

      invariants.put(clazz, inv);
   }

   private static void addInvariantConditions(ArrayList<InvariantCondition> conditions, Class<?> clazz)
   {
      Invariant inv = (Invariant)AnnotationElement.getAnyAnnotation(clazz, Invariant.class);
      if (inv != null)
      {
         if (DesignByContractAspect.verbose) System.out.println("[dbc] Found non-static invariants in class: " + clazz);
         String[] exprs = inv.value();
         if (exprs != null)
         {
            for (int i = 0 ; i < exprs.length ; i++)
            {
               conditions.add(new InvariantCondition(clazz, exprs[i], false));
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.