use of org.talend.dataquality.analysis.AnalysisParameters in project tdq-studio-se by Talend.
the class RespositoryDetailView method createAnaysisDetail.
private void createAnaysisDetail(Analysis ana) {
if (ana == null) {
return;
}
createName(ana);
createPurpose(ana);
createDescription(ana);
AnalysisParameters parameters = ana.getParameters();
String description = parameters == null ? null : parameters.getAnalysisType().getLiteral();
// $NON-NLS-1$
newLabelAndText(gContainer, DefaultMessagesImpl.getString("RespositoryDetailView.otherType"), description);
AnalysisContext context = ana.getContext();
int numn = context == null ? 0 : context.getAnalysedElements().size();
newLabelAndText(gContainer, DefaultMessagesImpl.getString("RespositoryDetailView.numberOfAnalyzedElements"), // $NON-NLS-1$
String.valueOf(numn));
DataManager connection = context == null ? null : context.getConnection();
if (connection == null) {
description = null;
} else {
description = connection.getName();
}
// $NON-NLS-1$
newLabelAndText(gContainer, DefaultMessagesImpl.getString("RespositoryDetailView.connection"), description);
}
use of org.talend.dataquality.analysis.AnalysisParameters in project tdq-studio-se by Talend.
the class AnalysisBaseBuilder method createAnalysisParameters.
private AnalysisParameters createAnalysisParameters(AnalysisType type) {
AnalysisParameters context = AnalysisFactory.eINSTANCE.createAnalysisParameters();
context.setAnalysisType(type);
return context;
}
use of org.talend.dataquality.analysis.AnalysisParameters in project tdq-studio-se by Talend.
the class UnitTestBuildHelper method createAndInitAnalysis.
public static Analysis createAndInitAnalysis() {
Analysis ana = UnitTestBuildHelper.createRealAnalysis("anaA", null, false);
AnalysisParameters parameters = AnalysisFactory.eINSTANCE.createAnalysisParameters();
parameters.setExecutionLanguage(ExecutionLanguage.SQL);
ana.setParameters(parameters);
AnalysisContext context = AnalysisFactory.eINSTANCE.createAnalysisContext();
ana.setContext(context);
Connection createConnection = ConnectionFactory.eINSTANCE.createConnection();
createConnection.setName("MySQL");
context.setConnection(createConnection);
return ana;
}
use of org.talend.dataquality.analysis.AnalysisParameters in project tdq-studio-se by Talend.
the class MatchAnalysisExecutorTest method testExecute.
/**
* Test method for
* {@link org.talend.dq.analysis.MatchAnalysisExecutor#execute(org.talend.dataquality.analysis.Analysis)}.
*/
@SuppressWarnings("nls")
@Test
public void testExecute() {
MatchAnalysisExecutor matchAnalysisExecutor = new MatchAnalysisExecutor();
Analysis analysis = AnalysisPackage.eINSTANCE.getAnalysisFactory().createAnalysis();
AnalysisContext context = AnalysisPackage.eINSTANCE.getAnalysisFactory().createAnalysisContext();
analysis.setContext(context);
AnalysisParameters params = AnalysisPackage.eINSTANCE.getAnalysisFactory().createAnalysisParameters();
analysis.setParameters(params);
TaggedValueHelper.setTaggedValue(analysis, TaggedValueHelper.PREVIEW_ROW_NUMBER, String.valueOf(100));
// analysisResult.setAnalysis(analysis);
context.setConnection(delimitedFileconnection);
// $NON-NLS-1$
URL fileUrl = this.getClass().getResource("match_test_data");
metadataTable = UnitTestBuildHelper.getDefault().initFileConnection(fileUrl, delimitedFileconnection);
this.name = UnitTestBuildHelper.getDefault().initColumns(context, this.metadataTable);
// Scenario 1
// - Match key: name, no block key, levenshtein attribute algorithm. groupQualityThreshold = 0.9d, matchInterval
// = 0.95d .
double groupQualityThreshold = 0.9d;
double matchInterval = 0.95d;
assertScenario1(matchAnalysisExecutor, analysis, name, "name", groupQualityThreshold, matchInterval);
// Scenario 2
// - Same to scenario 1, EXCEPT matchInterval = 0.8d .
matchInterval = 0.8d;
assertScenario2(matchAnalysisExecutor, analysis, name, "name", groupQualityThreshold, matchInterval);
// Scenario 3
// - Same to scenario 2, EXCEPT groupQualityThreshold = 0.95d.
groupQualityThreshold = 0.95d;
assertScenario3(matchAnalysisExecutor, analysis, name, "name", groupQualityThreshold, matchInterval);
// Scenario 4
// - Same to scenario 3, EXCEPT a new blocking key = country.
assertScenario4(matchAnalysisExecutor, analysis, name, "name", groupQualityThreshold, matchInterval);
}
use of org.talend.dataquality.analysis.AnalysisParameters in project tdq-studio-se by Talend.
the class TableAnalysisSqlExecutorTest method setUp.
/**
* DOC xqliu Comment method "setUp".
*
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
// create TdTable
TdTable testTdTable = RelationalFactory.eINSTANCE.createTdTable();
// $NON-NLS-1$
testTdTable.setName("generateTable");
// create connection
DatabaseConnection testDatabaseConnection = ConnectionFactory.eINSTANCE.createDatabaseConnection();
TaggedValueHelper.setTaggedValue(testDatabaseConnection, TaggedValueHelper.DB_PRODUCT_NAME, SupportDBUrlType.MYSQLDEFAULTURL.getDBKey());
// create catalog
Catalog testCatalog = orgomg.cwm.resource.relational.RelationalFactory.eINSTANCE.createCatalog();
// $NON-NLS-1$
testCatalog.setName("TBI");
testTdTable.setNamespace(testCatalog);
testCatalog.setNamespace(testDatabaseConnection);
testCatalog.getDataManager().add(testDatabaseConnection);
// create analysis
testAnalysis = AnalysisFactory.eINSTANCE.createAnalysis();
// create Analaysis result
AnalysisResult testAnalysisResult = AnalysisFactory.eINSTANCE.createAnalysisResult();
testAnalysis.setResults(testAnalysisResult);
// create analysis parameter
AnalysisParameters testAnalysisParameters = AnalysisFactory.eINSTANCE.createAnalysisParameters();
testAnalysis.setParameters(testAnalysisParameters);
// create analysis Content
AnalysisContext testAnalysisContext = AnalysisFactory.eINSTANCE.createAnalysisContext();
testAnalysis.setContext(testAnalysisContext);
testAnalysisContext.setConnection(testDatabaseConnection);
// create WhereRuleAide indicatorDefinition
testWhereRuleIndicatorDefinition = RulesFactory.eINSTANCE.createWhereRule();
// $NON-NLS-1$
testWhereRuleIndicatorDefinition.setLabel("rule1");
// create WhereRule indicator
testWhereRuleIndicator = IndicatorSqlFactory.eINSTANCE.createWhereRuleIndicator();
testAnalysisResult.getIndicators().add(testWhereRuleIndicator);
testWhereRuleIndicator.setAnalyzedElement(testTdTable);
testWhereRuleIndicator.setIndicatorDefinition(testWhereRuleIndicatorDefinition);
}
Aggregations