Details

      Description

      Page objects written in groovy throw a StackOverflowError. There seems to be a recursive issue when proxying groovy's metaclass property.

      GoogleGroovy.groovy
      package test
      
      import org.jboss.arquillian.graphene.page.Location
      import org.openqa.selenium.WebElement
      import org.openqa.selenium.support.FindBy
      
      @Location("https://www.google.com/")
      public class GoogleGroovy {
          @FindBy
          WebElement q
      
          def search(String query){
              q.sendKeys(query)
              sleep(5000)
          }
      }
      
      GoogleJava.java
      package test;
      
      import org.jboss.arquillian.graphene.page.Location;
      import org.openqa.selenium.WebElement;
      import org.openqa.selenium.support.FindBy;
      
      @Location("https://www.google.com/")
      public class GoogleJava {
          @FindBy
          WebElement q;
      
          public void search(String query) throws Exception {
              q.sendKeys(query);
              Thread.sleep(5000);
          }
      }
      
      
      GoogleTestCase.groovy
      package test
      
      import org.jboss.arquillian.drone.api.annotation.Drone
      import org.jboss.arquillian.graphene.Graphene
      import org.jboss.arquillian.junit.Arquillian
      import org.junit.Test
      import org.junit.runner.RunWith
      import org.openqa.selenium.firefox.FirefoxDriver
      
      @RunWith(Arquillian.class)
      class GoogleTestCase {
          @Drone
          FirefoxDriver driver
      
          @Test
          def void testUsingJava(){
              def googleJava = Graphene.goTo(GoogleJava)
              googleJava.search("hello world")
          }
      
          @Test
          def void testUsingGroovy(){
              def googleGroovy = Graphene.goTo(GoogleGroovy)
              googleGroovy.search("jello world")
          }
      }
      
      Stacktrace
      Jun 01, 2014 12:47:08 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__$stMC' found in test.GoogleTestCase. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:08 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__timeStamp' found in test.GoogleTestCase. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:08 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__timeStamp__239_neverHappen1401597979243' found in test.GoogleTestCase. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__$stMC' found in test.GoogleGroovy. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Package-friendly field '__$stMC' found in test.GoogleGroovy. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__timeStamp' found in test.GoogleGroovy. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Package-friendly field '__timeStamp' found in test.GoogleGroovy. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__timeStamp__239_neverHappen1401597978002' found in test.GoogleGroovy. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Package-friendly field '__timeStamp__239_neverHappen1401597978002' found in test.GoogleGroovy. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__$stMC' found in test.GoogleGroovy$$EnhancerByGraphene$$2eb2d5f8. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Package-friendly field '__$stMC' found in test.GoogleGroovy$$EnhancerByGraphene$$2eb2d5f8. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__timeStamp' found in test.GoogleGroovy$$EnhancerByGraphene$$2eb2d5f8. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Package-friendly field '__timeStamp' found in test.GoogleGroovy$$EnhancerByGraphene$$2eb2d5f8. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Public field '__timeStamp__239_neverHappen1401597978002' found in test.GoogleGroovy$$EnhancerByGraphene$$2eb2d5f8. Direct access to fields outside of the declaring class is not allowed.
      Jun 01, 2014 12:47:12 AM org.jboss.arquillian.graphene.enricher.FieldAccessValidatorEnricher checkFieldValidity
      WARNING: Package-friendly field '__timeStamp__239_neverHappen1401597978002' found in test.GoogleGroovy$$EnhancerByGraphene$$2eb2d5f8. Direct access to fields outside of the declaring class is not allowed.
      
      java.lang.StackOverflowError
      	at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.invoke(GrapheneContextualHandler.java:205)
      	at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.intercept(GrapheneContextualHandler.java:229)
      	at test.GoogleGroovy$$EnhancerByGraphene$$2eb2d5f8.getMetaClass(<generated>)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.checkCall(PogoMetaClassSite.java:59)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:36)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      .....
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                groovester3 Chris Jones
                Reporter:
                groovester3 Chris Jones
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: