use of org.talend.designer.core.generic.utils.TestProperties in project tdi-studio-se by Talend.
the class GenericNodeConnectorTest method testGetComponentProperties.
@Test
public void testGetComponentProperties() {
//$NON-NLS-1$
TestProperties testProps2 = (TestProperties) new TestProperties("test2").init();
GenericNodeConnector connector = new GenericNodeConnector(testNode, false);
connector.setComponentProperties(testProps2);
assertEquals(testNode.getComponentProperties(), connector.getComponentProperties());
connector = new GenericNodeConnector(null, false);
connector.setComponentProperties(testProps2);
assertEquals(testProps2, connector.getComponentProperties());
}
use of org.talend.designer.core.generic.utils.TestProperties in project tdi-studio-se by Talend.
the class GenericElementParameterTest method before.
@Before
public void before() {
ComponentService componentService = ComponentsUtils.getComponentService();
//$NON-NLS-1$
TestProperties props = (TestProperties) new TestProperties("test").init();
Form form = props.getForm(Form.MAIN);
//$NON-NLS-1$ //$NON-NLS-2$
IComponent component = ComponentsFactoryProvider.getInstance().get("tSalesforceConnection", "DI");
INode node = new Node(component, new Process(new FakePropertyImpl()));
parameter = new GenericElementParameter(node, props, form, form.getWidget(props.userId), componentService);
}
use of org.talend.designer.core.generic.utils.TestProperties in project tdi-studio-se by Talend.
the class GenericNodeConnectorTest method before.
@Before
public void before() {
process = new Process(createProperty());
testNode = new Node(testComponent, process);
//$NON-NLS-1$
TestProperties testProps = (TestProperties) new TestProperties("test").init();
testNode.setComponentProperties(testProps);
}
use of org.talend.designer.core.generic.utils.TestProperties in project tdi-studio-se by Talend.
the class ComponentTest method testGetCodegenPropInfosWithoutReferenceObject.
@Test
public void testGetCodegenPropInfosWithoutReferenceObject() {
//$NON-NLS-1$
ComponentProperties props = (ComponentProperties) new TestProperties("test").init();
List<CodegenPropInfo> propInfos = component.getCodegenPropInfos(props);
for (CodegenPropInfo propInfo : propInfos) {
Properties properties = propInfo.props;
if (properties instanceof ComponentReferenceProperties) {
ComponentReferenceProperties crp = (ComponentReferenceProperties) properties;
assertEquals(Boolean.TRUE, crp.componentInstanceId.getTaggedValue(IGenericConstants.ADD_QUOTES));
assertEquals(Boolean.TRUE, crp.referenceDefinitionName.getTaggedValue(IGenericConstants.ADD_QUOTES));
//please see ComponentRefController class, the reference will be set when some ui action happen, so expect the value is null as no any ui action here
assertNull(crp.getReference());
}
}
}
use of org.talend.designer.core.generic.utils.TestProperties in project tdi-studio-se by Talend.
the class ComponentTest method testGetCodegenPropInfosWithReferencePropertiesObject.
@Test
public void testGetCodegenPropInfosWithReferencePropertiesObject() {
//$NON-NLS-1$
TestProperties props = (TestProperties) new TestProperties("test").init();
props.referencePros.setReference(new TestReferencedProperties("reference").init());
List<CodegenPropInfo> propInfos = component.getCodegenPropInfos(props);
for (CodegenPropInfo propInfo : propInfos) {
Properties properties = propInfo.props;
if (properties instanceof ComponentReferenceProperties) {
ComponentReferenceProperties crp = (ComponentReferenceProperties) properties;
assertEquals(Boolean.TRUE, crp.componentInstanceId.getTaggedValue(IGenericConstants.ADD_QUOTES));
assertEquals(Boolean.TRUE, crp.referenceDefinitionName.getTaggedValue(IGenericConstants.ADD_QUOTES));
assertNotNull(crp.getReference());
}
}
}
Aggregations