Package org.easymock

Examples of org.easymock.AbstractMatcher


        TypedEventMessage message = new TypedEventMessage();
        Message handle = message.getHandle();

        mockTaskProcessor.processMessage(handle);
        controlTaskProcessor.setMatcher(new AbstractMatcher()
        {
            protected boolean argumentMatches(Object exp, Object act)
            {
                Message mesg = (Message) exp;
View Full Code Here


            catch ( final ArchiverException e )
            {
                Assert.fail( "Should never happen." );
            }

            control.setMatcher( new AbstractMatcher()
            {

                @Override
                protected boolean argumentMatches( final Object expected, final Object actual )
                {
View Full Code Here

        verifyAll();
    }

    public void testTryOperationsAreInvoked() throws Exception
    {
        controlPullCoffeeOperations_.setDefaultMatcher(new AbstractMatcher()
        {
            public boolean matches(Object[] arg0, Object[] arg1)
            {
                StringHolder name = (StringHolder) arg0[0];
View Full Code Here

        mockPullCoffee_.try_drinking_coffee(null, null);
        controlPullCoffeeOperations_.setMatcher(MockControl.ALWAYS_MATCHER);
        controlPullCoffeeOperations_.setThrowable(new TRANSIENT());

        mockPullCoffee_.try_cancel_coffee(null);
        controlPullCoffeeOperations_.setMatcher(new AbstractMatcher()
        {
            public boolean matches(Object[] arg0, Object[] arg1)
            {
                StringHolder name = (StringHolder) arg0[0];
View Full Code Here

    public void testFormat() throws Exception
    {
        mockTaskProcessor_.processMessage(null);

        controlTaskProcessor_.setMatcher(new AbstractMatcher()
        {
            public boolean matches(Object[] expected, Object[] actual)
            {
                if (expected[0] != null)
                {
                    try
                    {
                        Property[] _props = ((Message) expected[0]).toTypedEvent();

                        assertEquals(3, _props.length);

                        assertEquals("event_type", _props[0].name);
                        EventType et = EventTypeHelper.extract(_props[0].value);
                        assertEquals(PullCoffeeHelper.id(), et.domain_name);

                        assertEquals(
                                "::org::jacorb::test::notification::typed::PullCoffee::drinking_coffee",
                                et.type_name);

                        assertEquals("jacorb", _props[1].value.extract_string());
                        assertEquals(20, _props[2].value.extract_long());

                        return true;
                    } catch (Exception e)
                    {
                        return false;
                    }
                }
                return true;
            }
        });

        mockPullCoffee_.try_drinking_coffee(null, null);
        controlPullCoffeeOperations_.setMatcher(new AbstractMatcher()
        {
            public boolean matches(Object[] expected, Object[] actual)
            {
                StringHolder name = (StringHolder) expected[0];
                IntHolder minutes = (IntHolder) expected[1];

                // need to set the out params
                if (name != null)
                {
                    name.value = "jacorb";
                }

                if (minutes != null)
                {
                    minutes.value = 20;
                }

                return true;
            }
        });
        controlPullCoffeeOperations_.setReturnValue(true);

        mockPullCoffee_.try_cancel_coffee(null);
        controlPullCoffeeOperations_.setMatcher(new AbstractMatcher()
        {
            public boolean matches(Object[] expected, Object[] actual)
            {
                StringHolder name = (StringHolder) expected[0];
View Full Code Here

        TypedEventMessage message = new TypedEventMessage();
        Message handle = message.getHandle();

        mockTaskProcessor.processMessage(handle);
        controlTaskProcessor.setMatcher(new AbstractMatcher()
        {
            protected boolean argumentMatches(Object exp, Object act)
            {
                Message mesg = (Message) exp;
View Full Code Here

        TypedEventMessage message = new TypedEventMessage();
        Message handle = message.getHandle();

        mockTaskProcessor.processMessage(handle);
        controlTaskProcessor.setMatcher(new AbstractMatcher()
        {
            protected boolean argumentMatches(Object exp, Object act)
            {
                Message mesg = (Message) exp;
View Full Code Here

    @Test
    public void testStartTaskRegistersTask()
    {
        mockTaskProcessor_.executeTaskPeriodically(1000, null, true);
        controlTaskProcessor_.setMatcher(new AbstractMatcher()
        {
            public boolean matches(Object[] expected, Object[] actual)
            {
                return expected[0].equals(actual[0]);
            }
View Full Code Here

    @Test
    public void testRestartStarted()
    {
        mockTaskProcessor_.executeTaskPeriodically(1000, null, true);
        controlTaskProcessor_.setMatcher(new AbstractMatcher()
        {
            public boolean matches(Object[] expected, Object[] actual)
            {
                return expected[0].equals(actual[0]);
            }
View Full Code Here

    }

    @Test
    public void testTryOperationsAreInvoked() throws Exception
    {
        controlPullCoffeeOperations_.setDefaultMatcher(new AbstractMatcher()
        {
            public boolean matches(Object[] arg0, Object[] arg1)
            {
                StringHolder name = (StringHolder) arg0[0];
View Full Code Here

TOP

Related Classes of org.easymock.AbstractMatcher

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.