This is an automated email from the ASF dual-hosted git repository.
fanrui pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new ad47f4630 [hotfix] Fix code style of junit5 test cases (#1911)
ad47f4630 is described below
commit ad47f463012ae8c6aa8b175416b6c2ae8b0fa2df
Author: Roc Marshal <[email protected]>
AuthorDate: Wed Oct 26 23:25:07 2022 +0800
[hotfix] Fix code style of junit5 test cases (#1911)
---
.../benmanes/caffeine/cache/RefreshCacheTest.java | 4 ++--
.../util/concurrent/CompletableFutureTest.java | 8 +++----
.../src/test/java/java/util/regex/RegexTest.java | 10 ++++-----
.../org/apache/commons/mail/SendEmailTest.java | 6 ++---
.../console/base/util/FileUtilsTest.java | 8 +++----
.../console/base/util/ShaHashUtilsTest.java | 4 ++--
.../console/core/entity/DependencyTest.java | 4 ++--
.../streampark/console/core/entity/GitTest.java | 8 +++----
.../console/core/enums/AlertTypeTest.java | 2 +-
.../core/service/ApplicationServiceTest.java | 8 +++----
.../console/core/service/VariableServiceTest.java | 6 ++---
.../core/service/alert/AlertServiceTest.java | 12 +++++-----
.../console/system/authentication/JWTTest.java | 4 ++--
.../flink/repl/test/FlinkInterpreterTest.java | 6 ++---
.../java/org/apache/streampark/RegExpTest.java | 10 ++++-----
.../streampark/plugin/profiling/AgentITCase.java | 12 +++++-----
.../plugin/profiling/AgentThreadFactoryTest.java | 4 ++--
.../streampark/plugin/profiling/ArgumentsTest.java | 24 ++++++++++----------
.../plugin/profiling/ProfilerRunnableTest.java | 4 ++--
.../plugin/profiling/YamlConfigProviderTest.java | 8 +++----
.../profiler/CpuAndMemoryProfilerTest.java | 4 ++--
.../profiler/MethodArgumentProfilerTest.java | 4 ++--
.../profiler/MethodDurationProfilerTest.java | 4 ++--
.../profiler/ProcessInfoProfilerTest.java | 4 ++--
.../profiler/StacktraceCollectorProfilerTest.java | 8 +++----
.../profiler/StacktraceReporterProfilerTest.java | 4 ++--
.../profiling/profiler/ThreadInfoProfilerTest.java | 4 ++--
.../reporter/ConsoleOutputReporterTest.java | 4 ++--
.../transformer/MethodProfilerStaticProxyTest.java | 10 ++++-----
.../profiling/util/ClassAndMethodFilterTest.java | 10 ++++-----
.../util/ClassAndMethodMetricBufferTest.java | 6 ++---
.../util/ClassMethodArgmentMetricBufferTest.java | 6 ++---
.../util/ClassMethodArgumentFilterTest.java | 10 ++++-----
.../plugin/profiling/util/IOUtilsTest.java | 4 ++--
.../plugin/profiling/util/ProcFileUtilsTest.java | 26 +++++++++++-----------
.../plugin/profiling/util/ReflectionUtilsTest.java | 4 ++--
.../plugin/profiling/util/SparkUtilsTest.java | 12 ++++------
.../profiling/util/StacktraceMetricBufferTest.java | 4 ++--
.../plugin/profiling/util/StringUtilsTest.java | 12 +++++-----
.../src/main/java/org/apache/streampark/Main.java | 24 --------------------
.../streampark/storage/oss/OssStorageService.java | 4 ++--
.../storage/oss/OssStorageServiceTest.java | 4 ++--
42 files changed, 148 insertions(+), 176 deletions(-)
diff --git
a/streampark-console/streampark-console-service/src/test/java/com/github/benmanes/caffeine/cache/RefreshCacheTest.java
b/streampark-console/streampark-console-service/src/test/java/com/github/benmanes/caffeine/cache/RefreshCacheTest.java
index 4b88c8ce6..7457748c4 100644
---
a/streampark-console/streampark-console-service/src/test/java/com/github/benmanes/caffeine/cache/RefreshCacheTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/com/github/benmanes/caffeine/cache/RefreshCacheTest.java
@@ -22,12 +22,12 @@ import org.junit.jupiter.api.Test;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
-public class RefreshCacheTest {
+class RefreshCacheTest {
Cache<String, String> caffeine = null;
@Test
- public void cache() throws Exception {
+ void cache() throws Exception {
if (caffeine == null) {
caffeine = Caffeine.newBuilder()
.refreshAfterWrite(50, TimeUnit.MILLISECONDS)
diff --git
a/streampark-console/streampark-console-service/src/test/java/java/util/concurrent/CompletableFutureTest.java
b/streampark-console/streampark-console-service/src/test/java/java/util/concurrent/CompletableFutureTest.java
index 849fc855d..0ba35631d 100644
---
a/streampark-console/streampark-console-service/src/test/java/java/util/concurrent/CompletableFutureTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/java/util/concurrent/CompletableFutureTest.java
@@ -24,10 +24,10 @@ import org.junit.jupiter.api.Test;
import java.util.concurrent.atomic.AtomicBoolean;
-public class CompletableFutureTest {
+class CompletableFutureTest {
@Test
- public void testStartJobNormally() throws Exception {
+ void testStartJobNormally() throws Exception {
// It takes 5 seconds to start job.
CompletableFuture<String> future = CompletableFuture.supplyAsync(() ->
runStart(5));
@@ -52,7 +52,7 @@ public class CompletableFutureTest {
}
@Test
- public void testStopJobEarly() throws Exception {
+ void testStopJobEarly() throws Exception {
// It takes 10 seconds to start job.
CompletableFuture<String> future = CompletableFuture.supplyAsync(() ->
runStart(10));
@@ -84,7 +84,7 @@ public class CompletableFutureTest {
}
@Test
- public void testStartJobTimeout() throws Exception {
+ void testStartJobTimeout() throws Exception {
// It takes 10 seconds to start job.
CompletableFuture<String> future = CompletableFuture.supplyAsync(() ->
runStart(10));
diff --git
a/streampark-console/streampark-console-service/src/test/java/java/util/regex/RegexTest.java
b/streampark-console/streampark-console-service/src/test/java/java/util/regex/RegexTest.java
index 22846f614..4805aeb8d 100644
---
a/streampark-console/streampark-console-service/src/test/java/java/util/regex/RegexTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/java/util/regex/RegexTest.java
@@ -30,10 +30,10 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
-public class RegexTest {
+class RegexTest {
@Test
- public void regex() {
+ void regex() {
String jar = "streampark-flink-shims_flink-1.11-1.1.0-SNAPSHOT.jar";
String shimsRegex =
"streampark-flink-shims_flink-(1.11|1.12)-(.*).jar$";
Pattern pattern = Pattern.compile(shimsRegex, Pattern.CASE_INSENSITIVE
| Pattern.DOTALL);
@@ -45,7 +45,7 @@ public class RegexTest {
}
@Test
- public void classLoader() throws MalformedURLException {
+ void classLoader() throws MalformedURLException {
List<URL> libCache = new ArrayList<>(0);
List<URL> shimsCache = new ArrayList<>(0);
String regex =
"(^|.*)streampark-flink-shims_flink-(1.12|1.13|1.14|1.15)-(.*).jar$";
@@ -79,7 +79,7 @@ public class RegexTest {
}
@Test
- public void flinkVersion() {
+ void flinkVersion() {
final Pattern flinkVersionPattern = Pattern.compile("^Version: (.*),
Commit ID: (.*)$");
String flinkHome = System.getenv("FLINK_HOME");
String libPath = flinkHome.concat("/lib");
@@ -107,7 +107,7 @@ public class RegexTest {
}
@Test
- public void jobName() {
+ void jobName() {
final Pattern jobNamePattern =
Pattern.compile("^[.\\x{4e00}-\\x{9fa5}A-Za-z0-9_\\-\\s]+$");
String jobName = "flink-sql demo";
if (jobNamePattern.matcher(jobName).matches()) {
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/commons/mail/SendEmailTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/commons/mail/SendEmailTest.java
index 5b16a62d9..7ce35bdca 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/commons/mail/SendEmailTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/commons/mail/SendEmailTest.java
@@ -35,14 +35,14 @@ import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
-public class SendEmailTest {
+class SendEmailTest {
private Template template;
private SenderEmail senderEmail;
@BeforeEach
- public void initConfig() throws Exception {
+ void initConfig() throws Exception {
this.template = FreemarkerUtils.loadTemplateFile("alert-email.ftl");
senderEmail = new SenderEmail();
senderEmail.setFrom("****@domain.com");
@@ -54,7 +54,7 @@ public class SendEmailTest {
}
@Test
- public void alert() {
+ void alert() {
Application application = new Application();
application.setStartTime(new Date());
application.setJobName("Test My Job");
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/FileUtilsTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/FileUtilsTest.java
index 60aa2f516..61f7f8f18 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/FileUtilsTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/FileUtilsTest.java
@@ -31,10 +31,10 @@ import java.util.Random;
/**
* Test for {@link FileUtils}
*/
-public class FileUtilsTest {
+class FileUtilsTest {
@Test
- public void testReadEndOfFile(@TempDir Path tempDir) throws IOException {
+ void testReadEndOfFile(@TempDir Path tempDir) throws IOException {
Path filePath = tempDir.resolve("tmp_file");
File file = filePath.toFile();
FileOutputStream outputStream = new FileOutputStream(file);
@@ -63,7 +63,7 @@ public class FileUtilsTest {
}
@Test
- public void testReadEndOfFileWithChinese(@TempDir Path tempDir) throws
IOException {
+ void testReadEndOfFileWithChinese(@TempDir Path tempDir) throws
IOException {
Path filePath = tempDir.resolve("tmp_file");
File file = filePath.toFile();
PrintWriter writer = new PrintWriter(file);
@@ -77,7 +77,7 @@ public class FileUtilsTest {
}
@Test
- public void testReadFileFromOffset(@TempDir Path tempDir) throws
IOException {
+ void testReadFileFromOffset(@TempDir Path tempDir) throws IOException {
Path filePath = tempDir.resolve("tmp_file");
File file = filePath.toFile();
FileOutputStream outputStream = new FileOutputStream(file);
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/ShaHashUtilsTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/ShaHashUtilsTest.java
index 9e28dea8a..fc83f3e0b 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/ShaHashUtilsTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/ShaHashUtilsTest.java
@@ -23,10 +23,10 @@ import org.junit.jupiter.api.Test;
/**
* Test for {@link ShaHashUtils}
*/
-public class ShaHashUtilsTest {
+class ShaHashUtilsTest {
@Test
- public void testEncrypt() {
+ void testEncrypt() {
String randomSalt = "rh8b1ojwog777yrg0daesf04gk";
String encryptPassword = ShaHashUtils.encrypt(randomSalt,
"streampark");
Assertions.assertEquals("2513f3748847298ea324dffbf67fe68681dd92315bda830065facd8efe08f54f",
encryptPassword);
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/entity/DependencyTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/entity/DependencyTest.java
index 4576c05ce..d242b96f6 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/entity/DependencyTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/entity/DependencyTest.java
@@ -31,10 +31,10 @@ import java.util.TimerTask;
import scala.collection.JavaConversions;
@Slf4j
-public class DependencyTest {
+class DependencyTest {
@Test
- public void resolveMavenDependencies() {
+ void resolveMavenDependencies() {
/**
* <dependency>
* <groupId>org.apache.flink</groupId>
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/entity/GitTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/entity/GitTest.java
index c90c1977f..5428ed0bb 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/entity/GitTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/entity/GitTest.java
@@ -24,23 +24,23 @@ import org.junit.jupiter.api.Test;
import java.util.List;
-public class GitTest {
+class GitTest {
private final Project project = new Project();
@BeforeEach
- public void before() {
+ void before() {
project.setUrl("https://github.com/streamxhub/streampark-quickstart");
}
@Test
- public void getBranchs() {
+ void getBranchs() {
List<String> branches = project.getAllBranches();
branches.forEach(System.out::println);
}
@Test
- public void auth() {
+ void auth() {
GitAuthorizedError error = project.gitCheck();
System.out.println(error);
}
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/enums/AlertTypeTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/enums/AlertTypeTest.java
index d0c02b2c4..0ac92eb08 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/enums/AlertTypeTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/enums/AlertTypeTest.java
@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.List;
-public class AlertTypeTest {
+class AlertTypeTest {
@Test
void decodeTest() {
List<AlertType> notifyTypes = AlertType.decode(5);
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java
index 60bd0c736..c6fc0c06f 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java
@@ -39,13 +39,13 @@ import java.util.Date;
*/
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = StreamParkConsoleBootstrap.class, webEnvironment =
SpringBootTest.WebEnvironment.RANDOM_PORT)
-public class ApplicationServiceTest {
+class ApplicationServiceTest {
@Autowired
private ApplicationService applicationService;
@Test
- public void revokeTest() {
+ void revokeTest() {
Date now = new Date();
Application app = new Application();
app.setId(100001L);
@@ -83,7 +83,7 @@ public class ApplicationServiceTest {
}
@Test
- public void start() throws Exception {
+ void start() throws Exception {
Application application = new Application();
application.setId(1304056220683497473L);
application.setFlameGraph(false);
@@ -95,7 +95,7 @@ public class ApplicationServiceTest {
}
@Test
- public void uploadTest() throws Exception {
+ void uploadTest() throws Exception {
File file = new File(""); // specify the file path
MultipartFile mulFile = new MockMultipartFile(
"", // fileName (eg: streampark.jar)
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/VariableServiceTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/VariableServiceTest.java
index daf4191fb..c4ffac7cf 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/VariableServiceTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/VariableServiceTest.java
@@ -32,7 +32,7 @@ import
org.springframework.test.context.junit.jupiter.SpringExtension;
*/
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = StreamParkConsoleBootstrap.class, webEnvironment =
SpringBootTest.WebEnvironment.RANDOM_PORT)
-public class VariableServiceTest {
+class VariableServiceTest {
@Autowired
private VariableService variableService;
@@ -41,7 +41,7 @@ public class VariableServiceTest {
* Test whether the variable will be replaced normally
*/
@Test
- public void testNormalReplace() {
+ void testNormalReplace() {
Long teamId = 100000L;
Long userId = 100000L;
String variableCode = "collect_kafka.brokers-520room";
@@ -64,7 +64,7 @@ public class VariableServiceTest {
* Test whether the variable cannot be replaced normally
*/
@Test
- public void testAbnormalReplace() {
+ void testAbnormalReplace() {
Long teamId = 100000L;
Long userId = 100000L;
// It contains a non-normal character '#' which should not be matched
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/alert/AlertServiceTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/alert/AlertServiceTest.java
index e64a9dbbd..224e1d660 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/alert/AlertServiceTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/alert/AlertServiceTest.java
@@ -35,14 +35,14 @@ import org.springframework.web.client.RestTemplate;
import java.util.Date;
import java.util.TimeZone;
-public class AlertServiceTest {
+class AlertServiceTest {
AlertTemplate alertTemplate;
AlertConfigWithParams params = new AlertConfigWithParams();
ObjectMapper mapper = new ObjectMapper();
RestTemplate restTemplate = new RestTemplate();
@BeforeEach
- public void before1() {
+ void before1() {
alertTemplate = new AlertTemplate();
alertTemplate.setTitle("Notify: StreamPark alert job for test");
alertTemplate.setSubject("StreamPark Alert: test-job OTHER");
@@ -59,7 +59,7 @@ public class AlertServiceTest {
alertTemplate.setDuration(DateUtils.toRichTimeDuration(0));
}
- public void before2() {
+ void before2() {
alertTemplate = new AlertTemplate();
alertTemplate.setTitle("Alert: StreamPark alert job for test");
alertTemplate.setSubject("StreamPark Alert: test-job OTHER");
@@ -76,7 +76,7 @@ public class AlertServiceTest {
}
@Test
- public void dingTalkAlertTest() throws Exception {
+ void dingTalkAlertTest() throws Exception {
DingTalkAlertNotifyServiceImpl notifyService = new
DingTalkAlertNotifyServiceImpl(restTemplate);
notifyService.loadTemplateFile();
@@ -92,7 +92,7 @@ public class AlertServiceTest {
}
@Test
- public void weComAlertTest() throws Exception {
+ void weComAlertTest() throws Exception {
WeComAlertNotifyServiceImpl notifyService = new
WeComAlertNotifyServiceImpl(restTemplate);
notifyService.loadTemplateFile();
@@ -106,7 +106,7 @@ public class AlertServiceTest {
}
@Test
- public void larkAlertTest() {
+ void larkAlertTest() {
LarkAlertNotifyServiceImpl notifyService = new
LarkAlertNotifyServiceImpl(restTemplate, mapper);
notifyService.loadTemplateFile();
diff --git
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/system/authentication/JWTTest.java
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/system/authentication/JWTTest.java
index d7382dcd1..24a5f122c 100644
---
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/system/authentication/JWTTest.java
+++
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/system/authentication/JWTTest.java
@@ -28,10 +28,10 @@ import java.util.Date;
import java.util.TimeZone;
import java.util.UUID;
-public class JWTTest {
+class JWTTest {
@Test
- public void getExpireTime() {
+ void getExpireTime() {
String userName = "black";
String secret = UUID.randomUUID().toString();
String expireTime = AccessToken.DEFAULT_EXPIRE_TIME;
diff --git
a/streampark-flink/streampark-flink-repl/src/test/java/org/apache/streampark/flink/repl/test/FlinkInterpreterTest.java
b/streampark-flink/streampark-flink-repl/src/test/java/org/apache/streampark/flink/repl/test/FlinkInterpreterTest.java
index 1cca1a292..d00c8f89a 100644
---
a/streampark-flink/streampark-flink-repl/src/test/java/org/apache/streampark/flink/repl/test/FlinkInterpreterTest.java
+++
b/streampark-flink/streampark-flink-repl/src/test/java/org/apache/streampark/flink/repl/test/FlinkInterpreterTest.java
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
import java.util.Properties;
-public class FlinkInterpreterTest {
+class FlinkInterpreterTest {
private static final Logger LOGGER =
LoggerFactory.getLogger(FlinkInterpreterTest.class);
@@ -54,7 +54,7 @@ public class FlinkInterpreterTest {
}
@Test
- public void testWordCount() {
+ void testWordCount() {
try {
InterpreterOutput out = new InterpreterOutput(line -> {
@@ -82,7 +82,7 @@ public class FlinkInterpreterTest {
}
@Test
- public void testStream() {
+ void testStream() {
String code = "\n" +
"%flink.execution.mode=yarn\n" +
"// the host and the port to connect to\n" +
diff --git
a/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/test/java/org/apache/streampark/RegExpTest.java
b/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/test/java/org/apache/streampark/RegExpTest.java
index 8c1e15661..78cc878c6 100644
---
a/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/test/java/org/apache/streampark/RegExpTest.java
+++
b/streampark-flink/streampark-flink-shims/streampark-flink-shims-base/src/test/java/org/apache/streampark/RegExpTest.java
@@ -25,7 +25,7 @@ import java.util.regex.Pattern;
/**
* some simple tests
*/
-public class RegExpTest {
+class RegExpTest {
/**
* Case insensitive, matches everything as one line, . matches newlines,
note: \s matches any whitespace character, including newlines
@@ -39,7 +39,7 @@ public class RegExpTest {
private static final Pattern CREATE_HIVE_CATALOG =
Pattern.compile("CREATE\\s+CATALOG\\s+.+", DEFAULT_PATTERN_FLAGS);
@Test
- public void testCreateHiveCatalog() {
+ void testCreateHiveCatalog() {
String str = "create catalog hive with (\n" +
" 'type' = 'hive',\n" +
" 'hadoop-conf-dir' =
'D:\\IDEAWorkspace\\work\\baishan\\log\\data-max\\src\\main\\resources',\n" +
@@ -58,7 +58,7 @@ public class RegExpTest {
DEFAULT_PATTERN_FLAGS);
@Test
- public void testCreateFunction() {
+ void testCreateFunction() {
String str = "create function if not exists hive.get_json_value as
'com.flink.function.JsonValueFunction' language java";
Matcher matcher = CREATE_FUNCTION.matcher(str);
System.out.println(matcher.matches());
@@ -70,7 +70,7 @@ public class RegExpTest {
private static final Pattern USE_DATABASE =
Pattern.compile("USE\\s+(?!(CATALOG|MODULES)).*", DEFAULT_PATTERN_FLAGS);
@Test
- public void testUseDatabase() {
+ void testUseDatabase() {
String str = "use modul.a ";
Matcher matcher = USE_DATABASE.matcher(str);
System.out.println(matcher.matches());
@@ -82,7 +82,7 @@ public class RegExpTest {
private static final Pattern SHOW_FUNCTIONS =
Pattern.compile("SHOW\\s+(USER\\s+|)FUNCTIONS", DEFAULT_PATTERN_FLAGS);
@Test
- public void testShowFunction() {
+ void testShowFunction() {
String str = "show user functions";
Matcher matcher = SHOW_FUNCTIONS.matcher(str);
System.out.println(matcher.matches());
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/AgentITCase.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/AgentITCase.java
index 9b23ed15b..9e278e4bd 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/AgentITCase.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/AgentITCase.java
@@ -30,10 +30,10 @@ import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
-public class AgentITCase {
+class AgentITCase {
@Test
- public void runAgent() throws InterruptedException, IOException {
+ void runAgent() throws InterruptedException, IOException {
String javaHome = System.getProperty("java.home");
String javaBin = Paths.get(javaHome,
"bin/java").toAbsolutePath().toString();
@@ -107,7 +107,7 @@ public class AgentITCase {
}
@Test
- public void runAgent_noop() throws InterruptedException, IOException {
+ void runAgent_noop() throws InterruptedException, IOException {
String javaHome = System.getProperty("java.home");
String javaBin = Paths.get(javaHome,
"bin/java").toAbsolutePath().toString();
@@ -142,7 +142,7 @@ public class AgentITCase {
}
@Test
- public void runAgent_noopConfigProvider() throws InterruptedException,
IOException {
+ void runAgent_noopConfigProvider() throws InterruptedException,
IOException {
String javaHome = System.getProperty("java.home");
String javaBin = Paths.get(javaHome,
"bin/java").toAbsolutePath().toString();
@@ -177,7 +177,7 @@ public class AgentITCase {
}
@Test
- public void runAgent_argumentProfilingZero() throws InterruptedException,
IOException {
+ void runAgent_argumentProfilingZero() throws InterruptedException,
IOException {
String javaHome = System.getProperty("java.home");
String javaBin = Paths.get(javaHome,
"bin/java").toAbsolutePath().toString();
@@ -243,7 +243,7 @@ public class AgentITCase {
}
@Test
- public void runAgent_appIdVariable() throws InterruptedException,
IOException {
+ void runAgent_appIdVariable() throws InterruptedException, IOException {
String javaHome = System.getProperty("java.home");
String javaBin = Paths.get(javaHome,
"bin/java").toAbsolutePath().toString();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/AgentThreadFactoryTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/AgentThreadFactoryTest.java
index f074b18f0..bb553b5f5 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/AgentThreadFactoryTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/AgentThreadFactoryTest.java
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
import java.util.concurrent.atomic.AtomicInteger;
-public class AgentThreadFactoryTest {
+class AgentThreadFactoryTest {
@Test
- public void newThread() throws InterruptedException {
+ void newThread() throws InterruptedException {
final AtomicInteger i = new AtomicInteger(10);
AgentThreadFactory threadFactory = new AgentThreadFactory();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/ArgumentsTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/ArgumentsTest.java
index 3d9ae8687..73998ea2c 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/ArgumentsTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/ArgumentsTest.java
@@ -30,10 +30,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-public class ArgumentsTest {
+class ArgumentsTest {
@Test
- public void allArguments() {
+ void allArguments() {
Arguments arguments =
Arguments.parseArgs(
"reporter=org.apache.streampark.plugin.profiling.ArgumentsTest$DummyReporter,durationProfiling=a.bc.foo,metricInterval=123,appIdVariable=APP_ID1,appIdRegex=app123,argumentProfiling=package1.class1.method1.1");
@@ -53,7 +53,7 @@ public class ArgumentsTest {
}
@Test
- public void emptyArguments() {
+ void emptyArguments() {
Arguments arguments = Arguments.parseArgs("");
Assertions.assertEquals(0, arguments.getRawArgValues().size());
Assertions.assertFalse(arguments.isNoop());
@@ -67,13 +67,13 @@ public class ArgumentsTest {
}
@Test()
- public void emptyArgumentValue() {
+ void emptyArgumentValue() {
Assertions.assertThrows(IllegalArgumentException.class,
() ->
Arguments.parseArgs("reporter=,durationProfiling=,metricInterval=,appIdRegex=,"));
}
@Test
- public void noop() {
+ void noop() {
Arguments arguments =
Arguments.parseArgs("durationProfiling=a.bc.foo,noop=true,durationProfiling=ab.c.d.test");
Assertions.assertEquals(2, arguments.getRawArgValues().size());
@@ -82,7 +82,7 @@ public class ArgumentsTest {
}
@Test
- public void durationProfiling() {
+ void durationProfiling() {
Arguments arguments =
Arguments.parseArgs("durationProfiling=a.bc.foo,durationProfiling=ab.c.d.test");
Assertions.assertEquals(2, arguments.getDurationProfiling().size());
@@ -94,7 +94,7 @@ public class ArgumentsTest {
}
@Test
- public void argumentProfiling() {
+ void argumentProfiling() {
Arguments arguments =
Arguments.parseArgs("durationProfiling=a.bc.foo,durationProfiling=ab.c.d.test");
Assertions.assertEquals(2, arguments.getDurationProfiling().size());
@@ -106,7 +106,7 @@ public class ArgumentsTest {
}
@Test
- public void setReporter() {
+ void setReporter() {
Arguments arguments = Arguments.parseArgs("");
arguments.setReporter("org.apache.streampark.plugin.profiling.ArgumentsTest$DummyReporter");
@@ -115,7 +115,7 @@ public class ArgumentsTest {
}
@Test
- public void setConfigProvider() {
+ void setConfigProvider() {
Arguments arguments = Arguments.parseArgs("");
arguments.setConfigProvider(
@@ -125,7 +125,7 @@ public class ArgumentsTest {
}
@Test
- public void processConfigProvider_DummyConfigProvider() {
+ void processConfigProvider_DummyConfigProvider() {
Arguments arguments =
Arguments.parseArgs(
"tag=tag1,cluster=cluster1,metricInterval=1000,ioProfiling=true,durationProfiling=a.bc.foo,durationProfiling=ab.c.d.test,configProvider=org.apache.streampark.plugin.profiling.ArgumentsTest$DummyConfigProvider");
@@ -144,7 +144,7 @@ public class ArgumentsTest {
}
@Test
- public void processConfigProvider_SimpleConfigProvider() {
+ void processConfigProvider_SimpleConfigProvider() {
Arguments arguments =
Arguments.parseArgs(
"tag=tag1,metricInterval=1000,ioProfiling=true,durationProfiling=a.bc.foo,durationProfiling=ab.c.d.test,configProvider=org.apache.streampark.plugin.profiling.ArgumentsTest$SimpleConfigProvider");
@@ -162,7 +162,7 @@ public class ArgumentsTest {
}
@Test
- public void processConfigProvider_OverrideConfigProvider() {
+ void processConfigProvider_OverrideConfigProvider() {
Arguments arguments =
Arguments.parseArgs(
"tag=tag1,metricInterval=1000,ioProfiling=true,durationProfiling=a.bc.foo,durationProfiling=ab.c.d.test,configProvider=org.apache.streampark.plugin.profiling.ArgumentsTest$OverrideConfigProvider");
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/ProfilerRunnableTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/ProfilerRunnableTest.java
index 4ba4aefcf..749c9186b 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/ProfilerRunnableTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/ProfilerRunnableTest.java
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
import java.util.concurrent.atomic.AtomicInteger;
-public class ProfilerRunnableTest {
+class ProfilerRunnableTest {
@Test
- public void invokeRunnable() {
+ void invokeRunnable() {
final AtomicInteger i = new AtomicInteger(10);
ProfilerRunner profilerRunnable =
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/YamlConfigProviderTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/YamlConfigProviderTest.java
index adfebd80e..74f042bbf 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/YamlConfigProviderTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/YamlConfigProviderTest.java
@@ -30,10 +30,10 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
-public class YamlConfigProviderTest {
+class YamlConfigProviderTest {
@Test
- public void getConfig() throws IOException {
+ void getConfig() throws IOException {
{
YamlConfigProvider provider = new
YamlConfigProvider("not_exiting_file");
Assertions.assertEquals(0, provider.getConfig().size());
@@ -95,14 +95,14 @@ public class YamlConfigProviderTest {
}
@Test
- public void getConfigFromBadHttpUrl() throws IOException {
+ void getConfigFromBadHttpUrl() {
YamlConfigProvider provider = new
YamlConfigProvider("http://localhost/bad_url");
Map<String, Map<String, List<String>>> config = provider.getConfig();
Assertions.assertEquals(0, config.size());
}
@Test
- public void getConfigFromFile() throws IOException {
+ void getConfigFromFile() throws IOException {
String content =
"key1: value1\n"
+ "key2:\n"
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/CpuAndMemoryProfilerTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/CpuAndMemoryProfilerTest.java
index a060ffffd..fffc3c3a6 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/CpuAndMemoryProfilerTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/CpuAndMemoryProfilerTest.java
@@ -26,10 +26,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-public class CpuAndMemoryProfilerTest {
+class CpuAndMemoryProfilerTest {
@Test
- public void profile() {
+ void profile() {
final List<String> nameList = new ArrayList<>();
final List<Map<String, Object>> metricList = new ArrayList<>();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/MethodArgumentProfilerTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/MethodArgumentProfilerTest.java
index fc24d7c36..8488c3130 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/MethodArgumentProfilerTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/MethodArgumentProfilerTest.java
@@ -28,10 +28,10 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-public class MethodArgumentProfilerTest {
+class MethodArgumentProfilerTest {
@Test
- public void profile() {
+ void profile() {
final List<String> nameList = new ArrayList<>();
final List<Map<String, Object>> metricList = new ArrayList<>();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/MethodDurationProfilerTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/MethodDurationProfilerTest.java
index 7fb673eeb..3f08e762a 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/MethodDurationProfilerTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/MethodDurationProfilerTest.java
@@ -28,10 +28,10 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-public class MethodDurationProfilerTest {
+class MethodDurationProfilerTest {
@Test
- public void profile() {
+ void profile() {
final List<String> nameList = new ArrayList<>();
final List<Map<String, Object>> metricList = new ArrayList<>();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/ProcessInfoProfilerTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/ProcessInfoProfilerTest.java
index cebf1db37..eed3fbfaa 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/ProcessInfoProfilerTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/ProcessInfoProfilerTest.java
@@ -28,10 +28,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-public class ProcessInfoProfilerTest {
+class ProcessInfoProfilerTest {
@Test
- public void profile() {
+ void profile() {
final List<String> nameList = new ArrayList<>();
final List<Map<String, Object>> metricList = new ArrayList<>();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/StacktraceCollectorProfilerTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/StacktraceCollectorProfilerTest.java
index a5e3c3963..f51b73ac5 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/StacktraceCollectorProfilerTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/StacktraceCollectorProfilerTest.java
@@ -30,10 +30,10 @@ import java.util.Map;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicLong;
-public class StacktraceCollectorProfilerTest {
+class StacktraceCollectorProfilerTest {
@Test
- public void profile() throws InterruptedException {
+ void profile() throws InterruptedException {
StacktraceMetricBuffer buffer = new StacktraceMetricBuffer();
StacktraceCollectorProfiler profiler = new
StacktraceCollectorProfiler(buffer, null);
@@ -124,7 +124,7 @@ public class StacktraceCollectorProfilerTest {
}
@Test
- public void profile_ignoreThread() throws InterruptedException {
+ void profile_ignoreThread() throws InterruptedException {
StacktraceMetricBuffer buffer = new StacktraceMetricBuffer();
StacktraceCollectorProfiler profiler = new
StacktraceCollectorProfiler(buffer, "testDummy");
@@ -205,7 +205,7 @@ public class StacktraceCollectorProfilerTest {
}
@Test
- public void profile_largeStack() throws InterruptedException {
+ void profile_largeStack() throws InterruptedException {
StacktraceMetricBuffer buffer = new StacktraceMetricBuffer();
StacktraceCollectorProfiler profiler = new
StacktraceCollectorProfiler(buffer, null, 20000);
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/StacktraceReporterProfilerTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/StacktraceReporterProfilerTest.java
index 369aebdc2..6ca71fc38 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/StacktraceReporterProfilerTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/StacktraceReporterProfilerTest.java
@@ -29,10 +29,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-public class StacktraceReporterProfilerTest {
+class StacktraceReporterProfilerTest {
@Test
- public void profile() {
+ void profile() {
final List<String> nameList = new ArrayList<>();
final List<Map<String, Object>> metricList = new ArrayList<>();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/ThreadInfoProfilerTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/ThreadInfoProfilerTest.java
index 87445d471..a505a15f8 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/ThreadInfoProfilerTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/profiler/ThreadInfoProfilerTest.java
@@ -26,10 +26,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-public class ThreadInfoProfilerTest {
+class ThreadInfoProfilerTest {
@Test
- public void profile() {
+ void profile() {
final List<String> nameList = new ArrayList<>();
final List<Map<String, Object>> metricList = new ArrayList<>();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/reporter/ConsoleOutputReporterTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/reporter/ConsoleOutputReporterTest.java
index ad0250941..66b3c7b36 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/reporter/ConsoleOutputReporterTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/reporter/ConsoleOutputReporterTest.java
@@ -21,10 +21,10 @@ import org.junit.jupiter.api.Test;
import java.util.HashMap;
-public class ConsoleOutputReporterTest {
+class ConsoleOutputReporterTest {
@Test
- public void report() {
+ void report() {
ConsoleOutputReporter reporter = new ConsoleOutputReporter();
reporter.report("Test", new HashMap<String, Object>());
}
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/transformer/MethodProfilerStaticProxyTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/transformer/MethodProfilerStaticProxyTest.java
index 264133569..1d1fc796e 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/transformer/MethodProfilerStaticProxyTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/transformer/MethodProfilerStaticProxyTest.java
@@ -30,23 +30,23 @@ import org.junit.jupiter.api.Test;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
-public class MethodProfilerStaticProxyTest {
+class MethodProfilerStaticProxyTest {
private ClassMethodArgumentMetricBuffer buffer;
@BeforeEach
- public void before() {
+ void before() {
buffer = new ClassMethodArgumentMetricBuffer();
MethodArgumentCollector collector = new
MethodArgumentCollector(buffer);
MethodProfilerStaticProxy.setArgumentCollector(collector);
}
@AfterEach
- public void after() {
+ void after() {
MethodProfilerStaticProxy.setCollector(null);
}
@Test
- public void collectMethodArgument_nullValue() {
+ void collectMethodArgument_nullValue() {
MethodProfilerStaticProxy.collectMethodArgument("class1", "method1",
1, null);
MethodProfilerStaticProxy.collectMethodArgument("class1", "method1",
1, null);
@@ -60,7 +60,7 @@ public class MethodProfilerStaticProxyTest {
}
@Test
- public void collectMethodArgument_veryLongValue() {
+ void collectMethodArgument_veryLongValue() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < Constants.MAX_STRING_LENGTH; i++) {
sb.append('a');
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodFilterTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodFilterTest.java
index ea7646053..9a39eb4ae 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodFilterTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodFilterTest.java
@@ -23,10 +23,10 @@ import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collections;
-public class ClassAndMethodFilterTest {
+class ClassAndMethodFilterTest {
@Test
- public void matchClass() {
+ void matchClass() {
ClassAndMethodFilter filter = new ClassAndMethodFilter(null);
Assertions.assertFalse(filter.matchMethod("class1", "method1"));
@@ -59,7 +59,7 @@ public class ClassAndMethodFilterTest {
}
@Test
- public void matchMethod() {
+ void matchMethod() {
ClassAndMethodFilter filter = new ClassAndMethodFilter(null);
Assertions.assertFalse(filter.matchMethod("class1", "method1"));
@@ -80,7 +80,7 @@ public class ClassAndMethodFilterTest {
}
@Test
- public void matchMethod_wildcard() {
+ void matchMethod_wildcard() {
ClassAndMethodFilter filter =
new ClassAndMethodFilter(Collections.singletonList(new
ClassAndMethod("class1", "")));
Assertions.assertFalse(filter.matchMethod("class1", "method1"));
@@ -92,7 +92,7 @@ public class ClassAndMethodFilterTest {
}
@Test
- public void matchMethod_prefix() {
+ void matchMethod_prefix() {
ClassAndMethodFilter filter =
new ClassAndMethodFilter(
Arrays.asList(
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodMetricBufferTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodMetricBufferTest.java
index f05078295..09f90d965 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodMetricBufferTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassAndMethodMetricBufferTest.java
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
import java.util.Map;
-public class ClassAndMethodMetricBufferTest {
+class ClassAndMethodMetricBufferTest {
@Test
- public void appendValue() {
+ void appendValue() {
ClassAndMethodLongMetricBuffer buffer = new
ClassAndMethodLongMetricBuffer();
buffer.appendValue("class1", "method1", "metric1", 11);
buffer.appendValue("class1", "method2", "metric1", 22);
@@ -61,7 +61,7 @@ public class ClassAndMethodMetricBufferTest {
}
@Test
- public void appendValue_concurrent() throws InterruptedException {
+ void appendValue_concurrent() throws InterruptedException {
ClassAndMethodLongMetricBuffer buffer = new
ClassAndMethodLongMetricBuffer();
String[] classNames = new String[] {"class1", "class2", "class1",
"class2", "class101"};
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgmentMetricBufferTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgmentMetricBufferTest.java
index 73534bc1b..89463f167 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgmentMetricBufferTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgmentMetricBufferTest.java
@@ -23,10 +23,10 @@ import org.junit.jupiter.api.Test;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
-public class ClassMethodArgmentMetricBufferTest {
+class ClassMethodArgmentMetricBufferTest {
@Test
- public void appendValue() {
+ void appendValue() {
ClassMethodArgumentMetricBuffer buffer = new
ClassMethodArgumentMetricBuffer();
buffer.appendValue("class1", "method1", "arg1");
buffer.appendValue("class1", "method2", "arg1");
@@ -53,7 +53,7 @@ public class ClassMethodArgmentMetricBufferTest {
}
@Test
- public void appendValue_concurrent() throws InterruptedException {
+ void appendValue_concurrent() throws InterruptedException {
ClassMethodArgumentMetricBuffer buffer = new
ClassMethodArgumentMetricBuffer();
String[] classNames = new String[] {"class1", "class2", "class1",
"class2", "class101"};
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgumentFilterTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgumentFilterTest.java
index dbec99dad..db7147692 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgumentFilterTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ClassMethodArgumentFilterTest.java
@@ -23,10 +23,10 @@ import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collections;
-public class ClassMethodArgumentFilterTest {
+class ClassMethodArgumentFilterTest {
@Test
- public void matchClass() {
+ void matchClass() {
ClassMethodArgumentFilter filter = new ClassMethodArgumentFilter(null);
Assertions.assertEquals(0, filter.matchMethod("class1",
"method1").size());
@@ -63,7 +63,7 @@ public class ClassMethodArgumentFilterTest {
}
@Test
- public void matchMethod() {
+ void matchMethod() {
ClassMethodArgumentFilter filter = new ClassMethodArgumentFilter(null);
Assertions.assertEquals(0, filter.matchMethod("class1",
"method1").size());
@@ -91,7 +91,7 @@ public class ClassMethodArgumentFilterTest {
}
@Test
- public void matchMethod_wildcard() {
+ void matchMethod_wildcard() {
ClassMethodArgumentFilter filter =
new ClassMethodArgumentFilter(Collections.singletonList(new
ClassMethodArgument("class1", "", 10)));
Assertions.assertEquals(0, filter.matchMethod("class1",
"method1").size());
@@ -106,7 +106,7 @@ public class ClassMethodArgumentFilterTest {
}
@Test
- public void matchMethod_prefix() {
+ void matchMethod_prefix() {
ClassMethodArgumentFilter filter =
new ClassMethodArgumentFilter(
Arrays.asList(
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/IOUtilsTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/IOUtilsTest.java
index 9734ab5af..5f616678f 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/IOUtilsTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/IOUtilsTest.java
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
import java.io.ByteArrayInputStream;
-public class IOUtilsTest {
+class IOUtilsTest {
@Test
- public void toByteArray() {
+ void toByteArray() {
byte[] bytes = new byte[] {1, 2, 3};
ByteArrayInputStream byteArrayInputStream = new
ByteArrayInputStream(bytes);
byte[] result = Utils.toByteArray(byteArrayInputStream);
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ProcFileUtilsTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ProcFileUtilsTest.java
index a8b88844d..02445571b 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ProcFileUtilsTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ProcFileUtilsTest.java
@@ -29,10 +29,10 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
-public class ProcFileUtilsTest {
+class ProcFileUtilsTest {
@Test
- public void getProcFileAsMap() throws IOException {
+ void getProcFileAsMap() throws IOException {
File file = File.createTempFile("test", "test");
file.deleteOnExit();
@@ -56,31 +56,31 @@ public class ProcFileUtilsTest {
}
@Test
- public void getProcFileAsMap_NotExistingFile() {
+ void getProcFileAsMap_NotExistingFile() {
Map<String, String> result =
ProcFileUtils.getProcFileAsMap("/not/existing/file");
Assertions.assertEquals(0, result.size());
}
@Test
- public void getProcFileAsMap_Directory() {
+ void getProcFileAsMap_Directory() {
Map<String, String> result = ProcFileUtils.getProcFileAsMap("/");
Assertions.assertEquals(0, result.size());
}
@Test
- public void getProcFileAsRowColumn_NotExistingFile() {
+ void getProcFileAsRowColumn_NotExistingFile() {
List<String[]> result =
ProcFileUtils.getProcFileAsRowColumn("/not/existing/file");
Assertions.assertEquals(0, result.size());
}
@Test
- public void getProcFileAsRowColumn_Directory() {
+ void getProcFileAsRowColumn_Directory() {
List<String[]> result = ProcFileUtils.getProcFileAsRowColumn("/");
Assertions.assertEquals(0, result.size());
}
@Test
- public void getProcStatus_DefaultFile() {
+ void getProcStatus_DefaultFile() {
Map<String, String> result = ProcFileUtils.getProcStatus();
// Mac has no proc file so result will be empty.
@@ -94,7 +94,7 @@ public class ProcFileUtilsTest {
}
@Test
- public void getProcIO_DefaultFile() {
+ void getProcIO_DefaultFile() {
Map<String, String> result = ProcFileUtils.getProcIO();
// Mac has no proc file so result will be empty.
@@ -108,7 +108,7 @@ public class ProcFileUtilsTest {
}
@Test
- public void getBytesValue() throws IOException {
+ void getBytesValue() throws IOException {
{
Map<String, String> map = Collections.emptyMap();
Long bytesValue = ProcFileUtils.getBytesValue(map, "VmRSS");
@@ -304,7 +304,7 @@ public class ProcFileUtilsTest {
}
@Test
- public void getProcStatCpuTime() throws IOException {
+ void getProcStatCpuTime() throws IOException {
{
Assertions.assertEquals(0,
ProcFileUtils.getProcStatCpuTime(null).size());
Assertions.assertEquals(0, ProcFileUtils.getProcStatCpuTime(new
ArrayList<>()).size());
@@ -359,7 +359,7 @@ public class ProcFileUtilsTest {
}
@Test
- public void getPid_NoValue() throws IOException {
+ void getPid_NoValue() throws IOException {
File file = File.createTempFile("test", "test");
file.deleteOnExit();
@@ -371,7 +371,7 @@ public class ProcFileUtilsTest {
}
@Test
- public void getPid_HasValue() throws IOException {
+ void getPid_HasValue() throws IOException {
File file = File.createTempFile("test", "test");
file.deleteOnExit();
@@ -384,7 +384,7 @@ public class ProcFileUtilsTest {
}
@Test
- public void getCmdline() throws IOException {
+ void getCmdline() {
String result = ProcFileUtils.getCmdline();
Assertions.assertTrue(result == null || !result.isEmpty());
}
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ReflectionUtilsTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ReflectionUtilsTest.java
index 6fb131205..d1bfe6a25 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ReflectionUtilsTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/ReflectionUtilsTest.java
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
import java.lang.reflect.InvocationTargetException;
-public class ReflectionUtilsTest {
+class ReflectionUtilsTest {
@Test
- public void executeStaticMethods()
+ void executeStaticMethods()
throws ClassNotFoundException, NoSuchMethodException,
IllegalAccessException,
InvocationTargetException {
Object result =
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/SparkUtilsTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/SparkUtilsTest.java
index fd53b9287..ef91d1873 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/SparkUtilsTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/SparkUtilsTest.java
@@ -22,25 +22,21 @@ import org.apache.streampark.plugin.profiling.Arguments;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-import java.lang.reflect.InvocationTargetException;
-
-public class SparkUtilsTest {
+class SparkUtilsTest {
@Test
- public void probeAppId() {
+ void probeAppId() {
Assertions.assertNull(SparkUtils.probeAppId(Arguments.ARG_APP_ID_REGEX));
Assertions.assertEquals("jar", SparkUtils.probeAppId("jar"));
}
@Test
- public void getAppId()
- throws ClassNotFoundException, NoSuchMethodException,
IllegalAccessException,
- InvocationTargetException {
+ void getAppId() {
Assertions.assertNull(SparkUtils.getSparkEnvAppId());
}
@Test
- public void probeRole() {
+ void probeRole() {
Assertions.assertEquals(
"executor",
SparkUtils.probeRole("java
org.apache.spark.executor.CoarseGrainedExecutorBackend"));
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/StacktraceMetricBufferTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/StacktraceMetricBufferTest.java
index 63f2696d8..97659bd12 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/StacktraceMetricBufferTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/StacktraceMetricBufferTest.java
@@ -25,10 +25,10 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
-public class StacktraceMetricBufferTest {
+class StacktraceMetricBufferTest {
@Test
- public void appendValue() {
+ void appendValue() {
StacktraceMetricBuffer buffer = new StacktraceMetricBuffer();
Set<Stacktrace> distinctStacktraces = new HashSet<>();
diff --git
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/StringUtilsTest.java
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/StringUtilsTest.java
index 69eb24402..41d9d86cd 100644
---
a/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/StringUtilsTest.java
+++
b/streampark-plugin/streampark-jvm-profiler/src/test/java/org/apache/streampark/plugin/profiling/util/StringUtilsTest.java
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
import java.util.List;
-public class StringUtilsTest {
+class StringUtilsTest {
@Test
- public void splitByLength() {
+ void splitByLength() {
List<String> list = StringUtils.splitByLength("a", 1);
Assertions.assertEquals(1, list.size());
Assertions.assertEquals("a", list.get(0));
@@ -48,7 +48,7 @@ public class StringUtilsTest {
}
@Test
- public void extractByRegex() {
+ void extractByRegex() {
Assertions.assertEquals(0, StringUtils.extractByRegex(null,
null).size());
Assertions.assertEquals(1, StringUtils.extractByRegex("", "").size());
Assertions.assertEquals("", StringUtils.extractByRegex("", "").get(0));
@@ -70,7 +70,7 @@ public class StringUtilsTest {
}
@Test
- public void getValueAsBytes() {
+ void getValueAsBytes() {
Assertions.assertNull(StringUtils.getBytesValueOrNull(null));
Assertions.assertNull(StringUtils.getBytesValueOrNull(""));
Assertions.assertNull(StringUtils.getBytesValueOrNull("xxx"));
@@ -106,7 +106,7 @@ public class StringUtilsTest {
}
@Test
- public void getArgumentValue() {
+ void getArgumentValue() {
Assertions.assertNull(StringUtils.getArgumentValue(null, null));
Assertions.assertNull(StringUtils.getArgumentValue(null, ""));
Assertions.assertNull(StringUtils.getArgumentValue("", null));
@@ -138,7 +138,7 @@ public class StringUtilsTest {
}
@Test
- public void getArgumentValues() {
+ void getArgumentValues() {
Assertions.assertArrayEquals(new String[0],
StringUtils.getArgumentValues(null, null));
Assertions.assertArrayEquals(new String[0],
StringUtils.getArgumentValues(null, ""));
Assertions.assertArrayEquals(new String[0],
StringUtils.getArgumentValues("", null));
diff --git a/streampark-storage/src/main/java/org/apache/streampark/Main.java
b/streampark-storage/src/main/java/org/apache/streampark/Main.java
deleted file mode 100644
index 3104d8f5e..000000000
--- a/streampark-storage/src/main/java/org/apache/streampark/Main.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.streampark;
-
-public class Main {
- public static void main(String[] args) {
- System.out.println("Hello world!");
- }
-}
diff --git
a/streampark-storage/src/main/java/org/apache/streampark/storage/oss/OssStorageService.java
b/streampark-storage/src/main/java/org/apache/streampark/storage/oss/OssStorageService.java
index c7efd1309..1e6b562e9 100644
---
a/streampark-storage/src/main/java/org/apache/streampark/storage/oss/OssStorageService.java
+++
b/streampark-storage/src/main/java/org/apache/streampark/storage/oss/OssStorageService.java
@@ -53,7 +53,7 @@ public class OssStorageService implements StorageService {
try {
ossClient.getObject(new GetObjectRequest(bucket, objectPath), new
File(localFilePath));
} catch (Exception e) {
- log.error("GetData failed. ObjectPath: %s, local path: %s.",
objectPath, localFilePath, e);
+ log.error("GetData failed. ObjectPath: {}, local path: {}.",
objectPath, localFilePath, e);
throw handleOssException(e);
}
}
@@ -64,7 +64,7 @@ public class OssStorageService implements StorageService {
PutObjectRequest putObjectRequest = new
PutObjectRequest(ossConfig.getBucket(), objectPath, new File(localFilePath));
ossClient.putObject(putObjectRequest);
} catch (Exception e) {
- log.error("PutData failed. ObjectPath: %s, local path: %s.",
objectPath, localFilePath, e);
+ log.error("PutData failed. ObjectPath: {}, local path: {}.",
objectPath, localFilePath, e);
throw handleOssException(e);
}
}
diff --git
a/streampark-storage/src/test/java/org/apache/streampark/storage/oss/OssStorageServiceTest.java
b/streampark-storage/src/test/java/org/apache/streampark/storage/oss/OssStorageServiceTest.java
index 4ccbbd710..0056272ba 100644
---
a/streampark-storage/src/test/java/org/apache/streampark/storage/oss/OssStorageServiceTest.java
+++
b/streampark-storage/src/test/java/org/apache/streampark/storage/oss/OssStorageServiceTest.java
@@ -22,10 +22,10 @@ import com.aliyun.oss.OSSException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class OssStorageServiceTest {
+class OssStorageServiceTest {
@Test
- public void testHandleException() throws Exception {
+ void testHandleException() {
OSSException ossException = new OSSException("mock error",
"MOCK_CODE", "requestId", "hostId", "header", "resource", "GET");
RuntimeException exp =
OssStorageService.handleOssException(ossException);
Assertions.assertEquals("Caught an OSSException. Error Message: mock
error. Error Code: MOCK_CODE. Request ID: requestId", exp.getMessage());