Skip to content

Commit 157d2d9

Browse files
committed
refactor RunOrderParameters constructors
1 parent 1c06971 commit 157d2d9

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

surefire-api/src/main/java/org/apache/maven/surefire/api/testset/RunOrderParameters.java

+11-15
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
import java.io.File;
2323
import org.apache.maven.surefire.api.util.RunOrder;
2424

25+
import static org.apache.maven.surefire.api.util.RunOrder.ALPHABETICAL;
26+
import static org.apache.maven.surefire.api.util.RunOrder.DEFAULT;
27+
2528
/**
2629
* @author Kristian Rosenvold
2730
*/
28-
public class RunOrderParameters
31+
public final class RunOrderParameters
2932
{
3033
private final RunOrder[] runOrder;
3134

@@ -35,35 +38,29 @@ public class RunOrderParameters
3538

3639
public RunOrderParameters( RunOrder[] runOrder, File runStatisticsFile )
3740
{
38-
this.runOrder = runOrder;
39-
this.runStatisticsFile = runStatisticsFile;
40-
this.runOrderRandomSeed = null;
41+
this( runOrder, runStatisticsFile, null );
4142
}
4243

4344
public RunOrderParameters( String runOrder, File runStatisticsFile )
4445
{
45-
this.runOrder = runOrder == null ? RunOrder.DEFAULT : RunOrder.valueOfMulti( runOrder );
46-
this.runStatisticsFile = runStatisticsFile;
47-
this.runOrderRandomSeed = null;
46+
this( runOrder, runStatisticsFile, null );
4847
}
4948

50-
public RunOrderParameters( RunOrder[] runOrder, File runStatisticsFile, Long runOrderRandomSeed )
49+
public RunOrderParameters( String runOrder, File runStatisticsFile, Long runOrderRandomSeed )
5150
{
52-
this.runOrder = runOrder;
53-
this.runStatisticsFile = runStatisticsFile;
54-
this.runOrderRandomSeed = runOrderRandomSeed;
51+
this( runOrder == null ? DEFAULT : RunOrder.valueOfMulti( runOrder ), runStatisticsFile, runOrderRandomSeed );
5552
}
5653

57-
public RunOrderParameters( String runOrder, File runStatisticsFile, Long runOrderRandomSeed )
54+
public RunOrderParameters( RunOrder[] runOrder, File runStatisticsFile, Long runOrderRandomSeed )
5855
{
59-
this.runOrder = runOrder == null ? RunOrder.DEFAULT : RunOrder.valueOfMulti( runOrder );
56+
this.runOrder = runOrder;
6057
this.runStatisticsFile = runStatisticsFile;
6158
this.runOrderRandomSeed = runOrderRandomSeed;
6259
}
6360

6461
public static RunOrderParameters alphabetical()
6562
{
66-
return new RunOrderParameters( new RunOrder[]{ RunOrder.ALPHABETICAL }, null );
63+
return new RunOrderParameters( new RunOrder[]{ ALPHABETICAL }, null );
6764
}
6865

6966
public RunOrder[] getRunOrder()
@@ -80,5 +77,4 @@ public File getRunStatisticsFile()
8077
{
8178
return runStatisticsFile;
8279
}
83-
8480
}

0 commit comments

Comments
 (0)