Uploaded image for project: 'Apache Gora'
  1. Apache Gora
  2. GORA-152

gora-core test incorrectly uses ByteBuffer's array() method to get its byte array

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.2
    • Fix Version/s: 0.2.1
    • Component/s: testing
    • Labels:
      None

      Description

      DataStoreTestUtil.java of gora-core test incorrectly uses ByteBuffer's array() method to get its byte array.

      Assert.assertEquals(content + i, ByteUtils.toString( webPage.getContent().array() ));

      It causes ComparisonFailure.
      https://issues.apache.org/jira/browse/GORA-53?focusedCommentId=13414694#comment-13414694

      testUpdate(org.apache.gora.cassandra.store.TestCassandraStore) Time elapsed: 0.68 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<[content0]> but was:<[?A@B@@@Pget_range_slices@@@5^O^@^@L@@@^A^K^@A@@@Nhttp://a.com/a^O@^B^L^@@@^B^L^@^A^K^@A@@@Cc:u^K@B@@@^Nhttp://a.com/a
      ^@C@D????5?@^@L@^A^K^@A@@@Gp:cnt:c^K@B@@@^Hcontent0
      ^@C@D????+?@@@^@]>
      at junit.framework.Assert.assertEquals(Assert.java:85)
      at junit.framework.Assert.assertEquals(Assert.java:91)
      at org.apache.gora.store.DataStoreTestUtil.testUpdateWebPage(DataStoreTestUtil.java:296)
      at org.apache.gora.store.DataStoreTestBase.testUpdate(DataStoreTestBase.java:267)

        Attachments

        1. GORA-152.patch
          2 kB
          Kazuomi Kashii

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kazk Kazuomi Kashii
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: