Close circuit test of MgB2 coil with superconducting joints and a persistent current switch