The Peoples’ Republic of China, with troops massed on the border with Vietnam, tested its first atomic bomb.