Package org.jbehave.core.mock

Examples of org.jbehave.core.mock.Matcher


        Ensure.that(c.matches(new Float(1)));
    }
   
    public void shouldCreateMatcherForPrimitiveByteType() throws Exception {
        byte b = 1;
        Matcher c = m.eq(b);
        Ensure.that(c.matches(new Byte(b)));
    }
View Full Code Here


        Ensure.that(c.matches(new Byte(b)));
    }
   
    public void shouldCreateMatcherForPrimitiveShortType() throws Exception {
        short s = 1;
        Matcher c = m.eq(s);
        Ensure.that(c.matches(new Short(s)));
    }
View Full Code Here

            this.methodFilter = matchMethodName(methodName);
        }
    }

    private Matcher matchMethodName(final String methodName) {
        return new Matcher() {
            public boolean matches(Object arg) {
                return ((Method) arg).getName().equals(methodName);
            }
        };
    }
View Full Code Here

      }
    }
  }

  private Matcher isLessThan(final int time) {
    return new Matcher() {
      public boolean matches(Object arg) {
        return arg instanceof Long && ((Long)arg).longValue() < time;
      }
       
      public String toString() {
View Full Code Here

      }
    };
  }
 
  private Matcher isGreaterThanOrEq(final int time) {
    return new Matcher() {
      public boolean matches(Object arg) {
        return arg instanceof Long && ((Long)arg).longValue() >= time;
     
     
      public String toString() {
View Full Code Here

            // succeeds
        }
    }
   
    private Matcher resultOfType(final Type type) {
        return new Matcher() {
            public boolean matches(Object arg) {
                return ((Result)arg).status() == type;
            }
        };
    }
View Full Code Here

            throw new Exception("from method");
        }
    }
   
    private Matcher resultContainingExceptionMessage(final String message) {
        return new Matcher() {
            public boolean matches(Object arg) {
                return message.equals(((Result)arg).cause().getMessage());
            }
            public String toString() {
                return "result containing CheckedException with message=" + message;
View Full Code Here

    public static class ClassWithOneBehaviourMethod {
        public void shouldDoOneThing() {}
    }
   
    private Matcher successfulResultFromMethodCalled(final String name) {
        return new Matcher() {
            public boolean matches(Object arg) {
                Result result = (Result)arg;
                return result.succeeded() && result.name().equals(name);
            }
            public String toString() {
View Full Code Here

            }
        };
    }
   
    private Matcher isBehaviourMethodFor(final String name) {
        return new Matcher() {
            public boolean matches(Object arg) {
                BehaviourMethod behaviourMethod = (BehaviourMethod)arg;
                return behaviourMethod != null && behaviourMethod.method().getName().equals(name);
            }
            public String toString() {
View Full Code Here

    };
    return panel;
  }
   
    private Matcher contains(final Segments segments, final Color color) {
        return new Matcher() {
            public boolean matches(Object arg) {
                return ((RenderedPit)arg).contains(segments, color);
            }
           
            public String toString() {               
View Full Code Here

TOP

Related Classes of org.jbehave.core.mock.Matcher

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.