Uploaded image for project: 'PhotArk'
  1. PhotArk
  2. PHOTARK-35

Fix photark-ui-test compiled in Java SDK 1.5

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • PhotArk M2
    • PhotArk M2
    • PhotArk UI
    • None

    Description

      Compiling the PhotArk with Java 5 will cause error in the unit test photark-ui-test:

      photark-ui-test/src/test/java/org/apache/photark/ui/IE7TestBrowser.java:[101,50] com.gargoylesoftware.htmlunit.html.HtmlElement cannot be dereferenced

      The reason is because these kind of lines:
      final HtmlPage page = webClient.getPage("http://localhost:8080/photark/admin/upload.html");
      ...

      assertTrue(page.getHtmlElementById("cancelBtnAlbumDesc").getAttribute("style").contains("display: none;"));

      The HtmlPage.getHtmlElementById returns <E extends HtmlElement> E getHtmlElementById and since HtmlElement is abstract class in Java 1.5 it cant find reference to implementation of the class.

      Need to add parameterized like:

      assertTrue(page.<HtmlElement>getHtmlElementById("cancelBtnAlbumDesc").getAttribute("style").contains("display: none;"));

      (This works fine with Java 1.6)

      Attachments

        1. htmlUnitTestFix.patch
          18 kB
          Henry Saputra

        Activity

          People

            lresende Luciano Resende
            hsaputra Henry Saputra
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: