1919
2020package org .elasticsearch .test ;
2121
22- import java .io .File ;
2322import java .io .IOException ;
2423import java .lang .reflect .Modifier ;
2524import java .nio .file .FileVisitResult ;
3130import java .util .HashSet ;
3231import java .util .Objects ;
3332import java .util .Set ;
34- import java .util .regex .Pattern ;
3533
3634/**
3735 * Checks that all tests in a directory are named according to our naming conventions. This is important because tests that do not follow
@@ -49,7 +47,7 @@ public class NamingConventionsCheck {
4947 public static void main (String [] args ) throws IOException {
5048 Class <?> testClass = null ;
5149 Class <?> integTestClass = null ;
52- String rootPathList = null ;
50+ Path rootPath = null ;
5351 boolean skipIntegTestsInDisguise = false ;
5452 boolean selfTest = false ;
5553 boolean checkMainClasses = false ;
@@ -72,21 +70,18 @@ public static void main(String[] args) throws IOException {
7270 checkMainClasses = true ;
7371 break ;
7472 case "--" :
75- rootPathList = args [++i ];
73+ rootPath = Paths . get ( args [++i ]) ;
7674 break ;
7775 default :
7876 fail ("unsupported argument '" + arg + "'" );
7977 }
8078 }
8179
8280 NamingConventionsCheck check = new NamingConventionsCheck (testClass , integTestClass );
83- for (String rootDir : rootPathList .split (Pattern .quote (File .pathSeparator ))) {
84- Path rootPath = Paths .get (rootDir );
85- if (checkMainClasses ) {
86- check .checkMain (rootPath );
87- } else {
88- check .checkTests (rootPath , skipIntegTestsInDisguise );
89- }
81+ if (checkMainClasses ) {
82+ check .checkMain (rootPath );
83+ } else {
84+ check .checkTests (rootPath , skipIntegTestsInDisguise );
9085 }
9186
9287 if (selfTest ) {
0 commit comments