You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2012/02/14 23:42:19 UTC

svn commit: r1244252 - in /commons/sandbox/graph/trunk: ./ src/main/java/org/apache/commons/graph/shortestpath/ src/test/java/org/apache/commons/graph/flow/ src/test/java/org/apache/commons/graph/shortestpath/

Author: marcosperanza
Date: Tue Feb 14 22:42:19 2012
New Revision: 1244252

URL: http://svn.apache.org/viewvc?rev=1244252&view=rev
Log:
fixed english mistakes
fixed format error
upgraded developer section

Modified:
    commons/sandbox/graph/trunk/pom.xml
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/DijkstraTestCase.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/FloydWarshallTestCase.java

Modified: commons/sandbox/graph/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/pom.xml?rev=1244252&r1=1244251&r2=1244252&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/pom.xml (original)
+++ commons/sandbox/graph/trunk/pom.xml Tue Feb 14 22:42:19 2012
@@ -53,6 +53,11 @@
       <email>jason AT zenplex DOT com</email>
     </developer>
     <developer>
+      <name>Marco Speranza</name>
+      <id>marcosperanza</id>
+      <email>marcosperanza AT apache DOT org</email>
+    </developer>
+    <developer>
       <name>Oliver Heger</name>
       <id>oheger</id>
       <email>oheger AT apache DOT org</email>
@@ -74,10 +79,6 @@
       <email>squarcel AT dia DOT uniroma3 DOT it</email>
     </contributor>
     <contributor>
-      <name>Marco Speranza</name>
-      <email>marco DOT speranza79 AT gmail DOT com</email>
-    </contributor>
-    <contributor>
       <name>Matteo Moci</name>
       <email>mox601 AT gmail DOT com</email>
     </contributor>

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java?rev=1244252&r1=1244251&r2=1244252&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java Tue Feb 14 22:42:19 2012
@@ -105,10 +105,13 @@ final class DefaultTargetSourceSelector<
         {
             if ( !source.equals( target ) )
             {
-                try{
+                try
+                {
                     WeightedPath<V, WE, W> weightedPath = predecessors.buildPath( source, target );
                     allVertexPairsShortestPath.addShortestPath( source, target, weightedPath );
-                }catch (PathNotFoundException e) {
+                }
+                catch ( PathNotFoundException e )
+                {
                     continue;
                 }
             }

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java?rev=1244252&r1=1244251&r2=1244252&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java Tue Feb 14 22:42:19 2012
@@ -49,7 +49,7 @@ public class EdmondsKarpTestCase
 
         // actual max flow
         findMaxFlow( (DirectedMutableWeightedGraph<Vertex, WeightedEdge<Integer>, Integer>)  null ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeight() );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = NullPointerException.class )
@@ -71,7 +71,7 @@ public class EdmondsKarpTestCase
 
         // actual max flow
         findMaxFlow( graph ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeight() );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java?rev=1244252&r1=1244251&r2=1244252&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java Tue Feb 14 22:42:19 2012
@@ -44,7 +44,7 @@ public final class AStarTestCase
     public void testNullGraah()
     {
         findShortestPath( (WeightedGraph<Vertex, WeightedEdge<Double>, Double>) null ).from( null ).to( null ).applyingAStar( new DoubleWeight() ).withHeuristic( null );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = NullPointerException.class )
@@ -54,7 +54,7 @@ public final class AStarTestCase
             new UndirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double>();
 
         findShortestPath( graph ).from( null ).to( null ).applyingAStar( new DoubleWeight() ).withHeuristic( null );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = NullPointerException.class )
@@ -64,7 +64,7 @@ public final class AStarTestCase
             new UndirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Double>, Double>();
 
         findShortestPath( graph ).from( new BaseLabeledVertex( "a" ) ).to( new BaseLabeledVertex( "b" ) ).applyingAStar( new DoubleWeight() ).withHeuristic( null );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = NullPointerException.class )
