As you were correctly advised, you had no risk for HIV, so whatever pain you are having in your penis is NOT related to HIV. There isn't anything more to say about this no-risk event.
********* THREAD CLOSED *********
HIV transmission takes place only as a result of exchange of body fluids INSIDE the body. This means, transmission is not possible without unprotected penile penetration in vagina/anus.
In your case, your risk never existed. To answer your questions,
1. No, you did not get HIV from the exposure you described.
2. No. Since your risk remains non-existent, no test is needed.