Hi Jian,
After doing R&D i found that stub files generated are not having all
the built in methods of interface GroovyObject:
eg my LoginModule class:
import org.tellurium.dsl.*;
import groovy.util.*;
import java.lang.*;
import groovy.lang.*;
import java.util.*;
import java.io.*;
import java.net.*;
public class LoginModule
extends org.tellurium.dsl.DslContext {
public LoginModule
() {}
public void defineUi() { }
public void loginAdmin() { }
public void loginTemp() { }
public java.lang.String logOut() { return (java.lang.String)null;}
public java.lang.String getText() { return (java.lang.String)null;}
public void login(java.lang.String userName, java.lang.String
password) { }
protected groovy.lang.MetaClass $getStaticMetaClass() { return
(groovy.lang.MetaClass)null;}
}
Is this problem is related to tellurium or groovy?
I tried the following script on my system it worked very well :
<?xml version="1.0" ?>
<project name="test" default="jointcompile">
<property environment="env"/>
<path id="groovy.cp">
<fileset dir="${env.GROOVY_HOME}" includes="embeddable/groovy-
all-*.jar"/>
<pathelement location="junk"/>
</path>
<taskdef name="groovyc"
classname="org.codehaus.groovy.ant.Groovyc" classpathref="groovy.cp"/>
<target name="jointcompile">
<mkdir dir="junk"/>
<echo file="junk/Interface4198.java">
interface Interface4198 {
void method();
}
</echo>
<echo file="junk/Test4198.groovy">
import Interface4198
class Test4198 implements Interface4198 {
void method() { println 'Inside method' }
}
</echo>
<groovyc classpathref="groovy.cp" srcdir="junk" destdir="junk"
fork="true" failonerror="true">
<javac />
</groovyc>
</target>
</project>
.
Can you help me in this?
Thanks,
Khush.
On May 13, 6:50 pm, Jian Fang <[email protected]> wrote:
> I can see your problem there. You compile Groovy files first and then
> compile Java files.
> In the first step, the Groovy file cannot find the interface file since it
> is not compiled yet.
>
> One way is to use Groovy joint compilation. For example, in Tellurium core,
> we used the following script.
>
> <groovyc srcdir="${dir.source.tellurium}"
> destdir="${dir.build.tellurium}">
> <classpath refid="tellurium.classpath" />
> <javac source="1.5" target="1.5" debug="on" />
> </groovyc>
>
> Otherwise, you have to figure out the file dependencies and compile them
> group by group with javac
> or groovyc.
>
> Thanks,
>
> Jian
>
>
>
> On Thu, May 13, 2010 at 2:12 AM, khush <[email protected]> wrote:
> > Hi all,
>
> > I am trying to run my ant task for compiling my tellurium web test
> > classes(java+groovy).
>
> > It was working fine but i suddenly did one small change that i created
> > an java interface and imported it into my groovy class.
>
> > After that my ant task started giving this err:
>
> > [groovyc]
> > org.codehaus.groovy.control.MultipleCompilationErrorsException:
> > startup failed, web\user\UserModule.groovy: 3: unable to resolve class
> > web.Statics
>
> > Where Static is my java interface and i import it in my grovvy class
> > like
>
> > import web.Statics
>
> > However when i compile and run my test cases through idea it workes
> > very well.
>
> > Anybody has any idea about this issue?
>
> > My ant task is as followings:
>
> > <target name="setup-webtest" description="Compiles and configures one
> > Tellurium webtest.">
> > <groovyc destdir="${test-build.dir}"
> > classpathref="full.classpath" srcdir="${src.tellurium.webtest}"/>
>
> > <javac debug="${compiler.debug}" destdir="${test-build.dir}"
> > fork="true" executable="${javac.executable}"
> > classpathref="full.classpath" target="$
> > {javac.target.version}" source="${javac.source.version}">
> > <src path="${src.tellurium.webtest}"/>
> > </javac>
> > </target>
>
> > -Khush
>
> > --
> > 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]<tellurium-users%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/tellurium-users?hl=en.
>
> --
> 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
> athttp://groups.google.com/group/tellurium-users?hl=en.
--
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.