renatoathaydes / Automaton

Simple framework which allows the testing of Swing and JavaFX2 applications.
Apache License 2.0
99 stars 20 forks source link

A poor attempt at recovering from Java::GroovyLang::MissingMethodException #35

Closed oreoshake closed 8 years ago

oreoshake commented 8 years ago

Hey there, first time groovy contributor. I'm not positive this is the best place to catch the exception but It Works On My Machine :tm:

This happens when running Automaton tests within my JRubyFX application, I have no idea if this error happens outside of JRuby.

I run into this exception a lot:

Java::GroovyLang::MissingMethodException:         Java::GroovyLang::MissingMethodException: No signature of method: com.sun.javafx.scene.control.skin.TableHeaderRow.getText() is applicable for argument types: () values: []
        Possible solutions: getAt(java.lang.String), getClip(), getEffect(), getId(), getParent(), getScene()
            org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(org/codehaus/groovy/runtime/ScriptBytecodeAdapter.java:55)
            org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(org/codehaus/groovy/runtime/ScriptBytecodeAdapter.java:166)
            com.athaydes.automaton.SwingUtil.callMethodIfExists(SwingUtil.groovy:206)
            com.athaydes.automaton.SwingUtil.callMethodIfExists(com/athaydes/automaton/SwingUtil.groovy:206)
            java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:497)
            org.codehaus.groovy.reflection.CachedMethod.invoke(org/codehaus/groovy/reflection/CachedMethod.java:90)
            groovy.lang.MetaMethod.doMethodInvoke(groovy/lang/MetaMethod.java:233)
            org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(org/codehaus/groovy/runtime/callsite/StaticMetaMethodSite.java:43)
            org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(org/codehaus/groovy/runtime/callsite/StaticMetaMethodSite.java:88)
            org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(org/codehaus/groovy/runtime/callsite/CallSiteArray.java:45)
            org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(org/codehaus/groovy/runtime/callsite/StaticMetaMethodSite.java:93)
            org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(org/codehaus/groovy/runtime/callsite/AbstractCallSite.java:120)
            com.athaydes.automaton.selector.TextFxSelector.matches(FxSelectors.groovy:26)
            com.athaydes.automaton.selector.TextFxSelector.matches(com/athaydes/automaton/selector/FxSelectors.groovy:26)
            java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:497)
            org.codehaus.groovy.reflection.CachedMethod.invoke(org/codehaus/groovy/reflection/CachedMethod.java:90)

This happens for TableHeaderRows, StyledTextAreas, and more.

oreoshake commented 8 years ago

Hmm actually I don't get this if I build from master, but only if I reference the 1.2.3 jar from maven. Will investigate and reopen if necessary.

renatoathaydes commented 8 years ago

Hi @oreoshake this problem was fixed in master and so the fixed code is already going to be in the next release!

Thanks for attempting to get a PR in, but this one came too late!

Best regards.

oreoshake commented 8 years ago

:metal: @renatoathaydes

:heart: automaton