commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marcospera...@apache.org
Subject svn commit: r1295954 - in /commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph: coloring/ connectivity/ flow/ scc/
Date Thu, 01 Mar 2012 22:33:07 GMT
Author: marcosperanza
Date: Thu Mar  1 22:33:06 2012
New Revision: 1295954

URL: http://svn.apache.org/viewvc?rev=1295954&view=rev
Log:
Removed unneeded empty creation of graph configuration

Modified:
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringBackTrackingTestCase.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringTestCase.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/connectivity/FindConnectedComponetTestCase.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/flow/FordFulkersonTestCase.java
    commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/scc/KosarajuSharirTestCase.java

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringBackTrackingTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringBackTrackingTestCase.java?rev=1295954&r1=1295953&r2=1295954&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringBackTrackingTestCase.java
(original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringBackTrackingTestCase.java
Thu Mar  1 22:33:06 2012
@@ -58,15 +58,7 @@ public class GraphColoringBackTrackingTe
     public void testNullColorGraph()
     {
         UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge> g =
-            newUndirectedMutableGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledEdge>()
-            {
-                @Override
-                public void connect()
-                {
-                    // empty
-                }
-
-            } );
+            new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge>();
         coloring( g ).withColors( null ).applyingBackTrackingAlgorithm();
     }
 
@@ -74,17 +66,10 @@ public class GraphColoringBackTrackingTe
     public void testEmptyGraph()
     {
         UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge> g =
-            newUndirectedMutableGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledEdge>()
-            {
-
-                @Override
-                public void connect()
-                {
-                    // empty
-                }
+            new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge>();
 
-            } );
-        ColoredVertices<BaseLabeledVertex, Integer> coloredVertices = coloring( g ).withColors(
createColorsList( 1 ) ).applyingBackTrackingAlgorithm();
+        ColoredVertices<BaseLabeledVertex, Integer> coloredVertices =
+            coloring( g ).withColors( createColorsList( 1 ) ).applyingBackTrackingAlgorithm();
         assertNotNull( coloredVertices );
         assertEquals( 0, coloredVertices.getRequiredColors() );
     }

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringTestCase.java?rev=1295954&r1=1295953&r2=1295954&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringTestCase.java
(original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/coloring/GraphColoringTestCase.java
Thu Mar  1 22:33:06 2012
@@ -57,16 +57,8 @@ public class GraphColoringTestCase exten
     public void testNullColorGraph()
     {
         UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge> g =
-            newUndirectedMutableGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledEdge>()
-            {
-
-                @Override
-                public void connect()
-                {
-                    // empty
-                }
+            new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge>();
 
-            } );
         coloring( g ).withColors( null ).applyingBackTrackingAlgorithm();
     }
 
@@ -74,16 +66,8 @@ public class GraphColoringTestCase exten
     public void testEmptyGraph()
     {
         UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge> g =
-            newUndirectedMutableGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledEdge>()
-            {
-
-                @Override
-                public void connect()
-                {
-                    // empty
-                }
+            new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge>();
 
-            } );
         ColoredVertices<BaseLabeledVertex, Integer> coloredVertices = coloring( g ).withColors(
createColorsList( 1 ) ).applyingGreedyAlgorithm();
         assertNotNull( coloredVertices );
         assertEquals( 0, coloredVertices.getRequiredColors() );

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/connectivity/FindConnectedComponetTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/connectivity/FindConnectedComponetTestCase.java?rev=1295954&r1=1295953&r2=1295954&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/connectivity/FindConnectedComponetTestCase.java
(original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/connectivity/FindConnectedComponetTestCase.java
Thu Mar  1 22:33:06 2012
@@ -53,16 +53,10 @@ public final class FindConnectedComponet
     public void verifyEmptyGraph()
     {
         UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge> graph =
-            newUndirectedMutableGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledEdge>()
-            {
+            new UndirectedMutableGraph<BaseLabeledVertex, BaseLabeledEdge>();
 
-                public void connect()
-                {
-                    //empty
-                }
-
-            } );
-        Collection<List<BaseLabeledVertex>> c = findConnectedComponent( graph
).includingAllVertices().applyingMinimumSpanningTreeAlgorithm();
+        Collection<List<BaseLabeledVertex>> c =
+            findConnectedComponent( graph ).includingAllVertices().applyingMinimumSpanningTreeAlgorithm();
         assertNotNull( c );
         assertEquals( 0, c.size() );
     }

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=1295954&r1=1295953&r2=1295954&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
Thu Mar  1 22:33:06 2012
@@ -58,14 +58,7 @@ public class EdmondsKarpTestCase
         final BaseLabeledVertex g = null;
 
         DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer> graph =
-            newDirectedMutableWeightedGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledWeightedEdge<Integer>>()
-            {
-                @Override
-                public void connect()
-                {
-                }
-
-            } );
+            new DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer>();
 
         // actual max flow
         findMaxFlow( graph ).from( a ).to( g ).applyingEdmondsKarp( new IntegerWeightBaseOperations()
);

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/FordFulkersonTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/FordFulkersonTestCase.java?rev=1295954&r1=1295953&r2=1295954&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/FordFulkersonTestCase.java
(original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/flow/FordFulkersonTestCase.java
Thu Mar  1 22:33:06 2012
@@ -123,24 +123,8 @@ public final class FordFulkersonTestCase
     @Test(expected=NullPointerException.class)
     public void testNullVertices()
     {
-        DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer> graph = null;
-        try
-        {
-            graph =
-                newDirectedMutableWeightedGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledWeightedEdge<Integer>>()
-                {
-
-                    @Override
-                    public void connect()
-                    {
-                    }
-
-                } );
-        }
-        catch ( NullPointerException e )
-        {
-            fail( e.getMessage() );
-        }
+        DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer> graph =
+            new DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer>();
 
         // actual max flow
         findMaxFlow( graph ).from( null ).to( null ).applyingFordFulkerson( new IntegerWeightBaseOperations()
);

Modified: commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/scc/KosarajuSharirTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/scc/KosarajuSharirTestCase.java?rev=1295954&r1=1295953&r2=1295954&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/scc/KosarajuSharirTestCase.java
(original)
+++ commons/sandbox/graph/trunk/src/test/java/org/apache/commons/graph/scc/KosarajuSharirTestCase.java
Thu Mar  1 22:33:06 2012
@@ -56,16 +56,8 @@ public final class KosarajuSharirTestCas
     {
 
         final BaseLabeledVertex a = null;
-
         DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer> graph =
-            newDirectedMutableWeightedGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledWeightedEdge<Integer>>()
-            {
-                @Override
-                public void connect()
-                {
-                }
-
-            } );
+            new DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer>();
 
         findStronglyConnectedComponent( graph ).applyingKosarajuSharir( a );
     }
@@ -74,14 +66,7 @@ public final class KosarajuSharirTestCas
     public void testNotExistVertex()
     {
         DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer> graph =
-            newDirectedMutableWeightedGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledWeightedEdge<Integer>>()
-            {
-                @Override
-                public void connect()
-                {
-                }
-
-            } );
+            new DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer>();
 
         findStronglyConnectedComponent( graph ).applyingKosarajuSharir( new BaseLabeledVertex(
"NOT EXISTS" ) );
     }
@@ -90,14 +75,7 @@ public final class KosarajuSharirTestCas
     public void testEmptyGraph()
     {
         DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer> graph =
-            newDirectedMutableWeightedGraph( new AbstractGraphConnection<BaseLabeledVertex,
BaseLabeledWeightedEdge<Integer>>()
-            {
-                @Override
-                public void connect()
-                {
-                }
-
-            } );
+            new DirectedMutableWeightedGraph<BaseLabeledVertex, BaseLabeledWeightedEdge<Integer>,
Integer>();
 
         findStronglyConnectedComponent( graph ).applyingKosarajuSharir();
     }



Mime
View raw message