Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-19147 All branch-2 unit tests pass
  3. HBASE-19862

Fix TestTokenAuthentication - fake RegionCoprocessorEnvironment is not of type HasRegionServerServices

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-beta-2, 2.0.0
    • None
    • None

    Description

      We have temporary HasRegionServerServices (added in HBASE-19007) and concept of CoreCoprocessors which require that whichever *CoprocessorEnvironment they get, it should also implement HasRegionServerServices.
      This test builds mock RegionCpEnv for TokenProvider (RegionCoprocessor), but it falls short of what's expected and results in following exceptions in test logs

      2018-01-25 14:38:54,855 ERROR [TokenServer:d9a9782cd075,39492,1516891133911] helpers.MarkerIgnoringBase(159): Aborting on: org.apache.hadoop.hbase.security.token.TestTokenAuthentication$TokenServer$2 cannot be cast to org.apache.hadoop.hbase.coprocessor.HasRegionServerServices
      java.lang.ClassCastException: org.apache.hadoop.hbase.security.token.TestTokenAuthentication$TokenServer$2 cannot be cast to org.apache.hadoop.hbase.coprocessor.HasRegionServerServices
      	at org.apache.hadoop.hbase.security.token.TokenProvider.start(TokenProvider.java:70)
      	at org.apache.hadoop.hbase.security.token.TestTokenAuthentication$TokenServer.initialize(TestTokenAuthentication.java:275)
      	at org.apache.hadoop.hbase.security.token.TestTokenAuthentication$TokenServer.run(TestTokenAuthentication.java:347)
      

      Patch adds the missing interface to the mock. Also, uses Mockito to mock the interfaces rather the crude way.

      Attachments

        1. HBASE-19862.branch-2.001.patch
          8 kB
          Apekshit Sharma

        Issue Links

          Activity

            People

              appy Apekshit Sharma
              appy Apekshit Sharma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: