Create a file sun-web.xml with the following content
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Servlet 3.0//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd">
<sun-web-app>
<context-root>/</context-root>
</sun-web-app>
and put it into the WEB-INF directory. This will allow you to get rid of 'testapplication' in your URL.
You also have to change port numbers to standard. There are several ways to do it. One of the them is to go to the web console of the application server then
Configuration->Network Config->Network Listeners
You have to provide 80 for Port parameter of the http-listener-1 and 443 for Port parameter of the http-listener-2
This allow you to get rid of the port number '8080' in your URL
(However the faster way is merely to make search in the domain.xml config file for '8080' and change port numbers there)
After these changes your application will respond on http:/ /localhost and https:/ /localhost
The domain name 'www.testapplicaiton.com' has nothing to do with Glassfish. You have to use DNS.