Announcement Announcement Module
Collapse
No announcement yet.
grails functional-test over proxy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • grails functional-test over proxy

    Hey,

    i'm trying to run a grails functional test(http://www.grails.org/plugin/functional-test) over a proxy. So i set up a proxy which is listening on port 80, but for some reason i ve the feeling that grails executes the "get" command over some other port. Because even if the proxy server is not runnig my functional test gets a pass although i m not able to connect to any site using my web browser. I was monitoring the connectons of my computer via tcpview and it seems like grails functional testing using some random ports(like 54560) for executing the get command. I tried to listen at this port, but then grails just took another one
    I was also trying to use this command:
    grails -Dgrails.server.port.http=8080 -Dserver.port=8080 functional-tests and it didnt seem to have any effect.
    At least if i shut down my internet connection i get a fail from the funct-test plugin )

    this is the code of my simple test is somehow like that:

    Code:
    class HelloWorldFunctionalTests extends functionaltestplugin.FunctionalTestCase {
        void testSomeWebsiteFeature() {
            get('http://www.some-adresse.com')
    
    		click "search"
    
    		assertStatus 200 
    		assertContentContains "Search"
    
    		
        }
    }

  • #2
    Are you sure that random port isn't simply the one created to receive the response? Also, you need to specify the address of the proxy in the test otherwise the request will go direct to the website. For example,
    Code:
    get "localhost:80"

    Comment


    • #3
      ok, but how do i specify the adress, where i m going to?
      get('localhost:9090') <-- for proxy
      and then i need somehow to say to my testcase, that it should get the data from google.com for example

      Comment


      • #4
        That depends on your proxy. How does it work? Perhaps it reads an HTTP header? Or perhaps it's hard-coded to forward all requests to another address?

        Comment


        • #5
          well it depends on which possiblities i have. I just turn it on on the 9090 port and then go to internet explorer into tools -> internet options -> connections -> "use a proxy for your lan" and give "localhost:9090" in.
          As described here:
          http://jakarta.apache.org/jmeter/use...ep_by_step.pdf

          Comment


          • #6
            OK. It might work if you set the proxy manually (and revert to using the original URL in the test case):

            grails -Dhttp.proxyHost=locahost -Dhttp.proxyPort=9090 test-app

            Comment


            • #7
              grails seems just to ignore my proxy setting. I tried
              Code:
              grails -Dhttp.proxyHost=locahost -Dhttp.proxyPort=9090 test-app
              and I tried
              Code:
              grails -Dhttp.proxyHost=locahost -Dhttp.proxyPort=9090 functional-tests
              and just nothing happens. Grails seems just to go somehow without using that proxy
              I ve grails 1.2.2 since 1.3.2 has problems with fucntional testing for some reason. Maybe i should use som other version of grails?
              Maybe this is the reason? http://jira.codehaus.org/browse/GRAILS-5874

              But as I said: I use grails 1.2.x cause functional testing plug-in doesnt work properly on 1.3.2.

              Comment


              • #8
                Nobody any ideas, how i could test a remote website using a proxy?

                Comment


                • #9
                  The functional test plugin uses HtmlUnit. It may be worth checking its website to find out whether there is anything special you have to do to enable proxy support.

                  Comment

                  Working...
                  X