2019 bis heute  2018  | 2017 2016 2015 2014 | 2013 | 2012

Mailingliste - Einträge 2012

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

[QF-Test] Eclipse Class Loading/Imports in SUT scripts

  • Subject: [QF-Test] Eclipse Class Loading/Imports in SUT scripts
  • From: Stephen Bayne <stephen.bayne@?.com>
  • Date: Mon, 19 Mar 2012 12:05:08 +0000


We seem to be having a bit of a problem with getting access to certain classes within Eclipse in an SUT Jython script.

I have tried the following to get access to org.eclipse.ui.PlatformUI and none have worked:

Copying Eclipse plugin jars to QF-Test's plugin directory: This gave us the class but outside the context of our application. Also found that it's not recommended to do it this way.

Importing PlatformUI without any jars in the plugins directory: Resulted in an ImportError as Jython's ClassLoader is not very good with Eclipse classes.

Getting the ClassLoader and calling loadClass() from an existing component using rc.getComponent("WorkbenchWindow").getClass().getClassLoader().loadClass("org.eclipse.ui.PlatformUI"): This throws a ClassNotFoundException.

Getting QF-Test's run-context ClassLoader and calling loadClass() using rc.context.__class__.getClassLoader().loadClass("org.eclipse.ui.PlatformUI"): This also throws a ClassNotFoundException

It is worth noting that using the latter two methods above to access any class under org.eclipse.swt.widgets works absolutely fine.

My question then is this: How can we get access to the classes in eclipse bundles outside of SWT using Jython?

Any help is very much appreciated.

Stephen Bayne
CriticalBlue Ltd