Package org.ops4j.pax.wicket.test.spring

Examples of org.ops4j.pax.wicket.test.spring.ApplicationContextMock


    protected RuleManager ruleManager;

    @Before
    public void makeContextMock() throws Exception {
        tester = new WicketTester();
        context = new ApplicationContextMock();
        defaultPaxWicketInjector = new PaxWicketSpringBeanComponentInjector(tester.getApplication(), context);
        tester.getApplication().getComponentInstantiationListeners().add(defaultPaxWicketInjector);

        context.putBean("blueprintBundleContext", bundleContext);
        context.putBean("blueprintBundle", bundle);
View Full Code Here


    private long id;

    @Before
    public void setup() throws Exception {
        tester = new WicketTester();
        ApplicationContextMock context = new ApplicationContextMock();
        PaxWicketSpringBeanComponentInjector defaultPaxWicketInjector =
            new PaxWicketSpringBeanComponentInjector(tester.getApplication(), context);
        tester.getApplication().getComponentInstantiationListeners().add(defaultPaxWicketInjector);

        ruleManager = mock(RuleManager.class);
        Collection<RuleBaseElementId> value = new ArrayList<RuleBaseElementId>();
        value.add(new RuleBaseElementId(RuleBaseElementType.Process, "foo"));
        when(ruleManager.listAll(RuleBaseElementType.Process)).thenReturn(value);
        context.putBean("ruleManager", ruleManager);

        id = 0;
        workflowService = mock(WorkflowService.class);
        when(workflowService.startFlow(anyString())).thenAnswer(new Answer<Long>() {
            @Override
            public Long answer(InvocationOnMock invocation) throws Throwable {
                return id++;
            }
        });
        context.putBean("workflowService", workflowService);
    }
View Full Code Here

TOP

Related Classes of org.ops4j.pax.wicket.test.spring.ApplicationContextMock

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.