Hi Brian,

At a guess, I'd say it Jython found org.testng.TestNG, but that this imports com.beust.jcommander.ParameterException, which the JVM loader cannot find, maybe because it is is not on your Java class path.

The reason the error does not occur when you import the module as org.testng (I think) is that Jython only needs to register the existence of the classes for that. When you from ... import a class, it is actually loaded. There seems to be a missing dependency. Starting Jython with -v or with -J-verbose may tell you more.

TestListenerAdapter doesn't have the same dependencies.

I got this effect, downloading the JAR (I shortened the results):

dev>set CLASSPATH=.;testng-6.8.jar
*sys-package-mgr*: processing new jar, 'C:\Users\Jeff\Documents\Eclipse\jython-trunk\testng-6.8.jar'
Jython 2.7b1+ (default:bb71f88cbe80+, Jun 12 2013, 00:06:45)
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_35
Type "help", "copyright", "credits" or "license" for more information.
>>> import org.testng
>>> dir(org.testng)
['Assert', 'AssertJUnit', 'ClassMethodMap',  ... ]
>>> from org.testng import TestNG
>>> dir(TestNG)

Jeff Allen
On 12/06/2013 18:22, Brian Brown wrote:
This is jython2.7b1 and testing-6.8.5

this code works:

import org.testng
    print dir(org.testng)

which results in:

['Assert', 'AssertJUnit', 'ClassMethodMap', 'CommandLineArgs', 
     'mustache', 'remote', 'reporters', 'util', 'xml']

... as I would expect.

I can do:

from org.testng import TestListenerAdapter

and that works fine. However, if I try:

from org.testng import TestNG

I get the following traceback:

 >>> from org.testng import TestNG
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     java.lang.NoClassDefFoundError: com/beust/jcommander/ParameterException
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:264)