Java 类org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:FilterOrderingIntegrationTests.java   
@Test
public void testFilterOrdering() {
    load();
    List<RegisteredFilter> registeredFilters = this.context
            .getBean(MockEmbeddedServletContainerFactory.class).getContainer()
            .getRegisteredFilters();
    List<Filter> filters = new ArrayList<Filter>(registeredFilters.size());
    for (RegisteredFilter registeredFilter : registeredFilters) {
        filters.add(registeredFilter.getFilter());
    }
    Iterator<Filter> iterator = filters.iterator();
    assertThat(iterator.next()).isInstanceOf(OrderedCharacterEncodingFilter.class);
    assertThat(iterator.next()).isInstanceOf(SessionRepositoryFilter.class);
    assertThat(iterator.next()).isInstanceOf(Filter.class);
    assertThat(iterator.next()).isInstanceOf(Filter.class);
    assertThat(iterator.next()).isInstanceOf(OrderedRequestContextFilter.class);
    assertThat(iterator.next()).isInstanceOf(FilterChainProxy.class);
}
项目:spring-boot-concourse    文件:FilterOrderingIntegrationTests.java   
@Test
public void testFilterOrdering() {
    load();
    List<RegisteredFilter> registeredFilters = this.context
            .getBean(MockEmbeddedServletContainerFactory.class).getContainer()
            .getRegisteredFilters();
    List<Filter> filters = new ArrayList<Filter>(registeredFilters.size());
    for (RegisteredFilter registeredFilter : registeredFilters) {
        filters.add(registeredFilter.getFilter());
    }
    Iterator<Filter> iterator = filters.iterator();
    assertThat(iterator.next()).isInstanceOf(OrderedCharacterEncodingFilter.class);
    assertThat(iterator.next()).isInstanceOf(SessionRepositoryFilter.class);
    assertThat(iterator.next()).isInstanceOf(Filter.class);
    assertThat(iterator.next()).isInstanceOf(Filter.class);
    assertThat(iterator.next()).isInstanceOf(OrderedRequestContextFilter.class);
    assertThat(iterator.next()).isInstanceOf(FilterChainProxy.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:PublicMetricsAutoConfigurationTests.java   
private void loadWeb(Class<?>... config) {
    AnnotationConfigEmbeddedWebApplicationContext context = new AnnotationConfigEmbeddedWebApplicationContext();
    if (config.length > 0) {
        context.register(config);
    }
    context.register(DataSourcePoolMetadataProvidersConfiguration.class,
            CacheStatisticsAutoConfiguration.class,
            PublicMetricsAutoConfiguration.class,
            MockEmbeddedServletContainerFactory.class);
    context.refresh();
    this.context = context;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EmbeddedServletContainerAutoConfigurationTests.java   
private void verifyContext() {
    MockEmbeddedServletContainerFactory containerFactory = getContainerFactory();
    Servlet servlet = this.context.getBean(
            DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME,
            Servlet.class);
    verify(containerFactory.getServletContext()).addServlet("dispatcherServlet",
            servlet);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EmbeddedServletContainerAutoConfigurationTests.java   
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName)
        throws BeansException {
    if (bean instanceof ConfigurableEmbeddedServletContainer) {
        MockEmbeddedServletContainerFactory containerFactory = (MockEmbeddedServletContainerFactory) bean;
        assertThat(containerFactory.getServletContext()).isNull();
    }
    return bean;
}
项目:spring-boot-concourse    文件:PublicMetricsAutoConfigurationTests.java   
private void loadWeb(Class<?>... config) {
    AnnotationConfigEmbeddedWebApplicationContext context = new AnnotationConfigEmbeddedWebApplicationContext();
    if (config.length > 0) {
        context.register(config);
    }
    context.register(DataSourcePoolMetadataProvidersConfiguration.class,
            CacheStatisticsAutoConfiguration.class,
            PublicMetricsAutoConfiguration.class,
            MockEmbeddedServletContainerFactory.class);
    context.refresh();
    this.context = context;
}
项目:spring-boot-concourse    文件:EmbeddedServletContainerAutoConfigurationTests.java   
private void verifyContext() {
    MockEmbeddedServletContainerFactory containerFactory = getContainerFactory();
    Servlet servlet = this.context.getBean(
            DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME,
            Servlet.class);
    verify(containerFactory.getServletContext()).addServlet("dispatcherServlet",
            servlet);
}
项目:spring-boot-concourse    文件:EmbeddedServletContainerAutoConfigurationTests.java   
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName)
        throws BeansException {
    if (bean instanceof ConfigurableEmbeddedServletContainer) {
        MockEmbeddedServletContainerFactory containerFactory = (MockEmbeddedServletContainerFactory) bean;
        assertThat(containerFactory.getServletContext()).isNull();
    }
    return bean;
}
项目:contestparser    文件:PublicMetricsAutoConfigurationTests.java   
private void loadWeb(Class<?>... config) {
    AnnotationConfigEmbeddedWebApplicationContext context = new AnnotationConfigEmbeddedWebApplicationContext();
    if (config.length > 0) {
        context.register(config);
    }
    context.register(DataSourcePoolMetadataProvidersConfiguration.class,
            CacheStatisticsAutoConfiguration.class,
            PublicMetricsAutoConfiguration.class,
            MockEmbeddedServletContainerFactory.class);
    context.refresh();
    this.context = context;
}
项目:contestparser    文件:EmbeddedServletContainerAutoConfigurationTests.java   
private void verifyContext() {
    MockEmbeddedServletContainerFactory containerFactory = getContainerFactory();
    Servlet servlet = this.context.getBean(
            DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME,
            Servlet.class);
    verify(containerFactory.getServletContext()).addServlet("dispatcherServlet",
            servlet);
}
项目:contestparser    文件:EmbeddedServletContainerAutoConfigurationTests.java   
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName)
        throws BeansException {
    if (bean instanceof ConfigurableEmbeddedServletContainer) {
        MockEmbeddedServletContainerFactory containerFactory = (MockEmbeddedServletContainerFactory) bean;
        assertNull(containerFactory.getServletContext());
    }
    return bean;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ExampleEmbeddedWebApplicationConfiguration.java   
@Bean
public EmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:FilterOrderingIntegrationTests.java   
@Bean
public MockEmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WelcomePageMockMvcTests.java   
@Bean
public MockEmbeddedServletContainerFactory embeddedServletContainerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EmbeddedServletContainerAutoConfigurationTests.java   
private MockEmbeddedServletContainerFactory getContainerFactory() {
    return this.context.getBean(MockEmbeddedServletContainerFactory.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EmbeddedServletContainerAutoConfigurationTests.java   
@Bean
public EmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ResourceServerTokenServicesConfigurationTests.java   
@Bean
public MockEmbeddedServletContainerFactory embeddedServletContainerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:spring-boot-concourse    文件:ExampleEmbeddedWebApplicationConfiguration.java   
@Bean
public EmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:spring-boot-concourse    文件:FilterOrderingIntegrationTests.java   
@Bean
public MockEmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:spring-boot-concourse    文件:WelcomePageMockMvcTests.java   
@Bean
public MockEmbeddedServletContainerFactory embeddedServletContainerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:spring-boot-concourse    文件:EmbeddedServletContainerAutoConfigurationTests.java   
private MockEmbeddedServletContainerFactory getContainerFactory() {
    return this.context.getBean(MockEmbeddedServletContainerFactory.class);
}
项目:spring-boot-concourse    文件:EmbeddedServletContainerAutoConfigurationTests.java   
@Bean
public EmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:spring-boot-concourse    文件:ResourceServerTokenServicesConfigurationTests.java   
@Bean
public MockEmbeddedServletContainerFactory embeddedServletContainerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:contestparser    文件:ExampleEmbeddedWebApplicationConfiguration.java   
@Bean
public EmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:contestparser    文件:WelcomePageMockMvcTests.java   
@Bean
public MockEmbeddedServletContainerFactory embeddedServletContainerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:contestparser    文件:EmbeddedServletContainerAutoConfigurationTests.java   
private MockEmbeddedServletContainerFactory getContainerFactory() {
    return this.context.getBean(MockEmbeddedServletContainerFactory.class);
}
项目:contestparser    文件:EmbeddedServletContainerAutoConfigurationTests.java   
@Bean
public EmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:contestparser    文件:ResourceServerTokenServicesConfigurationTests.java   
@Bean
public MockEmbeddedServletContainerFactory embeddedServletContainerFactory() {
    return new MockEmbeddedServletContainerFactory();
}
项目:contestparser    文件:SessionAutoConfigurationTests.java   
@Bean
public EmbeddedServletContainerFactory containerFactory() {
    return new MockEmbeddedServletContainerFactory();
}