WindGateImporterDescription description = (WindGateImporterDescription) instance;
ProcessScript<T> process = WindGateTestHelper.createProcessScript(
definition.getModelClass(),
description);
ParameterList parameterList = new ParameterList(context.getArguments());
ResourceManipulator manipulator =
WindGateTestHelper.createResourceManipulator(context, description, parameterList);
SourceDriver<T> driver = manipulator.createSourceForSource(process);
return new WindGateSource<T>(WindGateTestHelper.prepare(driver), definition);
} else if (instance instanceof WindGateExporterDescription) {
WindGateExporterDescription description = (WindGateExporterDescription) instance;
ProcessScript<T> process = WindGateTestHelper.createProcessScript(
definition.getModelClass(),
description);
ParameterList parameterList = new ParameterList(context.getArguments());
ResourceManipulator manipulator =
WindGateTestHelper.createResourceManipulator(context, description, parameterList);
SourceDriver<T> driver = manipulator.createSourceForDrain(process);
return new WindGateSource<T>(WindGateTestHelper.prepare(driver), definition);
} else {
throw new IOException(MessageFormat.format(
"URI must represent a subclass of {1} or {2}: {0}",
source,