Hardware-in-the-Loop Testing for Distribution Automation