  The main goal of the JUNO experiment is the determination of the neutrino
mass ordering. To achieve this, an extraordinary energy resolution of at least
$3\,\%$ at $1\,$MeV is required for which all parts of the JUNO detector need
to meet certain quality criteria. This is relevant in particular for those
which are related to the energy resolution of the detector, such as the
photomultiplier tubes (PMTs) to be deployed in JUNO. This paper presents the
setup and performance of a dedicated PMT mass testing facility to examine and
characterize the performance of the 20-inch JUNO PMTs. Its quasi-industrial
size and operation level allows to test all 20000 PMTs intended to be used in
the JUNO experiment. With this PMT mass testing system, several key
characteristics like dark count rate, peak-to-valley ratio, photon detection
efficiency, and timing resolution have been determined at an operating gain of
$1\times10^7$ and assessed with respect to the requirements of JUNO.
Measurement conditions and modes for the PMTs as well as estimated accuracies
for the determination of the individual PMT parameters with the system are
presented as well.
