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]

Re: [QF-Test] How to get and use Classloader of SUT

  • Subject: Re: [QF-Test] How to get and use Classloader of SUT
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 15 Dec 2007 22:30:17 +0100

Hello Mark,

you can only use that ClassLoader in SUT Scripts because it is a
ClassLoader of the SUT. There is no way to move that over to the
Server side. So just make the ClassLoader a Jython global in the SUT,
use SUT scripts to load your properties etc., then - if necessary and
possible - transfer the results of that to the server with toServer.

Best regards,
"Michaelis, Mark" <mark.michaelis@?.com> writes:

> Hello,
> I need to get access to the Classloader of the SUT to read e. g. property-files and to create instances of some classes.
> I solved this problem by having an SUT script which gets a component and asks for its classloader.
> The problem: Now everytime I want to work with these classes the call is placed in the AWT EventQueue (as being an SUT Script) which is not nice at all.
> So my next guess was: Only get the classloader once and store it globally. Then in Server Scripts use the Classloader directly.
> But: Just making the variable global does not work as SUT Scripts and Server Scripts run in different contexts. rc.setGlobal() of course does not work because it only accepts Strings and with rc.toServer() it isn't any better. I just got a "Can't pickle"-exception and of course the QF-Test manual already states that it is not possible to transfer all Java Objects this way.
> So my question: Does anyone have a guess how I may continue? Or do I have to stick to the AWT EventQueue?
> Kind Regards
> - Mark
> -- 
> Mark Michaelis
> Software Engineer Quality Assurance
> CoreMedia 
> Ludwig-Erhard-Str. 18
> 20459 Hamburg, Germany
> www.coremedia.com 
> --------------------------------------------------------
> CoreMedia AG
> Executive Board: Sören Stamer (CEO), Dr. Klemens Kleiminger (CFO)
> Supervisory Board: Prof. Dr. Joachim Schmidt (Chairman)
> Trade Register: Amtsgericht Hamburg, HR B 76277
> --------------------------------------------------------

Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876
GF: Gregor Schmid, Karlheinz Kellerer          HRB München 140833