You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2009/06/01 00:01:18 UTC
svn commit: r780512 -
/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/
Author: luc
Date: Sun May 31 22:01:17 2009
New Revision: 780512
URL: http://svn.apache.org/viewvc?rev=780512&view=rev
Log:
updated tests to take into account serialization changes and the new
derivatives consistency check
these tests have been converted to Junit4
Modified:
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java
commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ClassicalRungeKuttaStepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,6 +17,8 @@
package org.apache.commons.math.ode.nonstiff;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -24,30 +26,26 @@
import java.io.ObjectOutputStream;
import java.util.Random;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
import org.apache.commons.math.ode.ContinuousOutputModel;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.IntegratorException;
import org.apache.commons.math.ode.sampling.StepHandler;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class ClassicalRungeKuttaStepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public ClassicalRungeKuttaStepInterpolatorTest(String name) {
- super(name);
- }
+public class ClassicalRungeKuttaStepInterpolatorTest {
- public void testDerivativesConsistency()
+ @Test
+ public void derivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
ClassicalRungeKuttaIntegrator integ = new ClassicalRungeKuttaIntegrator(step);
- checkDerivativesConsistency(integ, pb, 1.0e-10);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -92,8 +90,4 @@
}
- public static Test suite() {
- return new TestSuite(ClassicalRungeKuttaStepInterpolatorTest.class);
- }
-
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince54StepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,29 +17,28 @@
package org.apache.commons.math.ode.nonstiff;
-import junit.framework.*;
-import java.util.Random;
-import java.io.ByteArrayOutputStream;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Random;
import org.apache.commons.math.ode.ContinuousOutputModel;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.IntegratorException;
-import org.apache.commons.math.ode.nonstiff.DormandPrince54Integrator;
import org.apache.commons.math.ode.sampling.StepHandler;
import org.apache.commons.math.ode.sampling.StepInterpolator;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class DormandPrince54StepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public DormandPrince54StepInterpolatorTest(String name) {
- super(name);
- }
+public class DormandPrince54StepInterpolatorTest {
- public void testDerivativesConsistency()
+ @Test
+ public void derivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3(0.1);
double minStep = 0;
@@ -49,10 +48,11 @@
DormandPrince54Integrator integ = new DormandPrince54Integrator(minStep, maxStep,
scalAbsoluteTolerance,
scalRelativeTolerance);
- checkDerivativesConsistency(integ, pb, 1.0e-10);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -102,7 +102,8 @@
}
- public void testClone()
+ @Test
+ public void checkClone()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3(0.9);
double minStep = 0;
@@ -147,8 +148,4 @@
}
- public static Test suite() {
- return new TestSuite(DormandPrince54StepInterpolatorTest.class);
- }
-
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/DormandPrince853StepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,29 +17,28 @@
package org.apache.commons.math.ode.nonstiff;
-import junit.framework.*;
-import java.util.Random;
-import java.io.ByteArrayOutputStream;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Random;
import org.apache.commons.math.ode.ContinuousOutputModel;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.IntegratorException;
-import org.apache.commons.math.ode.nonstiff.DormandPrince853Integrator;
import org.apache.commons.math.ode.sampling.StepHandler;
import org.apache.commons.math.ode.sampling.StepInterpolator;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class DormandPrince853StepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public DormandPrince853StepInterpolatorTest(String name) {
- super(name);
- }
+public class DormandPrince853StepInterpolatorTest {
- public void testDerivativesConsistency()
+ @Test
+ public void derivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3(0.1);
double minStep = 0;
@@ -49,10 +48,11 @@
DormandPrince853Integrator integ = new DormandPrince853Integrator(minStep, maxStep,
scalAbsoluteTolerance,
scalRelativeTolerance);
- checkDerivativesConsistency(integ, pb, 1.0e-10);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -102,7 +102,8 @@
}
- public void testClone()
+ @Test
+ public void checklone()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3(0.9);
double minStep = 0;
@@ -147,8 +148,4 @@
}
- public static Test suite() {
- return new TestSuite(DormandPrince853StepInterpolatorTest.class);
- }
-
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/EulerStepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,6 +17,8 @@
package org.apache.commons.math.ode.nonstiff;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -24,23 +26,18 @@
import java.io.ObjectOutputStream;
import java.util.Random;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
import org.apache.commons.math.ode.ContinuousOutputModel;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
import org.apache.commons.math.ode.IntegratorException;
import org.apache.commons.math.ode.sampling.StepHandler;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class EulerStepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public EulerStepInterpolatorTest(String name) {
- super(name);
- }
+public class EulerStepInterpolatorTest {
- public void testNoReset() {
+ @Test
+ public void noReset() {
double[] y = { 0.0, 1.0, -2.0 };
double[][] yDot = { { 1.0, 2.0, -2.0 } };
@@ -57,7 +54,8 @@
}
- public void testInterpolationAtBounds()
+ @Test
+ public void interpolationAtBounds()
throws DerivativeException {
double t0 = 0;
@@ -93,7 +91,8 @@
}
- public void testInterpolationInside()
+ @Test
+ public void interpolationInside()
throws DerivativeException {
double[] y = { 1.0, 3.0, -4.0 };
@@ -118,15 +117,17 @@
}
- public void testDerivativesConsistency()
+ @Test
+ public void derivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
EulerIntegrator integ = new EulerIntegrator(step);
- checkDerivativesConsistency(integ, pb, 1.0e-10);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -181,8 +182,4 @@
}
}
- public static Test suite() {
- return new TestSuite(EulerStepInterpolatorTest.class);
- }
-
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GillStepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,7 +17,8 @@
package org.apache.commons.math.ode.nonstiff;
-import junit.framework.*;
+import static org.junit.Assert.assertTrue;
+
import java.util.Random;
import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
@@ -30,23 +31,22 @@
import org.apache.commons.math.ode.IntegratorException;
import org.apache.commons.math.ode.nonstiff.GillIntegrator;
import org.apache.commons.math.ode.sampling.StepHandler;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class GillStepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public GillStepInterpolatorTest(String name) {
- super(name);
- }
+public class GillStepInterpolatorTest {
+ @Test
public void testDerivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
GillIntegrator integ = new GillIntegrator(step);
- checkDerivativesConsistency(integ, pb, 1.0e-10);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -91,8 +91,4 @@
}
- public static Test suite() {
- return new TestSuite(GillStepInterpolatorTest.class);
- }
-
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,29 +17,28 @@
package org.apache.commons.math.ode.nonstiff;
-import junit.framework.*;
-import java.util.Random;
-import java.io.ByteArrayOutputStream;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Random;
import org.apache.commons.math.ode.ContinuousOutputModel;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.IntegratorException;
-import org.apache.commons.math.ode.nonstiff.GraggBulirschStoerIntegrator;
import org.apache.commons.math.ode.sampling.StepHandler;
import org.apache.commons.math.ode.sampling.StepInterpolator;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class GraggBulirschStoerStepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public GraggBulirschStoerStepInterpolatorTest(String name) {
- super(name);
- }
+public class GraggBulirschStoerStepInterpolatorTest {
- public void testDerivativesConsistency()
+ @Test
+ public void derivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3(0.9);
double minStep = 0;
@@ -50,10 +49,11 @@
GraggBulirschStoerIntegrator integ =
new GraggBulirschStoerIntegrator(minStep, maxStep,
absTolerance, relTolerance);
- checkDerivativesConsistency(integ, pb, 1.0e-8);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-8);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -104,7 +104,8 @@
}
- public void testClone()
+ @Test
+ public void checklone()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3(0.9);
double minStep = 0;
@@ -149,8 +150,4 @@
}
- public static Test suite() {
- return new TestSuite(GraggBulirschStoerStepInterpolatorTest.class);
- }
-
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54StepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,29 +17,28 @@
package org.apache.commons.math.ode.nonstiff;
-import junit.framework.*;
-import java.util.Random;
-import java.io.ByteArrayOutputStream;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Random;
import org.apache.commons.math.ode.ContinuousOutputModel;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.IntegratorException;
-import org.apache.commons.math.ode.nonstiff.HighamHall54Integrator;
import org.apache.commons.math.ode.sampling.StepHandler;
import org.apache.commons.math.ode.sampling.StepInterpolator;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class HighamHall54StepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public HighamHall54StepInterpolatorTest(String name) {
- super(name);
- }
+public class HighamHall54StepInterpolatorTest {
- public void testDerivativesConsistency()
+ @Test
+ public void derivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3(0.1);
double minStep = 0;
@@ -49,10 +48,11 @@
HighamHall54Integrator integ = new HighamHall54Integrator(minStep, maxStep,
scalAbsoluteTolerance,
scalRelativeTolerance);
- checkDerivativesConsistency(integ, pb, 1.0e-10);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -102,7 +102,8 @@
}
- public void testClone()
+ @Test
+ public void checkClone()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3(0.9);
double minStep = 0;
@@ -147,8 +148,4 @@
}
- public static Test suite() {
- return new TestSuite(HighamHall54StepInterpolatorTest.class);
- }
-
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/MidpointStepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,6 +17,8 @@
package org.apache.commons.math.ode.nonstiff;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -24,30 +26,26 @@
import java.io.ObjectOutputStream;
import java.util.Random;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
import org.apache.commons.math.ode.ContinuousOutputModel;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.IntegratorException;
import org.apache.commons.math.ode.sampling.StepHandler;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class MidpointStepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public MidpointStepInterpolatorTest(String name) {
- super(name);
- }
+public class MidpointStepInterpolatorTest {
+ @Test
public void testDerivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
MidpointIntegrator integ = new MidpointIntegrator(step);
- checkDerivativesConsistency(integ, pb, 1.0e-10);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -92,8 +90,4 @@
}
- public static Test suite() {
- return new TestSuite(MidpointStepInterpolatorTest.class);
- }
-
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java?rev=780512&r1=780511&r2=780512&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/ThreeEighthesStepInterpolatorTest.java Sun May 31 22:01:17 2009
@@ -17,6 +17,8 @@
package org.apache.commons.math.ode.nonstiff;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -24,30 +26,26 @@
import java.io.ObjectOutputStream;
import java.util.Random;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
import org.apache.commons.math.ode.ContinuousOutputModel;
import org.apache.commons.math.ode.DerivativeException;
import org.apache.commons.math.ode.IntegratorException;
import org.apache.commons.math.ode.sampling.StepHandler;
+import org.apache.commons.math.ode.sampling.StepInterpolatorTestUtils;
+import org.junit.Test;
-public class ThreeEighthesStepInterpolatorTest
- extends StepInterpolatorAbstractTest {
-
- public ThreeEighthesStepInterpolatorTest(String name) {
- super(name);
- }
+public class ThreeEighthesStepInterpolatorTest {
- public void testDerivativesConsistency()
+ @Test
+ public void derivativesConsistency()
throws DerivativeException, IntegratorException {
TestProblem3 pb = new TestProblem3();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
ThreeEighthesIntegrator integ = new ThreeEighthesIntegrator(step);
- checkDerivativesConsistency(integ, pb, 1.0e-10);
+ StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
- public void testSerialization()
+ @Test
+ public void serialization()
throws DerivativeException, IntegratorException,
IOException, ClassNotFoundException {
@@ -92,8 +90,4 @@
}
- public static Test suite() {
- return new TestSuite(ThreeEighthesStepInterpolatorTest.class);
- }
-
}