Search in sources :

Example 86 with TdExpression

use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.

the class IndicatorDefinitionFileHelperTest method setup.

@Before
public void setup() {
    indiDefinition = DefinitionFactoryImpl.eINSTANCE.createIndicatorDefinition();
    EList<TdExpression> tdExpessionLs = new BasicEList<TdExpression>();
    TdExpression tdExpression1 = // $NON-NLS-1$
    BooleanExpressionHelper.createTdExpression(// $NON-NLS-1$
    "MySql", // $NON-NLS-1$
    "SELECT SUM(CHAR_LENGTH(<%=__COLUMN_NAMES__%>)), COUNT(<%=__COLUMN_NAMES__%>) FROM <%=__TABLE_NAME__%>");
    TdExpression tdExpression2 = BooleanExpressionHelper.createTdExpression(// $NON-NLS-1$
    "DB2", // $NON-NLS-1$
    "SELECT SUM(LENGTH(<%=__COLUMN_NAMES__%>)), COUNT(<%=__COLUMN_NAMES__%>) FROM <%=__TABLE_NAME__%> <%=__WHERE_CLAUSE__%>");
    tdExpessionLs.add(tdExpression1);
    tdExpessionLs.add(tdExpression2);
    indiDefinition.getSqlGenericExpression().add(tdExpression1);
    indiDefinition.getSqlGenericExpression().add(tdExpression2);
    UnitTestBuildHelper.initProjectStructure();
}
Also used : TdExpression(org.talend.cwm.relational.TdExpression) BasicEList(org.eclipse.emf.common.util.BasicEList) Before(org.junit.Before)

Example 87 with TdExpression

use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.

the class TextIndicatorForNetezzaTest method testMaxLength.

@Test
public void testMaxLength() {
    TdExpression expression = findExpressionForNetezza(MAXIMAL_LENGTH);
    Assert.assertNotNull(expression);
    Assert.assertEquals(MAXIMAL_LENGTH_SQL, expression.getBody());
}
Also used : TdExpression(org.talend.cwm.relational.TdExpression) Test(org.junit.Test)

Example 88 with TdExpression

use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.

the class TextIndicatorForNetezzaTest method testMinLength.

@Test
public void testMinLength() {
    TdExpression expression = findExpressionForNetezza(MINIMAL_LENGTH);
    Assert.assertNotNull(expression);
    Assert.assertEquals(MINIMAL_LENGTH_SQL, expression.getBody());
}
Also used : TdExpression(org.talend.cwm.relational.TdExpression) Test(org.junit.Test)

Example 89 with TdExpression

use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.

the class TextIndicatorForNetezzaTest method testPattern.

@Test
public void testPattern() {
    TdExpression expression = findExpressionForNetezza(PATTERN_FREQUENCY);
    Assert.assertNotNull(expression);
    Assert.assertEquals(PATTERN_FREQUENCY_SQL, expression.getBody());
}
Also used : TdExpression(org.talend.cwm.relational.TdExpression) Test(org.junit.Test)

Example 90 with TdExpression

use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.

the class TextIndicatorForNetezzaTest method testMaxLengthWithBlankNull.

@Test
public void testMaxLengthWithBlankNull() {
    TdExpression expression = findExpressionForNetezza(MAXIMAL_LENGTH_WITH_BLANK_AND_NULL);
    Assert.assertNotNull(expression);
    Assert.assertEquals(MAXIMAL_LENGTH_WITH_BLANK_AND_NULL_SQL, expression.getBody());
}
Also used : TdExpression(org.talend.cwm.relational.TdExpression) Test(org.junit.Test)

Aggregations

TdExpression (org.talend.cwm.relational.TdExpression)121 Test (org.junit.Test)51 IndicatorDefinition (org.talend.dataquality.indicators.definition.IndicatorDefinition)30 UDIndicatorDefinition (org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition)29 ArrayList (java.util.ArrayList)19 RegularExpression (org.talend.dataquality.domain.pattern.RegularExpression)19 Pattern (org.talend.dataquality.domain.pattern.Pattern)16 TdColumn (org.talend.cwm.relational.TdColumn)12 Expression (orgomg.cwm.objectmodel.core.Expression)12 BasicEList (org.eclipse.emf.common.util.BasicEList)11 IndicatorParameters (org.talend.dataquality.indicators.IndicatorParameters)11 Domain (org.talend.dataquality.domain.Domain)10 TdTable (org.talend.cwm.relational.TdTable)9 ProductVersion (org.talend.utils.ProductVersion)9 Analysis (org.talend.dataquality.analysis.Analysis)8 PatternComponent (org.talend.dataquality.domain.pattern.PatternComponent)8 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)8 File (java.io.File)7 IFile (org.eclipse.core.resources.IFile)6 IFolder (org.eclipse.core.resources.IFolder)6