name.angoca.db2sa.core.graph.model
Class GraphTest

Package class diagram package GraphTest
java.lang.Object
  extended by name.angoca.db2sa.core.graph.model.GraphTest

public final class GraphTest
extends Object

Set of tests to check the states and graph structure..

Control Version

Version:
1.2.1 2010-05-17
Author:
Andres Gomez Casanova (AngocA)

Constructor Summary
GraphTest()
          Default constructor.
 
Method Summary
static void setUpBeforeClass()
          Destroys the configurator instance before the tests.
static void tearDownAfterClass()
          Clears the configuration file name property at the end of the test.
 void testAddNodeInSecondPhase()
          Test to try to add a node in secondPhase.
 void testAddNodeValidateGraph()
          Tests that it is not possible to add a node in a validated graph.
 void testAddNullRelation1()
          Tests that a relation cannot have a null child.
 void testAddNullRelation2()
          Tests that a relation cannot have a null parent.
 void testAddRelation()
          Tests that a graph can be in second phase.
 void testAddRelationInexistantChild()
          Tests that the child node of the relation has to exist.
 void testAddRelationInexistantParent()
          Tests that the parent node of the relation has to exist.
 void testAddRelationInSecondPhase()
          Test that it's not possible to add a relation in first phase.
 void testAddRelationValidateGraph()
          Tests that it is possible to add a relation in a validated graph.
 void testCongruent()
          Tests that the hashcode of two equal graphs is the same.
 void testCongruent2()
          Tests the hashcode of two graphs.
 void testConstructed()
          Tests the construction of a graph.
 void testDirectlySecondPhase()
          Tests that a node can not change to second phase without finishing the first phase.
 void testDuplicatedNode()
          Tests that it is not possible to add a duplicated node.
 void testEmptyGrammar()
          The grammar can not be empty.
 void testGetEndingNodeFirstPhase()
          Tests that is not possible to get a endingNode in first phase.
 void testgetEndingNodeSecondPhase()
          Tests that it cannot be possible to get EndingNode in secondPhase.
 void testGetStartingNode()
          Tests the retrieve of starting node.
 void testGetStartingNodeFirstPhase()
          Tests that is not possible to get a staringNode in first phase.
 void testgetStartingNodeSecondPhase()
          Tests that it cannot be possible to get StartingNode in secondPhase.
 void testHelpToString()
          Test the toString of HelpToken.
 void testInFirstPhase()
          Tests that a graph can be in first phase, and add a node.
 void testInFirstPhaseDoubleCall()
          Tests that is not possible to call first phase finished twice.
 void testInSecondPhase()
          Tests that a graph can be in second phase.
 void testInvalidEndingNode1()
          Test the bad construction of EndingNode.
 void testInvalidEndingNode21()
          Test the bad construction of EndingNode.
 void testInvalidStartingNode1()
          Test the bad construction of StartingNode.
 void testInvalidStartingNode2()
          Test the bad construction of StartingNode.
 void testMerge()
          Merge two graphs.
 void testMergeAndSimplify()
          Tests to merge a graph and then simplify it.
 void testMergeIdentical()
          Tests to merge two identical graphs.
 void testMergeNotValidated1()
          Try to merge a non validated graph.
 void testMergeNotValidated2()
          Try to merge a invalidated graph.
 void testMergeSame()
          Tests to merge the same graph.
 void testNoAboutTokenConfigured()
          When there is not about token defined, so the default one is used.
 void testNodeNameDuplicated()
          Tests the structure of a node with two names of different children of the same parent.
 void testNoEndingNode()
          Tests that a graph has to have ending node.
 void testNoHelpTokenConfigured()
          When there is not help token defined, so the default one is used.
 void testNoLicenseTokenConfigured()
          When there is not license token defined, so the default one is used.
 void testNoStartingNode()
          Tests that a graph has to have starting node.
 void testNotComingFromStartingNode()
          All nodes have to come from starting node.
 void testNotEqualsFirstPhaseGraph()
          Tests the equals with a null.
 void testNotEqualsNull()
          Tests the equals with a null.
 void testNotEqualsOtherObject()
          Tests the equals with a null.
 void testNotEqualsSimilarGraph()
          Tests the equals with a similar object.
 void testNotEqualsSimpleGraph()
          Tests the equals with a null.
 void testNotGoingToEndingNode()
          All nodes have to go to Ending node.
 void testNullValue()
          Tests the a null value for name.
 void testReferencingEndingNode()
          Tests referencing Ending node.
 void testReferencingStartingNode()
          Tests referencing Starting node.
 void testReflexive()
          Tests the reflexivity of the equals a.equals(b) == b.equals(a).
 void testSimplify1()
          Simplify two simple graphs.
 void testSimplify2()
          Tests to simplify a graph with an extra node an the beginning.
 void testSimplify3()
          Tests to simplify a graph with an extra node at the end.
 void testSimplify4()
          Tests to simplify a graph with nodes between the nodes to simplify.
 void testSymmetric()
          Tests the symmetry of the equals.
 void testToString2()
          Tests the toString 2.
 void testToStringExtraNode()
          Tests the toString with extra nodes.
 void testToStringWithoutExtraNode()
          Tests the toString without extra nodes.
 void testTransitivity()
          Tests the transitivity of the equals.
 void testValidateGraph()
          Graph validated.
 void testValidateGraphExtraNodesStructure()
          Tests that it is possible to validate the graph two times with extra nodes.
 void testValidateGraphStructure()
          Tests that it is possible to validate the graph one time.
 void testValidateGraphTwice()
          Tests that it is possible to validate the graph two times.
 void testValidateGraphTwiceExtraNodesStructure()
          Tests that it is possible to validate the graph two times with extra nodes.
 void testValidateGraphTwiceStructure()
          Tests that it is possible to validate the graph two times.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphTest

public GraphTest()
Default constructor.

Method Detail

setUpBeforeClass

public static void setUpBeforeClass()
                             throws AbstractDB2SAException
Destroys the configurator instance before the tests.

Throws:
AbstractDB2SAException - Never.

tearDownAfterClass

public static void tearDownAfterClass()
Clears the configuration file name property at the end of the test.


testAddNodeInSecondPhase

public void testAddNodeInSecondPhase()
                              throws AbstractDB2SAException
Test to try to add a node in secondPhase.

Throws:
AbstractDB2SAException - Never.

testAddNodeValidateGraph

public void testAddNodeValidateGraph()
                              throws AbstractDB2SAException
Tests that it is not possible to add a node in a validated graph.

Throws:
AbstractDB2SAException - Never.

testAddNullRelation1

public void testAddNullRelation1()
                          throws AbstractDB2SAException
Tests that a relation cannot have a null child.

Throws:
AbstractDB2SAException - Never.

testAddNullRelation2

public void testAddNullRelation2()
                          throws AbstractDB2SAException
Tests that a relation cannot have a null parent.

Throws:
AbstractDB2SAException - Never.

testAddRelation

public void testAddRelation()
                     throws AbstractDB2SAException
Tests that a graph can be in second phase.

Throws:
AbstractDB2SAException - Never.

testAddRelationInexistantChild

public void testAddRelationInexistantChild()
                                    throws AbstractDB2SAException
Tests that the child node of the relation has to exist.

Throws:
AbstractDB2SAException - Never.

testAddRelationInexistantParent

public void testAddRelationInexistantParent()
                                     throws AbstractDB2SAException
Tests that the parent node of the relation has to exist.

Throws:
AbstractDB2SAException - Never.

testAddRelationInSecondPhase

public void testAddRelationInSecondPhase()
                                  throws AbstractDB2SAException
Test that it's not possible to add a relation in first phase.

Throws:
AbstractDB2SAException - never.

testAddRelationValidateGraph

public void testAddRelationValidateGraph()
                                  throws AbstractDB2SAException
Tests that it is possible to add a relation in a validated graph.

Throws:
AbstractDB2SAException - Never.

testCongruent

public void testCongruent()
                   throws AbstractDB2SAException
Tests that the hashcode of two equal graphs is the same.

Throws:
AbstractDB2SAException - Never.

testCongruent2

public void testCongruent2()
                    throws AbstractDB2SAException
Tests the hashcode of two graphs.

Throws:
AbstractDB2SAException - Never.

testConstructed

public void testConstructed()
                     throws ParameterNullException
Tests the construction of a graph.

Throws:
ParameterNullException - Never.

testDirectlySecondPhase

public void testDirectlySecondPhase()
                             throws AbstractDB2SAException
Tests that a node can not change to second phase without finishing the first phase.

Throws:
AbstractDB2SAException - Never.

testDuplicatedNode

public void testDuplicatedNode()
                        throws AbstractDB2SAException
Tests that it is not possible to add a duplicated node.

Throws:
AbstractDB2SAException - Never.

testEmptyGrammar

public void testEmptyGrammar()
                      throws AbstractDB2SAException
The grammar can not be empty.

Throws:
AbstractDB2SAException - Never.

testGetEndingNodeFirstPhase

public void testGetEndingNodeFirstPhase()
                                 throws AbstractDB2SAException
Tests that is not possible to get a endingNode in first phase.

Throws:
AbstractDB2SAException - Never.

testgetEndingNodeSecondPhase

public void testgetEndingNodeSecondPhase()
                                  throws AbstractDB2SAException
Tests that it cannot be possible to get EndingNode in secondPhase.

