Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7031987

Add unit test for JNLP2Manager.getDecoratedPreference()

    Details

      Description

      Assertion:
      method to be tested: public void testGetDecoratedPreference() throws
      Exception in sun.plugin2.applet.JNLP2ManagerTest

      1. Feed a JNLP xml file as below with decorated value "true"
      private static final String SIMPLE_EMBEDDED_JNLP =
      "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + EOL +
      "<jnlp codebase='' href='launch.jnlp' spec='1.0+'>" + EOL +
      " <information>" + EOL +
      " <vendor>Sun</vendor>" + EOL +
      " <title>GUIFormExamples</title>" + EOL +
      " <shortcut online='true'>" + EOL +
      " <desktop/>" + EOL +
      " </shortcut>" + EOL +
      " </information>" + EOL +
      " <update check='always'/>" + EOL +
      " <resources>" + EOL +
      " <j2se href='http://java.sun.com/products/autodl/j2se&#39;
      version='1.5+'/>" + EOL +
      " <jar href='GUIFormExamples.jar' main='true'/>" + EOL +
      " <jar href='lib/swing-layout-1.0.4.jar'/>" + EOL +
      " </resources>" + EOL +
      " <applet-desc name='AntennaApplet'" + EOL +
      " main-class='examples.AntennaApplet'" + EOL +
      " width='800' height='50'" + EOL +
      " >" + EOL +
      " <param name='decorated' value='true'/>" + EOL +
      " </applet-desc>" + EOL +
      "</jnlp>";

      Should return true

      2. Feed a JNLP xml file as below with decorated value "false"
      private static final String SIMPLE_EMBEDDED_JNLP =
      "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + EOL +
      "<jnlp codebase='' href='launch.jnlp' spec='1.0+'>" + EOL +
      " <information>" + EOL +
      " <vendor>Sun</vendor>" + EOL +
      " <title>GUIFormExamples</title>" + EOL +
      " <shortcut online='true'>" + EOL +
      " <desktop/>" + EOL +
      " </shortcut>" + EOL +
      " </information>" + EOL +
      " <update check='always'/>" + EOL +
      " <resources>" + EOL +
      " <j2se href='http://java.sun.com/products/autodl/j2se&#39;
      version='1.5+'/>" + EOL +
      " <jar href='GUIFormExamples.jar' main='true'/>" + EOL +
      " <jar href='lib/swing-layout-1.0.4.jar'/>" + EOL +
      " </resources>" + EOL +
      " <applet-desc name='AntennaApplet'" + EOL +
      " main-class='examples.AntennaApplet'" + EOL +
      " width='800' height='50'" + EOL +
      " >" + EOL +
      " <param name='decorated' value='false'/>" + EOL +
      " </applet-desc>" + EOL +
      "</jnlp>";

      Should return false


      3. Feed a JNLP xml file as below without decorated value
      private static final String SIMPLE_EMBEDDED_JNLP =
      "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + EOL +
      "<jnlp codebase='' href='launch.jnlp' spec='1.0+'>" + EOL +
      " <information>" + EOL +
      " <vendor>Sun</vendor>" + EOL +
      " <title>GUIFormExamples</title>" + EOL +
      " <shortcut online='true'>" + EOL +
      " <desktop/>" + EOL +
      " </shortcut>" + EOL +
      " </information>" + EOL +
      " <update check='always'/>" + EOL +
      " <resources>" + EOL +
      " <j2se href='http://java.sun.com/products/autodl/j2se&#39;
      version='1.5+'/>" + EOL +
      " <jar href='GUIFormExamples.jar' main='true'/>" + EOL +
      " <jar href='lib/swing-layout-1.0.4.jar'/>" + EOL +
      " </resources>" + EOL +
      " <applet-desc name='AntennaApplet'" + EOL +
      " main-class='examples.AntennaApplet'" + EOL +
      " width='800' height='50'" + EOL +
      " >" + EOL +
      " </applet-desc>" + EOL +
      "</jnlp>";

      Should return true.


      4. Feed a JNLP xml file as below without decorated value
      private static final String SIMPLE_EMBEDDED_JNLP =
      "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + EOL +
      "<jnlp codebase='' href='launch.jnlp' spec='1.0+'>" + EOL +
      " <information>" + EOL +
      " <vendor>Sun</vendor>" + EOL +
      " <title>GUIFormExamples</title>" + EOL +
      " <shortcut online='true'>" + EOL +
      " <desktop/>" + EOL +
      " </shortcut>" + EOL +
      " </information>" + EOL +
      " <update check='always'/>" + EOL +
      " <resources>" + EOL +
      " <j2se href='http://java.sun.com/products/autodl/j2se&#39;
      version='1.5+'/>" + EOL +
      " <jar href='GUIFormExamples.jar' main='true'/>" + EOL +
      " <jar href='lib/swing-layout-1.0.4.jar'/>" + EOL +
      " </resources>" + EOL +
      " <applet-desc name='AntennaApplet'" + EOL +
      " main-class='examples.AntennaApplet'" + EOL +
      " width='800' height='50'" + EOL +
      " >" + EOL +
      " <param name='decorated' value='randomstr'/>" + EOL +
      " </applet-desc>" + EOL +
      "</jnlp>";

      Should return false.

        Attachments

          Activity

            People

            • Assignee:
              albertz Albert Zhang (Inactive)
              Reporter:
              albertz Albert Zhang (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: