A large military exercise involving high-speed boats and Royal Marines scaling walls has helped mark an upcoming celebration.