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

(alt-rt) JCK api/java_util/TreeMap/index.html#PutTests failing

XMLWordPrintable

    • 6
    • generic
    • generic
    • Verified

      JCK api/java_util/TreeMap/index.html#PutTests fails with -XX:+AggressiveOpts options for jdk8.
      This is new jck tests.

      The output is:
      put01: Passed. test cases: 5; all passed
      put02: Passed. OK
      put03: Passed. test cases: 3; all passed
      put04: Passed. OK
      putCompNull_01: Passed. test cases: 2; all passed
      putCompNull_02: Passed. test cases: 2; all passed
      Expected exception java.lang.NullPointerException was not thrown by testcase "putCompNull_NPE01"
      Testcase "putCompNull_NPE01" failed with arguments [null]
      Expected exception java.lang.NullPointerException was not thrown by testcase "putCompNull_NPE01"
      Testcase "putCompNull_NPE01" failed with arguments [java.lang.Object@8bfaf9f]
      putCompNull_NPE01: Failed. test cases: 2; all failed; first test case failure: putCompNull_NPE01
      putCompNull_NPE02: Passed. test cases: 2; all passed
      Expected exception java.lang.NullPointerException was not thrown by testcase "putNull_NPE01"
      Testcase "putNull_NPE01" failed with arguments [null]
      Expected exception java.lang.NullPointerException was not thrown by testcase "putNull_NPE01"
      Testcase "putNull_NPE01" failed with arguments [java.lang.Object@8bfaf9f]
      putNull_NPE01: Failed. test cases: 2; all failed; first test case failure: putNull_NPE01
      putNull_NPE02: Passed. test cases: 2; all passed
      put_CCE01: Passed. test cases: 3; all passed
      Expected exception java.lang.ClassCastException was not thrown by testcase "put_CCE02"
      Testcase "put_CCE02" failed with arguments [java.lang.Object@bb277f0, 1]
      Expected exception java.lang.ClassCastException was not thrown by testcase "put_CCE02"
      Testcase "put_CCE02" failed with arguments [class java.lang.Object, clazz]
      put_CCE02: Failed. test cases: 2; all failed; first test case failure: put_CCE02
      STATUS:Failed.test cases: 12; passed: 9; failed: 3; first test case failure: putCompNull_NPE01

      3 test cases fail:
      ---------------------------------------------------------------------------
          private Object[] values = {null, new Object()};

          private Object[][] pairsInvalidType = {
                  {new Object(), 1},
                  {Object.class, "clazz"},
          };

          /**
           * Tested method: public V put(K key, V value)<br>
           * Assertions: Throws NullPointerException if the specified key is null
           * and this map uses natural ordering
           */
          @TestCase
          @ExpectedExceptions(NullPointerException.class)
          public void putNull_NPE01(@TestData("values") Object value) {
              TreeMap map = new TreeMap();
              map.put(null, value);
          }

          /**
           * Tested method: public V put(K key, V value)<br>
           * Assertions: Comparator does not permit null keys
           */
          @TestCase
          @ExpectedExceptions(NullPointerException.class)
          public void putCompNull_NPE01(@TestData("values") Object value) {
              TreeMap map = new TreeMap(new ComparatorProhibitsNull());
              map.put(null, value);
          }

          /**
           * Tested method: public V put(K key, V value)<br>
           * Assertions: ClassCastException - if the specified key
           * cannot be compared with the keys currently in the map.
           */
          @TestCase
          @TestData("pairsInvalidType")
          @ExpectedExceptions(ClassCastException.class)
          public void put_CCE02(Object key, Object value) {
              TreeMap map = new TreeMap();
              map.put(key, value);
          }
      ---------------------------------------------------------------------------

            mduigou Mike Duigou
            ephilipp Evgeny Philippov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: