Search in sources :

Example 6 with IAppSource

use of com.qlangtech.tis.manage.IAppSource in project tis by qlangtech.

the class TestStreamComponentCodeGeneratorFlink method testSingleTableCodeGenerator.

/**
 * 测试单表增量脚本生成
 *
 * @throws Exception
 */
public void testSingleTableCodeGenerator() throws Exception {
    // CoreAction.create
    // String topologyName = "employees4local";
    String collectionName = "mysql_elastic";
    IAppSource appSource = IAppSource.load(null, collectionName);
    assertTrue(appSource instanceof DataxProcessor);
    DataxProcessor dataXProcessor = (DataxProcessor) appSource;
    // Optional<ERRules> erRule = ERRules.getErRule(topologyName);
    // // 测试针对单表的的topology增量脚本生成
    long timestamp = 20191111115959l;
    // SqlTaskNodeMeta.SqlDataFlowTopology topology = SqlTaskNodeMeta.getSqlDataFlowTopology(topologyName);
    // assertNotNull(topology);
    // if (!erRule.isPresent()) {
    // ERRules.createDefaultErRule(topology);
    // }
    List<FacadeContext> facadeList = Lists.newArrayList();
    StreamComponentCodeGeneratorFlink streamCodeGenerator = new StreamComponentCodeGeneratorFlink(collectionName, timestamp, facadeList, (IBasicAppSource) appSource);
    // EasyMock.replay(streamIncrGenerateStrategy);
    streamCodeGenerator.build();
    TestStreamComponentCodeGenerator.assertGenerateContentEqual(timestamp, collectionName, "MysqlElasticListener.scala");
// EasyMock.verify(streamIncrGenerateStrategy);
}
Also used : DataxProcessor(com.qlangtech.tis.datax.impl.DataxProcessor) IAppSource(com.qlangtech.tis.manage.IAppSource)

Aggregations

IAppSource (com.qlangtech.tis.manage.IAppSource)6 SingleTableAppSource (com.qlangtech.tis.manage.impl.SingleTableAppSource)2 JSONObject (com.alibaba.fastjson.JSONObject)1 ActionProxy (com.opensymphony.xwork2.ActionProxy)1 ITISCoordinator (com.qlangtech.tis.cloud.ITISCoordinator)1 IDataxProcessor (com.qlangtech.tis.datax.IDataxProcessor)1 DataxProcessor (com.qlangtech.tis.datax.impl.DataxProcessor)1 Descriptor (com.qlangtech.tis.extension.Descriptor)1 AjaxValve (com.qlangtech.tis.manage.common.valve.AjaxValve)1 SqlTaskNodeMeta (com.qlangtech.tis.sql.parser.SqlTaskNodeMeta)1 ERRules (com.qlangtech.tis.sql.parser.er.ERRules)1 InputStream (java.io.InputStream)1