Search in sources :

Example 26 with ProcessItem

use of org.talend.core.model.properties.ProcessItem in project tdi-studio-se by Talend.

the class FixUnevenItemContextParametersMigrationTaskTest method createTempProcessItem.

private ProcessItem createTempProcessItem() throws PersistenceException {
    ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
    Property myProperty = PropertiesFactory.eINSTANCE.createProperty();
    myProperty.setId(ProxyRepositoryFactory.getInstance().getNextId());
    ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
    itemState.setDeleted(false);
    itemState.setPath("");
    processItem.setState(itemState);
    processItem.setProperty(myProperty);
    myProperty.setLabel("myJob");
    myProperty.setVersion("0.1");
    processItem.setProcess(TalendFileFactory.eINSTANCE.createProcessType());
    ProxyRepositoryFactory.getInstance().create(processItem, new Path(""));
    return processItem;
}
Also used : Path(org.eclipse.core.runtime.Path) ProcessItem(org.talend.core.model.properties.ProcessItem) ItemState(org.talend.core.model.properties.ItemState) Property(org.talend.core.model.properties.Property)

Example 27 with ProcessItem

use of org.talend.core.model.properties.ProcessItem in project tdi-studio-se by Talend.

the class BuildJobFactoryTest method test_createBuildJobHandler_JobExportType_null.

@Test
public void test_createBuildJobHandler_JobExportType_null() {
    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(), (JobExportType) null);
    Assert.assertNotNull("Can't build job for standalone job", handler);
    Assert.assertEquals(BuildJobHandler.class.getName(), handler.getClass().getName());
}
Also used : ProcessItem(org.talend.core.model.properties.ProcessItem) IBuildJobHandler(org.talend.core.runtime.process.IBuildJobHandler) BuildJobHandler(org.talend.repository.ui.wizards.exportjob.handler.BuildJobHandler) IBuildJobHandler(org.talend.core.runtime.process.IBuildJobHandler) Property(org.talend.core.model.properties.Property) Test(org.junit.Test)

Example 28 with ProcessItem

use of org.talend.core.model.properties.ProcessItem in project tdi-studio-se by Talend.

the class BuildJobFactoryTest method test_createBuildJobHandler_JobExportType_POJO.

@Test
public void test_createBuildJobHandler_JobExportType_POJO() {
    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(), JobExportType.POJO);
    Assert.assertNotNull("Can't build job for standalone job", handler);
    Assert.assertEquals(BuildJobHandler.class.getName(), handler.getClass().getName());
}
Also used : ProcessItem(org.talend.core.model.properties.ProcessItem) IBuildJobHandler(org.talend.core.runtime.process.IBuildJobHandler) BuildJobHandler(org.talend.repository.ui.wizards.exportjob.handler.BuildJobHandler) IBuildJobHandler(org.talend.core.runtime.process.IBuildJobHandler) Property(org.talend.core.model.properties.Property) Test(org.junit.Test)

Example 29 with ProcessItem

use of org.talend.core.model.properties.ProcessItem in project tdi-studio-se by Talend.

the class BuildJobFactoryTest method test_createBuildJobHandler_String_default_withStandaloneSetting.

@Test
public void test_createBuildJobHandler_String_default_withStandaloneSetting() {
    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);
    property.getAdditionalProperties().put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, "STANDALONE");
    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());
}
Also used : ProcessItem(org.talend.core.model.properties.ProcessItem) IBuildJobHandler(org.talend.core.runtime.process.IBuildJobHandler) BuildJobHandler(org.talend.repository.ui.wizards.exportjob.handler.BuildJobHandler) IBuildJobHandler(org.talend.core.runtime.process.IBuildJobHandler) Property(org.talend.core.model.properties.Property) Test(org.junit.Test)

Example 30 with ProcessItem

use of org.talend.core.model.properties.ProcessItem in project tdi-studio-se by Talend.

the class BuildJobFactoryTest method test_createBuildJobHandler_String_default_withOSGiSetting.

@Test
public void test_createBuildJobHandler_String_default_withOSGiSetting() {
    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);
    property.getAdditionalProperties().put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, "OSGI");
    IBuildJobHandler handler = BuildJobFactory.createBuildJobHandler(processItem, "Default", property.getVersion(), JobScriptsManagerFactory.getDefaultExportChoiceMap(), (String) null);
    Assert.assertNull("Have supported OSGi build handler, not support before", handler);
}
Also used : ProcessItem(org.talend.core.model.properties.ProcessItem) IBuildJobHandler(org.talend.core.runtime.process.IBuildJobHandler) Property(org.talend.core.model.properties.Property) Test(org.junit.Test)

Aggregations

ProcessItem (org.talend.core.model.properties.ProcessItem)191 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)58 PersistenceException (org.talend.commons.exception.PersistenceException)56 ArrayList (java.util.ArrayList)45 Item (org.talend.core.model.properties.Item)43 Property (org.talend.core.model.properties.Property)43 JobletProcessItem (org.talend.core.model.properties.JobletProcessItem)37 ProcessType (org.talend.designer.core.model.utils.emf.talendfile.ProcessType)29 IProcess2 (org.talend.core.model.process.IProcess2)25 NodeType (org.talend.designer.core.model.utils.emf.talendfile.NodeType)25 IProcess (org.talend.core.model.process.IProcess)24 ExportFileResource (org.talend.repository.documentation.ExportFileResource)24 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)24 File (java.io.File)23 INode (org.talend.core.model.process.INode)23 IDesignerCoreService (org.talend.designer.core.IDesignerCoreService)22 IOException (java.io.IOException)21 IFile (org.eclipse.core.resources.IFile)20 List (java.util.List)19 EList (org.eclipse.emf.common.util.EList)19