Lines were too long
authorJaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 10:01:45 +0200
changeset 18871ecc458ecd0
parent 187 e8db9f297016
child 189 3ca9cbfda1a5
Lines were too long
samples/composition/src-test/api/ArithmeticaCompatibilityTest.java
     1.1 --- a/samples/composition/src-test/api/ArithmeticaCompatibilityTest.java	Sat Jun 14 10:01:36 2008 +0200
     1.2 +++ b/samples/composition/src-test/api/ArithmeticaCompatibilityTest.java	Sat Jun 14 10:01:45 2008 +0200
     1.3 @@ -65,15 +65,28 @@
     1.4              
     1.5              compare(now, old, seed);
     1.6          
     1.7 -            assertEquals("Verify amount of sumRange is the same", now.countSumRange, old.countSumRange);
     1.8 -            assertEquals("Verify amount of sumAll is the same", now.countSumAll, old.countSumAll);
     1.9 -            assertEquals("Verify amount of sumTwo is the same", now.countSumTwo, old.countSumTwo);
    1.10 +            assertEquals(
    1.11 +                "Verify amount of sumRange is the same", 
    1.12 +                now.countSumRange, old.countSumRange
    1.13 +            );
    1.14 +            assertEquals(
    1.15 +                "Verify amount of sumAll is the same", 
    1.16 +                now.countSumAll, old.countSumAll
    1.17 +            );
    1.18 +            assertEquals(
    1.19 +                "Verify amount of sumTwo is the same", 
    1.20 +                now.countSumTwo, old.countSumTwo
    1.21 +            );
    1.22          } catch (AssertionFailedError ex) {
    1.23 -            IllegalStateException n = new IllegalStateException ("Seed: " + seed + "\n" + ex.getMessage ());
    1.24 +            IllegalStateException n = new IllegalStateException (
    1.25 +                "Seed: " + seed + "\n" + ex.getMessage ()
    1.26 +            );
    1.27              n.initCause(ex);
    1.28              throw n;
    1.29          } catch (Exception ex) {
    1.30 -            IllegalStateException n = new IllegalStateException ("Seed: " + seed + "\n" + ex.getMessage ());
    1.31 +            IllegalStateException n = new IllegalStateException (
    1.32 +                "Seed: " + seed + "\n" + ex.getMessage ()
    1.33 +            );
    1.34              n.initCause(ex);
    1.35              throw n;
    1.36          }
    1.37 @@ -85,9 +98,18 @@
    1.38  
    1.39          compare(now, old, 1208120436947L);
    1.40  
    1.41 -        assertEquals("Verify amount of sumRange is the same", now.countSumRange, old.countSumRange);
    1.42 -        assertEquals("Verify amount of sumAll is the same", now.countSumAll, old.countSumAll);
    1.43 -        assertEquals("Verify amount of sumTwo is the same", now.countSumTwo, old.countSumTwo);
    1.44 +        assertEquals(
    1.45 +            "Verify amount of sumRange is the same", 
    1.46 +            now.countSumRange, old.countSumRange
    1.47 +        );
    1.48 +        assertEquals(
    1.49 +            "Verify amount of sumAll is the same", 
    1.50 +            now.countSumAll, old.countSumAll
    1.51 +        );
    1.52 +        assertEquals(
    1.53 +            "Verify amount of sumTwo is the same", 
    1.54 +            now.countSumTwo, old.countSumTwo
    1.55 +        );
    1.56      }
    1.57  
    1.58      public void testSimulateFailureOn1208120628821() throws Exception {
    1.59 @@ -96,14 +118,24 @@
    1.60  
    1.61          compare(now, old, 1208120628821L);
    1.62  
    1.63 -        assertEquals("Verify amount of sumRange is the same", now.countSumRange, old.countSumRange);
    1.64 -        assertEquals("Verify amount of sumAll is the same", now.countSumAll, old.countSumAll);
    1.65 -        assertEquals("Verify amount of sumTwo is the same", now.countSumTwo, old.countSumTwo);
    1.66 +        assertEquals(
    1.67 +            "Verify amount of sumRange is the same", 
    1.68 +            now.countSumRange, old.countSumRange
    1.69 +        );
    1.70 +        assertEquals(
    1.71 +            "Verify amount of sumAll is the same", 
    1.72 +            now.countSumAll, old.countSumAll
    1.73 +        );
    1.74 +        assertEquals(
    1.75 +            "Verify amount of sumTwo is the same", 
    1.76 +            now.countSumTwo, old.countSumTwo
    1.77 +        );
    1.78      }
    1.79      // END: total.rewrite.tests
    1.80      
    1.81      // BEGIN: total.rewrite.compare
    1.82 -    private void compare (Arithmetica now, OldArithmetica1 old, long seed) throws Exception {
    1.83 +    private void compare (Arithmetica now, OldArithmetica1 old, long seed) 
    1.84 +    throws Exception {
    1.85          java.util.Random r = new java.util.Random (seed);
    1.86          
    1.87          for (int loop = 0; loop < r.nextInt(5); loop++) {
    1.88 @@ -114,7 +146,7 @@
    1.89                      int a2 = r.nextInt(100);
    1.90                      int resNow = now.sumTwo(a1, a2);
    1.91                      int resOld = old.sumTwo(a1, a2);
    1.92 -                    assertEquals("Results of sumTwo are equal", resNow, resOld);
    1.93 +                    assertEquals("sumTwo results are equal", resNow, resOld);
    1.94                      break;
    1.95                  }
    1.96                  case 1: { // sumArray
    1.97 @@ -124,7 +156,7 @@
    1.98                      }
    1.99                      int resNow = now.sumAll(arr);
   1.100                      int resOld = old.sumAll(arr);
   1.101 -                    assertEquals("Results of sumArray are equal", resNow, resOld);
   1.102 +                    assertEquals("sumArray results are equal", resNow, resOld);
   1.103                      break;
   1.104                  }
   1.105                  case 2: { // sumRange
   1.106 @@ -132,7 +164,7 @@
   1.107                      int a2 = r.nextInt(100);
   1.108                      int resNow = now.sumRange(a1, a1 + a2);
   1.109                      int resOld = old.sumRange(a1, a1 + a2);
   1.110 -                    assertEquals("Results of sumRange are equal", resNow, resOld);
   1.111 +                    assertEquals("sumRange results are equal", resNow, resOld);
   1.112                      break;
   1.113                  }
   1.114              }