Greendiff91,
You may not have got HIV and you did acquire worry. The only way to get past the worry if you are this worried is to wait three months without engaging in risky behaviour and get a HIV test. Three months seems like a long time to wait and compared to your whole life, that is nothing.
I would tell you not to worry and since you mentioned the small ulcer, that is all the virus needs to get in the body system. With an ulcer, you can get STDs as well. Hopefully the other guy was clean...pre-cum is present in the penis all the time.
Do what you can do to get you through the three months, get tested and know your status. It takes three months of waiting for a blood test. Blood tests are more accurate compared to other tests.
All the best
Minneh Kamau Bushby