Hello,
Thank you for your query at DoctorSpring.com
I need to know a few more details before i can help you.
What's your age? Did the pain start while you were having sex, or it got aggravated during sex? When was the last time you had sex/masturbated? Was it normal? Do you have any burning sensation while passing urine?
Pain in the pelvis area and testes can indicate acute orchitis ( viral infections ) or UTIs or even prostatitis.
Once you provide more information, i can guide you further.
Regards.