Esempio 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]);
  }
Esempio n. 2
0
  /**
   * Test method for {@link
   * ch.entwine.weblounge.common.impl.content.page.PageletImpl#getContent(java.lang.String)} .
   */
  @Test
  public void testGetContentString() {
    assertEquals(germanContent, pagelet.getContent(contentName));
    assertEquals(lonelyContent, pagelet.getContent(lonelyContentName));

    pagelet.switchTo(french);
    assertEquals(frenchContent, pagelet.getContent(contentName));
    assertTrue(pagelet.getContent(lonelyContentName) == null);

    // Test unsupported languages.
    // Switching to Italian will actually switch to German (original language)
    pagelet.switchTo(italian);
    assertEquals(germanContent, pagelet.getContent(contentName));
    assertEquals(lonelyContent, pagelet.getContent(lonelyContentName));
  }