Another round of deprecation warnings removal in tests.

This commit is contained in:
Luc Maisonobe 2015-12-25 15:27:00 +01:00
parent b078df4ecd
commit 370fd53bee
8 changed files with 20 additions and 6 deletions

View File

@ -85,6 +85,7 @@ public class ExponentialDistributionTest extends RealDistributionAbstractTest {
@Test
public void testCumulativeProbability2() {
@SuppressWarnings("deprecation")
double actual = getDistribution().cumulativeProbability(0.25, 0.75);
Assert.assertEquals(0.0905214, actual, 10e-4);
}

View File

@ -74,6 +74,7 @@ public class GammaDistributionTest extends RealDistributionAbstractTest {
}
//---------------------------- Additional test cases -------------------------
@SuppressWarnings("deprecation")
@Test
public void testParameterAccessors() {
GammaDistribution distribution = (GammaDistribution) getDistribution();

View File

@ -171,6 +171,7 @@ public abstract class RealDistributionAbstractTest {
* Verifies that cumulative probability density calculations match expected values
* using current test instance data
*/
@SuppressWarnings("deprecation")
protected void verifyCumulativeProbabilities() {
// verify cumulativeProbability(double)
for (int i = 0; i < cumulativeTestPoints.length; i++) {
@ -278,6 +279,7 @@ public abstract class RealDistributionAbstractTest {
/**
* Verifies that probability computations are consistent
*/
@SuppressWarnings("deprecation")
@Test
public void testConsistency() {
for (int i=1; i < cumulativeTestPoints.length; i++) {
@ -303,6 +305,7 @@ public abstract class RealDistributionAbstractTest {
/**
* Verifies that illegal arguments are correctly handled
*/
@SuppressWarnings("deprecation")
@Test
public void testIllegalArguments() {
try {
@ -351,6 +354,7 @@ public abstract class RealDistributionAbstractTest {
* interval. Test points outside of the domain of the density function
* are discarded.
*/
@SuppressWarnings("deprecation")
@Test
public void testDensityIntegrals() {
final double tol = 1.0e-9;
@ -386,6 +390,7 @@ public abstract class RealDistributionAbstractTest {
* Verify that isSupportLowerBoundInclusvie returns true iff the lower bound
* is finite and density is non-NaN, non-infinite there.
*/
@SuppressWarnings("deprecation")
@Test
public void testIsSupportLowerBoundInclusive() {
final double lowerBound = distribution.getSupportLowerBound();
@ -402,6 +407,7 @@ public abstract class RealDistributionAbstractTest {
* Verify that isSupportUpperBoundInclusvie returns true iff the upper bound
* is finite and density is non-NaN, non-infinite there.
*/
@SuppressWarnings("deprecation")
@Test
public void testIsSupportUpperBoundInclusive() {
final double upperBound = distribution.getSupportUpperBound();

View File

@ -58,8 +58,7 @@ public class RandomCirclePointGenerator {
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
cY = new NormalDistribution(rng, y, ySigma,
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI,
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI);
}
/**

View File

@ -65,8 +65,7 @@ public class RandomStraightLinePointGenerator {
intercept = b;
error = new NormalDistribution(rng, 0, sigma,
NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
x = new UniformRealDistribution(rng, lo, hi,
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
x = new UniformRealDistribution(rng, lo, hi);
}
/**

View File

@ -358,7 +358,9 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
// First bin has mass 11 / 10000, the rest have mass 10 / 10000.
final double bMinus = bin == 0 ? 0 : (bin - 1) * binMass + firstBinMass;
final RealDistribution kernel = findKernel(lower, upper);
@SuppressWarnings("deprecation")
final double withinBinKernelMass = kernel.cumulativeProbability(lower, upper);
@SuppressWarnings("deprecation")
final double kernelCum = kernel.cumulativeProbability(lower, testPoints[i]);
cumValues[i] = bMinus + (bin == 0 ? firstBinMass : binMass) * kernelCum/withinBinKernelMass;
}
@ -377,6 +379,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
binBounds[bin - 1];
final double upper = binBounds[bin];
final RealDistribution kernel = findKernel(lower, upper);
@SuppressWarnings("deprecation")
final double withinBinKernelMass = kernel.cumulativeProbability(lower, upper);
final double density = kernel.density(testPoints[i]);
densityValues[i] = density * (bin == 0 ? firstBinMass : binMass) / withinBinKernelMass;
@ -390,6 +393,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
* will face convergence problems. Only test within-bin integrals and spans
* across no more than 3 bin boundaries.
*/
@SuppressWarnings("deprecation")
@Override
@Test
public void testDensityIntegrals() {
@ -566,8 +570,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes
}
@Override
protected RealDistribution getKernel(SummaryStatistics bStats) {
return new UniformRealDistribution(randomData.getRandomGenerator(), bStats.getMin(), bStats.getMax(),
UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
return new UniformRealDistribution(randomData.getRandomGenerator(), bStats.getMin(), bStats.getMax());
}
}
}

View File

@ -484,6 +484,7 @@ public final class FastFourierTransformerTest {
* Additional tests for 2D data.
*/
@SuppressWarnings("deprecation")
@Test
public void test2DData() {
FastFourierTransformer transformer;
@ -525,6 +526,7 @@ public final class FastFourierTransformerTest {
}
}
@SuppressWarnings("deprecation")
@Test
public void test2DDataUnitary() {
FastFourierTransformer transformer;

View File

@ -43,6 +43,7 @@ public class ResizableDoubleArrayTest extends DoubleArrayAbstractTest {
ra = new ResizableDoubleArray();
}
@SuppressWarnings("deprecation")
@Test
public void testConstructors() {
float defaultExpansionFactor = 2.0f;
@ -339,6 +340,7 @@ public class ResizableDoubleArrayTest extends DoubleArrayAbstractTest {
iterations + 1 , eDA2.getNumElements() );
}
@SuppressWarnings("deprecation")
@Test
public void testWithInitialCapacityAndExpansionFactor() {
@ -447,6 +449,7 @@ public class ResizableDoubleArrayTest extends DoubleArrayAbstractTest {
}
@SuppressWarnings("deprecation")
@Test
public void testMutators() {
((ResizableDoubleArray)da).setContractionCriteria(10f);