Chesterton wrote The Man who was Thursday (1908) spoofing the policial mindset about anarchist plots that was pervasive at the turn of the century. If you search for "XIX century novels about terrorism" you'll find more material.