Package org.jbehave.core.mock

Examples of org.jbehave.core.mock.Matcher


        DefaultWindowWrapper wrapper = new DefaultWindowWrapper(AFrame.FRAME_NAME);
       
        try {
            AFrame frame = new AFrame();
           
            Matcher spaceKeyEvent = new Matcher() {
                public boolean matches(Object arg) {
                    return ((KeyEvent)arg).getKeyCode() == KeyEvent.VK_SPACE ||
                        ((KeyEvent)arg).getKeyChar() == ' ';
                }
            };
View Full Code Here


        List list = Arrays.asList(actualCommand);
        ensureThat(list, collectionContains(BehaviourClassOne.class.getName()));
    }

    private Matcher collectionContains(final Object item) {
        return new Matcher() {
            public boolean matches(Object arg) {
                return ((Collection)arg).contains(item);
            }

            public String toString() {
View Full Code Here

        task.setProject(project);
    }
   

    private Matcher collectionContains(final Object item) {
        return new Matcher() {
            public boolean matches(Object arg) {
                return ((Collection)arg).contains(item);
            }

            public String toString() {
View Full Code Here

    UsingMiniMock m = new UsingMiniMock();
   
    public interface SomeType {}

    private Matcher containsMocks() {
        return new Matcher() {
            public boolean matches(Object arg) {
                return ((UsingMiniMock)arg).containsMocks();
            }
            public String toString() {
                return "UsingMiniMock instance containing mocks";
View Full Code Here

        ensureThat(m, containsMocks());
     
    }
   
    public void shouldCreateMatcherForPrimitiveFloatingPointTypes() throws Exception {
        Matcher matchesFloatValue = m.eq(1.0);
        ensureThat(new Float(1.0), matchesFloatValue);
        ensureThat(new Double(1.0), matchesFloatValue);
    }
View Full Code Here

        ensureThat(new Float(1.0), matchesFloatValue);
        ensureThat(new Double(1.0), matchesFloatValue);
    }
   
    public void shouldCreateMatcherForPrimitiveIntegerTypes() throws Exception {
        Matcher matchesIntTypeValue = m.eq(1);
        ensureThat(new Byte((byte)1), matchesIntTypeValue);
        ensureThat(new Short((short)1), matchesIntTypeValue);
        ensureThat(new Integer(1), matchesIntTypeValue);
        ensureThat(new Long((long)1), matchesIntTypeValue);
    }
View Full Code Here

        ensureThat(new Integer(1), matchesIntTypeValue);
        ensureThat(new Long((long)1), matchesIntTypeValue);
    }
   
    public void shouldCreateMatcherForPrimitiveCharType() throws Exception {
        Matcher c = m.eq('c');
        Ensure.that("matcher should match Character 'c'", c.matches(new Character('c')));
    }
View Full Code Here

        Matcher c = m.eq('c');
        Ensure.that("matcher should match Character 'c'", c.matches(new Character('c')));
    }
   
    public void shouldCreateMatcherForPrimitiveLongType() throws Exception {
        Matcher c = m.eq(1l);
        Ensure.that(c.matches(new Long(1)));
    }
View Full Code Here

        Matcher c = m.eq(1l);
        Ensure.that(c.matches(new Long(1)));
    }
   
    public void shouldCreateMatcherForPrimitiveBooleanType() throws Exception {
        Matcher c = m.eq(true);
        Ensure.that(c.matches(Boolean.TRUE));
    }
View Full Code Here

        Ensure.that(c.matches(Boolean.TRUE));
    }
   
    public void shouldCreateMatcherForPrimitiveFloatType() throws Exception {
        float f = 1;
        Matcher c = m.eq(f);
        Ensure.that(c.matches(new Float(1)));
    }
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.