commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1141886 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/RandomKeyTest.java
Date Fri, 01 Jul 2011 09:18:44 GMT
Author: luc
Date: Fri Jul  1 09:18:44 2011
New Revision: 1141886

URL: http://svn.apache.org/viewvc?rev=1141886&view=rev
Log:
fixed unused variable warning, using proper Junit4 tests

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/RandomKeyTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/RandomKeyTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/RandomKeyTest.java?rev=1141886&r1=1141885&r2=1141886&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/RandomKeyTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/genetics/RandomKeyTest.java
Fri Jul  1 09:18:44 2011
@@ -62,14 +62,9 @@ public class RandomKeyTest {
         Assert.assertEquals("d", decoded.get(4));
     }
     
-    @Test
+    @Test(expected=IllegalArgumentException.class)
     public void testInvalidRepresentation() {
-        try {
-            DummyRandomKey drk = new DummyRandomKey(new Double[] {0.1, 0.1, 2d, 0.8, 0.2});
-            Assert.fail("Expecting InvalidRepresentationException");
-        } catch (IllegalArgumentException ex) {
-            // Expected
-        }
+        new DummyRandomKey(new Double[] {0.1, 0.1, 2d, 0.8, 0.2});
     }
 
     @Test



Mime
View raw message