FW: Upgrading to 3.2.3 from 2.0 and resolvers

30 views
Skip to first unread message

Vicki Gadolin

unread,
May 13, 2013, 5:26:11 PM5/13/13
to marathon...@googlegroups.com

Here is some additional information:

 

When Marathon tries to access my Resolver, here is the error message:

 

    from com.axiomainc.libra.gui.marathon.util import ResourceRetriever

ValueError: Attempted relative import in non-package

 

From: Vicki Gadolin
Sent: Monday, May 13, 2013 2:14 PM
To: marathon...@googlegroups.com
Subject: Upgrading to 3.2.3 from 2.0 and resolvers

 

I am currently researching what it is going to take to convert my 2.0 tests and modules into version 3.2.3 tests and modules.

 

1.       I am running into an issue where Marathon 3.2.3 cannot find my resolver.  I have added the full path in my classpath and have added the .java class name to the resolvers tab.  For some reason, Marathon says that it cannot find the resolver.  If you have some input to this, please let me know.

 

2.       I am curious on if a resolver is even necessary in this version.

 

My resolver basically gets a file and sets an absolute path for it (my tests run on various servers and each server is a bit different)

 

Here is an example of some of the code that is in the resolver:

 

   public static String getFile(String resourcePath) {

      String path = System.class.getResource(resourcePath).getPath();

      path = path.replaceAll("%20", " ");

      return (new File(path)).getAbsolutePath();

   }

 

   public static String getPathFile(String resourcePath) {

      String path = System.class.getResource(resourcePath).getPath();

      path = path.replaceAll("%20", " ");

      String absolutePath = (new File(path)).getAbsolutePath();

      return getDirectory(absolutePath);

   }

 

Has anyone done something similar and if so, did you just use a module or did you use a resolver?

 

FYI.  Part of my resolver also gets the number of files and removes some files.

 

Regards,

VickiG

 

Vicki Gadolin

unread,
May 13, 2013, 5:34:22 PM5/13/13
to marathon...@googlegroups.com

Additional information:

 

java.lang.NoSuchMethodException: com.axiomainc.libra.gui.marathon.util.ResourceRetriever.<init>(net.sourceforge.marathon.component.ComponentFinder, boolean, net.sourceforge.marathon.recorder.WindowMonitor)

                at java.lang.Class.getConstructor0(Class.java:2715)

                at java.lang.Class.getConstructor(Class.java:1659)

                at net.sourceforge.marathon.providers.ResolversProvider.get(ResolversProvider.java:66)

                at net.sourceforge.marathon.component.ComponentFinder.<init>(ComponentFinder.java:85)

                at net.sourceforge.marathon.runtime.JavaRuntime.createResolver(JavaRuntime.java:237)

                at net.sourceforge.marathon.runtime.JavaRuntime.getComponentResolver(JavaRuntime.java:229)

                at net.sourceforge.marathon.runtime.JavaRuntime.createScript(JavaRuntime.java:204)

                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 net.sourceforge.rmilite.impl.RemoteInvocationHandlerImpl.invoke(RemoteInvocationHandlerImpl.java:70)

                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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)

                at sun.rmi.transport.Transport$1.run(Transport.java:159)

                at java.security.AccessController.doPrivileged(Native Method)

                at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

                at java.lang.Thread.run(Thread.java:662)

java.lang.ClassNotFoundException: com.axiomainc.libra.gui.marathon.resolvers.LibraComponentResolver.java

                at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

                at java.security.AccessController.doPrivileged(Native Method)

                at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

                at java.lang.Class.forName0(Native Method)

                at java.lang.Class.forName(Class.java:171)

                at net.sourceforge.marathon.providers.ResolversProvider.get(ResolversProvider.java:65)

                at net.sourceforge.marathon.component.ComponentFinder.<init>(ComponentFinder.java:85)

                at net.sourceforge.marathon.runtime.JavaRuntime.createResolver(JavaRuntime.java:237)

                at net.sourceforge.marathon.runtime.JavaRuntime.getComponentResolver(JavaRuntime.java:229)

                at net.sourceforge.marathon.runtime.JavaRuntime.createScript(JavaRuntime.java:204)

                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 net.sourceforge.rmilite.impl.RemoteInvocationHandlerImpl.invoke(RemoteInvocationHandlerImpl.java:70)

                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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)

                at sun.rmi.transport.Transport$1.run(Transport.java:159)

                at java.security.AccessController.doPrivileged(Native Method)

                at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

                at java.lang.Thread.run(Thread.java:662)

