Dozens of public agencies and private companies have joined forces to hold a communications exercise that prepares for the threat of a cyber-attack.