Skip to content

Commit ced4673

Browse files
committed
tidying
1 parent 5a95e9f commit ced4673

File tree

52 files changed

+505
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+505
-129
lines changed

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/math/RangedBigDecimalNoMinWithLesserSpecifiedPrecisionPropertyParameterTest.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,53 @@ a copy of this software and associated documentation files (the
3737
import java.math.BigInteger;
3838
import java.util.List;
3939

40-
public class RangedBigDecimalNoMinWithLesserSpecifiedPrecisionPropertyParameterTest
40+
public class
41+
RangedBigDecimalNoMinWithLesserSpecifiedPrecisionPropertyParameterTest
4142
extends BasicGeneratorPropertyParameterTest {
4243

4344
@InRange(max = "987654321987654321.09876")
4445
@Precision(scale = 3)
4546
public static final BigDecimal TYPE_BEARER = null;
4647

47-
private final BigDecimal max = new BigDecimal("987654321987654321.09876");
48+
private final BigDecimal max =
49+
new BigDecimal("987654321987654321.09876");
4850
private final BigInteger maxBigInt = max.movePointRight(5).toBigInteger();
4951

5052
@Override protected void primeSourceOfRandomness() {
5153
when(randomForParameterGenerator.nextBigInteger(
52-
maxBigInt.subtract(maxBigInt.subtract(TEN.movePointRight(5).toBigInteger())).bitLength()))
54+
maxBigInt.subtract(
55+
maxBigInt.subtract(TEN.movePointRight(5).toBigInteger()))
56+
.bitLength()))
5357
.thenReturn(new BigInteger("6"));
5458
when(randomForParameterGenerator.nextBigInteger(
55-
maxBigInt.subtract(maxBigInt.subtract(TEN.pow(2).movePointRight(5).toBigInteger())).bitLength()))
59+
maxBigInt.subtract(
60+
maxBigInt.subtract(TEN.pow(2).movePointRight(5).toBigInteger()))
61+
.bitLength()))
5662
.thenReturn(new BigInteger("35"));
57-
when(distro.sampleWithMean(1, randomForParameterGenerator)).thenReturn(0);
58-
when(distro.sampleWithMean(2, randomForParameterGenerator)).thenReturn(1);
63+
when(distro.sampleWithMean(1, randomForParameterGenerator))
64+
.thenReturn(0);
65+
when(distro.sampleWithMean(2, randomForParameterGenerator))
66+
.thenReturn(1);
5967
}
6068

6169
@Override protected int trials() {
6270
return 2;
6371
}
6472

6573
@Override protected List<?> randomValues() {
66-
return asList(new BigDecimal("987654321987654311.09882"), new BigDecimal("987654321987654221.09911"));
74+
return asList(
75+
new BigDecimal("987654321987654311.09882"),
76+
new BigDecimal("987654321987654221.09911"));
6777
}
6878

6979
@Override public void verifyInteractionWithRandomness() {
7080
verify(randomForParameterGenerator).nextBigInteger(
71-
maxBigInt.subtract(maxBigInt.subtract(TEN.movePointRight(5).toBigInteger())).bitLength());
81+
maxBigInt.subtract(
82+
maxBigInt.subtract(TEN.movePointRight(5).toBigInteger()))
83+
.bitLength());
7284
verify(randomForParameterGenerator).nextBigInteger(
73-
maxBigInt.subtract(maxBigInt.subtract(TEN.pow(2).movePointRight(5).toBigInteger())).bitLength());
85+
maxBigInt.subtract(
86+
maxBigInt.subtract(TEN.pow(2).movePointRight(5).toBigInteger()))
87+
.bitLength());
7488
}
7589
}

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/math/RangedBigDecimalPropertyParameterTest.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,22 @@ a copy of this software and associated documentation files (the
4242
public class RangedBigDecimalPropertyParameterTest
4343
extends BasicGeneratorPropertyParameterTest {
4444

45-
@InRange(min = "-12345678123456781234567812345.678", max = "9876543219876543.21")
45+
@InRange(
46+
min = "-12345678123456781234567812345.678",
47+
max = "9876543219876543.21")
4648
public static final BigDecimal TYPE_BEARER = null;
4749

48-
private final BigDecimal min = new BigDecimal("-12345678123456781234567812345.678");
50+
private final BigDecimal min =
51+
new BigDecimal("-12345678123456781234567812345.678");
4952
private final BigDecimal max = new BigDecimal("9876543219876543.21");
5053
private int numberOfBits;
5154

5255
@Override protected void primeSourceOfRandomness() {
53-
numberOfBits = max.movePointRight(3).subtract(min.movePointRight(3)).toBigInteger().bitLength();
56+
numberOfBits =
57+
max.movePointRight(3)
58+
.subtract(min.movePointRight(3))
59+
.toBigInteger()
60+
.bitLength();
5461
when(randomForParameterGenerator.nextBigInteger(numberOfBits))
5562
.thenReturn(new BigInteger("2").pow(numberOfBits).subtract(ONE))
5663
.thenReturn(ONE)
@@ -72,6 +79,7 @@ public class RangedBigDecimalPropertyParameterTest
7279
}
7380

7481
@Override public void verifyInteractionWithRandomness() {
75-
verify(randomForParameterGenerator, times(5)).nextBigInteger(numberOfBits);
82+
verify(randomForParameterGenerator, times(5))
83+
.nextBigInteger(numberOfBits);
7684
}
7785
}

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/math/RangedBigDecimalWithGreaterSpecifiedPrecisionPropertyParameterTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,23 @@ a copy of this software and associated documentation files (the
4444
public class RangedBigDecimalWithGreaterSpecifiedPrecisionPropertyParameterTest
4545
extends BasicGeneratorPropertyParameterTest {
4646

47-
@InRange(min = "-12345678123456781234567812345.678", max = "9876543219876543.21")
47+
@InRange(
48+
min = "-12345678123456781234567812345.678",
49+
max = "9876543219876543.21")
4850
@Precision(scale = 6)
4951
public static final BigDecimal TYPE_BEARER = null;
5052

51-
private final BigDecimal min = new BigDecimal("-12345678123456781234567812345.678");
53+
private final BigDecimal min =
54+
new BigDecimal("-12345678123456781234567812345.678");
5255
private final BigDecimal max = new BigDecimal("9876543219876543.21");
5356
private int numberOfBits;
5457

5558
@Override protected void primeSourceOfRandomness() {
56-
numberOfBits = max.movePointRight(6).subtract(min.movePointRight(6)).toBigInteger().bitLength();
59+
numberOfBits =
60+
max.movePointRight(6)
61+
.subtract(min.movePointRight(6))
62+
.toBigInteger()
63+
.bitLength();
5764
when(randomForParameterGenerator.nextBigInteger(numberOfBits))
5865
.thenReturn(new BigInteger("2").pow(numberOfBits).subtract(ONE))
5966
.thenReturn(ONE)

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/math/RangedBigDecimalWithLesserSpecifiedPrecisionPropertyParameterTest.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,23 @@ a copy of this software and associated documentation files (the
4343
public class RangedBigDecimalWithLesserSpecifiedPrecisionPropertyParameterTest
4444
extends BasicGeneratorPropertyParameterTest {
4545

46-
@InRange(min = "-12345678123456781234567812345.678", max = "9876543219876543.21")
46+
@InRange(
47+
min = "-12345678123456781234567812345.678",
48+
max = "9876543219876543.21")
4749
@Precision(scale = 2)
4850
public static final BigDecimal TYPE_BEARER = null;
4951

50-
private final BigDecimal min = new BigDecimal("-12345678123456781234567812345.678");
52+
private final BigDecimal min =
53+
new BigDecimal("-12345678123456781234567812345.678");
5154
private final BigDecimal max = new BigDecimal("9876543219876543.21");
5255
private int numberOfBits;
5356

5457
@Override protected void primeSourceOfRandomness() {
55-
numberOfBits = max.movePointRight(3).subtract(min.movePointRight(3)).toBigInteger().bitLength();
58+
numberOfBits =
59+
max.movePointRight(3)
60+
.subtract(min.movePointRight(3))
61+
.toBigInteger()
62+
.bitLength();
5663
when(randomForParameterGenerator.nextBigInteger(numberOfBits))
5764
.thenReturn(new BigInteger("2").pow(numberOfBits).subtract(ONE))
5865
.thenReturn(ONE)
@@ -74,6 +81,7 @@ public class RangedBigDecimalWithLesserSpecifiedPrecisionPropertyParameterTest
7481
}
7582

7683
@Override public void verifyInteractionWithRandomness() {
77-
verify(randomForParameterGenerator, times(5)).nextBigInteger(numberOfBits);
84+
verify(randomForParameterGenerator, times(5))
85+
.nextBigInteger(numberOfBits);
7886
}
7987
}

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/math/RangedBigIntegerNoMaxPropertyParameterTest.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,32 @@ public class RangedBigIntegerNoMaxPropertyParameterTest
4444
private final BigInteger min = new BigInteger("-987654321987654321");
4545

4646
@Override protected void primeSourceOfRandomness() {
47-
when(randomForParameterGenerator.nextBigInteger(min.add(TEN).subtract(min).bitLength()))
47+
when(randomForParameterGenerator.nextBigInteger(
48+
min.add(TEN).subtract(min).bitLength()))
4849
.thenReturn(new BigInteger("6"));
49-
when(randomForParameterGenerator.nextBigInteger(min.add(TEN.pow(2)).subtract(min).bitLength()))
50+
when(randomForParameterGenerator.nextBigInteger(
51+
min.add(TEN.pow(2)).subtract(min).bitLength()))
5052
.thenReturn(new BigInteger("35"));
51-
when(distro.sampleWithMean(1, randomForParameterGenerator)).thenReturn(0);
52-
when(distro.sampleWithMean(2, randomForParameterGenerator)).thenReturn(1);
53+
when(distro.sampleWithMean(1, randomForParameterGenerator))
54+
.thenReturn(0);
55+
when(distro.sampleWithMean(2, randomForParameterGenerator))
56+
.thenReturn(1);
5357
}
5458

5559
@Override protected int trials() {
5660
return 2;
5761
}
5862

5963
@Override protected List<?> randomValues() {
60-
return asList(new BigInteger("-987654321987654315"), new BigInteger("-987654321987654286"));
64+
return asList(
65+
new BigInteger("-987654321987654315"),
66+
new BigInteger("-987654321987654286"));
6167
}
6268

6369
@Override public void verifyInteractionWithRandomness() {
64-
verify(randomForParameterGenerator).nextBigInteger(min.add(TEN).subtract(min).bitLength());
65-
verify(randomForParameterGenerator).nextBigInteger(min.add(TEN.pow(2)).subtract(min).bitLength());
70+
verify(randomForParameterGenerator)
71+
.nextBigInteger(min.add(TEN).subtract(min).bitLength());
72+
verify(randomForParameterGenerator)
73+
.nextBigInteger(min.add(TEN.pow(2)).subtract(min).bitLength());
6674
}
6775
}

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/math/RangedBigIntegerNoMinPropertyParameterTest.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,32 @@ public class RangedBigIntegerNoMinPropertyParameterTest
4444
private final BigInteger max = new BigInteger("987654321987654321");
4545

4646
@Override protected void primeSourceOfRandomness() {
47-
when(randomForParameterGenerator.nextBigInteger(max.subtract(max.subtract(TEN)).bitLength()))
47+
when(randomForParameterGenerator.nextBigInteger(
48+
max.subtract(max.subtract(TEN)).bitLength()))
4849
.thenReturn(new BigInteger("6"));
49-
when(randomForParameterGenerator.nextBigInteger(max.subtract(max.subtract(TEN.pow(2))).bitLength()))
50+
when(randomForParameterGenerator.nextBigInteger(
51+
max.subtract(max.subtract(TEN.pow(2))).bitLength()))
5052
.thenReturn(new BigInteger("35"));
51-
when(distro.sampleWithMean(1, randomForParameterGenerator)).thenReturn(0);
52-
when(distro.sampleWithMean(2, randomForParameterGenerator)).thenReturn(1);
53+
when(distro.sampleWithMean(1, randomForParameterGenerator))
54+
.thenReturn(0);
55+
when(distro.sampleWithMean(2, randomForParameterGenerator))
56+
.thenReturn(1);
5357
}
5458

5559
@Override protected int trials() {
5660
return 2;
5761
}
5862

5963
@Override protected List<?> randomValues() {
60-
return asList(new BigInteger("987654321987654317"), new BigInteger("987654321987654256"));
64+
return asList(
65+
new BigInteger("987654321987654317"),
66+
new BigInteger("987654321987654256"));
6167
}
6268

6369
@Override public void verifyInteractionWithRandomness() {
64-
verify(randomForParameterGenerator).nextBigInteger(max.subtract(max.subtract(TEN)).bitLength());
65-
verify(randomForParameterGenerator).nextBigInteger(max.subtract(max.subtract(TEN.pow(2))).bitLength());
70+
verify(randomForParameterGenerator)
71+
.nextBigInteger(max.subtract(max.subtract(TEN)).bitLength());
72+
verify(randomForParameterGenerator)
73+
.nextBigInteger(max.subtract(max.subtract(TEN.pow(2))).bitLength());
6674
}
6775
}

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/math/RangedBigIntegerPropertyParameterTest.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ a copy of this software and associated documentation files (the
4141
public class RangedBigIntegerPropertyParameterTest
4242
extends BasicGeneratorPropertyParameterTest {
4343

44-
@InRange(min = "-12345678123456781234567812345678", max = "987654321987654321")
44+
@InRange(
45+
min = "-12345678123456781234567812345678",
46+
max = "987654321987654321")
4547
public static final BigInteger TYPE_BEARER = null;
4648

47-
private final BigInteger min = new BigInteger("-12345678123456781234567812345678");
48-
private final BigInteger max = new BigInteger("987654321987654321");
49+
private final BigInteger min =
50+
new BigInteger("-12345678123456781234567812345678");
51+
private final BigInteger max =
52+
new BigInteger("987654321987654321");
4953

5054
@Override protected void primeSourceOfRandomness() {
5155
int numberOfBits = max.subtract(min).bitLength();
@@ -62,10 +66,15 @@ public class RangedBigIntegerPropertyParameterTest
6266
}
6367

6468
@Override protected List<?> randomValues() {
65-
return asList(min.add(ONE), min.add(TEN), min.add(ZERO), min.add(new BigInteger("234234234234")));
69+
return asList(
70+
min.add(ONE),
71+
min.add(TEN),
72+
min.add(ZERO),
73+
min.add(new BigInteger("234234234234")));
6674
}
6775

6876
@Override public void verifyInteractionWithRandomness() {
69-
verify(randomForParameterGenerator, times(5)).nextBigInteger(max.subtract(min).bitLength());
77+
verify(randomForParameterGenerator, times(5))
78+
.nextBigInteger(max.subtract(min).bitLength());
7079
}
7180
}

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/nio/charset/CharsetPropertyParameterTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@ a copy of this software and associated documentation files (the
3535
import java.util.ArrayList;
3636
import java.util.List;
3737

38-
public class CharsetPropertyParameterTest extends BasicGeneratorPropertyParameterTest {
38+
public class CharsetPropertyParameterTest
39+
extends BasicGeneratorPropertyParameterTest {
40+
3941
public static final Charset TYPE_BEARER = null;
4042

4143
private static final List<String> CHARSET_NAMES =
4244
new ArrayList<>(Charset.availableCharsets().keySet());
4345

4446
@Override protected void primeSourceOfRandomness() {
45-
when(randomForParameterGenerator.choose(Charset.availableCharsets().keySet()))
47+
when(randomForParameterGenerator.choose(
48+
Charset.availableCharsets().keySet()))
4649
.thenReturn(CHARSET_NAMES.get(2))
4750
.thenReturn(CHARSET_NAMES.get(0))
4851
.thenReturn(CHARSET_NAMES.get(1));

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/util/BitSetPropertyParameterTest.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@ a copy of this software and associated documentation files (the
3535
import static java.util.Arrays.*;
3636
import static org.mockito.Mockito.*;
3737

38-
public class BitSetPropertyParameterTest extends BasicGeneratorPropertyParameterTest {
38+
public class BitSetPropertyParameterTest
39+
extends BasicGeneratorPropertyParameterTest {
40+
3941
public static final BitSet TYPE_BEARER = null;
4042

4143
@Override protected void primeSourceOfRandomness() {
4244
when(Generating.booleans(randomForParameterGenerator))
4345
.thenReturn(true).thenReturn(false).thenReturn(true);
44-
when(distro.sampleWithMean(1, randomForParameterGenerator)).thenReturn(0);
45-
when(distro.sampleWithMean(2, randomForParameterGenerator)).thenReturn(1);
46-
when(distro.sampleWithMean(3, randomForParameterGenerator)).thenReturn(2);
46+
when(distro.sampleWithMean(1, randomForParameterGenerator))
47+
.thenReturn(0);
48+
when(distro.sampleWithMean(2, randomForParameterGenerator))
49+
.thenReturn(1);
50+
when(distro.sampleWithMean(3, randomForParameterGenerator))
51+
.thenReturn(2);
4752
}
4853

4954
@Override protected int trials() {

generators/src/test/java/com/pholser/junit/quickcheck/generator/java/util/DatePropertyParameterTest.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,39 @@ a copy of this software and associated documentation files (the
3535
import static java.util.Arrays.*;
3636
import static org.mockito.Mockito.*;
3737

38-
public class DatePropertyParameterTest extends BasicGeneratorPropertyParameterTest {
38+
public class DatePropertyParameterTest
39+
extends BasicGeneratorPropertyParameterTest {
40+
3941
public static final Date TYPE_BEARER = null;
4042

4143
@Override protected void primeSourceOfRandomness() {
42-
when(Generating.longs(randomForParameterGenerator, Integer.MIN_VALUE, Long.MAX_VALUE))
43-
.thenReturn(0L).thenReturn(60000L).thenReturn(100000000L).thenReturn(300000000000L);
44+
when(Generating.longs(
45+
randomForParameterGenerator,
46+
Integer.MIN_VALUE,
47+
Long.MAX_VALUE))
48+
.thenReturn(0L)
49+
.thenReturn(60000L)
50+
.thenReturn(100000000L)
51+
.thenReturn(300000000000L);
4452
}
4553

4654
@Override protected int trials() {
4755
return 4;
4856
}
4957

5058
@Override protected List<?> randomValues() {
51-
return asList(new Date(0), new Date(60000), new Date(100000000), new Date(300000000000L));
59+
return asList(
60+
new Date(0),
61+
new Date(60000),
62+
new Date(100000000),
63+
new Date(300000000000L));
5264
}
5365

5466
@Override public void verifyInteractionWithRandomness() {
55-
verifyLongs(randomForParameterGenerator, times(4), Integer.MIN_VALUE, Long.MAX_VALUE);
67+
verifyLongs(
68+
randomForParameterGenerator,
69+
times(4),
70+
Integer.MIN_VALUE,
71+
Long.MAX_VALUE);
5672
}
5773
}

0 commit comments

Comments
 (0)