Uploaded image for project: 'Samza'
  1. Samza
  2. SAMZA-387

Unit testing main methods is hard

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.8.0
    • Fix Version/s: None
    • Component/s: container, yarn
    • Labels:

      Description

      Both SamzaAppMaster and SamzaContainer are hard to unit test. I ran into this as part of SAMZA-382, but it's a recurring problem. The issue is that we have a lot of logic in the main() method that's not mockable.

      I think a good solution would be to write a helper class for things like environment variable, JmxServer, etc, and manage them all cleanly in an object that we can test, rather than in the main() method.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              criccomini Chris Riccomini
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: