Package org.apache.wicket.spring.test

Examples of org.apache.wicket.spring.test.ApplicationContextMock


  {
    // setup dependencies
    setUpDependencies();

    // setup mock injection
    ApplicationContextMock ctx = new ApplicationContextMock();
    addDependenciesToContext(ctx);

    tester = new WicketTester();
    tester.getApplication()
      .getComponentInstantiationListeners()
View Full Code Here


  private ISpringContextLocator ctxLocator;

  protected void setUp() throws Exception
  {
    ctx=new ApplicationContextMock();
    ctxLocator = new SpringContextLocatorMock(ctx);
  }
View Full Code Here

   
    @Test
    public void testMessagePOST() {
        WicketTester tester = new WicketTester();
       
    ApplicationContextMock appctx = new ApplicationContextMock();
        //TODO: eliminate dependency to DOJO configuration!
        appctx.putBean(mock(DOJOConfiguration.class));

    appctx.putBean(mock(SessionDataContainer.class));
    EventsDispatcher eventsDispatcher = mock(EventsDispatcher.class);
        appctx.putBean(eventsDispatcher);
        appctx.putBean(mock(AuthorizedUserService.class));
        appctx.putBean(mock(UserReaderFactory.class));
        appctx.putBean(mock(LocaleService.class));
        appctx.putBean(mock(MenuService.class));
        appctx.putBean(mock(TargetLinkFactory.class));
        appctx.putBean(mock(TargetKeyFactory.class));
        WicketConfiguration wicketConfiguration = mock(WicketConfiguration.class);
        when(wicketConfiguration.getItemsPerPage()).thenReturn(10);
        appctx.putBean(wicketConfiguration);
       
        appctx.putBean(mock(PagePreprocessorsRegistry.class));
        appctx.putBean(mock(BreadcrumbInfoAccessor.class));
        appctx.putBean(mock(BreadcrumbsStore.class));
        MessageReader messageReader = mock(MessageReader.class);
        when(messageReader.getUserMessages(Mockito.<Integer>any(), Mockito.<SortDescriptor>any())).thenReturn(new EmptyDataSet<Message>(Message.class));
        appctx.putBean(messageReader);
        appctx.putBean(mock(MessageWriter.class));
        appctx.putBean(mock(RepresentationFactory.class));
       
       
       
        tester.getApplication().getComponentInstantiationListeners().add(
            new SpringComponentInjector(tester.getApplication(), appctx));
View Full Code Here

            final boolean filterIsEnabled) throws MalformedURLException, ServletException,
            IOException {

        GeoServer mockGeoServer = getMockGeoServer(proxyBaseUrl);

        ApplicationContextMock context = new ApplicationContextMock();
        context.putBean(mockGeoServer);

        GeoServerExtensions ext = new GeoServerExtensions();
        ext.setApplicationContext(context);

        MockFilterConfig config = new MockFilterConfig() {
View Full Code Here

TOP

Related Classes of org.apache.wicket.spring.test.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.