Throws:
AbstractDB2SAException - Never.

testGetStartingNode

public void testGetStartingNode()
                         throws AbstractDB2SAException
Tests the retrieve of starting node.

Throws:
AbstractDB2SAException - Never.

testGetStartingNodeFirstPhase

public void testGetStartingNodeFirstPhase()
                                   throws AbstractDB2SAException
Tests that is not possible to get a staringNode in first phase.

Throws:
AbstractDB2SAException - Never.

testgetStartingNodeSecondPhase

public void testgetStartingNodeSecondPhase()
                                    throws AbstractDB2SAException
Tests that it cannot be possible to get StartingNode in secondPhase.

Throws:
AbstractDB2SAException - Never.

testInFirstPhase

public void testInFirstPhase()
                      throws AbstractDB2SAException
Tests that a graph can be in first phase, and add a node.

Throws:
AbstractDB2SAException - Never.

testInFirstPhaseDoubleCall

public void testInFirstPhaseDoubleCall()
                                throws AbstractDB2SAException
Tests that is not possible to call first phase finished twice.

Throws:
AbstractDB2SAException - Never.

testInSecondPhase

public void testInSecondPhase()
                       throws AbstractDB2SAException
Tests that a graph can be in second phase.

Throws:
AbstractDB2SAException - Never.

testInvalidEndingNode1

public void testInvalidEndingNode1()
                            throws AbstractDB2SAException
Test the bad construction of EndingNode.

Throws:
AbstractDB2SAException - Never.

testInvalidEndingNode21

public void testInvalidEndingNode21()
                             throws AbstractDB2SAException
Test the bad construction of EndingNode.

Throws:
AbstractDB2SAException - Never.

testInvalidStartingNode1

public void testInvalidStartingNode1()
                              throws AbstractDB2SAException
Test the bad construction of StartingNode.

Throws:
AbstractDB2SAException - Never.

testInvalidStartingNode2

public void testInvalidStartingNode2()
                              throws AbstractDB2SAException
Test the bad construction of StartingNode.

Throws:
AbstractDB2SAException - Never.

testMerge

public void testMerge()
               throws AbstractDB2SAException
Merge two graphs.

Throws:
AbstractDB2SAException - Never.

testMergeAndSimplify

public void testMergeAndSimplify()
                          throws AbstractDB2SAException
Tests to merge a graph and then simplify it.

Throws:
AbstractDB2SAException - Never.

testMergeIdentical

public void testMergeIdentical()
                        throws AbstractDB2SAException
Tests to merge two identical graphs.

Throws:
AbstractDB2SAException - Never.

testMergeNotValidated1

public void testMergeNotValidated1()
                            throws AbstractDB2SAException
Try to merge a non validated graph.

Throws:
AbstractDB2SAException - Never.

testMergeNotValidated2

public void testMergeNotValidated2()
                            throws AbstractDB2SAException
Try to merge a invalidated graph.

Throws:
AbstractDB2SAException - Never.

testMergeSame

public void testMergeSame()
                   throws AbstractDB2SAException
Tests to merge the same graph.

Throws:
AbstractDB2SAException - Never.

testNoAboutTokenConfigured

public void testNoAboutTokenConfigured()
                                throws AbstractDB2SAException
When there is not about token defined, so the default one is used.

Throws:
AbstractDB2SAException - Never.

testNoLicenseTokenConfigured

public void testNoLicenseTokenConfigured()
                                  throws AbstractDB2SAException
When there is not license token defined, so the default one is used.

Throws:
AbstractDB2SAException - Never.

testNoEndingNode

public void testNoEndingNode()
                      throws AbstractDB2SAException
Tests that a graph has to have ending node.

Throws:
AbstractDB2SAException - Never.

testNoHelpTokenConfigured

public void testNoHelpTokenConfigured()
                               throws AbstractDB2SAException
When there is not help token defined, so the default one is used.

Throws:
AbstractDB2SAException - Never.

testNoStartingNode

public void testNoStartingNode()
                        throws AbstractDB2SAException
Tests that a graph has to have starting node.

Throws:
AbstractDB2SAException - Never.

testNotComingFromStartingNode

public void testNotComingFromStartingNode()
                                   throws AbstractDB2SAException
All nodes have to come from starting node.

Throws:
AbstractDB2SAException - Never.

testNotEqualsFirstPhaseGraph

public void testNotEqualsFirstPhaseGraph()
                                  throws AbstractDB2SAException
Tests the equals with a null.

Throws:
AbstractDB2SAException - Never.

testNotEqualsNull

public void testNotEqualsNull()
                       throws AbstractDB2SAException
Tests the equals with a null.

Throws:
AbstractDB2SAException - Never.

testNotEqualsOtherObject

