Package de.odysseus.calyxo.base.test

Examples of de.odysseus.calyxo.base.test.TestI18nSupport


   */
  protected void setUp() throws Exception {
    super.setUp();

    ModuleContext context = new TestModuleContext("test");
    I18nSupport support = new TestI18nSupport();
    context.setAttribute(I18nSupport.I18N_SUPPORT_KEY, support);
    parser = new FormsRootConfigParser(context);
  }
View Full Code Here


    super(arg0);
  }

  public void testNoArgs() {
    Message message = new Message("bundle", "msg0");
    String string = message.format(Locale.ENGLISH, new TestI18nSupport());
    assertEquals("en.bundle.msg0()", string);
  }
View Full Code Here

  public void testValueArg() {
    Message message = new Message("bundle", "msg1");
    Message.Arg arg = new Message.ValueArg("arg");
    message.add(arg);
    String string = message.format(Locale.ENGLISH, new TestI18nSupport());
    assertEquals("en.bundle.msg1(arg)", string);
  }
View Full Code Here

  public void testResourceArg() {
    Message message = new Message("bundle", "msg1");
    Message.Arg arg = new Message.ResourceArg("bundle", "arg");
    message.add(arg);
    String string = message.format(Locale.ENGLISH, new TestI18nSupport());
    assertEquals("en.bundle.msg1(en.bundle.arg)", string);
  }
View Full Code Here

    Message message = new Message("bundle", "msg2");
    Message.Arg arg1 = new Message.ResourceArg("bundle", "arg1");
    message.add(arg1);
    Message.Arg arg2 = new Message.ValueArg("arg2");
    message.add(arg2);
    String string = message.format(Locale.ENGLISH, new TestI18nSupport());
    assertEquals("en.bundle.msg2(en.bundle.arg1,arg2)", string);
  }
View Full Code Here

    // configure module container
    ServletContext context = request.getSession().getServletContext();
    TestModuleGroup group = TestModuleGroup.getInstance(context);
    group.add(module);
    // install i18n support
    I18nSupport support = new TestI18nSupport();
    module.setAttribute(I18nSupport.I18N_SUPPORT_KEY, support);
  }
View Full Code Here

    // select module
    group.setTestModuleContext(request, module);
  }

  public void testGetInstance() {
    I18nSupport support = new TestI18nSupport();
    module.setAttribute(I18nSupport.I18N_SUPPORT_KEY, support);
   
    assertSame(support, I18nSupport.getInstance(module));
    assertSame(support, I18nSupport.getInstance(request));
    assertSame(support, I18nSupport.getInstance(new TestPageContext(request)));
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.base.test.TestI18nSupport

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.