java.lang.Exception: Unable to process: C:\Marathon_Libratrunk\src\test\Marathon\Modules\ResourceRetriever.py

                at net.sourceforge.marathon.python.ModuleList.createModuleFromFile(ModuleList.java:211)

                at net.sourceforge.marathon.python.ModuleList.createModuleForDir(ModuleList.java:158)

                at net.sourceforge.marathon.python.ModuleList.loadModulesFromDirs(ModuleList.java:128)

                at net.sourceforge.marathon.python.ModuleList.importModules(ModuleList.java:69)

                at net.sourceforge.marathon.python.ModuleList.<init>(ModuleList.java:59)

                at net.sourceforge.marathon.python.PythonScript.loadScript(PythonScript.java:282)

                at net.sourceforge.marathon.python.PythonScript.<init>(PythonScript.java:239)

                at net.sourceforge.marathon.python.PythonScriptModel.getScript(PythonScriptModel.java:91)

                at net.sourceforge.marathon.runtime.JavaRuntime.createScript(JavaRuntime.java:204)

                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 net.sourceforge.rmilite.impl.RemoteInvocationHandlerImpl.invoke(RemoteInvocationHandlerImpl.java:70)

                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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)

                at sun.rmi.transport.Transport$1.run(Transport.java:159)

                at java.security.AccessController.doPrivileged(Native Method)

                at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

                at java.lang.Thread.run(Thread.java:662)

Caused by: SyntaxError: ("mismatched input 'public' expecting INDENT", ('ResourceRetriever.py', 16, 0, 'public class ResourceRetriever {\n'))

 

                at org.python.core.PyException.fillInStackTrace(PyException.java:70)

                at java.lang.Throwable.<init>(Throwable.java:181)

                at java.lang.Exception.<init>(Exception.java:29)

                at java.lang.RuntimeException.<init>(RuntimeException.java:32)

                at org.python.core.PyException.<init>(PyException.java:46)

                at org.python.core.PyException.<init>(PyException.java:43)

                at org.python.core.PyException.<init>(PyException.java:39)

                at org.python.core.PySyntaxError.<init>(PySyntaxError.java:22)

                at org.python.core.ParserFacade.fixParseError(ParserFacade.java:96)

                at org.python.core.ParserFacade.parse(ParserFacade.java:188)

                at net.sourceforge.marathon.python.ModuleList.createModuleFromFile(ModuleList.java:186)

                ... 27 more

Dakshinamurthy Karra

unread,
May 14, 2013, 12:23:30 AM5/14/13
to marathon...@googlegroups.com
Are you sure there are no syntax errors in ResourceRetriever.py? That is one error I could see.

-- KD



--
Looking for professional help with your Marathon projects?
Go visit: http://marathontesting.com
---
You received this message because you are subscribed to the Google Groups "Marathon Java GUI Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marathon-testi...@googlegroups.com.
To post to this group, send email to marathon...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vicki Gadolin

unread,
May 14, 2013, 10:35:08 AM5/14/13
to marathon...@googlegroups.com

I don’t think so.  Nothing has changed in this code.  It works fine in the 2.0 version

Dakshinamurthy Karra

unread,
May 15, 2013, 12:57:30 AM5/15/13
to marathon...@googlegroups.com
The bundled Jython version is changed. That may be the issue. I don't recall any changes to the resolvers, still you can verify by just recompiling your custom resolver.

-- KD

Vicki Gadolin

unread,
May 15, 2013, 9:49:26 AM5/15/13
to marathon...@googlegroups.com

Ok thank you for the information.  I was starting to think that it was something along those lines.  Thanks for the confirmation.

Reply all
Reply to author
Forward
0 new messages