Hi Jian,

After looking deeper, the problem comes from the fact that both groovy 
UiModule in 1st & 2nd test case extend the same class.

Is this known limitation ?


Regards,

Setya

> Here is a good article on JUnit.
>
> http://www.devx.com/Java/Article/31983/0/page/3
>
> On Sat, Sep 26, 2009 at 9:10 PM, Jian Fang <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Also tried @RunWith and @Suite as follows,
>
>     -------------------------------------------------
>     package example.test.java;
>
>     import org.junit.runner.RunWith;
>     import org.junit.runners.Suite;
>
>     @RunWith(Suite.class)
>     @Suite.SuiteClasses({
>             GoogleSearchTestCase.class,
>             GoogleBooksListJavaTestCase.class
>             })
>     public class TelluriumTestSuite {
>        
>     }
>     ---------------------------------------
>
>     The test suite works fine for me.
>
>     Please check if your error is really related to the test suite itself.
>
>     Thanks,
>
>     Jian
>
>
>
>     On Sat, Sep 26, 2009 at 2:41 PM, Jian Fang
>     <[email protected] <mailto:[email protected]>> wrote:
>
>         The root cause is this line,
>
>
>         org.tellurium.exception.
>         UiObjectNotFoundException: Cannot find UI Object
>         communityPageRoot.return
>
>         Could you put a breakpoint in the following line
>
>
>         
> com.telkom.sdp.module.community.CommunityPage.returnFromCommunityPage(CommunityPage.groovy:59
>
>         and try to debug and see why the parser "ui" cannot find the
>         object "communityPageRoot.return"?
>
>         Thanks,
>
>         Jian
>
>
>         On Sat, Sep 26, 2009 at 5:05 AM, Setya <[email protected]
>         <mailto:[email protected]>> wrote:
>
>
>             Hi,
>
>             We finally find that we can use @RunWith & @SuiteClasses
>             annotations for
>             this purpose. But when we run the tests together, the 2nd
>             test case
>             always throws the following exception:
>
>             java.lang.IllegalArgumentException: object is not an
>             instance of
>             declaring class
>                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>             Method)
>                at
>             
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                at
>             
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                at java.lang.reflect.Method.invoke(Method.java:597)
>                at
>             
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
>                at
>             groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
>                at
>             groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1061)
>                at
>             
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:127)
>                at
>             
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:147)
>                at
>             
> com.telkom.sdp.module.community.RemoveCommunityPage.defineUi(RemoveCommunityPage.groovy:18)
>                at
>             
> com.telkom.sdp.test.community.TestRemoveCommunityPage.displayCommunityPage(TestRemoveCommunityPage.java:29)
>                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>             Method)
>                at
>             
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                at
>             
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                at java.lang.reflect.Method.invoke(Method.java:597)
>                at
>             
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>                at
>             
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>                at
>             
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>                at
>             
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>                at
>             
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>                at
>             org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>                at org.junit.runners.Suite.runChild(Suite.java:115)
>                at org.junit.runners.Suite.runChild(Suite.java:23)
>                at
>             org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
>                at
>             org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
>                at
>             org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
>                at
>             
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>                at
>             
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>                at
>             org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>                at
>             
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>
>             org.tellurium.exception.UiObjectNotFoundException: Cannot
>             find UI Object
>             communityPageRoot.return
>                at
>             sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>             Method)
>                at
>             
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>                at
>             
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>                at
>             java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>                at
>             
> org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:70)
>                at
>             
> org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:64)
>                at
>             
> org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:78)
>                at
>             
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:55)
>                at
>             
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:191)
>                at
>             
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:199)
>                at
>             
> org.tellurium.dsl.BaseDslContext.walkToWithException(BaseDslContext.groovy:214)
>                at
>             
> org.tellurium.dsl.BaseDslContext$walkToWithException.callCurrent(Unknown
>             Source)
>                at
>             org.tellurium.dsl.BaseDslContext.click(BaseDslContext.groovy:219)
>                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>             Method)
>                at
>             
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                at
>             
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                at java.lang.reflect.Method.invoke(Method.java:597)
>                at
>             
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
>                at
>             groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
>                at
>             groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1061)
>                at
>             
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
>                at
>             
> com.telkom.sdp.module.community.CommunityPage.returnFromCommunityPage(CommunityPage.groovy:59)
>                at
>             
> com.telkom.sdp.test.community.TestRemoveCommunityPage.returnFromCommunityPage(TestRemoveCommunityPage.java:172)
>                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>             Method)
>                at
>             
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>                at
>             
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>                at java.lang.reflect.Method.invoke(Method.java:597)
>                at
>             
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>                at
>             
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>                at
>             
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>                at
>             
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
>                at
>             org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>                at org.junit.runners.Suite.runChild(Suite.java:115)
>                at org.junit.runners.Suite.runChild(Suite.java:23)
>                at
>             org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
>                at
>             org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
>                at
>             org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
>                at
>             
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>                at
>             
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>                at
>             org.junit.runners.ParentRunner.run(ParentRunner.java:220)
>                at
>             
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>                at
>             
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>
>             Any idea ?
>
>
>             Regards,
>
>             Setya
>
>             > Setya,
>             >
>             > I use ant junit batchtest for such a job.
>             >
>             > Zsolt
>             >
>             > 2009/9/26 Setya <[email protected]
>             <mailto:[email protected]> <mailto:[email protected]
>             <mailto:[email protected]>>>
>             >
>             >
>             >     Hi all,
>             >
>             >     We have test cases that we want to include in single
>             test suite, since
>             >     we can not use TestSuite class provided by JUnit, is
>             there any
>             >     alternative class provided by Tellurium ?
>             >
>             >     Regards,
>             >
>             >     Setya
>             >
>             >
>             >
>             > >
>
>
>
>
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to