use of org.talend.dataquality.indicators.RowCountIndicator in project tdq-studio-se by Talend.
the class TableIndicator method createTableIndicatorWithRowCountIndicator.
/**
* DOC xqliu Comment method "createTableIndicatorWithRowCountIndicator".
*
* @param table
* @return
*/
public static TableIndicator createTableIndicatorWithRowCountIndicator(NamedColumnSet set) {
TableIndicator tableIndicator = new TableIndicator(set);
RowCountIndicator createIndicator = IndicatorsFactory.eINSTANCE.createRowCountIndicator();
DefinitionHandler.getInstance().setDefaultIndicatorDefinition(createIndicator);
createIndicator.setAnalyzedElement(set);
Indicator[] indicators = new Indicator[] { createIndicator };
tableIndicator.setIndicators(indicators);
return tableIndicator;
}
use of org.talend.dataquality.indicators.RowCountIndicator in project tdq-studio-se by Talend.
the class CountsIndicatorImpl method basicSetRowCountIndicator.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRowCountIndicator(RowCountIndicator newRowCountIndicator, NotificationChain msgs) {
RowCountIndicator oldRowCountIndicator = rowCountIndicator;
rowCountIndicator = newRowCountIndicator;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, IndicatorsPackage.COUNTS_INDICATOR__ROW_COUNT_INDICATOR, oldRowCountIndicator, newRowCountIndicator);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.talend.dataquality.indicators.RowCountIndicator in project tdq-studio-se by Talend.
the class InidcatorUnitTest method testGetIndicatorNameCase3.
/**
* Test method for {@link org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit#getIndicatorName()}.
*
* test case 3: Get Indicator Name from TableIndicatorUnit
*/
@Test
public void testGetIndicatorNameCase3() {
RowCountIndicator rowCountIndicator = IndicatorsFactory.eINSTANCE.createRowCountIndicator();
IRepositoryViewObject rowCountRepositoryViewObject = null;
try {
List<IRepositoryViewObject> all = ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.SYSTEM_INDICATORS_SIMPLE_STATISTICS);
Assert.assertEquals(10, all.size());
rowCountRepositoryViewObject = all.get(7);
} catch (PersistenceException e) {
Assert.fail(e.getMessage());
}
Assert.assertNotNull(rowCountRepositoryViewObject);
TDQIndicatorDefinitionItem rowCountItem = (TDQIndicatorDefinitionItem) rowCountRepositoryViewObject.getProperty().getItem();
rowCountIndicator.setIndicatorDefinition(rowCountItem.getIndicatorDefinition());
TableIndicatorUnit TableIndicatorUnit = new TableIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, rowCountIndicator, null);
Assert.assertEquals(org.talend.cwm.management.i18n.Messages.getString(rowCountItem.getProperty().getLabel()), TableIndicatorUnit.getIndicatorName());
}
use of org.talend.dataquality.indicators.RowCountIndicator in project tdq-studio-se by Talend.
the class InidcatorUnitTest method testGetFormsCase1.
/**
* Test method for {@link org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit#getForms()}.
*
* test case 1: Get Forms from ColumnSetIndicatorUnit
*/
@Test
public void testGetFormsCase1() {
RowCountIndicator rowCountIndicator = IndicatorsFactory.eINSTANCE.createRowCountIndicator();
IRepositoryViewObject rowCountRepositoryViewObject = null;
try {
List<IRepositoryViewObject> all = ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.SYSTEM_INDICATORS_SIMPLE_STATISTICS);
Assert.assertEquals(10, all.size());
rowCountRepositoryViewObject = all.get(7);
} catch (PersistenceException e) {
Assert.fail(e.getMessage());
}
Assert.assertNotNull(rowCountRepositoryViewObject);
TDQIndicatorDefinitionItem rowCountItem = (TDQIndicatorDefinitionItem) rowCountRepositoryViewObject.getProperty().getItem();
rowCountIndicator.setIndicatorDefinition(rowCountItem.getIndicatorDefinition());
ColumnSetIndicatorUnit columnSetIndicatorUnit = new ColumnSetIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, rowCountIndicator);
FormEnum[] forms = new FormEnum[] { FormEnum.IndicatorThresholdsForm };
FormEnum[] resultforms = columnSetIndicatorUnit.getForms();
Assert.assertEquals(forms.length, resultforms.length);
for (int index = 0; index < forms.length; index++) {
Assert.assertEquals(forms[index], resultforms[index]);
}
}
use of org.talend.dataquality.indicators.RowCountIndicator in project tdq-studio-se by Talend.
the class InidcatorUnitTest method testGetIndicatorNameCase2.
/**
* Test method for {@link org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit#getIndicatorName()}.
*
* test case 2: Get Indicator Name from ColumnIndicatorUnit
*/
@Test
public void testGetIndicatorNameCase2() {
RowCountIndicator rowCountIndicator = IndicatorsFactory.eINSTANCE.createRowCountIndicator();
IRepositoryViewObject rowCountRepositoryViewObject = null;
try {
List<IRepositoryViewObject> all = ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.SYSTEM_INDICATORS_SIMPLE_STATISTICS);
Assert.assertEquals(10, all.size());
rowCountRepositoryViewObject = all.get(7);
} catch (PersistenceException e) {
Assert.fail(e.getMessage());
}
Assert.assertNotNull(rowCountRepositoryViewObject);
TDQIndicatorDefinitionItem rowCountItem = (TDQIndicatorDefinitionItem) rowCountRepositoryViewObject.getProperty().getItem();
rowCountIndicator.setIndicatorDefinition(rowCountItem.getIndicatorDefinition());
ColumnIndicatorUnit columnIndicatorUnit = new ColumnIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum, rowCountIndicator, null);
Assert.assertEquals(org.talend.cwm.management.i18n.Messages.getString(rowCountItem.getProperty().getLabel()), columnIndicatorUnit.getIndicatorName());
}
Aggregations