[ http://jira.codehaus.org/browse/MSUREFIRE-122?page=comments#action_73990 
] 
            
fabrizio giustina commented on MSUREFIRE-122:
---------------------------------------------

Hi Charlie,
I tried to integrate your patches, but looks like that tests on the 
jythonProviderTest don't work properly. After adding the surefire-jython 
provider and applying your patch to the maven surefire plugin this is what I 
get when I try running tests:


[INFO] Surefire report directory: 
\jythonProvider.tar\jythonProvider\jythonProviderTest\target\surefire-reports
*sys-package-mgr*: processing new jar, 
'C:\repository\m2\jython\jython\2.2-alpha1\jython-2.2-alpha1.jar'
org.apache.maven.surefire.booter.SurefireExecutionException: Problem reflecting 
on class org.python.core.PySystemState; nested exception is 
java.lang.reflect.InvocationTargetException: null; nested exception is
 org.apache.maven.surefire.testset.TestSetFailedException: Problem reflecting 
on class org.python.core.PySystemState; nested exception is 
java.lang.reflect.InvocationTargetException: null
org.apache.maven.surefire.testset.TestSetFailedException: Problem reflecting on 
class org.python.core.PySystemState; nested exception is 
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at 
org.apache.maven.surefire.jython.JythonDirectoryTestSuite.setupInterpreter(JythonDirectoryTestSuite.java:130)
        at 
org.apache.maven.surefire.jython.JythonDirectoryTestSuite.locateTestSets(JythonDirectoryTestSuite.java:102)
        at 
org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:147)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:108)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:265)
        at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:792)
Caused by: Traceback (innermost last):
  File "<string>", line 7, in ?
ImportError: cannot import name SurefireTestSet

        at org.python.core.Py.ImportError(Py.java:193)
        at org.python.core.imp.importFromAs(imp.java:694)
        at org.python.core.imp.importFrom(imp.java:667)
        at org.python.pycode._pyx0.f$0(<string>:7)
        at org.python.pycode._pyx0.call_function(<string>)
        at org.python.core.PyTableCode.call(PyTableCode.java:213)
        at org.python.core.PyCode.call(PyCode.java:14)
        at org.python.core.Py.runCode(Py.java:1182)
        at org.python.core.Py.exec(Py.java:1204)
        at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:137)
        ... 14 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE


The problem may be caused by recent changes on the surefire classloader... let 
me know if you can have a look at it.




> Support tests written in Jython
> -------------------------------
>
>                 Key: MSUREFIRE-122
>                 URL: http://jira.codehaus.org/browse/MSUREFIRE-122
>             Project: Maven 2.x Surefire Plugin
>          Issue Type: New Feature
>            Reporter: Charlie Groves
>         Assigned To: fabrizio giustina
>             Fix For: 2.3
>
>         Attachments: jythonProvider.tar.gz
>
>
> I've written a first pass at a surefire-provider for JUnit and Python 
> unittest TestCases written in Jython.  Before I continue any further I'd like 
> to make sure that the provider is wanted and that I'm heading in the right 
> direction.
> To do the minimum to get it up and running, I've hooked into the 
> maven-surefire-plugin to hook my provider into the system somewhat like the 
> TestNG provider did.  maven-surefire-plugin passes a path(defaults to 
> src/test/jython) to the provider.  The provider searches the path for files 
> matching include patterns and loads those as Python modules.  For every class 
> in the matching modules that extends junit or unittest TestCase, it makes a 
> SurefireTestSuite and exposes them for running.  Sound like a decent approach?
> To give it a spin, apply maven-surefire-plugin.patch, mvn install on the 
> surefire-jython project and run mvn test in jythonProviderTest.  It's just 
> contains a single Junit testcase with a failing and passing test.
> I haven't even checked what happens when the jython tests throw exceptions, 
> and I know there's alot to be done as far as making it a usable plugin, but I 
> felt like getting some feedback before continuing.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to