jt2594838 commented on code in PR #16851:
URL: https://github.com/apache/iotdb/pull/16851#discussion_r2583447645
##########
integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java:
##########
@@ -757,4 +758,64 @@ public void testValidPipeWithoutWithSink() {
fail(e.getMessage());
}
}
+
+ @Test
+ public void testPipePluginValidation() {
+ try (final Connection connection = senderEnv.getConnection();
+ final Statement statement = connection.createStatement()) {
+ try {
+ statement.execute(
+ "create pipePlugin TestProcessor as
'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'xxx'");
+ fail();
+ } catch (final SQLException e) {
+ Assert.assertEquals(
+ "701: Untrusted uri xxx, current trusted_uri_pattern is file:.*",
e.getMessage());
+ }
+ try {
+ statement.execute(
+ "create pipePlugin TestProcessor as
'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI 'file:.*'");
+ fail();
+ } catch (final SQLException e) {
+ Assert.assertEquals("701: URI is not hierarchical", e.getMessage());
+ }
+ try {
+ statement.execute(
+ String.format(
+ "create pipePlugin TestProcessor as
'org.apache.iotdb.db.pipe.example.TestProcessor' USING URI '%s'",
+ new File(
+ System.getProperty("user.dir")
+ + File.separator
+ + "target"
+ + File.separator
+ + "test-classes"
+ + File.separator)
+ .toURI()
+ + "PipePlugin.jar"));
+ fail();
+ } catch (final SQLException e) {
+ Assert.assertEquals(
+ "1603: Failed to get executable for PipePlugin DO-NOTHING-SINK,
please check the URI.",
+ e.getMessage());
Review Comment:
The error message is not consistent.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]