Search in sources :

Example 6 with ComponentReferenceProperties

use of org.talend.components.api.properties.ComponentReferenceProperties 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());
        }
    }
}
Also used : TestProperties(org.talend.designer.core.generic.utils.TestProperties) ComponentProperties(org.talend.components.api.properties.ComponentProperties) CodegenPropInfo(org.talend.designer.core.generic.model.Component.CodegenPropInfo) ComponentProperties(org.talend.components.api.properties.ComponentProperties) ComponentReferenceProperties(org.talend.components.api.properties.ComponentReferenceProperties) TestProperties(org.talend.designer.core.generic.utils.TestProperties) Properties(org.talend.daikon.properties.Properties) TestReferencedProperties(org.talend.designer.core.generic.utils.TestReferencedProperties) ComponentReferenceProperties(org.talend.components.api.properties.ComponentReferenceProperties) Test(org.junit.Test)

Example 7 with ComponentReferenceProperties

use of org.talend.components.api.properties.ComponentReferenceProperties 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());
        }
    }
}
Also used : TestProperties(org.talend.designer.core.generic.utils.TestProperties) CodegenPropInfo(org.talend.designer.core.generic.model.Component.CodegenPropInfo) ComponentProperties(org.talend.components.api.properties.ComponentProperties) ComponentReferenceProperties(org.talend.components.api.properties.ComponentReferenceProperties) TestProperties(org.talend.designer.core.generic.utils.TestProperties) Properties(org.talend.daikon.properties.Properties) TestReferencedProperties(org.talend.designer.core.generic.utils.TestReferencedProperties) TestReferencedProperties(org.talend.designer.core.generic.utils.TestReferencedProperties) ComponentReferenceProperties(org.talend.components.api.properties.ComponentReferenceProperties) Test(org.junit.Test)

Aggregations

ComponentReferenceProperties (org.talend.components.api.properties.ComponentReferenceProperties)7 ComponentProperties (org.talend.components.api.properties.ComponentProperties)4 GenericElementParameter (org.talend.designer.core.generic.model.GenericElementParameter)4 Properties (org.talend.daikon.properties.Properties)3 CCombo (org.eclipse.swt.custom.CCombo)2 Point (org.eclipse.swt.graphics.Point)2 Test (org.junit.Test)2 IElementParameter (org.talend.core.model.process.IElementParameter)2 INode (org.talend.core.model.process.INode)2 NamedThing (org.talend.daikon.NamedThing)2 CodegenPropInfo (org.talend.designer.core.generic.model.Component.CodegenPropInfo)2 TestProperties (org.talend.designer.core.generic.utils.TestProperties)2 TestReferencedProperties (org.talend.designer.core.generic.utils.TestReferencedProperties)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Entry (java.util.Map.Entry)1 Properties (java.util.Properties)1 Schema (org.apache.avro.Schema)1 Command (org.eclipse.gef.commands.Command)1 DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)1