use of org.talend.core.runtime.process.IBuildJobHandler in project tdi-studio-se by Talend.
the class BuildJobFactoryTest method test_createBuildJobHandler_String_default_withoutSetting.
@Test
public void test_createBuildJobHandler_String_default_withoutSetting() {
Property property = PropertiesFactory.eINSTANCE.createProperty();
property.setAuthor(((RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
property.setLabel("ABC");
property.setVersion(VersionUtils.DEFAULT_VERSION);
//$NON-NLS-1$
property.setStatusCode("");
ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
processItem.setProperty(property);
IBuildJobHandler handler = BuildJobFactory.createBuildJobHandler(processItem, "Default", property.getVersion(), JobScriptsManagerFactory.getDefaultExportChoiceMap(), (String) null);
Assert.assertNotNull("Can't build job for standalone job", handler);
Assert.assertEquals(BuildJobHandler.class.getName(), handler.getClass().getName());
}
use of org.talend.core.runtime.process.IBuildJobHandler in project tdi-studio-se by Talend.
the class BuildJobFactoryTest method test_createBuildJobHandler_JobExportType_ZIP.
@Test
public void test_createBuildJobHandler_JobExportType_ZIP() {
IBuildJobHandler handler = BuildJobFactory.createBuildJobHandler(PropertiesFactory.eINSTANCE.createProcessItem(), "Default", "0.1", JobScriptsManagerFactory.getDefaultExportChoiceMap(), JobExportType.WSZIP);
Assert.assertNull("Have supportted ZIP, not support before", handler);
}
use of org.talend.core.runtime.process.IBuildJobHandler in project tdi-studio-se by Talend.
the class BuildJobFactoryTest method test_createBuildJobHandler_JobExportType_war.
@Test
public void test_createBuildJobHandler_JobExportType_war() {
IBuildJobHandler handler = BuildJobFactory.createBuildJobHandler(PropertiesFactory.eINSTANCE.createProcessItem(), "Default", "0.1", JobScriptsManagerFactory.getDefaultExportChoiceMap(), JobExportType.WSWAR);
Assert.assertNull("Have supportted WAR, not support before", handler);
}
use of org.talend.core.runtime.process.IBuildJobHandler in project tdi-studio-se by Talend.
the class StandardJobStandaloneBuildProvider method createBuildExportHandler.
@Override
public IBuildExportHandler createBuildExportHandler(Map<String, Object> parameters) {
if (parameters == null || parameters.isEmpty()) {
return null;
}
final Object item = parameters.get(ITEM);
if (item == null || !(item instanceof ProcessItem)) {
return null;
}
final Object version = parameters.get(VERSION);
if (version == null) {
return null;
}
final Object contextGroup = parameters.get(CONTEXT_GROUP);
if (contextGroup == null) {
return null;
}
Object choiceOption = parameters.get(CHOICE_OPTION);
if (choiceOption == null) {
choiceOption = Collections.emptyMap();
}
if (!(choiceOption instanceof Map)) {
return null;
}
IBuildJobHandler buildHandler = new BuildJobHandler((ProcessItem) item, version.toString(), contextGroup.toString(), (Map<ExportChoice, Object>) choiceOption);
return buildHandler;
}
Aggregations