use of org.talend.core.model.properties.Property 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());
}
use of org.talend.core.model.properties.Property 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);
}
use of org.talend.core.model.properties.Property in project tdi-studio-se by Talend.
the class BuildJobFactoryTest method test_createBuildJobHandler_String_standalone.
@Test
public void test_createBuildJobHandler_String_standalone() {
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(), "STANDALONE");
Assert.assertNotNull("Can't build job for standalone job", handler);
Assert.assertEquals(BuildJobHandler.class.getName(), handler.getClass().getName());
}
use of org.talend.core.model.properties.Property in project tdi-studio-se by Talend.
the class JobVersionUtilsTest method createRepositoryObject.
private IRepositoryViewObject createRepositoryObject(String lable) throws PersistenceException {
// create item
itemPath = new Path(folderName);
Property property = PropertiesFactory.eINSTANCE.createProperty();
property.setAuthor(((RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
property.setVersion(VersionUtils.DEFAULT_VERSION);
//$NON-NLS-1$
property.setStatusCode("");
ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
processItem.setProperty(property);
repositoryFactory = RepositoryPlugin.getDefault().getRepositoryService().getProxyRepositoryFactory();
property.setId(repositoryFactory.getNextId());
property.setLabel(lable);
ProcessType process = TalendFileFactory.eINSTANCE.createProcessType();
ParametersType parameterType = TalendFileFactory.eINSTANCE.createParametersType();
// add depended routines.
List<RoutinesParameterType> dependenciesInPreference = RoutinesUtil.createDependenciesInPreference();
parameterType.getRoutinesParameter().addAll(dependenciesInPreference);
process.setParameters(parameterType);
processItem.setProcess(process);
repositoryFactory.create(processItem, itemPath);
return new RepositoryObject(property);
}
use of org.talend.core.model.properties.Property in project tesb-studio-se by Talend.
the class LocalESBRunContainerServiceTest method testCreateJavaProcessor.
/**
* Test method for
* {@link org.talend.designer.esb.runcontainer.core.LocalESBRunContainerService#createJavaProcessor(org.talend.core.model.process.IProcess, Property, boolean)}
*/
@Test
public void testCreateJavaProcessor() {
IESBRunContainerService service = (IESBRunContainerService) GlobalServiceRegister.getDefault().getService(IESBRunContainerService.class);
String[] esbComponents = { "tESBProviderRequest", "tRESTClient", "tRESTRequest", "tRESTResponse", "tESBConsumer", "tESBProviderFault", "tESBProviderRequest", "tESBProviderResponse" };
for (String esbComponent : esbComponents) {
Property property = PropertiesFactory.eINSTANCE.createProperty();
property.setVersion("0.1");
property.setId("property1");
property.setLabel("ESBArtifact");
ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
processItem.setProperty(property);
property.setItem(processItem);
ProcessType process = TalendFileFactory.eINSTANCE.createProcessType();
processItem.setProcess(process);
NodeType node = TalendFileFactory.eINSTANCE.createNodeType();
process.getNode().add(node);
node.setComponentName(esbComponent);
IComponent tESBComponent = ComponentsFactoryProvider.getInstance().get(esbComponent, ComponentCategory.CATEGORY_4_DI.getName());
Process esbJob = new Process(property);
Node tESBComponent_1 = new Node(tESBComponent, esbJob);
esbJob.addNodeContainer(new NodeContainer(tESBComponent_1));
Assert.assertNotNull(service.createJavaProcessor(esbJob, property, false));
}
}
Aggregations