Exemplo n.º 1
0
  /**
   * Test method for {@link
   * ch.entwine.weblounge.common.impl.content.page.PageletImpl#getMultiValueContent(java.lang.String)}
   * .
   */
  @Test
  public void testGetMultiValueContentString() {
    assertEquals(2, pagelet.getMultiValueContent(multivalueContentName).length);
    assertEquals(
        multivalueGermanContent[0], pagelet.getMultiValueContent(multivalueContentName)[0]);
    assertEquals(
        multivalueGermanContent[1], pagelet.getMultiValueContent(multivalueContentName)[1]);

    // French
    pagelet.switchTo(french);
    assertEquals(2, pagelet.getMultiValueContent(multivalueContentName).length);
    assertEquals(
        multivalueFrenchContent[0], pagelet.getMultiValueContent(multivalueContentName)[0]);
    assertEquals(
        multivalueFrenchContent[1], pagelet.getMultiValueContent(multivalueContentName)[1]);

    // Test unsupported languages
    // Switching to Italian will actually switch to German (original language)
    pagelet.switchTo(italian);
    assertEquals(2, pagelet.getMultiValueContent(multivalueContentName, italian).length);
    assertEquals(
        multivalueGermanContent[0], pagelet.getMultiValueContent(multivalueContentName)[0]);
    assertEquals(
        multivalueGermanContent[1], pagelet.getMultiValueContent(multivalueContentName)[1]);
  }
Exemplo n.º 2
0
  /**
   * Test method for {@link
   * ch.entwine.weblounge.common.impl.content.page.PageletImpl#getMultiValueContent(java.lang.String,
   * ch.entwine.weblounge.common.language.Language)} .
   */
  @Test
  public void testGetMultiValueContentStringLanguage() {
    assertEquals(2, pagelet.getMultiValueContent(multivalueContentName, german).length);
    assertEquals(
        multivalueGermanContent[0], pagelet.getMultiValueContent(multivalueContentName, german)[0]);
    assertEquals(
        multivalueGermanContent[1], pagelet.getMultiValueContent(multivalueContentName, german)[1]);

    // French
    assertEquals(2, pagelet.getMultiValueContent(multivalueContentName, french).length);
    assertEquals(
        multivalueFrenchContent[0], pagelet.getMultiValueContent(multivalueContentName, french)[0]);
    assertEquals(
        multivalueFrenchContent[1], pagelet.getMultiValueContent(multivalueContentName, french)[1]);

    // Test unsupported languages
    assertEquals(2, pagelet.getMultiValueContent(multivalueContentName, italian).length);
    assertEquals(
        multivalueGermanContent[0],
        pagelet.getMultiValueContent(multivalueContentName, italian)[0]);
    assertEquals(
        multivalueGermanContent[1],
        pagelet.getMultiValueContent(multivalueContentName, italian)[1]);
  }