Search in sources :

Example 1 with DescriptorsJSON

use of com.qlangtech.tis.util.DescriptorsJSON in project plugins by qlangtech.

the class TestDataxMySQLReader method testDescriptorsJSONGenerate.

public void testDescriptorsJSONGenerate() {
    DataxMySQLReader esWriter = new DataxMySQLReader();
    DescriptorsJSON descJson = new DescriptorsJSON(esWriter.getDescriptor());
    // System.out.println(descJson.getDescriptorsJSON().toJSONString());
    JsonUtil.assertJSONEqual(DataxMySQLReader.class, "mysql-datax-reader-descriptor.json", descJson.getDescriptorsJSON(), (m, e, a) -> {
        assertEquals(m, e, a);
    });
    UploadPluginMeta pluginMeta = UploadPluginMeta.parse("dataxReader:require,targetDescriptorName_MySQL,subFormFieldName_selectedTabs,dataxName_baisuitestTestcase");
    JSONObject subFormDescriptorsJSON = descJson.getDescriptorsJSON(pluginMeta.getSubFormFilter());
    JsonUtil.assertJSONEqual(DataxMySQLReader.class, "mysql-datax-reader-selected-tabs-subform-descriptor.json", subFormDescriptorsJSON, (m, e, a) -> {
        assertEquals(m, e, a);
    });
}
Also used : JSONObject(com.alibaba.fastjson.JSONObject) DescriptorsJSON(com.qlangtech.tis.util.DescriptorsJSON) UploadPluginMeta(com.qlangtech.tis.util.UploadPluginMeta)

Example 2 with DescriptorsJSON

use of com.qlangtech.tis.util.DescriptorsJSON in project plugins by qlangtech.

the class PluginDesc method testDescGenerate.

public static <TT extends Describable> void testDescGenerate(Class<TT> clazz, String assertFileName) {
    try {
        TT plugin = clazz.newInstance();
        DescriptorsJSON descJson = new DescriptorsJSON(plugin.getDescriptor());
        JsonUtil.assertJSONEqual(clazz, assertFileName, descJson.getDescriptorsJSON(), (m, e, a) -> {
            Assert.assertEquals(m, e, a);
        });
    // return plugin;
    } catch (Exception e) {
        throw new RuntimeException(assertFileName, e);
    }
}
Also used : DescriptorsJSON(com.qlangtech.tis.util.DescriptorsJSON)

Example 3 with DescriptorsJSON

use of com.qlangtech.tis.util.DescriptorsJSON in project plugins by qlangtech.

the class TestDataXPostgresqlWriter method testDescriptorsJSONGenerate.

public void testDescriptorsJSONGenerate() {
    DataXPostgresqlWriter esWriter = new DataXPostgresqlWriter();
    DescriptorsJSON descJson = new DescriptorsJSON(esWriter.getDescriptor());
    JsonUtil.assertJSONEqual(DataXPostgresqlReader.class, "postgres-datax-writer-descriptor.json", descJson.getDescriptorsJSON(), (m, e, a) -> {
        Assert.assertEquals(m, e, a);
    });
}
Also used : DescriptorsJSON(com.qlangtech.tis.util.DescriptorsJSON)

Example 4 with DescriptorsJSON

use of com.qlangtech.tis.util.DescriptorsJSON in project plugins by qlangtech.

the class TestStarRocksSinkFactory method testDescriptorsJSONGenerate.

public void testDescriptorsJSONGenerate() {
    StarRocksSinkFactory sinkFactory = new StarRocksSinkFactory();
    DescriptorsJSON descJson = new DescriptorsJSON(sinkFactory.getDescriptor());
    JsonUtil.assertJSONEqual(StarRocksSinkFactory.class, "starrocks-sink-factory.json", descJson.getDescriptorsJSON(), (m, e, a) -> {
        assertEquals(m, e, a);
    });
}
Also used : DescriptorsJSON(com.qlangtech.tis.util.DescriptorsJSON)

Example 5 with DescriptorsJSON

use of com.qlangtech.tis.util.DescriptorsJSON in project plugins by qlangtech.

the class TestClickHouseSinkFactory method testDescriptorsJSONGenerate.

// public void test() {
// Path path = Paths.get("/tmp/tis-clickhouse-sink");
// System.out.println(Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS));
// }
public void testDescriptorsJSONGenerate() {
    ClickHouseSinkFactory sinkFactory = new ClickHouseSinkFactory();
    DescriptorsJSON descJson = new DescriptorsJSON(sinkFactory.getDescriptor());
    JsonUtil.assertJSONEqual(ClickHouseSinkFactory.class, "clickhouse-sink-factory.json", descJson.getDescriptorsJSON(), (m, e, a) -> {
        assertEquals(m, e, a);
    });
}
Also used : DescriptorsJSON(com.qlangtech.tis.util.DescriptorsJSON)

Aggregations

DescriptorsJSON (com.qlangtech.tis.util.DescriptorsJSON)22 JSONObject (com.alibaba.fastjson.JSONObject)7 DataxReader (com.qlangtech.tis.datax.impl.DataxReader)6 JsonUtil (com.qlangtech.tis.trigger.util.JsonUtil)5 Collectors (java.util.stream.Collectors)5 Lists (com.google.common.collect.Lists)4 Descriptor (com.qlangtech.tis.extension.Descriptor)4 File (java.io.File)4 FileUtils (org.apache.commons.io.FileUtils)4 PluginExtraProps (com.qlangtech.tis.extension.util.PluginExtraProps)3 StringUtils (org.apache.commons.lang.StringUtils)3 Context (com.alibaba.citrus.turbine.Context)2 JSON (com.alibaba.fastjson.JSON)2 Maps (com.google.common.collect.Maps)2 Pager (com.koubei.web.tag.pager.Pager)2 TIS (com.qlangtech.tis.TIS)2 FullbuildPhase (com.qlangtech.tis.assemble.FullbuildPhase)2 Assert (com.qlangtech.tis.common.utils.Assert)2 CoreAction (com.qlangtech.tis.coredefine.module.action.CoreAction)2 DataxAction (com.qlangtech.tis.coredefine.module.action.DataxAction)2