Package org.switchyard

Examples of org.switchyard.MockContext


public class PolicyUtilTest {

    @Test
    public void testProvidePolicy() {
        Exchange ex = new MockExchange().setContext(new MockContext());
        PolicyUtil.provide(ex, DummyPolicy.A);
        Assert.assertTrue(PolicyUtil.isProvided(ex, DummyPolicy.A));
        Assert.assertFalse(PolicyUtil.isProvided(ex, DummyPolicy.B));
        Assert.assertFalse(PolicyUtil.isRequired(ex, DummyPolicy.B));
        Assert.assertEquals(1, PolicyUtil.getProvided(ex).size());
View Full Code Here


        Assert.assertEquals(1, PolicyUtil.getProvided(ex).size());
    }

    @Test
    public void testRequirePolicy() {
        Exchange ex = new MockExchange().setContext(new MockContext());
        PolicyUtil.require(ex, DummyPolicy.A);
        Assert.assertTrue(PolicyUtil.isRequired(ex, DummyPolicy.A));
        Assert.assertFalse(PolicyUtil.isRequired(ex, DummyPolicy.B));
        Assert.assertFalse(PolicyUtil.isProvided(ex, DummyPolicy.A));
        Assert.assertEquals(1, PolicyUtil.getRequired(ex).size());
View Full Code Here

TOP

Related Classes of org.switchyard.MockContext

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.