Package org.apache.wicket.mock

Examples of org.apache.wicket.mock.MockApplication


   *
   */
  @Test
  public void testDefaultStringResourceLoaderSetup()
  {
    IResourceSettings settings = new ResourceSettings(new MockApplication());
    List<IStringResourceLoader> loaders = settings.getStringResourceLoaders();
    Assert.assertEquals("There should be 4 default loaders", 4, loaders.size());
    Assert.assertTrue("First loader one should be the component one",
      loaders.get(0) instanceof ComponentStringResourceLoader);
    Assert.assertTrue("Second loader should be the application one",
View Full Code Here


   *
   */
  @Test
  public void testOverrideStringResourceLoaderSetup()
  {
    IResourceSettings settings = new ResourceSettings(new MockApplication());
    settings.getStringResourceLoaders().clear();
    settings.getStringResourceLoaders().add(
      new BundleStringResourceLoader("org.apache.wicket.resource.DummyResources"));
    settings.getStringResourceLoaders().add(new ComponentStringResourceLoader());
    List<IStringResourceLoader> loaders = settings.getStringResourceLoaders();
View Full Code Here

   *
   */
  @Test
  public void testLocalizer()
  {
    MockApplication dummy = new MockApplication();
    dummy.setName("test-app");
    dummy.setServletContext(new MockServletContext(dummy, ""));
    ThreadContext.setApplication(dummy);
    dummy.initApplication();
    Localizer localizer = dummy.getResourceSettings().getLocalizer();
    Assert.assertNotNull("Localizer should be available", localizer);
  }
View Full Code Here

  /**
   * @throws Exception
   */
  public void testRenderPage13() throws Exception
  {
    tester = new WicketTester(new MockApplication()
    {
      @Override
      protected void init()
      {
        super.init();
View Full Code Here

  /**
   * @return the application that should be used for the test
   */
  protected WebApplication newApplication()
  {
    return new MockApplication();
  }
View Full Code Here

  public void testNotModifiedResponseIncludesExpiresHeader() throws IOException,
    ServletException, ParseException
  {
    try
    {
      application = new MockApplication();
      WicketFilter filter = new WicketFilter();
      filter.init(new FilterTestingConfig());
      ThreadContext.setApplication(application);
      DynamicImageResource resource = new DynamicImageResource()
      {
View Full Code Here

   *
   * @throws Exception
   */
  public void testIgnorePaths() throws Exception
  {
    application = spy(new MockApplication());
    WicketFilter filter = new WicketFilter();
    filter.init(new FilterTestingConfig());

    HttpServletRequest request = mock(HttpServletRequest.class);
    when(request.getLocale()).thenReturn(new Locale("bg", "BG"));
View Full Code Here

public class StatelessFormTest extends WicketTestCase
{
  @Override
  protected WebApplication newApplication()
  {
    return new MockApplication()
    {
      @Override
      protected void init()
      {
        super.init();
View Full Code Here


  @Override
  protected WebApplication newApplication()
  {
    return new MockApplication()
    {
      @Override
      protected void init()
      {
        super.init();
View Full Code Here


  @Override
  protected WebApplication newApplication()
  {
    return new MockApplication()
    {
      @Override
      protected void init()
      {
        super.init();
View Full Code Here

TOP

Related Classes of org.apache.wicket.mock.MockApplication

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.