This is difficult, but what you essentially need is for a separate process to consume all of the available RAM, locking its own data into physical RAM, but leaving all of the swap available (you should be able to see the effect using the 'free' command)
I think there are already tools out there to do this (I don't recall any specific examples, but there are tools to fill up memory or test memory for bit errors while the system is running... that type of thing) or something close to it.
My question is ... why? Why intentionally cripple the test machine only to get number that is highly specific to your swap configuration (disk type, size, rotation rate, etc)? Also, how resource intensive is your application in the first place? If it isn't very (say a meg or two of RAM), then swapping won't hurt very badly.