Package org.drools.spi

Examples of org.drools.spi.ConflictResolver


    private ConflictResolverFactoryBean factory = new ConflictResolverFactoryBean();

    private MockControl setMockResolverStrategy() throws Exception {
        MockControl resolverControl = mocks.createControl(ConflictResolver.class);
        final ConflictResolver resolverMock = (ConflictResolver) resolverControl.getMock();
        factory.setResolverStrategies(new ArrayList() {{
            add(resolverMock);
        }});
        return resolverControl;
    }
View Full Code Here


        Activation leftActivationMock = (Activation) leftActivationControl.getMock();
        MockControl rightActivationControl = mocks.createControl(Activation.class);
        Activation rightActivationMock = (Activation) rightActivationControl.getMock();

        MockControl resolverControl_1 = mocks.createControl(ConflictResolver.class);
        final ConflictResolver resolverMock_1 = (ConflictResolver) resolverControl_1.getMock();
        MockControl resolverControl_2 = mocks.createControl(ConflictResolver.class);
        final ConflictResolver resolverMock_2 = (ConflictResolver) resolverControl_2.getMock();

        // Return value needs to be zero for the next resolver to be invoked
        resolverControl_1.expectAndReturn(resolverMock_1.compare(leftActivationMock, rightActivationMock), 0);
        resolverControl_2.expectAndReturn(resolverMock_2.compare(leftActivationMock, rightActivationMock), 0);

        factory.setResolverStrategies(new ArrayList() {{
            add(resolverMock_1);
            add(resolverMock_2);
        }});

        mocks.replay();
        factory.afterPropertiesSet();

        ConflictResolver resolver = (ConflictResolver) factory.getObject();
        resolver.compare(leftActivationMock, rightActivationMock);

        mocks.verify();
    }
View Full Code Here

TOP

Related Classes of org.drools.spi.ConflictResolver

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.