@@ -91,7 +91,7 @@ public final class AStarTestCase
         };
 
         findShortestPath( graph ).from( a ).to( b ).applyingAStar( null ).withHeuristic( heuristic );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = PathNotFoundException.class )

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java?rev=1244252&r1=1244251&r2=1244252&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java Tue Feb 14 22:42:19 2012
@@ -43,7 +43,7 @@ public final class BellmannFordTestCase
     {
         // the actual weighted path
         findShortestPath( (WeightedGraph<Vertex, WeightedEdge<Double>, Double>) null ).from( null ).applyingBelmannFord( new DoubleWeight() );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = NullPointerException.class )
@@ -57,7 +57,7 @@ public final class BellmannFordTestCase
             findShortestPath( graph ).from( null ).applyingBelmannFord( new DoubleWeight() );
 
         allVertexPairsShortestPath.findShortestPath( null, null );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = NullPointerException.class )
@@ -76,7 +76,7 @@ public final class BellmannFordTestCase
             findShortestPath( graph ).from( a ).applyingBelmannFord( null );
 
         allVertexPairsShortestPath.findShortestPath( a, b );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = PathNotFoundException.class )

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/DijkstraTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/DijkstraTestCase.java?rev=1244252&r1=1244251&r2=1244252&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/DijkstraTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/DijkstraTestCase.java Tue Feb 14 22:42:19 2012
@@ -43,7 +43,7 @@ public final class DijkstraTestCase
     {
         // the actual weighted path
         findShortestPath( (WeightedGraph<Vertex, WeightedEdge<Double>, Double>) null ).from( null ).to( null ).applyingDijkstra( new DoubleWeight() );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = NullPointerException.class )
@@ -55,7 +55,7 @@ public final class DijkstraTestCase
         // the actual weighted path
         findShortestPath( graph ).from( null ).to( null ).applyingDijkstra( new DoubleWeight() );
 
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = NullPointerException.class )
@@ -72,7 +72,7 @@ public final class DijkstraTestCase
         // the actual weighted path
         findShortestPath( graph ).from( a ).to( b ).applyingDijkstra( null );
 
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
     
     @Test( expected = PathNotFoundException.class )

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/FloydWarshallTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/FloydWarshallTestCase.java?rev=1244252&r1=1244251&r2=1244252&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/FloydWarshallTestCase.java (original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/FloydWarshallTestCase.java Tue Feb 14 22:42:19 2012
@@ -48,7 +48,7 @@ public class FloydWarshallTestCase
     {
         // the actual weighted path
         findShortestPath( (WeightedGraph<Vertex, WeightedEdge<Double>, Double>) null ).from( null ).to( null ).applyingDijkstra( new DoubleWeight() );
-        fail( "Null Pointer Exception not catched" );
+        fail( "Null Pointer Exception not caught" );
     }
 
     @Test( expected = PathNotFoundException.class )
@@ -67,7 +67,7 @@ public class FloydWarshallTestCase
             findShortestPath( graph ).applyingFloydWarshall( new DoubleWeight() );
 
         p.findShortestPath( a, b );
-        fail( "PathNotFoundException not catched" );
+        fail( "PathNotFoundException not caught" );
     }
     
     @Test



Re: svn commit: r1244252 - in /commons/sandbox/graph/trunk: ./ src/main/java/org/apache/commons/graph/shortestpath/ src/test/java/org/apache/commons/graph/flow/ src/test/java/org/apache/commons/graph/shortestpath/

Posted by Marco Speranza <ma...@apache.org>.
Hi


> In fact the annotation can cause a test to succeed when it should fail.
> If the NPE occurs too early in the test, the test will be marked as
> successful.
> If you want to ensure that the NPE only occurs in the last statement
> of the test case, then drop the expected qualifier and use the fail()
> call at the end of the test case.


Ok to avoid that I modified all tests that use annotation. I wrapped the
code  that precedes the invocation to method under test with a try-catch
block and I thrown a fail assertion if there are some NPE. In that way I'm
sure that the NPE is thown from the method under test.

Thanks for suggestion

Ciao

--
Marco Speranza <marcosperanza@ <ma...@gmail.com>apache.org>
Google Code: http://code.google.com/u/marco.speranza79/



2012/2/15 sebb <se...@gmail.com>

