Skip to content

Commit

Permalink
Show names of algorithms on parameterized tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gstamatelat committed Aug 22, 2022
1 parent 9b8a396 commit 007fbff
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/test/java/gr/james/sampling/RandomSamplingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public RandomSamplingTest(RandomSamplingImplementation<Integer> impl) {
this.collector = () -> impl.collector().apply(SAMPLE, RANDOM);
}

@Parameterized.Parameters()
@Parameterized.Parameters(name = "{0}")
public static Collection<RandomSamplingImplementation<Integer>> implementations() {
return Arrays.asList(
new WatermanImplementation<>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public StrictRandomSamplingTest(WeightedRandomSamplingImplementation<Integer> im
this.collector = () -> impl.weightedCollector().apply(SAMPLE, RANDOM);
}

@Parameterized.Parameters()
@Parameterized.Parameters(name = "{0}")
public static Collection<WeightedRandomSamplingImplementation<Integer>> implementations() {
return Arrays.asList(
new ChaoImplementation<>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ThreadSafeRandomSamplingTest(RandomSamplingImplementation<Integer> impl)
this.impl = () -> impl.implementation().apply(SAMPLE, RANDOM);
}

@Parameterized.Parameters()
@Parameterized.Parameters(name = "{0}")
public static Collection<RandomSamplingImplementation<Integer>> implementations() {
return Arrays.asList(
new LiLThreadSafeImplementation<>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public WeightedRandomSamplingTest(WeightedRandomSamplingImplementation<Integer>
this.collector = () -> impl.weightedCollector().apply(SAMPLE, RANDOM);
}

@Parameterized.Parameters()
@Parameterized.Parameters(name = "{0}")
public static Collection<RandomSamplingImplementation<Integer>> implementations() {
return Arrays.asList(
new EfraimidisImplementation<>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ public BiFunction<Integer, Random, WeightedRandomSampling<T>> weightedImplementa
public BiFunction<Integer, Random, WeightedRandomSamplingCollector<T>> weightedCollector() {
return ChaoSampling::weightedCollector;
}

@Override
public String toString() {
return "Chao";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ public BiFunction<Integer, Random, WeightedRandomSampling<T>> weightedImplementa
public BiFunction<Integer, Random, WeightedRandomSamplingCollector<T>> weightedCollector() {
return EfraimidisSampling::weightedCollector;
}

@Override
public String toString() {
return "Efraimidis";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ public BiFunction<Integer, Random, RandomSampling<T>> implementation() {
public BiFunction<Integer, Random, RandomSamplingCollector<T>> collector() {
return LiLSampling::collector;
}

@Override
public String toString() {
return "LiL";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ public BiFunction<Integer, Random, RandomSampling<T>> implementation() {
public BiFunction<Integer, Random, RandomSamplingCollector<T>> collector() {
return LiLSamplingThreadSafe::collector;
}

@Override
public String toString() {
return "LiLThreadSafe";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ public BiFunction<Integer, Random, WeightedRandomSampling<T>> weightedImplementa
public BiFunction<Integer, Random, WeightedRandomSamplingCollector<T>> weightedCollector() {
return ParetoSampling::weightedCollector;
}

@Override
public String toString() {
return "Pareto";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ public BiFunction<Integer, Random, WeightedRandomSampling<T>> weightedImplementa
public BiFunction<Integer, Random, WeightedRandomSamplingCollector<T>> weightedCollector() {
return SequentialPoissonSampling::weightedCollector;
}

@Override
public String toString() {
return "SequentialPoisson";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ public BiFunction<Integer, Random, RandomSampling<T>> implementation() {
public BiFunction<Integer, Random, RandomSamplingCollector<T>> collector() {
return VitterXSampling::collector;
}

@Override
public String toString() {
return "VitterX";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ public BiFunction<Integer, Random, RandomSampling<T>> implementation() {
public BiFunction<Integer, Random, RandomSamplingCollector<T>> collector() {
return VitterZSampling::collector;
}

@Override
public String toString() {
return "VitterZ";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ public BiFunction<Integer, Random, RandomSampling<T>> implementation() {
public BiFunction<Integer, Random, RandomSamplingCollector<T>> collector() {
return WatermanSampling::collector;
}

@Override
public String toString() {
return "Waterman";
}
}

0 comments on commit 007fbff

Please sign in to comment.