Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2361

Revisit 'VisibleForTesting' phrase used to indicate a member or method visible for testing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      ZooKeeper uses // VisibleForTesting comment to indicate a member or method which is visible for unit testing. The idea of this jira is to discuss better ways to convey the message more clear and implement the same. One idea could use annotations, needs to introduce @VisibleForTesting

      For example,
      ContainerManager.java#L134, PurgeTxnLog.java#L78, ZooKeeper.java#L1011 etc.

      ZooKeeper.java
          // VisibleForTesting
          public Testable getTestable() {
              return new ZooKeeperTestable(this, cnxn);
          }
      
      PurgeTxnLog.java
          // VisibleForTesting
          static void retainNRecentSnapshots(FileTxnSnapLog txnLog, List<File> snaps) {
      

      Attachments

        Activity

          People

            rakeshr Rakesh Radhakrishnan
            rakeshr Rakesh Radhakrishnan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: