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);
});
}
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);
}
}
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);
});
}
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);
});
}
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);
});
}
Aggregations