Skip to content

Commit

Permalink
add white list
Browse files Browse the repository at this point in the history
  • Loading branch information
liunaijie committed Feb 5, 2025
1 parent 4fde156 commit 79dab33
Showing 1 changed file with 81 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ public void checkConnectorOptionExist() {
}
NodeList<ClassOrInterfaceType>
implementedTypes =
classDeclaration
.getImplementedTypes();
classDeclaration
.getImplementedTypes();
implementedTypes.forEach(
implementedType -> {
if (implementedType
.getNameAsString()
.equals(
"SeaTunnelSource")
.getNameAsString()
.equals(
"SeaTunnelSource")
|| implementedType
.getNameAsString()
.equals(
"SeaTunnelSink")) {
.getNameAsString()
.equals(
"SeaTunnelSink")) {
connectorOptionFileNames.add(
path.getFileName()
.toString()
Expand Down Expand Up @@ -134,16 +134,88 @@ public void checkConnectorOptionExist() {
path.getFileName().toString().replace(JAVA_FILE_EXTENSION, "");
connectorOptionFileNames.remove(className);
});
connectorOptionFileNames.removeAll(buildWhiteList());
Assertions.assertEquals(
0,
connectorOptionFileNames.size(),
() ->
"Connector class does not have correspondingly [Options] class. "
+ "The connector need put all parameter into <ConnectorClassName>Options classes, like [ActivemqSink] and [ActivemqSinkOptions].\n"
+ "Those [Options] class are missing: \n"
+ String.join("\n", connectorOptionFileNames));
+ String.join("\n", connectorOptionFileNames)
+ "\n");
} catch (IOException e) {
throw new RuntimeException(e);
}
}

private Set<String> buildWhiteList() {
Set<String> whiteList = new HashSet<>();
whiteList.add("ElasticsearchSourceOptions");
whiteList.add("JdbcSinkOptions");
whiteList.add("TypesenseSourceOptions");
whiteList.add("RabbitmqSourceOptions");
whiteList.add("TypesenseSinkOptions");
whiteList.add("EmailSinkOptions");
whiteList.add("HudiSinkOptions");
whiteList.add("PulsarSinkOptions");
whiteList.add("HttpSinkOptions");
whiteList.add("SlsSinkOptions");
whiteList.add("DingTalkSinkOptions");
whiteList.add("Neo4jSinkOptions");
whiteList.add("SlackSinkOptions");
whiteList.add("MaxcomputeSinkOptions");
whiteList.add("PaimonSinkOptions");
whiteList.add("TDengineSourceOptions");
whiteList.add("PulsarSourceOptions");
whiteList.add("RedisSinkOptions");
whiteList.add("DruidSinkOptions");
whiteList.add("FakeSourceOptions");
whiteList.add("HbaseSinkOptions");
whiteList.add("MongodbSinkOptions");
whiteList.add("IoTDBSinkOptions");
whiteList.add("ActivemqSinkOptions");
whiteList.add("EasysearchSourceOptions");
whiteList.add("RabbitmqSinkOptions");
whiteList.add("StarRocksSourceOptions");
whiteList.add("AmazonSqsSinkOptions");
whiteList.add("IcebergSourceOptions");
whiteList.add("HbaseSourceOptions");
whiteList.add("PaimonSourceOptions");
whiteList.add("IoTDBSourceOptions");
whiteList.add("SlsSourceOptions");
whiteList.add("SentrySinkOptions");
whiteList.add("EasysearchSinkOptions");
whiteList.add("QdrantSinkOptions");
whiteList.add("ElasticsearchSinkOptions");
whiteList.add("MilvusSourceOptions");
whiteList.add("RocketMqSinkOptions");
whiteList.add("ClickhouseFileSinkOptions");
whiteList.add("IcebergSinkOptions");
whiteList.add("KafkaSourceOptions");
whiteList.add("AssertSinkOptions");
whiteList.add("MaxcomputeSourceOptions");
whiteList.add("InfluxDBSourceOptions");
whiteList.add("InfluxDBSinkOptions");
whiteList.add("CassandraSinkOptions");
whiteList.add("KuduSourceOptions");
whiteList.add("SocketSinkOptions");
whiteList.add("DataHubSinkOptions");
whiteList.add("ClickhouseSinkOptions");
whiteList.add("SelectDBSinkOptions");
whiteList.add("ConsoleSinkOptions");
whiteList.add("PrometheusSinkOptions");
whiteList.add("FirestoreSinkOptions");
whiteList.add("ClickhouseSourceOptions");
whiteList.add("MilvusSinkOptions");
whiteList.add("RocketMqSourceOptions");
whiteList.add("TablestoreSinkOptions");
whiteList.add("TableStoreDBSourceOptions");
whiteList.add("AmazonDynamoDBSinkOptions");
whiteList.add("KuduSinkOptions");
whiteList.add("KafkaSinkOptions");
whiteList.add("TDengineSinkOptions");
return whiteList;
}

}

0 comments on commit 79dab33

Please sign in to comment.