China has appealed for calm following North Korea's announcement that it planned to test a nuclear bomb.