What do you mean with "a custom launcher". Did you extend an existing launcher or create a new one?
It's not necessary to create a new launcher. Simply use an existing one.
If you want to start the whole application, you could do following:
SwingApplication app = new SwingApplication();
app.setSystemExitOnDispose(false);
app.startup(YourApplication.class.getName(), "/yourapp/application.xml", null);
while (app.getApplication() == null || !app.getApplication().getLauncher().isVisible())
{
try
{
Thread.sleep(100);
}
catch (InterruptedException ie)
{
throw new RuntimeException(ie);
}
}
YourApplication yapp = (YourApplication)app.getApplication();
if (yapp == null)
{
Assert.fail("Application was not started!");
}
If you won't start the whole application, it's important to set at least a factory:
UIFactoryManager.getFactoryInstance(SwingFactory.class);
The factory is important if you want to use GUI classes in your test cases. See example
JUnit test-case.
If your test cases don't work because of invalid configuration files, it could help to set the configuration basedir:
System.setProperty(IPackageSetup.CONFIG_BASEDIR, new File("").getAbsolutePath());
The path should be the directory which contains the rad directory.
Another option for headless tests is the
JVx headless UI.