> On 14 February 2012 22:42,  <ma...@apache.org> wrote:
> > Author: marcosperanza
> > Date: Tue Feb 14 22:42:19 2012
> > New Revision: 1244252
> >
> > URL: http://svn.apache.org/viewvc?rev=1244252&view=rev
> > Log:
> > fixed english mistakes
> > fixed format error
> > upgraded developer section
> >
> > Modified:
> >    commons/sandbox/graph/trunk/pom.xml
> >
>  commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
> >
>  commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
> >
>  commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java
> >
>  commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java
> >
>  commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/DijkstraTestCase.java
> >
>  commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/FloydWarshallTestCase.java
> >
> > Modified: commons/sandbox/graph/trunk/pom.xml
> > URL:
> http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/pom.xml?rev=1244252&r1=1244251&r2=1244252&view=diff
> >
> ==============================================================================
> > --- commons/sandbox/graph/trunk/pom.xml (original)
> > +++ commons/sandbox/graph/trunk/pom.xml Tue Feb 14 22:42:19 2012
> > @@ -53,6 +53,11 @@
> >       <email>jason AT zenplex DOT com</email>
> >     </developer>
> >     <developer>
> > +      <name>Marco Speranza</name>
> > +      <id>marcosperanza</id>
> > +      <email>marcosperanza AT apache DOT org</email>
> > +    </developer>
> > +    <developer>
> >       <name>Oliver Heger</name>
> >       <id>oheger</id>
> >       <email>oheger AT apache DOT org</email>
> > @@ -74,10 +79,6 @@
> >       <email>squarcel AT dia DOT uniroma3 DOT it</email>
> >     </contributor>
> >     <contributor>
> > -      <name>Marco Speranza</name>
> > -      <email>marco DOT speranza79 AT gmail DOT com</email>
> > -    </contributor>
> > -    <contributor>
> >       <name>Matteo Moci</name>
> >       <email>mox601 AT gmail DOT com</email>
> >     </contributor>
> >
> > Modified:
> commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
> > URL:
> http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java?rev=1244252&r1=1244251&r2=1244252&view=diff
> >
> ==============================================================================
> > ---
> commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
> (original)
> > +++
> commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
> Tue Feb 14 22:42:19 2012
> > @@ -105,10 +105,13 @@ final class DefaultTargetSourceSelector<
> >         {
> >             if ( !source.equals( target ) )
> >             {
> > -                try{
> > +                try
> > +                {
> >                     WeightedPath<V, WE, W> weightedPath =
> predecessors.buildPath( source, target );
> >                     allVertexPairsShortestPath.addShortestPath( source,
> target, weightedPath );
> > -                }catch (PathNotFoundException e) {
> > +                }
> > +                catch ( PathNotFoundException e )
> > +                {
> >                     continue;
> >                 }
> >             }
> >
> > Modified:
> commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
> > URL:
> http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java?rev=1244252&r1=1244251&r2=1244252&view=diff
> >
> ==============================================================================
> > ---
> commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
> (original)
> > +++
> commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
> Tue Feb 14 22:42:19 2012
> > @@ -49,7 +49,7 @@ public class EdmondsKarpTestCase
> >
> >         // actual max flow
> >         findMaxFlow( (DirectedMutableWeightedGraph<Vertex,
> WeightedEdge<Integer>, Integer>)  null ).from( a ).to( g
> ).applyingEdmondsKarp( new IntegerWeight() );
> > -        fail( "Null Pointer Exception not catched" );
> > +        fail( "Null Pointer Exception not caught" );
>
> Surely that should be something like:
>
> fail( "NullPointerException not thrown" );
>
> or
>
> fail( "expected NullPointerException" );
>
> ==
>
> Many of the tests also use the annotation:
>
>  @Test( expected = NullPointerException.class )
>
> which is not needed if fail() is used.
>
> In fact the annotation can cause a test to succeed when it should fail.
> If the NPE occurs too early in the test, the test will be marked as
> successful.
>
> If you want to ensure that the NPE only occurs in the last statement
> of the test case, then drop the expected qualifier and use the fail()
> call at the end of the test case.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: svn commit: r1244252 - in /commons/sandbox/graph/trunk: ./ src/main/java/org/apache/commons/graph/shortestpath/ src/test/java/org/apache/commons/graph/flow/ src/test/java/org/apache/commons/graph/shortestpath/

Posted by sebb <se...@gmail.com>.
On 14 February 2012 22:42,  <ma...@apache.org> wrote:
> Author: marcosperanza
> Date: Tue Feb 14 22:42:19 2012
> New Revision: 1244252
>
> URL: http://svn.apache.org/viewvc?rev=1244252&view=rev
> Log:
> fixed english mistakes
> fixed format error
> upgraded developer section
>
> Modified:
>    commons/sandbox/graph/trunk/pom.xml
>    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
>    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
>    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/AStarTestCase.java
>    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/BellmannFordTestCase.java
>    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/DijkstraTestCase.java
>    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/shortestpath/FloydWarshallTestCase.java
>
> Modified: commons/sandbox/graph/trunk/pom.xml
> URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/pom.xml?rev=1244252&r1=1244251&r2=1244252&view=diff
> ==============================================================================
> --- commons/sandbox/graph/trunk/pom.xml (original)
> +++ commons/sandbox/graph/trunk/pom.xml Tue Feb 14 22:42:19 2012
> @@ -53,6 +53,11 @@
>       <email>jason AT zenplex DOT com</email>
>     </developer>
>     <developer>
> +      <name>Marco Speranza</name>
> +      <id>marcosperanza</id>
> +      <email>marcosperanza AT apache DOT org</email>
> +    </developer>
> +    <developer>
>       <name>Oliver Heger</name>
>       <id>oheger</id>
>       <email>oheger AT apache DOT org</email>
> @@ -74,10 +79,6 @@
>       <email>squarcel AT dia DOT uniroma3 DOT it</email>
>     </contributor>
>     <contributor>
> -      <name>Marco Speranza</name>
> -      <email>marco DOT speranza79 AT gmail DOT com</email>
> -    </contributor>
> -    <contributor>
>       <name>Matteo Moci</name>
>       <email>mox601 AT gmail DOT com</email>
>     </contributor>
>
> Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java
> URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java?rev=1244252&r1=1244251&r2=1244252&view=diff
> ==============================================================================
> --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java (original)
> +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/DefaultTargetSourceSelector.java Tue Feb 14 22:42:19 2012
> @@ -105,10 +105,13 @@ final class DefaultTargetSourceSelector<
>         {
>             if ( !source.equals( target ) )
>             {
> -                try{
> +                try
> +                {
>                     WeightedPath<V, WE, W> weightedPath = predecessors.buildPath( source, target );
>                     allVertexPairsShortestPath.addShortestPath( source, target, weightedPath );
> -                }catch (PathNotFoundException e) {
> +                }
> +                catch ( PathNotFoundException e )
> +                {
>                     continue;
>                 }
>             }
>
> Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java
> URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java?rev=1244252&r1=1244251&r2=1244252&view=diff
> ==============================================================================
> --- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java (original)
> +++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/EdmondsKarpTestCase.java Tue Feb 14 22:42:19 2012
> @@ -49,7 +49,7 @@ public class EdmondsKarpTestCase
>
>         // actual max flow
>         findMaxFlow( (DirectedMutableWeightedGraph<Vertex, WeightedEdge<Integer>, Integer>)  null ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeight() );
> -        fail( "Null Pointer Exception not catched" );
> +        fail( "Null Pointer Exception not caught" );

Surely that should be something like:

fail( "NullPointerException not thrown" );

or

fail( "expected NullPointerException" );

==

Many of the tests also use the annotation:

 @Test( expected = NullPointerException.class )

which is not needed if fail() is used.

In fact the annotation can cause a test to succeed when it should fail.
If the NPE occurs too early in the test, the test will be marked as successful.

If you want to ensure that the NPE only occurs in the last statement
of the test case, then drop the expected qualifier and use the fail()
call at the end of the test case.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org