public void testNotEqualsOtherObject()
                              throws AbstractDB2SAException
Tests the equals with a null.

Throws:
AbstractDB2SAException - Never.

testNotEqualsSimilarGraph

public void testNotEqualsSimilarGraph()
                               throws AbstractDB2SAException
Tests the equals with a similar object.

Throws:
AbstractDB2SAException - Never.

testNotEqualsSimpleGraph

public void testNotEqualsSimpleGraph()
                              throws AbstractDB2SAException
Tests the equals with a null.

Throws:
AbstractDB2SAException - Never.

testNotGoingToEndingNode

public void testNotGoingToEndingNode()
                              throws AbstractDB2SAException
All nodes have to go to Ending node.

Throws:
AbstractDB2SAException - Never.

testNullValue

public void testNullValue()
                   throws ParameterNullException
Tests the a null value for name.

Throws:
ParameterNullException - Never.

testReferencingEndingNode

public void testReferencingEndingNode()
                               throws AbstractDB2SAException
Tests referencing Ending node.

Throws:
AbstractDB2SAException - Never.

testReferencingStartingNode

public void testReferencingStartingNode()
                                 throws AbstractDB2SAException
Tests referencing Starting node.

Throws:
AbstractDB2SAException - Never.

testReflexive

public void testReflexive()
                   throws AbstractDB2SAException
Tests the reflexivity of the equals a.equals(b) == b.equals(a).

Throws:
AbstractDB2SAException - Never.

testSimplify1

public void testSimplify1()
                   throws AbstractDB2SAException
Simplify two simple graphs.

Throws:
AbstractDB2SAException - Never.

testSimplify2

public void testSimplify2()
                   throws AbstractDB2SAException
Tests to simplify a graph with an extra node an the beginning.

Throws:
AbstractDB2SAException - Never.

testSimplify3

public void testSimplify3()
                   throws AbstractDB2SAException
Tests to simplify a graph with an extra node at the end.

Throws:
AbstractDB2SAException - Never.

testSimplify4

public void testSimplify4()
                   throws AbstractDB2SAException
Tests to simplify a graph with nodes between the nodes to simplify.

Throws:
AbstractDB2SAException - Never.

testSymmetric

public void testSymmetric()
                   throws AbstractDB2SAException
Tests the symmetry of the equals.

Throws:
AbstractDB2SAException - Never.

testToStringExtraNode

public void testToStringExtraNode()
                           throws AbstractDB2SAException
Tests the toString with extra nodes.

Throws:
AbstractDB2SAException - Never

testToStringWithoutExtraNode

public void testToStringWithoutExtraNode()
                                  throws AbstractDB2SAException
Tests the toString without extra nodes.

Throws:
AbstractDB2SAException - Never

testToString2

public void testToString2()
                   throws AbstractDB2SAException
Tests the toString 2.

Throws:
AbstractDB2SAException - Never

testTransitivity

public void testTransitivity()
                      throws AbstractDB2SAException
Tests the transitivity of the equals.

Throws:
AbstractDB2SAException - Never.

testValidateGraph

public void testValidateGraph()
                       throws AbstractDB2SAException
Graph validated.

Throws:
AbstractDB2SAException - Never.

testValidateGraphExtraNodesStructure

public void testValidateGraphExtraNodesStructure()
                                          throws AbstractDB2SAException
Tests that it is possible to validate the graph two times with extra nodes.

Throws:
AbstractDB2SAException - Never.

testValidateGraphStructure

public void testValidateGraphStructure()
                                throws AbstractDB2SAException
Tests that it is possible to validate the graph one time.

Throws:
AbstractDB2SAException - Never.

testValidateGraphTwice

public void testValidateGraphTwice()
                            throws AbstractDB2SAException
Tests that it is possible to validate the graph two times.

Throws:
AbstractDB2SAException - Never.

testValidateGraphTwiceExtraNodesStructure

public void testValidateGraphTwiceExtraNodesStructure()
                                               throws AbstractDB2SAException
Tests that it is possible to validate the graph two times with extra nodes.

Throws:
AbstractDB2SAException - Never.

testNodeNameDuplicated

public void testNodeNameDuplicated()
                            throws AbstractDB2SAException
Tests the structure of a node with two names of different children of the same parent.

Throws:
AbstractDB2SAException - Never.

testValidateGraphTwiceStructure

public void testValidateGraphTwiceStructure()
                                     throws AbstractDB2SAException
Tests that it is possible to validate the graph two times.

Throws:
AbstractDB2SAException - Never.

testHelpToString

public void testHelpToString()
                      throws InvalidGraphNodeException
Test the toString of HelpToken.

Throws:
InvalidGraphNodeException - Never.


Andres Gomez Casanova (AngocA) 2009-2010 Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.