Search in sources :

Example 11 with Properties

use of org.talend.daikon.properties.Properties 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 12 with Properties

use of org.talend.daikon.properties.Properties 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

ComponentProperties (org.talend.components.api.properties.ComponentProperties)12 Properties (org.talend.daikon.properties.Properties)12 ComponentReferenceProperties (org.talend.components.api.properties.ComponentReferenceProperties)6 NamedThing (org.talend.daikon.NamedThing)6 SimpleNamedThing (org.talend.daikon.SimpleNamedThing)4 Property (org.talend.daikon.properties.property.Property)4 SchemaProperty (org.talend.daikon.properties.property.SchemaProperty)4 ArrayList (java.util.ArrayList)3 INode (org.talend.core.model.process.INode)3 List (java.util.List)2 Test (org.junit.Test)2 CodegenPropInfo (org.talend.designer.core.generic.model.Component.CodegenPropInfo)2 GenericElementParameter (org.talend.designer.core.generic.model.GenericElementParameter)2 TestProperties (org.talend.designer.core.generic.utils.TestProperties)2 TestReferencedProperties (org.talend.designer.core.generic.utils.TestReferencedProperties)2 FakeElement (org.talend.designer.core.model.FakeElement)2 ElementParameter (org.talend.designer.core.model.components.ElementParameter)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Schema (org.apache.avro.Schema)1 Connector (org.talend.components.api.component.Connector)1