2018 up to now | 2017 | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2007

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QF-Test] Jython question regarding referencing a java object...

  • Subject: [QF-Test] Jython question regarding referencing a java object...
  • From: "Derrik Ammons" <dammons@?.COM>
  • Date: Wed, 21 Nov 2007 13:37:32 -0800

I'm getting a TypeError: method():2nd arg can't be coerced to pkg.MyClassName within a Server script node.
I instantiate a MyClassName object, newObject=StaticClass.createNewObject(), in a Server script and call an rc.setLocal("ReferencName",newObject).  I've also tried setGlobal as well with the same result.
Later downstream from that node, in the same Test Case node, in another Server script, I call fetchObject=rc.lookup("ReferenceName").  In the same script, I use that reference in a function call, anotherObject= StaticClass.method(someString, fetchObject).
I've compiled the java code into a jar file and placed it in the plugin directory like I normally do.  I imported the classes in the Server script like I normally do.  I tried both a setLocal and setGlobal methods of the run context.  I understand that when I do, there is a String association to the object, so that when I call rc.lookup(), fetchObject is a String, but I need the object so I can pass it into method.  How do I do this?
Hope my example makes sense.  I wanted to make it as generic as possible.